coer-elements 0.0.21 → 0.0.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/esm2022/coer-elements.mjs +2 -2
  2. package/esm2022/index.mjs +2 -0
  3. package/fesm2022/coer-elements.mjs +0 -4081
  4. package/fesm2022/coer-elements.mjs.map +1 -1
  5. package/index.d.ts +1 -5
  6. package/package.json +1 -1
  7. package/styles/angular-material.scss +8 -11
  8. package/styles/bootstrap.scss +3 -3
  9. package/components/index.d.ts +0 -16
  10. package/components/lib/coer-alert/coer-alert.component.d.ts +0 -23
  11. package/components/lib/coer-button/coer-button.component.d.ts +0 -44
  12. package/components/lib/coer-checkbox/coer-checkbox.component.d.ts +0 -28
  13. package/components/lib/coer-filebox/coer-filebox.component.d.ts +0 -33
  14. package/components/lib/coer-form/coer-form.component.d.ts +0 -33
  15. package/components/lib/coer-grid/coer-grid.component.d.ts +0 -53
  16. package/components/lib/coer-grid/coer-grid.extension.d.ts +0 -105
  17. package/components/lib/coer-grid/coer-grid.templates.d.ts +0 -9
  18. package/components/lib/coer-modal/coer-modal.component.d.ts +0 -38
  19. package/components/lib/coer-numberbox/coer-numberbox.component.d.ts +0 -56
  20. package/components/lib/coer-page-title/coer-page-title.component.d.ts +0 -12
  21. package/components/lib/coer-selectbox/coer-selectbox.component.d.ts +0 -75
  22. package/components/lib/coer-switch/coer-switch.component.d.ts +0 -31
  23. package/components/lib/coer-tab/coer-tab.component.d.ts +0 -35
  24. package/components/lib/coer-textarea/coer-textarea.component.d.ts +0 -51
  25. package/components/lib/coer-textbox/coer-textbox.component.d.ts +0 -57
  26. package/components/lib/components.module.d.ts +0 -31
  27. package/directives/index.d.ts +0 -3
  28. package/directives/lib/coer-ref.directive.d.ts +0 -14
  29. package/directives/lib/directives.module.d.ts +0 -8
  30. package/directives/lib/life-cycle.directive.d.ts +0 -16
  31. package/esm2022/components/index.mjs +0 -17
  32. package/esm2022/components/lib/coer-alert/coer-alert.component.mjs +0 -227
  33. package/esm2022/components/lib/coer-button/coer-button.component.mjs +0 -133
  34. package/esm2022/components/lib/coer-checkbox/coer-checkbox.component.mjs +0 -84
  35. package/esm2022/components/lib/coer-filebox/coer-filebox.component.mjs +0 -104
  36. package/esm2022/components/lib/coer-form/coer-form.component.mjs +0 -102
  37. package/esm2022/components/lib/coer-grid/coer-grid.component.mjs +0 -515
  38. package/esm2022/components/lib/coer-grid/coer-grid.extension.mjs +0 -412
  39. package/esm2022/components/lib/coer-grid/coer-grid.templates.mjs +0 -30
  40. package/esm2022/components/lib/coer-modal/coer-modal.component.mjs +0 -108
  41. package/esm2022/components/lib/coer-numberbox/coer-numberbox.component.mjs +0 -260
  42. package/esm2022/components/lib/coer-page-title/coer-page-title.component.mjs +0 -44
  43. package/esm2022/components/lib/coer-selectbox/coer-selectbox.component.mjs +0 -339
  44. package/esm2022/components/lib/coer-switch/coer-switch.component.mjs +0 -94
  45. package/esm2022/components/lib/coer-tab/coer-tab.component.mjs +0 -116
  46. package/esm2022/components/lib/coer-textarea/coer-textarea.component.mjs +0 -157
  47. package/esm2022/components/lib/coer-textbox/coer-textbox.component.mjs +0 -196
  48. package/esm2022/components/lib/components.module.mjs +0 -134
  49. package/esm2022/directives/index.mjs +0 -4
  50. package/esm2022/directives/lib/coer-ref.directive.mjs +0 -23
  51. package/esm2022/directives/lib/directives.module.mjs +0 -25
  52. package/esm2022/directives/lib/life-cycle.directive.mjs +0 -33
  53. package/esm2022/interfaces/index.mjs +0 -39
  54. package/esm2022/interfaces/lib/app-source.interface.mjs +0 -2
  55. package/esm2022/interfaces/lib/coer-filebox/file-image.interface.mjs +0 -2
  56. package/esm2022/interfaces/lib/coer-filebox/file.interface.mjs +0 -2
  57. package/esm2022/interfaces/lib/coer-grid/grid-button-by-row.interface.mjs +0 -2
  58. package/esm2022/interfaces/lib/coer-grid/grid-checkbox.interface.mjs +0 -2
  59. package/esm2022/interfaces/lib/coer-grid/grid-coer-numberbox.interface.mjs +0 -2
  60. package/esm2022/interfaces/lib/coer-grid/grid-coer-selectbox.interface.mjs +0 -2
  61. package/esm2022/interfaces/lib/coer-grid/grid-coer-switch.interface.mjs +0 -2
  62. package/esm2022/interfaces/lib/coer-grid/grid-coer-textbox.interface.mjs +0 -2
  63. package/esm2022/interfaces/lib/coer-grid/grid-column.interface.mjs +0 -2
  64. package/esm2022/interfaces/lib/coer-grid/grid-data-source.interface.mjs +0 -2
  65. package/esm2022/interfaces/lib/coer-grid/grid-header-button.interface.mjs +0 -2
  66. package/esm2022/interfaces/lib/coer-grid/grid-header-export-button.interface.mjs +0 -2
  67. package/esm2022/interfaces/lib/coer-grid/grid-header.interface.mjs +0 -2
  68. package/esm2022/interfaces/lib/coer-grid/grid-import.interface.mjs +0 -2
  69. package/esm2022/interfaces/lib/coer-grid/grid-input-checkbox.interface.mjs +0 -2
  70. package/esm2022/interfaces/lib/coer-grid/grid-input-switch-change.interface.mjs +0 -2
  71. package/esm2022/interfaces/lib/coer-grid/grid-input-textbox.interface.mjs +0 -2
  72. package/esm2022/interfaces/lib/coer-grid/grid-item.interface.mjs +0 -2
  73. package/esm2022/interfaces/lib/coer-grid/grid-keyup-enter.interface.mjs +0 -2
  74. package/esm2022/interfaces/lib/coer-grid/grid-length.interface.mjs +0 -2
  75. package/esm2022/interfaces/lib/coer-grid/grid-search.interface.mjs +0 -2
  76. package/esm2022/interfaces/lib/coer-grid/grid-sort.interface.mjs +0 -2
  77. package/esm2022/interfaces/lib/coer-menu/menu-option-selected.interface.mjs +0 -2
  78. package/esm2022/interfaces/lib/coer-menu/menu-selected.interface.mjs +0 -2
  79. package/esm2022/interfaces/lib/coer-menu/menu.interface.mjs +0 -2
  80. package/esm2022/interfaces/lib/coer-ref.interface.mjs +0 -2
  81. package/esm2022/interfaces/lib/page-title/breadcrumb.interface.mjs +0 -2
  82. package/esm2022/interfaces/lib/page-title/go-back.interface.mjs +0 -2
  83. package/esm2022/interfaces/lib/screen-size.interface.mjs +0 -2
  84. package/esm2022/interfaces/lib/service/http-request.interface.mjs +0 -2
  85. package/esm2022/interfaces/lib/service/http-response.interface.mjs +0 -2
  86. package/esm2022/interfaces/lib/service/patch.interface.mjs +0 -2
  87. package/esm2022/pipes/index.mjs +0 -5
  88. package/esm2022/pipes/lib/html.pipe.mjs +0 -18
  89. package/esm2022/pipes/lib/no-image.pipe.mjs +0 -23
  90. package/esm2022/pipes/lib/numeric-format.pipe.mjs +0 -15
  91. package/esm2022/pipes/lib/pipes.module.mjs +0 -31
  92. package/esm2022/public_api.mjs +0 -6
  93. package/esm2022/signals/index.mjs +0 -6
  94. package/esm2022/signals/lib/breakpoint.signal.mjs +0 -4
  95. package/esm2022/signals/lib/is-loading.signal.mjs +0 -3
  96. package/esm2022/signals/lib/is-menu-open.signal.mjs +0 -3
  97. package/esm2022/signals/lib/is-modal-open.signal.mjs +0 -3
  98. package/esm2022/signals/lib/menu.signal.mjs +0 -3
  99. package/esm2022/tools/index.mjs +0 -11
  100. package/esm2022/tools/lib/breadcrumbs.class.mjs +0 -63
  101. package/esm2022/tools/lib/control-value.class.mjs +0 -46
  102. package/esm2022/tools/lib/date-time.class.mjs +0 -29
  103. package/esm2022/tools/lib/files.class.mjs +0 -91
  104. package/esm2022/tools/lib/menu.class.mjs +0 -23
  105. package/esm2022/tools/lib/page.class.mjs +0 -156
  106. package/esm2022/tools/lib/screen.class.mjs +0 -51
  107. package/esm2022/tools/lib/service.class.mjs +0 -248
  108. package/esm2022/tools/lib/source.class.mjs +0 -80
  109. package/esm2022/tools/lib/tools.mjs +0 -220
  110. package/interfaces/index.d.ts +0 -33
  111. package/interfaces/lib/app-source.interface.d.ts +0 -4
  112. package/interfaces/lib/coer-filebox/file-image.interface.d.ts +0 -14
  113. package/interfaces/lib/coer-filebox/file.interface.d.ts +0 -5
  114. package/interfaces/lib/coer-grid/grid-button-by-row.interface.d.ts +0 -6
  115. package/interfaces/lib/coer-grid/grid-checkbox.interface.d.ts +0 -5
  116. package/interfaces/lib/coer-grid/grid-coer-numberbox.interface.d.ts +0 -12
  117. package/interfaces/lib/coer-grid/grid-coer-selectbox.interface.d.ts +0 -9
  118. package/interfaces/lib/coer-grid/grid-coer-switch.interface.d.ts +0 -6
  119. package/interfaces/lib/coer-grid/grid-coer-textbox.interface.d.ts +0 -11
  120. package/interfaces/lib/coer-grid/grid-column.interface.d.ts +0 -22
  121. package/interfaces/lib/coer-grid/grid-data-source.interface.d.ts +0 -6
  122. package/interfaces/lib/coer-grid/grid-header-button.interface.d.ts +0 -8
  123. package/interfaces/lib/coer-grid/grid-header-export-button.interface.d.ts +0 -10
  124. package/interfaces/lib/coer-grid/grid-header.interface.d.ts +0 -5
  125. package/interfaces/lib/coer-grid/grid-import.interface.d.ts +0 -4
  126. package/interfaces/lib/coer-grid/grid-input-checkbox.interface.d.ts +0 -5
  127. package/interfaces/lib/coer-grid/grid-input-switch-change.interface.d.ts +0 -5
  128. package/interfaces/lib/coer-grid/grid-input-textbox.interface.d.ts +0 -5
  129. package/interfaces/lib/coer-grid/grid-item.interface.d.ts +0 -5
  130. package/interfaces/lib/coer-grid/grid-keyup-enter.interface.d.ts +0 -6
  131. package/interfaces/lib/coer-grid/grid-length.interface.d.ts +0 -5
  132. package/interfaces/lib/coer-grid/grid-search.interface.d.ts +0 -4
  133. package/interfaces/lib/coer-grid/grid-sort.interface.d.ts +0 -5
  134. package/interfaces/lib/coer-menu/menu-option-selected.interface.d.ts +0 -9
  135. package/interfaces/lib/coer-menu/menu-selected.interface.d.ts +0 -10
  136. package/interfaces/lib/coer-menu/menu.interface.d.ts +0 -6
  137. package/interfaces/lib/coer-ref.interface.d.ts +0 -10
  138. package/interfaces/lib/page-title/breadcrumb.interface.d.ts +0 -6
  139. package/interfaces/lib/page-title/go-back.interface.d.ts +0 -6
  140. package/interfaces/lib/screen-size.interface.d.ts +0 -5
  141. package/interfaces/lib/service/http-request.interface.d.ts +0 -10
  142. package/interfaces/lib/service/http-response.interface.d.ts +0 -6
  143. package/interfaces/lib/service/patch.interface.d.ts +0 -5
  144. package/pipes/index.d.ts +0 -4
  145. package/pipes/lib/html.pipe.d.ts +0 -10
  146. package/pipes/lib/no-image.pipe.d.ts +0 -7
  147. package/pipes/lib/numeric-format.pipe.d.ts +0 -7
  148. package/pipes/lib/pipes.module.d.ts +0 -9
  149. package/public_api.d.ts +0 -1
  150. package/signals/index.d.ts +0 -5
  151. package/signals/lib/breakpoint.signal.d.ts +0 -1
  152. package/signals/lib/is-loading.signal.d.ts +0 -1
  153. package/signals/lib/is-menu-open.signal.d.ts +0 -1
  154. package/signals/lib/is-modal-open.signal.d.ts +0 -1
  155. package/signals/lib/menu.signal.d.ts +0 -2
  156. package/tools/index.d.ts +0 -10
  157. package/tools/lib/breadcrumbs.class.d.ts +0 -18
  158. package/tools/lib/control-value.class.d.ts +0 -25
  159. package/tools/lib/date-time.class.d.ts +0 -13
  160. package/tools/lib/files.class.d.ts +0 -16
  161. package/tools/lib/menu.class.d.ts +0 -8
  162. package/tools/lib/page.class.d.ts +0 -60
  163. package/tools/lib/screen.class.d.ts +0 -13
  164. package/tools/lib/service.class.d.ts +0 -39
  165. package/tools/lib/source.class.d.ts +0 -20
  166. package/tools/lib/tools.d.ts +0 -34
@@ -1,4085 +1,4 @@
1
- import * as i0 from '@angular/core';
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
- import { CommonModule } from '@angular/common';
5
- import * as i2 from '@angular/router';
6
- import { RouterModule, Router, ActivatedRoute } from '@angular/router';
7
- import * as i2$1 from '@angular/forms';
8
- import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
- import * as i1 from '@angular/platform-browser';
10
- import * as i3 from '@angular/material/button';
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';
22
- import * as bootstrap from 'bootstrap';
23
- import { Tooltip, Modal } from 'bootstrap';
24
- import Swal from 'sweetalert2';
25
- import * as XLSX from 'xlsx';
26
- import { Observable } from 'rxjs';
27
- import moment from 'moment';
28
- import { HttpClient, HttpRequest } from '@angular/common/http';
29
-
30
- class CoerRefDirective {
31
- constructor(template) {
32
- this.template = template;
33
- //Inputs
34
- this.coerRef = input('');
35
- this.title = input('');
36
- this.icon = input('');
37
- this.isDisabled = input(false);
38
- this.show = input(true);
39
- this.tooltip = input('');
40
- }
41
- 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 }); }
42
- 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 }); }
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerRefDirective, decorators: [{
45
- type: Directive,
46
- args: [{
47
- selector: '[coerRef]'
48
- }]
49
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
50
-
51
- class LifeCycleDirective {
52
- constructor(element) {
53
- this.element = element;
54
- //Outputs
55
- this.OnChanges = output();
56
- this.onInit = output();
57
- this.afterViewInit = output();
58
- this.onDestroy = output();
59
- }
60
- ngOnChanges(changes) {
61
- this.OnChanges.emit(changes);
62
- }
63
- ngOnInit() {
64
- this.onInit.emit(this.element.nativeElement);
65
- }
66
- ngAfterViewInit() {
67
- this.afterViewInit.emit(this.element.nativeElement);
68
- }
69
- ngOnDestroy() {
70
- this.onDestroy.emit(this.element.nativeElement);
71
- }
72
- 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 }); }
73
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: LifeCycleDirective, selector: "[lifecycle]", outputs: { OnChanges: "OnChanges", onInit: "onInit", afterViewInit: "afterViewInit", onDestroy: "onDestroy" }, usesOnChanges: true, ngImport: i0 }); }
74
- }
75
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LifeCycleDirective, decorators: [{
76
- type: Directive,
77
- args: [{
78
- selector: '[lifecycle]'
79
- }]
80
- }], ctorParameters: () => [{ type: i0.ElementRef }] });
81
-
82
- class DirectivesModule {
83
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DirectivesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
84
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: DirectivesModule, declarations: [CoerRefDirective,
85
- LifeCycleDirective], exports: [CoerRefDirective,
86
- LifeCycleDirective] }); }
87
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DirectivesModule }); }
88
- }
89
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DirectivesModule, decorators: [{
90
- type: NgModule,
91
- args: [{
92
- declarations: [
93
- CoerRefDirective,
94
- LifeCycleDirective,
95
- ],
96
- exports: [
97
- CoerRefDirective,
98
- LifeCycleDirective
99
- ]
100
- }]
101
- }] });
102
-
103
- class HtmlPipe {
104
- constructor(sanitizer) {
105
- this.sanitizer = sanitizer;
106
- }
107
- transform(value) {
108
- return this.sanitizer.bypassSecurityTrustHtml(value);
109
- }
110
- 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 }); }
111
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: HtmlPipe, name: "html" }); }
112
- }
113
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HtmlPipe, decorators: [{
114
- type: Pipe,
115
- args: [{ name: 'html' }]
116
- }], ctorParameters: () => [{ type: i1.DomSanitizer }] });
117
-
118
- const reference_signal = signal({});
119
- const Tools = {
120
- /** Generate a Guid */
121
- GetGuid: (seed = 'coer-system') => {
122
- let time = new Date().getTime();
123
- seed = seed.toString().trim();
124
- return seed + `-xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g, (c) => {
125
- const random = (time + Math.random() * 16) % 16 | 0;
126
- time = Math.floor(time / 16);
127
- return (c == 'x' ? random : (random & 0x3 | 0x8)).toString(16);
128
- });
129
- },
130
- /** Returns true if the value is null or undefined, false otherwise */
131
- IsNull: (value) => {
132
- if (value === undefined)
133
- return true;
134
- if (value === null)
135
- return true;
136
- return false;
137
- },
138
- /** Returns true if the value is not null or undefined, false otherwise */
139
- IsNotNull: (value) => {
140
- if (value === undefined)
141
- return false;
142
- if (value === null)
143
- return false;
144
- return true;
145
- },
146
- /** Returns true if the value is null or undefined or contains only whitespace, false otherwise */
147
- IsOnlyWhiteSpace: (value) => {
148
- if (value === undefined)
149
- return true;
150
- if (value === null)
151
- return true;
152
- if (typeof value === 'string' && value.trim() === '')
153
- return true;
154
- return false;
155
- },
156
- /** Returns true if has string value and is not only whitespace, false otherwise */
157
- IsNotOnlyWhiteSpace: (value) => {
158
- if (value === undefined)
159
- return false;
160
- if (value === null)
161
- return false;
162
- if (typeof value === 'string' && value.trim() === '')
163
- return false;
164
- return true;
165
- },
166
- /** Break reference of a object or array */
167
- BreakReference: (object) => {
168
- if (object === null)
169
- return object;
170
- if (typeof object === 'undefined')
171
- return object;
172
- if (typeof object === 'string')
173
- return object;
174
- if (typeof object === 'number')
175
- return object;
176
- if (typeof object === 'boolean')
177
- return object;
178
- const OBJECT = JSON.parse(JSON.stringify(object));
179
- return (Array.isArray(OBJECT)) ? [...OBJECT] : { ...OBJECT };
180
- },
181
- /** Clean extra whitespaces */
182
- CleanUpBlanks: (text) => {
183
- if (Tools.IsNull(text))
184
- return '';
185
- let worlds = String(text).split(' ');
186
- worlds = worlds.filter(x => x.length > 0);
187
- return worlds.join(' ');
188
- },
189
- /** Get properties of an object */
190
- GetObjectProperties: (obj) => {
191
- const properties = [];
192
- if (obj === null)
193
- return properties;
194
- if (typeof obj === 'undefined')
195
- return properties;
196
- if (typeof obj === 'string')
197
- return properties;
198
- if (typeof obj === 'number')
199
- return properties;
200
- if (typeof obj === 'boolean')
201
- return properties;
202
- for (const property in obj)
203
- properties.push(String(property));
204
- return properties;
205
- },
206
- /**
207
- * Set an index and merge more arrays of the same type
208
- * */
209
- SetIndex: (array, ...args) => {
210
- let index = 0;
211
- for (const arg of args) {
212
- array = Tools.BreakReference(array).concat(Tools.BreakReference(arg));
213
- }
214
- return Tools.BreakReference(array).map(item => Object.assign({ index: index++ }, item));
215
- },
216
- /** Set First Char To Lower */
217
- FirstCharToLower: (text) => {
218
- if (Tools.IsOnlyWhiteSpace(text))
219
- return '';
220
- const textArray = [];
221
- for (let i = 0; i < text.length; i++) {
222
- if (i === 0)
223
- textArray.push(text[i].toLowerCase());
224
- else
225
- textArray.push(text[i]);
226
- }
227
- return textArray.join('');
228
- },
229
- /** Set First Char To Upper */
230
- FirstCharToUpper: (text) => {
231
- if (Tools.IsOnlyWhiteSpace(text))
232
- return '';
233
- const textArray = [];
234
- for (let i = 0; i < text.length; i++) {
235
- if (i === 0)
236
- textArray.push(text[i].toUpperCase());
237
- else
238
- textArray.push(text[i]);
239
- }
240
- return textArray.join('');
241
- },
242
- /** Sort an array in ascending order by property */
243
- SortBy: (array, property, propertyType = 'string') => {
244
- switch (propertyType) {
245
- case 'string': {
246
- return array.sort((x, y) => {
247
- if (String(x[property]).toUpperCase().trim() < String(y[property]).toUpperCase().trim())
248
- return -1;
249
- else if (String(x[property]).toUpperCase().trim() > String(y[property]).toUpperCase().trim())
250
- return 1;
251
- else
252
- return 0;
253
- });
254
- }
255
- case 'number': {
256
- return array.sort((x, y) => Number(x[property] - Number(y[property])));
257
- }
258
- }
259
- },
260
- /** Sort an array in descending order by property */
261
- SortByDesc: (array, property, propertyType = 'string') => {
262
- switch (propertyType) {
263
- case 'string': {
264
- return array.sort((x, y) => {
265
- if (String(x[property]).toUpperCase().trim() < String(y[property]).toUpperCase().trim())
266
- return 1;
267
- else if (String(x[property]).toUpperCase().trim() > String(y[property]).toUpperCase().trim())
268
- return -1;
269
- else
270
- return 0;
271
- });
272
- }
273
- case 'number': {
274
- return array.sort((x, y) => Number(Number(y[property])) - x[property]);
275
- }
276
- }
277
- },
278
- /** Return a string with forman numeric */
279
- GetNumericFormat: (value, decimals = 0) => {
280
- if (Tools.IsOnlyWhiteSpace(value) || isNaN(Number(value))) {
281
- return '0';
282
- }
283
- let valueInteger = '';
284
- let valueDecimal = '';
285
- value = value.toString().replaceAll(' ', '');
286
- if (value.includes('.') || (decimals > 0)) {
287
- valueInteger = value.includes('.') ? value.split('.')[0] : value;
288
- if (decimals > 0) {
289
- const PADDING = decimals - valueDecimal.length;
290
- valueDecimal = value.includes('.') ? value.split('.')[1] : '';
291
- for (let i = 0; i < PADDING; i++)
292
- valueDecimal += '0';
293
- valueDecimal = valueDecimal.substring(0, decimals);
294
- valueDecimal = `.${valueDecimal}`;
295
- }
296
- }
297
- else {
298
- valueInteger = value;
299
- }
300
- let counter = 0;
301
- const VALUE_INTEGER_ARRAY = [];
302
- for (const char of valueInteger.split('').reverse()) {
303
- if (counter == 3) {
304
- VALUE_INTEGER_ARRAY.push(',');
305
- counter = 0;
306
- }
307
- VALUE_INTEGER_ARRAY.push(char);
308
- ++counter;
309
- }
310
- valueInteger = VALUE_INTEGER_ARRAY.reverse().join('');
311
- return `${valueInteger}${valueDecimal}`;
312
- },
313
- /** Wait the time indicated */
314
- Sleep: (milliseconds = 0, reference = null) => {
315
- if (Tools.IsNull(reference)) {
316
- return new Promise(Resolve => setTimeout(Resolve, milliseconds));
317
- }
318
- else
319
- return new Promise(Resolve => {
320
- reference = reference.replaceAll(' ', '_').toLowerCase();
321
- if (reference_signal().hasOwnProperty(reference)) {
322
- clearInterval(reference_signal()[reference]);
323
- }
324
- reference_signal.set(Object.assign(reference_signal(), {
325
- [reference]: setTimeout(() => {
326
- Resolve();
327
- clearInterval(reference_signal()[reference]);
328
- const _reference = { ...reference_signal() };
329
- delete _reference[reference];
330
- reference_signal.set({ ..._reference });
331
- }, milliseconds)
332
- }));
333
- });
334
- }
335
- };
336
-
337
- class NoImagePipe {
338
- transform(value) {
339
- const NO_IMAGE = '../../../images/no-image.png';
340
- if (Tools.IsOnlyWhiteSpace(value)) {
341
- return NO_IMAGE;
342
- }
343
- else if (typeof value === 'string') {
344
- return value;
345
- }
346
- //Files.ConvertToBase64(value as File).then(base64 => { return base64 });
347
- return NO_IMAGE;
348
- }
349
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NoImagePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
350
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: NoImagePipe, name: "noImage" }); }
351
- }
352
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NoImagePipe, decorators: [{
353
- type: Pipe,
354
- args: [{ name: 'noImage' }]
355
- }] });
356
-
357
- class NumericFormatPipe {
358
- transform(value, decimals = 0) {
359
- return Tools.GetNumericFormat(value, decimals);
360
- }
361
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NumericFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
362
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: NumericFormatPipe, name: "numericFormat" }); }
363
- }
364
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NumericFormatPipe, decorators: [{
365
- type: Pipe,
366
- args: [{ name: 'numericFormat' }]
367
- }] });
368
-
369
- class PipesModule {
370
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
371
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: PipesModule, declarations: [HtmlPipe,
372
- NoImagePipe,
373
- NumericFormatPipe], exports: [HtmlPipe,
374
- NoImagePipe,
375
- NumericFormatPipe] }); }
376
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PipesModule }); }
377
- }
378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PipesModule, decorators: [{
379
- type: NgModule,
380
- args: [{
381
- declarations: [
382
- HtmlPipe,
383
- NoImagePipe,
384
- NumericFormatPipe
385
- ],
386
- exports: [
387
- HtmlPipe,
388
- NoImagePipe,
389
- NumericFormatPipe
390
- ]
391
- }]
392
- }] });
393
-
394
- class CoerAlert {
395
- /** */
396
- Success(message = null, title = null, icon = null, autohide = 3000) {
397
- //Title
398
- if (!title || title == '')
399
- title = 'Success';
400
- const alertSuccessTitle = document.getElementById('alert-success-title');
401
- alertSuccessTitle.textContent = title;
402
- //Icon
403
- icon = this.GetIcon(title, icon, 'bi-check-circle fa-beat');
404
- const alertSuccessIcon = document.getElementById('alert-success-icon');
405
- this.SetIcon(alertSuccessIcon, icon);
406
- //Message
407
- if (!message)
408
- message = '';
409
- const alertSuccessMessage = document.getElementById('alert-success-message');
410
- alertSuccessMessage.innerHTML = message;
411
- //Toast
412
- const alertSuccess = document.getElementById('alert-success');
413
- this.SetAutoHide(alertSuccess, autohide);
414
- const toast = bootstrap.Toast.getOrCreateInstance(alertSuccess);
415
- toast.show();
416
- }
417
- /** */
418
- Error(message = null, title = null, icon = null, autohide = 3000) {
419
- //Title
420
- if (!title || title == '')
421
- title = 'Error';
422
- const alertErrorTitle = document.getElementById('alert-error-title');
423
- alertErrorTitle.textContent = title;
424
- //Icon
425
- icon = this.GetIcon(title, icon, 'bi-exclamation-octagon fa-beat');
426
- const alertErrorIcon = document.getElementById('alert-error-icon');
427
- this.SetIcon(alertErrorIcon, icon);
428
- //Message
429
- if (!message)
430
- message = '';
431
- const alertErrorBody = document.getElementById('alert-error-message');
432
- alertErrorBody.innerHTML = message;
433
- //Toast
434
- const alertError = document.getElementById('alert-error');
435
- this.SetAutoHide(alertError, autohide);
436
- const toast = bootstrap.Toast.getOrCreateInstance(alertError);
437
- toast.show();
438
- }
439
- /** */
440
- Info(message = null, title = null, icon = null, autohide = 3000) {
441
- //Title
442
- if (!title || title == '')
443
- title = 'Info';
444
- const alertInfoTitle = document.getElementById('alert-info-title');
445
- alertInfoTitle.textContent = title;
446
- //Icon
447
- icon = this.GetIcon(title, icon, 'bi-info-circle fa-beat');
448
- const alertInfoIcon = document.getElementById('alert-info-icon');
449
- this.SetIcon(alertInfoIcon, icon);
450
- //Message
451
- if (!message)
452
- message = '';
453
- const alertInfoBody = document.getElementById('alert-info-message');
454
- alertInfoBody.innerHTML = message;
455
- //Toast
456
- const alertInfo = document.getElementById('alert-info');
457
- this.SetAutoHide(alertInfo, autohide);
458
- const toast = bootstrap.Toast.getOrCreateInstance(alertInfo);
459
- toast.show();
460
- }
461
- /** */
462
- Warning(message = null, title = null, icon = null, autohide = 3000) {
463
- //Title
464
- if (!title || title == '')
465
- title = 'Warning';
466
- const alertWarningTitle = document.getElementById('alert-warning-title');
467
- alertWarningTitle.textContent = title;
468
- //Icon
469
- icon = this.GetIcon(title, icon, 'bi-exclamation-triangle-fill fa-beat');
470
- const alertWarningIcon = document.getElementById('alert-warning-icon');
471
- this.SetIcon(alertWarningIcon, icon);
472
- //Message
473
- if (!message)
474
- message = '';
475
- const alertWarningBody = document.getElementById('alert-warning-message');
476
- alertWarningBody.innerHTML = message;
477
- //Toast
478
- const alertWarning = document.getElementById('alert-warning');
479
- this.SetAutoHide(alertWarning, autohide);
480
- const toast = bootstrap.Toast.getOrCreateInstance(alertWarning);
481
- toast.show();
482
- }
483
- /** */
484
- Close(alert) {
485
- return new Promise(Resolve => {
486
- const element = document.getElementById(alert);
487
- const toast = bootstrap.Toast.getOrCreateInstance(element);
488
- toast.hide();
489
- setTimeout(() => { Resolve(); }, 200);
490
- });
491
- }
492
- /** */
493
- Confirm(message = 'Proceed?', alertType = 'warning', icon = null) {
494
- return new Promise(Resolve => {
495
- let color;
496
- let iconType;
497
- switch (alertType) {
498
- case 'danger':
499
- {
500
- if (icon == null)
501
- icon = 'bi-exclamation-octagon';
502
- iconType = 'error';
503
- color = '#dc3545'; //red
504
- break;
505
- }
506
- ;
507
- case 'success':
508
- {
509
- if (icon == null)
510
- icon = 'bi-check-circle';
511
- iconType = 'info';
512
- color = '#198754'; //green
513
- break;
514
- }
515
- ;
516
- case 'info':
517
- {
518
- if (icon == null)
519
- icon = 'bi-info-circle';
520
- iconType = 'error';
521
- color = '#0d6efd'; //blue
522
- break;
523
- }
524
- ;
525
- default: {
526
- if (icon == null)
527
- icon = 'bi-exclamation-triangle-fill';
528
- iconType = 'warning';
529
- color = '#ffc107'; //yellow
530
- break;
531
- }
532
- }
533
- switch (icon) {
534
- case 'delete':
535
- icon = 'fa-regular fa-trash-can';
536
- break;
537
- }
538
- Swal.fire({
539
- icon: iconType,
540
- iconColor: 'transparent',
541
- iconHtml: `<i class="${icon}" style="color: ${color};"></i>`,
542
- html: message,
543
- showConfirmButton: true,
544
- confirmButtonText: 'Yes',
545
- confirmButtonColor: color,
546
- focusConfirm: true,
547
- showDenyButton: true,
548
- denyButtonColor: color,
549
- focusDeny: false,
550
- reverseButtons: true,
551
- allowOutsideClick: false,
552
- allowEscapeKey: false,
553
- allowEnterKey: true,
554
- customClass: {
555
- denyButton: 'sweet-alert-button',
556
- confirmButton: 'sweet-alert-button'
557
- }
558
- }).then(({ value }) => setTimeout(() => Resolve(value)));
559
- });
560
- }
561
- /** */
562
- SetIcon(element, icon) {
563
- for (const item of [...element.classList.value.split(' ')]) {
564
- if (item.length > 0) {
565
- element.classList.remove(item);
566
- element.classList.remove('q');
567
- }
568
- }
569
- icon = icon.trim();
570
- const hasWhiteSpaces = / /;
571
- if (hasWhiteSpaces.test(icon)) {
572
- const classes = icon.split(' ');
573
- for (const icon of classes)
574
- element.classList.add(icon);
575
- }
576
- else
577
- element.classList.add(icon);
578
- }
579
- /** */
580
- SetAutoHide(element, autohide) {
581
- element.removeAttribute('data-bs-autohide');
582
- element.removeAttribute('data-bs-delay');
583
- if (autohide && autohide > 0) {
584
- if (autohide < 1000)
585
- autohide = 1000;
586
- element.setAttribute('data-bs-autohide', 'true');
587
- element.setAttribute('data-bs-delay', String(autohide));
588
- }
589
- else
590
- element.setAttribute('data-bs-autohide', 'false');
591
- }
592
- /** */
593
- GetIcon(title, icon, iconDefault) {
594
- if (icon == null || icon == '') {
595
- title = title.replaceAll(' ', '').toUpperCase();
596
- switch (title) {
597
- case 'ENABLED': return 'fa-solid fa-thumbs-up fa-flip-horizontal';
598
- case 'ACTIVE': return 'fa-solid fa-thumbs-up fa-flip-horizontal';
599
- case 'ACTIVED': return 'fa-solid fa-thumbs-up fa-flip-horizontal';
600
- case 'DISABLE': return 'fa-solid fa-thumbs-down fa-flip-horizontal';
601
- case 'DISABLED': return 'fa-solid fa-thumbs-down fa-flip-horizontal';
602
- case 'DELETE': return 'fa-regular fa-trash-can';
603
- case 'DELETED': return 'fa-regular fa-trash-can';
604
- default: return iconDefault;
605
- }
606
- }
607
- return icon;
608
- }
609
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerAlert, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
610
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CoerAlert, selector: "coer-alert", ngImport: i0, 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: ["*{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}.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"] }); }
611
- }
612
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerAlert, decorators: [{
613
- type: Component,
614
- 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: ["*{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}.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"] }]
615
- }] });
616
-
617
- class CoerButton {
618
- constructor() {
619
- //Variables
620
- this._id = Tools.GetGuid('coer-button');
621
- this._tooltip = '';
622
- //Inputs
623
- this.id = '';
624
- this.color = input('default');
625
- this.type = input('filled');
626
- this.icon = input('');
627
- this.iconPosition = input('left');
628
- this.animation = input(false);
629
- this.isLoading = input(false);
630
- this.isDisabled = input(false);
631
- this.isInvisible = input(false);
632
- this.width = input('125px');
633
- this.minWidth = input('30px');
634
- this.height = input('40px');
635
- this.minHeight = input('30px');
636
- this.marginTop = input('0px');
637
- this.marginRight = input('0px');
638
- this.marginBottom = input('0px');
639
- this.marginLeft = input('0px');
640
- this.path = input([]);
641
- this.tooltipPosition = input('left');
642
- //Outputs
643
- this.onClick = new EventEmitter();
644
- //computed
645
- this._isEnable = computed(() => {
646
- return !this.isLoading() && !this.isDisabled() && !this.isInvisible();
647
- });
648
- //computed
649
- this._icon = computed(() => {
650
- switch (this.icon()) {
651
- case 'new': return 'fa-solid fa-plus fa-lg';
652
- case 'save': return 'fa-solid fa-floppy-disk fa-lg';
653
- case 'cancel': return 'fa-solid fa-xmark fa-lg';
654
- case 'import': return 'fa-solid fa-file-arrow-up fa-lg';
655
- case 'excel': return 'bi bi-filetype-xlsx fa-lg';
656
- case 'menu': return 'fa-solid fa-bars';
657
- case 'delete': return 'fa-solid fa-trash-can';
658
- case 'edit': return 'fa-solid fa-pen fa-lg';
659
- case 'go': return 'bi bi-box-arrow-right';
660
- case 'back': return 'bi bi-box-arrow-left';
661
- default: return '';
662
- }
663
- });
664
- }
665
- set tooltip(value) {
666
- this._tooltip = value;
667
- if (value && this._tooltipElement) {
668
- this._tooltipElement.setContent({ '.tooltip-inner': this._tooltip });
669
- }
670
- }
671
- ngOnInit() {
672
- this.SetToolTip();
673
- this.SetEvents();
674
- }
675
- ngOnDestroy() {
676
- if (this._tooltipElement) {
677
- Tools.Sleep().then(() => this._tooltipElement.dispose());
678
- }
679
- }
680
- /** */
681
- SetEvents() {
682
- Tools.Sleep().then(() => {
683
- this._element = document.getElementById(`${this._id}-inner-button`);
684
- if (Tools.IsNotNull(this._element)) {
685
- this._element.addEventListener('focus', () => {
686
- if (!this._isEnable())
687
- this.Blur();
688
- });
689
- }
690
- });
691
- }
692
- SetToolTip() {
693
- Tools.Sleep().then(() => {
694
- const htmlElement = document.getElementById(`${this._id}-container`);
695
- if (Tools.IsNotNull(htmlElement)) {
696
- htmlElement.addEventListener('mouseleave', () => {
697
- if (Tools.IsNotNull(htmlElement) && Tools.IsNotNull(this._tooltipElement)) {
698
- this._tooltipElement.hide();
699
- }
700
- });
701
- this._tooltipElement = new Tooltip(htmlElement, {
702
- html: true,
703
- title: this._tooltip,
704
- placement: this.tooltipPosition
705
- });
706
- }
707
- });
708
- }
709
- /** */
710
- Click(event) {
711
- if (this._isEnable()) {
712
- this.onClick.emit(event);
713
- }
714
- this.Blur();
715
- }
716
- /** */
717
- Focus(timeout = 0) {
718
- Tools.Sleep(timeout).then(() => {
719
- if (this._isEnable())
720
- this._element.focus();
721
- });
722
- }
723
- /** */
724
- Blur() {
725
- Tools.Sleep().then(() => {
726
- this._element.blur();
727
- });
728
- }
729
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerButton, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
730
- 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: ["*{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}.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"] }] }); }
731
- }
732
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerButton, decorators: [{
733
- type: Component,
734
- 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: ["*{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}.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"] }]
735
- }], propDecorators: { id: [{
736
- type: Input
737
- }], tooltip: [{
738
- type: Input
739
- }], onClick: [{
740
- type: Output
741
- }] } });
742
-
743
- const CONTROL_VALUE = (component) => {
744
- return {
745
- provide: NG_VALUE_ACCESSOR,
746
- useExisting: forwardRef(() => component),
747
- multi: true
748
- };
749
- };
750
- class ControlValue {
751
- constructor() {
752
- this._isTouched = false;
753
- }
754
- get isTouched() {
755
- return this._isTouched;
756
- }
757
- /** */
758
- SetValue(value) {
759
- if (typeof this._UpdateValue === 'function') {
760
- this._UpdateValue(value);
761
- }
762
- this._value = value;
763
- }
764
- /** */
765
- SetTouched(isTouched) {
766
- if (typeof this._IsTouched === 'function') {
767
- this._IsTouched(isTouched);
768
- }
769
- this._isTouched = isTouched;
770
- }
771
- /** */
772
- writeValue(value) {
773
- this._value = value;
774
- }
775
- /** */
776
- registerOnChange(callback) {
777
- this._UpdateValue = callback;
778
- }
779
- /** */
780
- registerOnTouched(callback) {
781
- this._IsTouched = callback;
782
- }
783
- /** */
784
- setDisabledState(isDisabled) { }
785
- }
786
-
787
- class CoerCheckbox extends ControlValue {
788
- constructor() {
789
- super(...arguments);
790
- //Variables
791
- this._value = false;
792
- this._id = Tools.GetGuid('coer-checkbox');
793
- this._isLoading = true;
794
- this.id = input('');
795
- this.label = input('');
796
- this.labelPosition = input('after');
797
- this.isDisabled = input(false);
798
- this.isLoading = input(false);
799
- this.isInvisible = input(false);
800
- this.ignoreModel = input(false);
801
- //Outputs
802
- this.onChange = output();
803
- //computed
804
- this._isEnable = computed(() => {
805
- return !this.isLoading() && !this.isDisabled() && !this.isInvisible();
806
- });
807
- }
808
- //Inputs
809
- set value(value) {
810
- if (Tools.IsNull(value))
811
- value = false;
812
- this.SetValue(value);
813
- }
814
- //getter
815
- get value() {
816
- return this._value;
817
- }
818
- ngAfterViewInit() {
819
- Tools.Sleep().then(_ => this._isLoading = false);
820
- }
821
- //ControlValueAccessor
822
- SetValue(value) {
823
- if (Tools.IsNotNull(value)) {
824
- if (!this.ignoreModel()) {
825
- this._UpdateValue(value);
826
- }
827
- this._value = value;
828
- if (!this._isLoading && this._isEnable()) {
829
- this.onChange.emit(value);
830
- }
831
- }
832
- }
833
- //ControlValueAccessor
834
- writeValue(value) {
835
- if (Tools.IsNotNull(value)) {
836
- this._value = value;
837
- if (!this._isLoading && this._isEnable()) {
838
- this.onChange.emit(value);
839
- }
840
- }
841
- }
842
- /** */
843
- Check() {
844
- if (!this._isLoading && this._isEnable()) {
845
- this.SetValue(true);
846
- }
847
- }
848
- /** */
849
- Uncheck() {
850
- if (!this._isLoading && this._isEnable()) {
851
- this.SetValue(false);
852
- }
853
- }
854
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
855
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }] }); }
856
- }
857
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerCheckbox, decorators: [{
858
- type: Component,
859
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }]
860
- }], propDecorators: { value: [{
861
- type: Input
862
- }] } });
863
-
864
- class Files {
865
- static { this.EXCEL_EXTENSIONS = ['xls', 'xlsx', 'csv']; }
866
- /** Get Extension File */
867
- static GetExtension(file) {
868
- const fileName = file.name;
869
- if (fileName.includes('.')) {
870
- let worlds = fileName.split('.');
871
- if (worlds.length > 0) {
872
- let extension = worlds.pop();
873
- extension = extension.trim().toLowerCase();
874
- if (extension.length > 0)
875
- return extension;
876
- }
877
- }
878
- return null;
879
- }
880
- /** Is Excel File */
881
- static IsExcel(file) {
882
- const EXTENSION = Files.GetExtension(file);
883
- return Tools.IsNotNull(EXTENSION)
884
- ? this.EXCEL_EXTENSIONS.includes(EXTENSION)
885
- : false;
886
- }
887
- /** Read excel file */
888
- static ReadExcel(file) {
889
- return new Promise(Resolve => {
890
- let columns = [];
891
- let rows = [];
892
- const reader = new FileReader();
893
- reader.readAsArrayBuffer(file);
894
- reader.onload = () => {
895
- const dataBytes = new Uint8Array(reader.result);
896
- if (dataBytes) {
897
- const workbook = XLSX.read(dataBytes, {});
898
- const sheet = workbook.Sheets[workbook.SheetNames[0]];
899
- let dataSheet = XLSX.utils.sheet_to_json(sheet, {
900
- 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']
901
- });
902
- //Get Headers
903
- for (const column in dataSheet[0]) {
904
- columns.push(Tools.FirstCharToLower(String(dataSheet[0][column]).replaceAll(' ', '')));
905
- }
906
- //Get Rows
907
- rows = XLSX.utils.sheet_to_json(sheet, { header: columns });
908
- rows.shift();
909
- rows = rows.map(row => {
910
- const item = Tools.BreakReference(row);
911
- delete item['__rowNum__'];
912
- return item;
913
- });
914
- }
915
- Resolve({ columns, rows });
916
- };
917
- reader.onerror = () => { Resolve({ columns, rows }); };
918
- });
919
- }
920
- /** Export to excel file */
921
- static ExportExcel(data, fileName = 'coer_report', sheetName = 'Sheet1') {
922
- sheetName = Tools.CleanUpBlanks(sheetName);
923
- fileName = Tools.CleanUpBlanks(fileName);
924
- if (fileName.endsWith('.xls') || fileName.endsWith('.xlsx') || fileName.endsWith('.csv')) {
925
- if (fileName.includes('.xls')) {
926
- fileName = fileName.replaceAll('.xls', '.xlsx');
927
- }
928
- if (fileName.includes('.csv')) {
929
- fileName = fileName.replaceAll('.csv', '.xlsx');
930
- }
931
- }
932
- else {
933
- fileName += '.xlsx';
934
- }
935
- const WORK_SHEET = XLSX.utils.json_to_sheet(data);
936
- const WORK_BOOK = XLSX.utils.book_new();
937
- XLSX.utils.book_append_sheet(WORK_BOOK, WORK_SHEET, sheetName);
938
- XLSX.writeFile(WORK_BOOK, fileName);
939
- }
940
- /** Convert file to string base64 */
941
- static ConvertToBase64(file) {
942
- return new Promise(Resolve => {
943
- const reader = new FileReader();
944
- reader.readAsDataURL(file);
945
- reader.onload = () => {
946
- Resolve(reader.result?.toString() || '');
947
- };
948
- reader.onerror = () => Resolve('');
949
- });
950
- }
951
- }
952
-
953
- const isModalOpenSIGNAL = signal(false);
954
-
955
- class Screen {
956
- static get WINDOW_WIDTH() {
957
- return window.innerWidth;
958
- }
959
- static get WINDOW_HEIGHT() {
960
- return window.innerHeight;
961
- }
962
- static get DEVICE_WIDTH() {
963
- return window.screen.width;
964
- }
965
- static get DEVICE_HEIGHT() {
966
- return window.screen.height;
967
- }
968
- static get BREAKPOINT() {
969
- if (window.innerWidth < 576)
970
- return 'xs';
971
- else if (window.innerWidth >= 576 && window.innerWidth < 768)
972
- return 'sm';
973
- else if (window.innerWidth >= 768 && window.innerWidth < 992)
974
- return 'md';
975
- else if (window.innerWidth >= 992 && window.innerWidth < 1200)
976
- return 'lg';
977
- else if (window.innerWidth >= 1200 && window.innerWidth < 1400)
978
- return 'xl';
979
- else
980
- return 'xxl';
981
- }
982
- /** */
983
- static { this.Resize = new Observable(subscriber => {
984
- window.addEventListener("load", () => {
985
- window.dispatchEvent(new Event('resize'));
986
- });
987
- window.onresize = () => {
988
- subscriber.next({
989
- width: this.WINDOW_WIDTH,
990
- height: this.WINDOW_HEIGHT,
991
- breakpoin: this.BREAKPOINT
992
- });
993
- };
994
- }); }
995
- /** */
996
- static { this.BackButtonBrowser = new Observable(subscriber => {
997
- window.addEventListener('popstate', popStateEvent => {
998
- if (popStateEvent.state && popStateEvent.target) {
999
- subscriber.next(popStateEvent.target.location.href);
1000
- }
1001
- });
1002
- }); }
1003
- }
1004
-
1005
- class CoerModal {
1006
- constructor() {
1007
- //Variables
1008
- this._id = Tools.GetGuid('coer-modal');
1009
- this._isOpen = false;
1010
- this._isModalOpen = isModalOpenSIGNAL;
1011
- this.windowWidth = Screen.WINDOW_WIDTH;
1012
- //Inputs
1013
- this.id = '';
1014
- this.title = input('');
1015
- this.icon = input('');
1016
- this.showCloseButton = input(true);
1017
- this.width = input('small');
1018
- this.height = input('auto');
1019
- this.maxHeight = input('');
1020
- //Computed
1021
- this.contentList = computed(() => Array.from(this.contentRef._results));
1022
- //Computed
1023
- this.header = computed(() => {
1024
- const header = this.contentList().find(x => x.coerRef() === 'header');
1025
- return Tools.IsNotNull(header) ? header : null;
1026
- });
1027
- //Computed
1028
- this.body = computed(() => {
1029
- const body = this.contentList().find(x => x.coerRef() === '' || x.coerRef() === 'body');
1030
- return Tools.IsNotNull(body) ? body : null;
1031
- });
1032
- //Computed
1033
- this.footer = computed(() => {
1034
- const footer = this.contentList().find(x => x.coerRef() === 'footer');
1035
- return Tools.IsNotNull(footer) ? footer : null;
1036
- });
1037
- //Computed
1038
- this._title = computed(() => {
1039
- return Tools.IsNotNull(this.header()) && this.header().title().length > 0
1040
- ? this.header().title() : this.title();
1041
- });
1042
- //Computed
1043
- this._icon = computed(() => {
1044
- return Tools.IsNotNull(this.header()) && this.header().icon().length > 0
1045
- ? this.header().icon() : this.icon();
1046
- });
1047
- //Outputs
1048
- this.onOpen = output();
1049
- this.onClose = output();
1050
- //Generic Tools
1051
- this.IsNull = Tools.IsNull;
1052
- this.IsNotNull = Tools.IsNotNull;
1053
- }
1054
- //getter
1055
- get isOpen() {
1056
- return this._isOpen;
1057
- }
1058
- //getter
1059
- get _width() {
1060
- switch (this.width()) {
1061
- case 'small': return '450px';
1062
- case 'full': return `${this.windowWidth - 50}px`;
1063
- default: return 'auto';
1064
- }
1065
- }
1066
- ngOnInit() {
1067
- Screen.Resize.subscribe((response) => {
1068
- this.windowWidth = response.width;
1069
- });
1070
- Tools.Sleep().then(() => {
1071
- this._modal = new Modal(document.getElementById(this._id));
1072
- });
1073
- }
1074
- /** */
1075
- Open() {
1076
- this._modal.show();
1077
- if (!this._isOpen) {
1078
- this._isOpen = true;
1079
- this._isModalOpen.set(true);
1080
- Tools.Sleep(1000).then(() => this.onOpen.emit());
1081
- }
1082
- }
1083
- /** */
1084
- Close() {
1085
- this._modal.hide();
1086
- if (this._isOpen) {
1087
- this._isOpen = false;
1088
- this._isModalOpen.set(false);
1089
- Tools.Sleep(1000).then(() => this.onClose.emit());
1090
- }
1091
- }
1092
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerModal, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1093
- 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"] }] }); }
1094
- }
1095
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerModal, decorators: [{
1096
- type: Component,
1097
- 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"] }]
1098
- }], propDecorators: { contentRef: [{
1099
- type: ContentChildren,
1100
- args: [CoerRefDirective]
1101
- }], id: [{
1102
- type: Input
1103
- }] } });
1104
-
1105
- class CoerFilebox {
1106
- constructor() {
1107
- //Injections
1108
- this.alert = inject(CoerAlert);
1109
- this.IsNull = Tools.IsNull;
1110
- this.IsNotNull = Tools.IsNotNull;
1111
- //Elements
1112
- this.inputFileImage = viewChild.required('inputFileImage');
1113
- this.modal = viewChild.required('modal');
1114
- //Variables
1115
- this.base64 = '';
1116
- this._image = null;
1117
- this.imageExtensions = ['png', 'jpeg', 'jpg', 'gif', 'svg'];
1118
- //Inputs
1119
- this.type = input('image');
1120
- this.multiple = input(false);
1121
- this.isLoading = input(false);
1122
- this.isDisabled = input(false);
1123
- //Outputs
1124
- this.onSelected = output();
1125
- this.onDeleteImage = output();
1126
- //computed
1127
- this._isEnable = computed(() => {
1128
- return !this.isLoading() && !this.isDisabled();
1129
- });
1130
- /** */
1131
- this.GetExtensionFile = (fileName) => {
1132
- if (fileName.includes('.')) {
1133
- let worlds = fileName.split('.');
1134
- if (worlds.length > 0) {
1135
- let extension = worlds.pop();
1136
- extension = extension.trim();
1137
- extension = extension.toLowerCase();
1138
- if (extension.length > 0)
1139
- return extension;
1140
- }
1141
- }
1142
- this.alert.Warning('The file extension could not be recognized', 'Files');
1143
- return null;
1144
- };
1145
- }
1146
- set image(value) {
1147
- this._image = Tools.IsNotNull(value) ? value : null;
1148
- if (Tools.IsNotNull(value)) {
1149
- if (value?.value?.name) {
1150
- Files.ConvertToBase64(value?.value).then(base64 => {
1151
- return this.base64 = base64;
1152
- });
1153
- }
1154
- else
1155
- this.base64 = value?.value;
1156
- }
1157
- }
1158
- /** */
1159
- async UploadImages(event) {
1160
- const selectedFiles = Array.from(event.target.files);
1161
- const files = [];
1162
- let extension = null;
1163
- for (const file of selectedFiles) {
1164
- extension = this.GetExtensionFile(file.name) || '';
1165
- if (this.imageExtensions.includes(extension)) {
1166
- files.push({
1167
- file: file,
1168
- extension: extension,
1169
- base64: await Files.ConvertToBase64(file)
1170
- });
1171
- }
1172
- else
1173
- this.alert.Warning(`<b>.${extension}</b> extension not allowed`, 'Files');
1174
- }
1175
- //Response
1176
- this.inputFileImage().nativeElement.value = null;
1177
- this.onSelected.emit([...files]);
1178
- }
1179
- /** */
1180
- DeleteImage(event) {
1181
- event.stopPropagation();
1182
- if (this._isEnable()) {
1183
- this.onDeleteImage.emit();
1184
- }
1185
- }
1186
- /** */
1187
- ExpandImage(event) {
1188
- event.stopPropagation();
1189
- this.modal().Open();
1190
- }
1191
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerFilebox, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1192
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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" }] }); }
1193
- }
1194
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerFilebox, decorators: [{
1195
- type: Component,
1196
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }]
1197
- }], propDecorators: { image: [{
1198
- type: Input
1199
- }] } });
1200
-
1201
- class CoerForm {
1202
- constructor() {
1203
- //Injection
1204
- this.alert = inject(CoerAlert);
1205
- this.formGroup = input.required();
1206
- this.isLoading = input(false);
1207
- this.isDisabled = input(false);
1208
- /** */
1209
- this.IsInvalidControl = (formControlName) => {
1210
- return Tools.IsNotNull(this.formGroup().get(formControlName))
1211
- ? (this.formGroup().get(formControlName).touched && this.formGroup().get(formControlName).invalid)
1212
- : true;
1213
- };
1214
- }
1215
- get _isDisabled() {
1216
- return this.isLoading() || this.isDisabled();
1217
- }
1218
- /** */
1219
- TouchForm() {
1220
- this.formGroup().markAllAsTouched();
1221
- }
1222
- /** */
1223
- SetControlValue(formControlName, value) {
1224
- if (Tools.IsNotNull(this.formGroup().get(formControlName))) {
1225
- this.formGroup().get(formControlName).setValue(value);
1226
- }
1227
- else {
1228
- this.alert.Warning(`${formControlName} Control`, 'Not Found');
1229
- }
1230
- }
1231
- /** */
1232
- GetControlValue(formControlName) {
1233
- return Tools.IsNotNull(this.formGroup().get(formControlName))
1234
- ? this.formGroup().get(formControlName).value
1235
- : null;
1236
- }
1237
- /** Get form value */
1238
- GetValue() {
1239
- return Tools.BreakReference(this.formGroup().value);
1240
- }
1241
- /** */
1242
- Reset(properties = null) {
1243
- if (Tools.IsNull(properties))
1244
- this.formGroup().reset();
1245
- else
1246
- this.formGroup().reset(properties);
1247
- }
1248
- /**
1249
- * Mark all controls as touched.
1250
- * If form is invalid emit a warning and focus first invalid control.
1251
- */
1252
- IsValid() {
1253
- this.TouchForm();
1254
- if (this.formGroup().invalid) {
1255
- this.alert.Warning('Please complete the required fields', 'Instructions', 'fa-solid fa-list-check');
1256
- this.Focus();
1257
- }
1258
- return {
1259
- isValid: this.formGroup().valid,
1260
- formValue: this.GetValue()
1261
- };
1262
- }
1263
- /** Focus the especified control or first invalid control */
1264
- Focus(formControl = null) {
1265
- const formControlCollection = new Map();
1266
- const formControlErrorCollection = new Map();
1267
- for (const property of Tools.GetObjectProperties(this.formGroup().controls)) {
1268
- formControlErrorCollection.set(property, this.formGroup().controls[property].errors);
1269
- const htmlElement = document.querySelector(`[formcontrolname='${property}'] input`);
1270
- if (Tools.IsNotNull(htmlElement))
1271
- formControlCollection.set(property, htmlElement);
1272
- }
1273
- if (formControlCollection.size > 0) {
1274
- if (Tools.IsNull(formControl)) {
1275
- for (const [property, error] of formControlErrorCollection) {
1276
- if (Tools.IsNotNull(error)) {
1277
- formControl = property;
1278
- break;
1279
- }
1280
- }
1281
- if (Tools.IsNull(formControl)) {
1282
- formControl = Array.from(formControlCollection.keys())[0];
1283
- }
1284
- }
1285
- const element = formControlCollection.get(formControl);
1286
- if (Tools.IsNotNull(element))
1287
- element.focus();
1288
- }
1289
- }
1290
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerForm, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1291
- 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"] }] }); }
1292
- }
1293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerForm, decorators: [{
1294
- type: Component,
1295
- 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>" }]
1296
- }] });
1297
-
1298
- class CoerNumberBox extends ControlValue {
1299
- constructor() {
1300
- super(...arguments);
1301
- //Injections
1302
- this.alert = inject(CoerAlert);
1303
- //Component Value
1304
- this._value = '';
1305
- this.matFormField = viewChild.required('matFormField');
1306
- this.coerNumberbox = viewChild.required('coerNumberbox');
1307
- //Variables
1308
- this._id = Tools.GetGuid('coer-numberbox');
1309
- this._isLoadingEvent = signal(false);
1310
- this.hideCaret = false;
1311
- this.id = '';
1312
- this.label = input('');
1313
- this.placeholder = input('');
1314
- this.min = input(0);
1315
- this.max = input(2147483647);
1316
- this.decimals = input(0);
1317
- this.width = input('100%');
1318
- this.minWidth = input('190px');
1319
- this.maxWidth = input('100%');
1320
- this.marginTop = input('0px');
1321
- this.marginRight = input('0px');
1322
- this.marginBottom = input('0px');
1323
- this.marginLeft = input('0px');
1324
- this.isInvalid = input(false);
1325
- this.isValid = input(false);
1326
- this.isDisabled = input(false);
1327
- this.isReadonly = input(false);
1328
- this.isLoading = input(false);
1329
- this.selectOnFocus = input(true);
1330
- this.textPosition = input('right');
1331
- //Outputs
1332
- this.onKeyupEnter = output();
1333
- this.onInput = output();
1334
- //computed
1335
- this._isEnable = computed(() => {
1336
- return !this.isDisabled() && !this.isLoading() && !this.isReadonly();
1337
- });
1338
- //computed
1339
- this.floatLabel = computed(() => {
1340
- return this.label() == '' ? 'always' : 'auto';
1341
- });
1342
- //computed
1343
- this.paddingRight = computed(() => {
1344
- return this.isInvalid() || this.isValid()
1345
- ? '18px' : '0px';
1346
- });
1347
- }
1348
- //Inputs
1349
- set value(value) {
1350
- if (Tools.IsNull(value))
1351
- value = 0;
1352
- this.SetValue(value);
1353
- }
1354
- ngOnInit() {
1355
- Tools.Sleep().then(() => {
1356
- this.element = document.getElementById(this._id);
1357
- if (this.element) {
1358
- this.element.addEventListener('focus', () => {
1359
- if (!this._isEnable())
1360
- this.Blur();
1361
- else if (this.selectOnFocus())
1362
- this.Select();
1363
- });
1364
- this.element.addEventListener('blur', () => this.Blur());
1365
- this.element.addEventListener('keyup', (event) => {
1366
- if (this._isEnable()) {
1367
- const { key } = event;
1368
- if (key === 'Enter') {
1369
- let value = this.coerNumberbox().nativeElement.value;
1370
- value = this.OnlyNumbers(value);
1371
- value = this.ValidateRangeValue(value);
1372
- this.onKeyupEnter.emit(value);
1373
- this.Blur();
1374
- }
1375
- if (key === 'ArrowUp') {
1376
- this.hideCaret = true;
1377
- this.SetValue(Number(this._value) + 1);
1378
- Tools.Sleep(500, 'ArrowUp').then(() => this.hideCaret = false);
1379
- }
1380
- if (key === 'ArrowDown') {
1381
- this.hideCaret = true;
1382
- this.SetValue(Number(this._value) - 1);
1383
- Tools.Sleep(500, 'ArrowDown').then(() => this.hideCaret = false);
1384
- }
1385
- }
1386
- });
1387
- this.element.addEventListener('input', () => {
1388
- Tools.Sleep().then(() => {
1389
- let value = this.coerNumberbox().nativeElement.value;
1390
- value = this.OnlyNumbers(value);
1391
- value = this.ValidateRangeValue(value);
1392
- if (this._isEnable())
1393
- this.onInput.emit(value);
1394
- });
1395
- });
1396
- }
1397
- });
1398
- }
1399
- //getter
1400
- get value() {
1401
- return this._value;
1402
- }
1403
- //ControlValueAccessor
1404
- SetValue(value) {
1405
- value = this.OnlyNumbers(value);
1406
- value = this.ValidateRangeValue(value);
1407
- this._UpdateValue(value);
1408
- this.coerNumberbox().nativeElement.value = value;
1409
- this._value = value;
1410
- }
1411
- //ControlValueAccessor
1412
- writeValue(value) {
1413
- value = this.OnlyNumbers(value);
1414
- value = this.ValidateRangeValue(value);
1415
- this.coerNumberbox().nativeElement.value = value;
1416
- this._value = value;
1417
- }
1418
- /** */
1419
- OnlyNumbers(value) {
1420
- let isNegative = false;
1421
- let valueString = String(value).trim();
1422
- //Negatives
1423
- if (valueString.includes('-')) {
1424
- if (this.min() < 0) {
1425
- isNegative = valueString.startsWith('-');
1426
- if (valueString == '-')
1427
- return '-';
1428
- if (valueString == '-.')
1429
- return '-0.';
1430
- if (valueString == '-0')
1431
- return '-0';
1432
- if (valueString == '-0.')
1433
- return '-0.';
1434
- }
1435
- else if (Number(value) < this.min()) {
1436
- this.alert.Warning(`Minimum ${this.min()}`, 'Out of range', 'fa-solid fa-hashtag');
1437
- valueString = '0';
1438
- }
1439
- }
1440
- const charArray = [];
1441
- for (const char of valueString) {
1442
- if (['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char)) {
1443
- charArray.push(char);
1444
- }
1445
- else if (char == '.' && this.decimals() > 0) {
1446
- charArray.push(char);
1447
- }
1448
- }
1449
- valueString = charArray.join('');
1450
- //Decimals
1451
- if (this.decimals() > 0) {
1452
- let integerString = valueString.split('.')[0] || '';
1453
- let decimalString = valueString.split('.')[1] || '';
1454
- decimalString = decimalString.substring(0, this.decimals());
1455
- if (valueString == '.')
1456
- return '0.';
1457
- else if (valueString.includes('.') && decimalString == '') {
1458
- return (isNegative) ? `-${integerString}.` : `${integerString}.`;
1459
- }
1460
- else if (valueString.includes('.') && decimalString.endsWith('0')) {
1461
- return (isNegative) ? `-${integerString}.${decimalString}` : `${integerString}.${decimalString}`;
1462
- }
1463
- else if (integerString == '' && decimalString == '') {
1464
- return '0';
1465
- }
1466
- valueString = `${integerString}.${decimalString}`;
1467
- }
1468
- if (isNegative) {
1469
- valueString = `-${valueString}`;
1470
- }
1471
- return Number(valueString);
1472
- }
1473
- /** */
1474
- ValidateRangeValue(value) {
1475
- if (['-', '.', '-.', '-0', '-0.'].includes(String(value))) {
1476
- return String(value);
1477
- }
1478
- if (Number(value) < this.min()) {
1479
- this.alert.Warning(`Minimum ${this.min()}`, 'Out of range', 'fa-solid fa-hashtag');
1480
- value = this.min();
1481
- }
1482
- if (Number(value) > this.max()) {
1483
- this.alert.Warning(`Cannot exceed ${this.max()}`, 'Out of range', 'fa-solid fa-hashtag');
1484
- value = this.max();
1485
- }
1486
- if (this.decimals() <= 0) {
1487
- if (String(value).includes('.')) {
1488
- value = String(value).split('.')[0];
1489
- }
1490
- }
1491
- return String(value);
1492
- }
1493
- /** */
1494
- Focus(timeout = 0) {
1495
- if (this._isLoadingEvent())
1496
- return;
1497
- else
1498
- this._isLoadingEvent.set(true);
1499
- Tools.Sleep(timeout).then(() => {
1500
- if (this._isEnable()) {
1501
- this.element.focus();
1502
- }
1503
- this._isLoadingEvent.set(false);
1504
- });
1505
- }
1506
- /** */
1507
- Select(timeout = 0) {
1508
- if (this._isLoadingEvent())
1509
- return;
1510
- else
1511
- this._isLoadingEvent.set(true);
1512
- Tools.Sleep(timeout).then(() => {
1513
- if (this._isEnable()) {
1514
- this.element.focus();
1515
- this.element.select();
1516
- }
1517
- this._isLoadingEvent.set(false);
1518
- });
1519
- }
1520
- /** */
1521
- Blur() {
1522
- if (this._isLoadingEvent())
1523
- return;
1524
- else
1525
- this._isLoadingEvent.set(true);
1526
- Tools.Sleep().then(() => {
1527
- if (this.element) {
1528
- this.element.blur();
1529
- setTimeout(() => {
1530
- const element = document.querySelector(`#${this._id}-container .mdc-line-ripple--active`);
1531
- if (element)
1532
- element.classList.remove('mdc-line-ripple--active');
1533
- this._isLoadingEvent.set(false);
1534
- });
1535
- }
1536
- });
1537
- }
1538
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerNumberBox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1539
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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" }] }); }
1540
- }
1541
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerNumberBox, decorators: [{
1542
- type: Component,
1543
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }]
1544
- }], propDecorators: { value: [{
1545
- type: Input
1546
- }], id: [{
1547
- type: Input
1548
- }] } });
1549
-
1550
- class CoerSelectbox extends ControlValue {
1551
- constructor() {
1552
- super(...arguments);
1553
- //Component Value
1554
- this._value = null;
1555
- //Variables
1556
- this._scrollByRow = 40.8;
1557
- this._coerTextBox = viewChild.required('coerTextBox');
1558
- this._id = Tools.GetGuid('coer-selectBox');
1559
- this._index = signal(-1);
1560
- this._search = signal('');
1561
- this._isOpen = signal(false);
1562
- this._isDirty = signal(false);
1563
- this._isOverMenu = signal(false);
1564
- this._isLoadingEvent = signal(false);
1565
- this._scroll = signal(0);
1566
- this.id = '';
1567
- this.label = input('');
1568
- this.dataSource = input([]);
1569
- this.propDisplay = input('name');
1570
- this.rowsByPage = input(50);
1571
- this.placeholder = input('-- Select --');
1572
- this.width = input('100%');
1573
- this.minWidth = input('190px');
1574
- this.maxWidth = input('100%');
1575
- this.marginTop = input('0px');
1576
- this.marginRight = input('0px');
1577
- this.marginBottom = input('0px');
1578
- this.marginLeft = input('0px');
1579
- this.isInvalid = input(false);
1580
- this.isValid = input(false);
1581
- this.isDisabled = input(false);
1582
- this.isReadonly = input(false);
1583
- this.isLoading = input(false);
1584
- //Outputs
1585
- this.onSelected = output();
1586
- //computed
1587
- this._isEnable = computed(() => {
1588
- return !this.isDisabled() && !this.isLoading() && !this.isReadonly();
1589
- });
1590
- //computed
1591
- this.floatLabel = computed(() => {
1592
- return this.label() == '' ? 'always' : 'auto';
1593
- });
1594
- //computed
1595
- this._dataSource = computed(() => {
1596
- let index = 0;
1597
- const search = this._search();
1598
- const propDisplay = this.propDisplay();
1599
- let dataSource = this.dataSource().map((item) => Object.assign(item, { index: index++ }));
1600
- if (this._isDirty() && !this._isLoadingEvent()) {
1601
- dataSource = [...dataSource].filter((item) => String(item[propDisplay]).trim().toUpperCase().includes(search.trim().toUpperCase()));
1602
- }
1603
- let indexRow = 0;
1604
- return Tools.BreakReference(dataSource)
1605
- .splice(0, this.rowsByPage())
1606
- .map((item) => Object.assign(item, { indexRow: indexRow++ }));
1607
- });
1608
- /** */
1609
- this.GetIndexRow = (item) => {
1610
- return item['indexRow'];
1611
- };
1612
- /** */
1613
- this.GetDisplay = (item) => {
1614
- return Tools.IsNotNull(item) ? item[this.propDisplay()] : '';
1615
- };
1616
- }
1617
- //Inputs
1618
- set value(value) {
1619
- if (Tools.IsNull(value))
1620
- value = null;
1621
- this.SetValue(value);
1622
- }
1623
- ngOnInit() {
1624
- this.SetEvents();
1625
- }
1626
- //getter
1627
- get value() {
1628
- return this._value;
1629
- }
1630
- //getter
1631
- get _displayed() {
1632
- return Tools.IsNotNull(this._value) ? this._value[this.propDisplay()] : '';
1633
- }
1634
- //getter
1635
- get _placeholder() {
1636
- let placeholder = this.placeholder();
1637
- if (this.dataSource().length <= 0) {
1638
- placeholder = '-- No Options --';
1639
- }
1640
- return Tools.IsNotNull(this._value)
1641
- ? this._displayed
1642
- : placeholder;
1643
- }
1644
- //computed
1645
- get _showCancel() {
1646
- return Tools.IsNotNull(this._value)
1647
- && this._search().length <= 0;
1648
- }
1649
- //computed
1650
- get paddingRight() {
1651
- return this.isInvalid() || this.isValid() || this._showCancel
1652
- ? '40px' : '15px';
1653
- }
1654
- //computed
1655
- get widthIcons() {
1656
- return this.isInvalid() || this.isValid() || this._showCancel
1657
- ? '55px' : '30px';
1658
- }
1659
- /** */
1660
- SetValue(_value) {
1661
- if (_value === undefined)
1662
- _value = null;
1663
- this._UpdateValue(_value);
1664
- this._value = _value;
1665
- this._search.set(this.GetDisplay(_value));
1666
- }
1667
- /** */
1668
- writeValue(_value) {
1669
- if (_value === undefined)
1670
- _value = null;
1671
- this._value = _value;
1672
- this._search.set(this.GetDisplay(_value));
1673
- }
1674
- /** */
1675
- SetEvents() {
1676
- Tools.Sleep().then(() => {
1677
- //Container
1678
- this._container = document.getElementById(`${this._id}-container`);
1679
- this._container.addEventListener('mouseenter', () => {
1680
- this._isOverMenu.set(true);
1681
- });
1682
- this._container.addEventListener('mouseleave', () => {
1683
- this._isOverMenu.set(false);
1684
- });
1685
- //DropDown
1686
- this._dropDownMenu = document.getElementById(`${this._id}-dropdown-menu`);
1687
- this._dropDownMenu.addEventListener('mouseenter', () => {
1688
- this._isOverMenu.set(true);
1689
- });
1690
- this._dropDownMenu.addEventListener('mouseleave', () => {
1691
- this._isOverMenu.set(false);
1692
- });
1693
- //TextBox
1694
- this._textbox = document.getElementById(this._id);
1695
- this._textbox.addEventListener('focus', () => {
1696
- if (this._isEnable())
1697
- this.Focus();
1698
- else
1699
- this.Blur();
1700
- });
1701
- this._textbox.addEventListener('keyup', (event) => {
1702
- const { key } = event;
1703
- if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) {
1704
- if (key === 'ArrowUp') {
1705
- const firstIndex = (this._dataSource().length <= 0) ? -1 : 0;
1706
- if ((this._index() - 1) >= firstIndex) {
1707
- this._index.update(index => index - 1);
1708
- if (this._index() >= 3)
1709
- this._scroll.update(scroll => scroll -= this._scrollByRow);
1710
- else
1711
- this._scroll.set(0);
1712
- this._dropDownMenu.scrollTo(0, this._scroll());
1713
- }
1714
- else {
1715
- this._scroll.set(0);
1716
- this._index.set(-1);
1717
- this._textbox.focus();
1718
- this._textbox.select();
1719
- }
1720
- this._dropDownMenu.scrollTo(0, this._scroll());
1721
- }
1722
- else if (key === 'ArrowDown') {
1723
- const lastIndex = (this._dataSource().length - 1);
1724
- if ((this._index() + 1) <= lastIndex) {
1725
- this._index.update(index => index + 1);
1726
- if (this._index() >= 3)
1727
- this._scroll.update(scroll => scroll += this._scrollByRow);
1728
- }
1729
- this._dropDownMenu.scrollTo(0, this._scroll());
1730
- }
1731
- else if (['ArrowLeft', 'ArrowRight'].includes(key)) {
1732
- if (Tools.IsNotNull(this._value) && !this._isDirty()) {
1733
- this._scroll.set(0);
1734
- this._dropDownMenu.scrollTo(0, this._scroll());
1735
- this.Search(this._displayed);
1736
- }
1737
- this._isDirty.set(true);
1738
- }
1739
- }
1740
- else {
1741
- if (key == 'Delete' && this._search() == '') {
1742
- this.Unselect();
1743
- }
1744
- this._isDirty.set(true);
1745
- }
1746
- });
1747
- this._textbox.addEventListener('mouseenter', () => {
1748
- this._isOverMenu.set(true);
1749
- });
1750
- this._textbox.addEventListener('mouseleave', () => {
1751
- this._isOverMenu.set(false);
1752
- });
1753
- this._textbox.addEventListener('paste', () => {
1754
- Tools.Sleep().then(_ => {
1755
- this._search.update(search => search = search.toString().trim());
1756
- });
1757
- });
1758
- //Document
1759
- document.addEventListener('click', () => {
1760
- if (!this._isOverMenu())
1761
- this.Blur();
1762
- });
1763
- document.addEventListener('keyup', (event) => {
1764
- if (event.key === 'Enter') {
1765
- if (this._index() >= 0) {
1766
- if (Tools.IsNotNull(this._value) && this._search() == this._value[this.propDisplay()]) {
1767
- this._isLoadingEvent.set(true);
1768
- }
1769
- const dataSource = Tools.BreakReference(this._dataSource());
1770
- const _value = dataSource.find(x => x.indexRow == this._index());
1771
- this.SelectItem(_value);
1772
- this._isLoadingEvent.set(false);
1773
- }
1774
- this.Blur();
1775
- }
1776
- });
1777
- });
1778
- }
1779
- /** */
1780
- SelectItem(item) {
1781
- if (Tools.IsNotNull(item)) {
1782
- const _item = Tools.BreakReference(this.dataSource()[item.index]);
1783
- if (Tools.IsNotNull(_item)) {
1784
- this.SetValue(Tools.BreakReference(_item));
1785
- this.Blur();
1786
- }
1787
- delete _item.indexRow;
1788
- delete _item.index;
1789
- this.onSelected.emit({ ..._item });
1790
- }
1791
- }
1792
- /** */
1793
- Unselect() {
1794
- this._search.set('');
1795
- this.SetValue(null);
1796
- this.Blur();
1797
- }
1798
- /** */
1799
- Focus(timeout = 0) {
1800
- if (this._isLoadingEvent())
1801
- return;
1802
- else
1803
- this._isLoadingEvent.set(true);
1804
- Tools.Sleep(timeout).then(_ => {
1805
- if (this._isEnable()) {
1806
- this._textbox.focus();
1807
- this._textbox.select();
1808
- this.Open();
1809
- }
1810
- Tools.Sleep().then(_ => {
1811
- if (Tools.IsNotNull(this._value)) {
1812
- this.Search(this._displayed);
1813
- }
1814
- this._isLoadingEvent.set(false);
1815
- });
1816
- });
1817
- }
1818
- /** */
1819
- Blur() {
1820
- if (this._isLoadingEvent())
1821
- return;
1822
- this._isLoadingEvent.set(true);
1823
- this._isDirty.set(false);
1824
- this._index.set(-1);
1825
- this._scroll.set(0);
1826
- this._dropDownMenu.scrollTo(0, this._scroll());
1827
- this._search.set(this._displayed);
1828
- Tools.Sleep().then(_ => {
1829
- this._textbox.blur();
1830
- this.Close();
1831
- Tools.Sleep().then(_ => {
1832
- const element = document.querySelector(`#${this._id}-container .mdc-line-ripple--active`);
1833
- if (element)
1834
- element.classList.remove('mdc-line-ripple--active');
1835
- this._isLoadingEvent.set(false);
1836
- });
1837
- });
1838
- }
1839
- /** */
1840
- Open() {
1841
- if (!this._dropDownMenu.classList.contains('show')) {
1842
- this._dropDownMenu.classList.add('show');
1843
- }
1844
- this._isOpen.set(true);
1845
- }
1846
- /** */
1847
- Close() {
1848
- if (this._dropDownMenu.classList.contains('show')) {
1849
- this._dropDownMenu.classList.remove('show');
1850
- }
1851
- this._isOpen.set(false);
1852
- }
1853
- /** */
1854
- Search(_value) {
1855
- this._search.set(String(_value));
1856
- Tools.Sleep(0, `${this._id}-search`).then(_ => {
1857
- const item = this._dataSource().find(item => String(item[this.propDisplay()]).trim().toUpperCase().includes(String(_value).trim().toUpperCase()));
1858
- if (Tools.IsNotNull(item)) {
1859
- this._index.set(item.indexRow);
1860
- if (this._index() >= 3) {
1861
- this._scroll.set((this._index() - 2) * this._scrollByRow);
1862
- }
1863
- else {
1864
- this._scroll.set(0);
1865
- }
1866
- this._dropDownMenu.scrollTo(0, this._scroll());
1867
- }
1868
- });
1869
- }
1870
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerSelectbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1871
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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" }] }); }
1872
- }
1873
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerSelectbox, decorators: [{
1874
- type: Component,
1875
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }]
1876
- }], propDecorators: { value: [{
1877
- type: Input
1878
- }], id: [{
1879
- type: Input
1880
- }] } });
1881
-
1882
- class CoerTextBox extends ControlValue {
1883
- constructor() {
1884
- super(...arguments);
1885
- //Component Value
1886
- this._value = '';
1887
- this.matFormField = viewChild.required('matFormField');
1888
- this.coerTextBox = viewChild.required('coerTextBox');
1889
- //Variables
1890
- this._id = Tools.GetGuid('coer-textBox');
1891
- this._isLoadingEvent = signal(false);
1892
- this.id = '';
1893
- this.label = input('');
1894
- this.placeholder = input('');
1895
- this.minLength = input(0);
1896
- this.maxLength = input(50);
1897
- this.showSearchIcon = input(false);
1898
- this.showClearIcon = input(false);
1899
- this.width = input('100%');
1900
- this.minWidth = input('190px');
1901
- this.maxWidth = input('100%');
1902
- this.marginTop = input('0px');
1903
- this.marginRight = input('0px');
1904
- this.marginBottom = input('0px');
1905
- this.marginLeft = input('0px');
1906
- this.isInvalid = input(false);
1907
- this.isValid = input(false);
1908
- this.isDisabled = input(false);
1909
- this.isReadonly = input(false);
1910
- this.isLoading = input(false);
1911
- this.selectOnFocus = input(true);
1912
- this.textPosition = input('left');
1913
- //Outputs
1914
- this.onKeyupEnter = output();
1915
- this.onInput = output();
1916
- this.onClickClear = output();
1917
- //computed
1918
- this._isEnable = computed(() => {
1919
- return !this.isDisabled() && !this.isLoading() && !this.isReadonly();
1920
- });
1921
- //computed
1922
- this.floatLabel = computed(() => {
1923
- return this.label() == '' ? 'always' : 'auto';
1924
- });
1925
- //computed
1926
- this.paddingRight = computed(() => {
1927
- return this.isInvalid() || this.isValid()
1928
- ? '18px' : '0px';
1929
- });
1930
- }
1931
- //Inputs
1932
- set value(value) {
1933
- if (Tools.IsNull(value))
1934
- value = '';
1935
- this.SetValue(value);
1936
- }
1937
- ngOnInit() {
1938
- this.SetEvents();
1939
- }
1940
- //getter
1941
- get _showSearchIcon() {
1942
- return this.showSearchIcon()
1943
- && !this._showClearIcon
1944
- && !this.isDisabled()
1945
- && !this.isLoading();
1946
- }
1947
- //getter
1948
- get _showClearIcon() {
1949
- return this.showClearIcon()
1950
- && !this.isDisabled()
1951
- && !this.isLoading()
1952
- && this._value != undefined
1953
- && String(this._value).length > 0;
1954
- }
1955
- //getter
1956
- get value() {
1957
- return this._value;
1958
- }
1959
- /** */
1960
- SetEvents() {
1961
- Tools.Sleep().then(() => {
1962
- this.element = document.getElementById(this._id);
1963
- if (this.element) {
1964
- this.element.addEventListener('focus', () => {
1965
- if (!this._isEnable())
1966
- this.Blur();
1967
- else if (this.selectOnFocus())
1968
- this.Select();
1969
- });
1970
- this.element.addEventListener('keyup', (event) => {
1971
- if (this._isEnable()) {
1972
- const { key } = event;
1973
- if (key === 'Enter') {
1974
- const value = this.coerTextBox().nativeElement.value;
1975
- this.onKeyupEnter.emit(value);
1976
- this.Blur();
1977
- }
1978
- }
1979
- });
1980
- this.element.addEventListener('blur', () => this.Blur());
1981
- this.element.addEventListener('input', () => {
1982
- Tools.Sleep().then(() => {
1983
- const value = this.coerTextBox().nativeElement.value;
1984
- if (this._isEnable())
1985
- this.onInput.emit(value);
1986
- });
1987
- });
1988
- this.element.addEventListener('paste', () => {
1989
- Tools.Sleep().then(() => {
1990
- this.SetValue(this._value.toString().trim());
1991
- });
1992
- });
1993
- }
1994
- });
1995
- }
1996
- /** */
1997
- Focus(timeout = 0) {
1998
- if (this._isLoadingEvent())
1999
- return;
2000
- else
2001
- this._isLoadingEvent.set(true);
2002
- Tools.Sleep(timeout).then(() => {
2003
- if (this._isEnable()) {
2004
- this.element.focus();
2005
- }
2006
- this._isLoadingEvent.set(false);
2007
- });
2008
- }
2009
- /** */
2010
- Select(timeout = 0) {
2011
- if (this._isLoadingEvent())
2012
- return;
2013
- else
2014
- this._isLoadingEvent.set(true);
2015
- Tools.Sleep(timeout).then(() => {
2016
- if (this._isEnable()) {
2017
- this.element.focus();
2018
- this.element.select();
2019
- }
2020
- this._isLoadingEvent.set(false);
2021
- });
2022
- }
2023
- /** */
2024
- Blur() {
2025
- if (this._isLoadingEvent())
2026
- return;
2027
- else
2028
- this._isLoadingEvent.set(true);
2029
- Tools.Sleep().then(() => {
2030
- if (this.element) {
2031
- this.element.blur();
2032
- Tools.Sleep().then(() => {
2033
- const element = document.querySelector(`#${this._id}-container .mdc-line-ripple--active`);
2034
- if (element)
2035
- element.classList.remove('mdc-line-ripple--active');
2036
- });
2037
- }
2038
- this._isLoadingEvent.set(false);
2039
- });
2040
- }
2041
- /** */
2042
- Clear() {
2043
- this.SetValue('');
2044
- this.Focus();
2045
- }
2046
- /** */
2047
- ClickSearch() {
2048
- Tools.Sleep().then(() => {
2049
- if (this._isEnable()) {
2050
- if (this.showClearIcon())
2051
- this.Focus();
2052
- else {
2053
- this.onKeyupEnter.emit(this._value);
2054
- this.Blur();
2055
- }
2056
- }
2057
- });
2058
- }
2059
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTextBox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2060
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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" }] }); }
2061
- }
2062
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTextBox, decorators: [{
2063
- type: Component,
2064
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }]
2065
- }], propDecorators: { value: [{
2066
- type: Input
2067
- }], id: [{
2068
- type: Input
2069
- }] } });
2070
-
2071
- class DateTime {
2072
- /** Get UTC Offset */
2073
- static GetOffset() {
2074
- return moment().utcOffset();
2075
- }
2076
- /** YYYY-MM-DD HH:mm:ss */
2077
- static GetFormatDB(date) {
2078
- if ((typeof date === 'string'))
2079
- date = date.replaceAll('/', '-');
2080
- return moment(date).format('YYYY-MM-DD HH:mm:ss');
2081
- }
2082
- /** Convert UTC Date to Local Zone */
2083
- static ToLocalZone(date) {
2084
- date = DateTime.GetFormatDB(date);
2085
- return moment(date).add(DateTime.GetOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
2086
- }
2087
- /** Convert Local Zone Date to UTC */
2088
- static ToUTC(date) {
2089
- date = DateTime.GetFormatDB(date);
2090
- return moment(date).subtract(DateTime.GetOffset(), 'minutes').format('YYYY-MM-DD HH:mm:ss');
2091
- }
2092
- /** DD MMM YYYY */
2093
- static GetDateFormat(date) {
2094
- date = DateTime.GetFormatDB(date);
2095
- return moment(date).parseZone().local(true).format('DD MMM YYYY');
2096
- }
2097
- }
2098
-
2099
- class CoerGridExtension extends ControlValue {
2100
- constructor() {
2101
- super(...arguments);
2102
- //Injections
2103
- this.alert = inject(CoerAlert);
2104
- //Elements
2105
- this.inputFile = viewChild.required('inputFileRef');
2106
- this.inputSearch = viewChild.required('inputSearch');
2107
- this.coerTextboxList = viewChildren(CoerTextBox);
2108
- this.coerNumberboxList = viewChildren(CoerNumberBox);
2109
- this.coerSelectboxList = viewChildren(CoerSelectbox);
2110
- this.coerCheckboxList = viewChildren(CoerCheckbox);
2111
- //Variables
2112
- this._value = [];
2113
- this.value_signal = signal([]);
2114
- this._gridSearch = signal('');
2115
- this._isLoading = true;
2116
- this._isLoadingMessage = true;
2117
- this._id = Tools.GetGuid('coer-grid');
2118
- this._expandedGroups = [];
2119
- this._enableAnimations = false;
2120
- this._indexFocus = signal(0);
2121
- this._sort = signal({ columnName: '', direction: 'none', icon: '' });
2122
- //Generic Tools
2123
- this.GetNumericFormat = Tools.GetNumericFormat;
2124
- this.GetDateFormat = DateTime.GetDateFormat;
2125
- //Inputs
2126
- this.columns = input([]);
2127
- this.cleanColumnName = input(true);
2128
- this.addButton = { show: false };
2129
- this.exportButton = { show: false };
2130
- this.importButton = { show: false };
2131
- this.search = { show: false, ignore: false };
2132
- this.buttonByRow = {};
2133
- this.checkbox = { show: false };
2134
- this.tooltipByRow = input('');
2135
- this.isLoading = input(false);
2136
- this.isDisabled = input(false);
2137
- this.rowsByPage = input(50);
2138
- this.groupBy = input('');
2139
- this.showColumnGrouped = input(false);
2140
- this.rowsByGroup = input(50);
2141
- this.isInvisible = input(false);
2142
- this.showFooter = input(true);
2143
- this.width = input('100%');
2144
- this.MinWidth = input('250px');
2145
- this.MaxWidth = input('100%');
2146
- this.height = input('350px');
2147
- this.minHeight = input('140px');
2148
- this.maxHeight = input('100vh');
2149
- this.margin = input('auto');
2150
- this.enableSort = input(true);
2151
- this.enableRowFocus = input(true);
2152
- //Outputs
2153
- this.onClickAdd = output();
2154
- this.onClickImport = output();
2155
- this.onClickExport = output();
2156
- this.onClickRow = output();
2157
- this.onDoubleClickRow = output();
2158
- this.onClickDeleteRow = output();
2159
- this.onClickEditRow = output();
2160
- this.onClickGoRow = output();
2161
- this.onKeyupEnter = output();
2162
- this.onKeyupEnterLast = output();
2163
- this.onSwitchChange = output();
2164
- this.onTextboxChange = output();
2165
- this.onSelectboxChange = output();
2166
- this.onCheckboxChange = output();
2167
- //computed
2168
- this._isDisabled = computed(() => {
2169
- return this.isDisabled() || this.isLoading() || this.isInvisible();
2170
- });
2171
- //computed
2172
- this._isGrouped = computed(() => {
2173
- return this.groupBy().length > 0;
2174
- });
2175
- //computed
2176
- this.gridColumns = computed(() => {
2177
- const SET_COLUMNS = new Set();
2178
- //Has filter columns?
2179
- if (this.columns().length > 0) {
2180
- for (const { property } of this.columns()) {
2181
- SET_COLUMNS.add(property);
2182
- }
2183
- }
2184
- //Get all columns
2185
- else
2186
- for (const row of this.value_signal()) {
2187
- for (const property in row) {
2188
- SET_COLUMNS.add(property);
2189
- }
2190
- }
2191
- //Remove indexRow column
2192
- if (SET_COLUMNS.has('indexRow')) {
2193
- SET_COLUMNS.delete('indexRow');
2194
- }
2195
- //Remove groupBy column
2196
- if (this._isGrouped() && !this.showColumnGrouped() && SET_COLUMNS.has(this.groupBy())) {
2197
- SET_COLUMNS.delete(this.groupBy());
2198
- }
2199
- //Set index column
2200
- let indexColumn = 0;
2201
- return Array.from(SET_COLUMNS).map(property => Tools.BreakReference({
2202
- columnName: property,
2203
- indexColumn: indexColumn++,
2204
- width: this._GetColumnConfig(property)?.width || 'auto'
2205
- }));
2206
- });
2207
- //computed
2208
- this.gridDataSource = computed(() => {
2209
- let list = this.gridDataSourceFiltered();
2210
- //It's Grouped?
2211
- if (this._isGrouped()) {
2212
- //let indexRow = 0;
2213
- let indexGroup = 0;
2214
- const SET_COLUMN = new Set();
2215
- for (const row of list) {
2216
- SET_COLUMN.add(row[this.groupBy()]);
2217
- }
2218
- const DATA_SOURCE_GROPUED = [];
2219
- for (const column of SET_COLUMN) {
2220
- DATA_SOURCE_GROPUED.push({
2221
- groupBy: column,
2222
- indexGroup: indexGroup++,
2223
- length: list.filter((item) => item[this.groupBy()] == column).length,
2224
- rows: [...list]
2225
- .filter((item) => item[this.groupBy()] == column)
2226
- .splice(0, this.rowsByGroup())
2227
- //.map((item: any) => Object.assign({ indexRow: indexRow++ }, item))
2228
- });
2229
- }
2230
- //Response by group
2231
- return [...DATA_SOURCE_GROPUED].splice(0, this.rowsByPage());
2232
- }
2233
- //Response
2234
- return [{
2235
- groupBy: 'Not Grouped',
2236
- indexGroup: -1,
2237
- length: -1,
2238
- rows: [...list].splice(0, this.rowsByPage())
2239
- }];
2240
- });
2241
- //computed
2242
- this.gridDataSourceFiltered = computed(() => {
2243
- let list = [];
2244
- const dataSource = Tools.BreakReference(this.value_signal());
2245
- //Ignore Filter
2246
- if (this._gridSearch() == '' || this.search?.ignore) {
2247
- list = dataSource;
2248
- }
2249
- //Filter by search
2250
- else {
2251
- const SET_ROW = new Set();
2252
- let listFiltered = [];
2253
- for (const { columnName } of this.gridColumns()) {
2254
- listFiltered = dataSource.filter((item) => !SET_ROW.has(item['indexRow'])
2255
- && String(item[Tools.FirstCharToLower(columnName)]).trim().toUpperCase().includes(String(this._gridSearch()).trim().toUpperCase()));
2256
- for (const { indexRow } of listFiltered) {
2257
- SET_ROW.add(indexRow);
2258
- }
2259
- list = Tools.BreakReference(list.concat(listFiltered));
2260
- }
2261
- }
2262
- return Tools.BreakReference(list);
2263
- });
2264
- /** Get Column Configuration */
2265
- this._GetColumnConfig = (columnName) => {
2266
- return this.columns().find(x => x.property.replaceAll(' ', '').toUpperCase() == columnName.replaceAll(' ', '').toUpperCase());
2267
- };
2268
- /** Clean Name or get alias */
2269
- this._GetColumnName = (columnName) => {
2270
- const columnConfig = this._GetColumnConfig(columnName);
2271
- //Get Alias
2272
- if (columnConfig && columnConfig.alias && columnConfig.alias.length > 0) {
2273
- return columnConfig.alias;
2274
- }
2275
- //Clean headerName
2276
- if (this.cleanColumnName() && columnName.length > 0) {
2277
- columnName = Tools.FirstCharToLower(columnName);
2278
- const charArray = [];
2279
- for (const char of columnName) {
2280
- if (char === char.toUpperCase())
2281
- charArray.push(' ');
2282
- charArray.push(char);
2283
- }
2284
- charArray[0] = charArray[0].toUpperCase();
2285
- columnName = charArray.join('');
2286
- }
2287
- return columnName.trim();
2288
- };
2289
- /** */
2290
- this._GetShortIcon = (columnName) => {
2291
- return this._sort().columnName == columnName ? this._sort().icon : '';
2292
- };
2293
- /** */
2294
- this._GetId = (indexRow, indexColumn, suffix = '') => {
2295
- if (suffix.length > 0)
2296
- suffix = `-${suffix}`;
2297
- return `${this._id}-row${indexRow}column${indexColumn}${suffix}`;
2298
- };
2299
- /** */
2300
- this._GetCellValue = (row, columnName) => {
2301
- return row[Tools.FirstCharToLower(columnName).replaceAll(' ', '')];
2302
- };
2303
- /** */
2304
- this._GetTooltip = (prefix, row, suffix = '') => {
2305
- let column = Tools.FirstCharToLower(this.tooltipByRow()).replaceAll(' ', '');
2306
- if (suffix.length > 0) {
2307
- suffix = ` ${suffix}`;
2308
- }
2309
- return this.tooltipByRow().length > 0
2310
- ? `${prefix} ${row[column]}${suffix}`
2311
- : `${prefix}${suffix}`;
2312
- };
2313
- /** */
2314
- this._HideRow = (group) => {
2315
- return (this._isGrouped() ? !(this._expandedGroups.some(x => x == group.groupBy)) : false);
2316
- };
2317
- }
2318
- //getter
2319
- get _height() {
2320
- let height = this.height();
2321
- if (height == 'full') {
2322
- const TOOLBAR = 45;
2323
- const PAGE_HEADER = 70;
2324
- const GRID_HEADER = document.getElementById(`${this._id}-header`);
2325
- const HEADER = (GRID_HEADER && GRID_HEADER.children.length > 0) ? 50 : 0;
2326
- const MARGIN = 30;
2327
- const PADDING = 20;
2328
- const FOOTER = this.showFooter() ? 24.5 : 0;
2329
- height = (Screen.WINDOW_HEIGHT - TOOLBAR - PAGE_HEADER - MARGIN - HEADER - PADDING - FOOTER) + 'px';
2330
- }
2331
- return height;
2332
- }
2333
- //getter
2334
- get _onlyOneCheck() {
2335
- return Tools.IsNotNull(this.checkbox.onlyOneCheck) && this.checkbox.onlyOneCheck;
2336
- }
2337
- ngAfterViewInit() {
2338
- Tools.Sleep().then(() => {
2339
- this._enableAnimations = true;
2340
- this._isLoading = false;
2341
- this._isLoadingMessage = false;
2342
- });
2343
- }
2344
- //ControlValueAccessor
2345
- SetValue(value) {
2346
- let indexRow = 0;
2347
- if (!Tools.IsNotNull(value))
2348
- value = [];
2349
- const dataSource = Tools.BreakReference(value).map((item) => Object.assign({ checked: false }, { ...item }, { indexRow: indexRow++ }));
2350
- this._UpdateValue(dataSource);
2351
- this._value = dataSource;
2352
- this.value_signal.set(dataSource);
2353
- }
2354
- //ControlValueAccessor
2355
- writeValue(value) {
2356
- let indexRow = 0;
2357
- if (!Tools.IsNotNull(value))
2358
- value = [];
2359
- const dataSource = Tools.BreakReference(value).map((item) => Object.assign({ checked: false }, { ...item }, { indexRow: indexRow++ }));
2360
- this._value = dataSource;
2361
- this.value_signal.set(dataSource);
2362
- }
2363
- /** */
2364
- _IsCellType(property, data, type) {
2365
- let response = false;
2366
- const columnConfig = this._GetColumnConfig(property);
2367
- const value = data[property];
2368
- const row = Tools.BreakReference(data);
2369
- if (columnConfig) {
2370
- if (['coerTextbox', 'coerNumberbox', 'coerSelectbox', 'coerSwitch'].includes(type)) {
2371
- const inputConfig = columnConfig;
2372
- response = inputConfig.hasOwnProperty(type)
2373
- && typeof inputConfig[type] === 'function'
2374
- && inputConfig[type]({ property, row, value }).isInput;
2375
- }
2376
- else
2377
- switch (type) {
2378
- case 'number': {
2379
- if (typeof columnConfig.typeNumber === 'boolean') {
2380
- response = columnConfig.typeNumber;
2381
- }
2382
- else if (typeof columnConfig.typeNumber === 'function') {
2383
- response = (data === null) ? false : columnConfig.typeNumber({ property, row, value });
2384
- }
2385
- break;
2386
- }
2387
- case 'date': {
2388
- if (data === null)
2389
- return false;
2390
- if (typeof columnConfig.typeDate === 'boolean') {
2391
- response = columnConfig.typeDate;
2392
- }
2393
- else if (typeof columnConfig.typeDate === 'function') {
2394
- response = (data === null) ? false : columnConfig.typeDate({ property, row, value });
2395
- }
2396
- break;
2397
- }
2398
- case 'template': {
2399
- if (data === null)
2400
- return false;
2401
- response = (typeof columnConfig.template === 'string') || (typeof columnConfig.template === 'function');
2402
- break;
2403
- }
2404
- }
2405
- }
2406
- return response;
2407
- }
2408
- /** */
2409
- _IsCellColor(property, data, color) {
2410
- let response = false;
2411
- const columnConfig = this._GetColumnConfig(property);
2412
- if (columnConfig) {
2413
- if (typeof columnConfig[color] === 'boolean') {
2414
- response = columnConfig[color];
2415
- }
2416
- else if (typeof columnConfig[color] === 'function') {
2417
- response = columnConfig[color]({
2418
- property,
2419
- row: Tools.BreakReference(data),
2420
- value: data[property]
2421
- });
2422
- }
2423
- }
2424
- return response;
2425
- }
2426
- /** */
2427
- GetAttribute(property, data, attribute, type) {
2428
- const columnConfig = this._GetColumnConfig(property);
2429
- const value = Tools.IsNotNull(data) ? data[property] : null;
2430
- const row = Tools.BreakReference(data);
2431
- if (columnConfig) {
2432
- if (type === 'defaul-cell') {
2433
- switch (attribute) {
2434
- case 'textAlign': {
2435
- return columnConfig?.textAlign || 'left';
2436
- }
2437
- case 'template': {
2438
- const inputConfig = columnConfig;
2439
- if (inputConfig.hasOwnProperty(attribute)) {
2440
- if (typeof inputConfig[attribute] === 'string') {
2441
- return inputConfig[attribute];
2442
- }
2443
- else if (typeof inputConfig[attribute] === 'function') {
2444
- return inputConfig[attribute]({ property, row, value }) || '';
2445
- }
2446
- }
2447
- }
2448
- }
2449
- }
2450
- else if (['coerTextbox', 'coerNumberbox', 'coerSelectbox', 'coerSwitch'].includes(type)) {
2451
- const inputConfig = columnConfig;
2452
- if (inputConfig.hasOwnProperty(type) && typeof inputConfig[type] === 'function') {
2453
- return inputConfig[type]({ property, row, value })[attribute] || null;
2454
- }
2455
- }
2456
- }
2457
- return null;
2458
- }
2459
- /** */
2460
- ButtonByRow(property, data = null) {
2461
- let response = false;
2462
- const buttonByRow = this.buttonByRow;
2463
- const row = Tools.IsNotNull(data) ? Tools.BreakReference(data) : null;
2464
- if (buttonByRow.hasOwnProperty(property)) {
2465
- if (row === null) {
2466
- response = (typeof buttonByRow[property] === 'boolean') ? buttonByRow[property] : true;
2467
- }
2468
- else if (typeof buttonByRow[property] === 'boolean') {
2469
- response = buttonByRow[property];
2470
- }
2471
- else if (typeof buttonByRow[property] === 'function') {
2472
- response = buttonByRow[property]({ property, row, value: null });
2473
- }
2474
- }
2475
- return response ? (this._value && this._value.length > 0) : false;
2476
- }
2477
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerGridExtension, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2478
- 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 }); }
2479
- }
2480
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerGridExtension, decorators: [{
2481
- type: Component,
2482
- args: [{
2483
- selector: 'coer-grid-extension',
2484
- template: ''
2485
- }]
2486
- }], propDecorators: { addButton: [{
2487
- type: Input
2488
- }], exportButton: [{
2489
- type: Input
2490
- }], importButton: [{
2491
- type: Input
2492
- }], search: [{
2493
- type: Input
2494
- }], buttonByRow: [{
2495
- type: Input
2496
- }], checkbox: [{
2497
- type: Input
2498
- }] } });
2499
-
2500
- class CoerSwitch extends ControlValue {
2501
- constructor() {
2502
- super(...arguments);
2503
- //Variables
2504
- this._value = false;
2505
- this._id = Tools.GetGuid('coer-switch');
2506
- this._tooltip = '';
2507
- this.id = '';
2508
- this.label = input('');
2509
- this.labelPosition = input('after');
2510
- this.isDisabled = input(false);
2511
- this.isLoading = input(false);
2512
- this.isInvisible = input(false);
2513
- this.tooltipPosition = input('top');
2514
- //Outputs
2515
- this.onChange = output();
2516
- //conmputed
2517
- this._isEnable = computed(() => {
2518
- return !this.isLoading() && !this.isDisabled() && !this.isInvisible();
2519
- });
2520
- }
2521
- //Inputs
2522
- set value(value) {
2523
- if (Tools.IsNull(value))
2524
- value = false;
2525
- this.SetValue(value);
2526
- }
2527
- set tooltip(value) {
2528
- this._tooltip = value;
2529
- if (value && this._tooltipElement) {
2530
- this._tooltipElement.setContent({ '.tooltip-inner': this._tooltip });
2531
- }
2532
- }
2533
- ngOnInit() {
2534
- Tools.Sleep().then(() => {
2535
- const htmlElement = document.getElementById(this._id);
2536
- if (htmlElement) {
2537
- htmlElement.addEventListener('mouseleave', () => {
2538
- if (this._tooltipElement)
2539
- this._tooltipElement.hide();
2540
- });
2541
- this._tooltipElement = new Tooltip(htmlElement, {
2542
- html: true,
2543
- title: this._tooltip,
2544
- placement: this.tooltipPosition()
2545
- });
2546
- }
2547
- });
2548
- }
2549
- ngOnDestroy() {
2550
- if (this._tooltipElement) {
2551
- Tools.Sleep().then(() => this._tooltipElement.dispose());
2552
- }
2553
- }
2554
- //getter
2555
- get value() {
2556
- return this._value;
2557
- }
2558
- /** */
2559
- Focus() {
2560
- Tools.Sleep().then(() => {
2561
- if (this._isEnable())
2562
- this.coerSwitch.focus();
2563
- });
2564
- }
2565
- /** */
2566
- Change(value) {
2567
- this.SetValue(value);
2568
- this.onChange.emit(value);
2569
- }
2570
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerSwitch, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2571
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }] }); }
2572
- }
2573
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerSwitch, decorators: [{
2574
- type: Component,
2575
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }]
2576
- }], propDecorators: { coerSwitch: [{
2577
- type: ViewChild,
2578
- args: ['coerSwitch']
2579
- }], value: [{
2580
- type: Input
2581
- }], id: [{
2582
- type: Input
2583
- }], tooltip: [{
2584
- type: Input
2585
- }] } });
2586
-
2587
- class CoerGrid extends CoerGridExtension {
2588
- constructor() {
2589
- super(...arguments);
2590
- //computed
2591
- this.dataSource = computed(() => {
2592
- return Tools.BreakReference(this.value_signal()).map(item => {
2593
- if (item.hasOwnProperty('checked'))
2594
- delete item.checked;
2595
- if (item.hasOwnProperty('indexRow'))
2596
- delete item.indexRow;
2597
- return item;
2598
- });
2599
- });
2600
- //computed
2601
- this.selectedItems = computed(() => {
2602
- return Tools.BreakReference(this.value_signal()).filter(item => item.checked).map(item => {
2603
- if (item.hasOwnProperty('checked'))
2604
- delete item.checked;
2605
- if (item.hasOwnProperty('indexRow'))
2606
- delete item.indexRow;
2607
- return item;
2608
- });
2609
- });
2610
- //computed
2611
- this.gridLength = computed(() => {
2612
- return {
2613
- dataSource: this.value_signal()?.length || 0,
2614
- dataSourceFiltered: this.gridDataSourceFiltered()?.length || 0,
2615
- dataSourceSelected: this.selectedItems()?.length || 0
2616
- };
2617
- });
2618
- }
2619
- //getter
2620
- get isValid() {
2621
- return (this.coerTextboxList().length > 0 ? this.coerTextboxList().every(x => !x.isInvalid()) : true)
2622
- && (this.coerNumberboxList().length > 0 ? this.coerNumberboxList().every(x => !x.isInvalid()) : true)
2623
- && (this.coerSelectboxList().length > 0 ? this.coerSelectboxList().every(x => !x.isInvalid()) : true);
2624
- }
2625
- //computed
2626
- //protected _columnsFiltered = computed<IGridHeader[]>(() => {
2627
- // return this.isGrouped() && !this.showColumnGrouped
2628
- // ? this._columns().filter(x => x.columnName.toUpperCase() != this.groupBy.toUpperCase())
2629
- // : this._columns();
2630
- //});
2631
- /** */
2632
- FocusSearch() {
2633
- Tools.Sleep(0).then(() => {
2634
- if (this.inputSearch)
2635
- this.inputSearch().Focus();
2636
- });
2637
- }
2638
- /** */
2639
- SelectSearch() {
2640
- Tools.Sleep(0).then(() => {
2641
- if (this.inputSearch)
2642
- this.inputSearch().Select();
2643
- });
2644
- }
2645
- /** */
2646
- GetRowBy(callback) {
2647
- const row = this._value.find(callback);
2648
- return (row === undefined) ? null : row;
2649
- }
2650
- /** */
2651
- async Import(event = null) {
2652
- if (this.importButton?.preventDefault) {
2653
- this.onClickImport.emit({ data: [], file: null });
2654
- return;
2655
- }
2656
- if (event === null) {
2657
- this.inputFile().nativeElement.value = null;
2658
- this.inputFile().nativeElement.click();
2659
- return;
2660
- }
2661
- else if (event.target.files.length > 0) {
2662
- this._isLoading = true;
2663
- const [selectedFile] = event.target.files;
2664
- if (Files.IsExcel(selectedFile)) {
2665
- const { rows } = await Files.ReadExcel(selectedFile);
2666
- if (Tools.IsNull(this.importButton?.Autofill) || this.importButton.Autofill) {
2667
- this.SetValue(rows.concat(this._value));
2668
- this.onClickImport.emit({ data: this._value, file: selectedFile });
2669
- }
2670
- else {
2671
- this.onClickImport.emit({ data: rows, file: selectedFile });
2672
- }
2673
- }
2674
- else {
2675
- let message = 'Allowed extensions:';
2676
- for (const extension of Files.EXCEL_EXTENSIONS) {
2677
- message += ` <b>${extension}</b>,`;
2678
- }
2679
- message = message.substring(0, message.length - 1);
2680
- this.alert.Warning(message, 'Invalid File Type', 'bi bi-filetype-xlsx fa-lg');
2681
- this.onClickImport.emit({ data: [], file: null });
2682
- }
2683
- this.inputFile().nativeElement.value = null;
2684
- Tools.Sleep(1000).then(() => this._isLoading = false);
2685
- }
2686
- }
2687
- /** */
2688
- Export(exportFile = true) {
2689
- let item = {};
2690
- this._isLoading = true;
2691
- const FILE_NAME = (this.exportButton?.fileName || 'COER Report') + '.xlsx';
2692
- let ROW_DATA_SOURCE = (this.exportButton.hasOwnProperty('onlyRowFiltered') && !this.exportButton.onlyRowFiltered)
2693
- ? this.value_signal() : this.gridDataSourceFiltered();
2694
- const COLUMN_DATA_SOURCE = new Set();
2695
- if (this.exportButton.hasOwnProperty('onlyColumnFiltered') && !this.exportButton.onlyColumnFiltered) {
2696
- for (const row of this.value_signal()) {
2697
- for (const columnName in row) {
2698
- if (columnName == 'indexRow')
2699
- continue;
2700
- COLUMN_DATA_SOURCE.add(Tools.FirstCharToLower(columnName));
2701
- }
2702
- }
2703
- }
2704
- else {
2705
- for (const { columnName } of this.gridColumns()) {
2706
- if (columnName == 'indexRow')
2707
- continue;
2708
- COLUMN_DATA_SOURCE.add(Tools.FirstCharToLower(columnName));
2709
- }
2710
- }
2711
- const EXPORT_DATA = [];
2712
- for (const row of ROW_DATA_SOURCE) {
2713
- for (const column of COLUMN_DATA_SOURCE) {
2714
- item = Object.assign(item, { [this._GetColumnName(column)]: row[column] });
2715
- }
2716
- EXPORT_DATA.push(item);
2717
- item = Tools.BreakReference({});
2718
- }
2719
- if (exportFile) {
2720
- Files.ExportExcel(EXPORT_DATA, FILE_NAME);
2721
- }
2722
- this.onClickExport.emit(EXPORT_DATA);
2723
- Tools.Sleep(3000).then(() => this._isLoading = false);
2724
- }
2725
- /** */
2726
- InputChange(indexRow, columnName, value, input) {
2727
- if (input === 'coer-textbox-search') {
2728
- if (this._isLoading)
2729
- return;
2730
- Tools.Sleep(0, `coerGridInputChange${columnName}`).then(async (_) => {
2731
- this._gridSearch.set(value);
2732
- if (this.checkbox.show) {
2733
- this._isLoadingMessage = true;
2734
- await Tools.Sleep();
2735
- for (const row of this._value.filter((x) => x.checked)) {
2736
- this.CheckBy((x) => x.indexRow == row.indexRow);
2737
- }
2738
- await Tools.Sleep();
2739
- this._isLoadingMessage = false;
2740
- }
2741
- });
2742
- return;
2743
- }
2744
- const property = Tools.FirstCharToLower(columnName);
2745
- const row = this._value[indexRow];
2746
- row[property] = value;
2747
- if (input === 'coer-switch') {
2748
- this.onSwitchChange.emit({ property, row: Tools.BreakReference(row), value });
2749
- }
2750
- else if (input === 'coer-textbox') {
2751
- this.onTextboxChange.emit({ property, row: Tools.BreakReference(row), value });
2752
- }
2753
- else if (input === 'coer-selectbox') {
2754
- this.onSelectboxChange.emit({ property, row: Tools.BreakReference(row), value });
2755
- }
2756
- else if (input === 'coer-numberbox') {
2757
- this.onTextboxChange.emit({ property, row: Tools.BreakReference(row), value });
2758
- }
2759
- Tools.Sleep(1000, `coerGridInputChange${indexRow}${columnName}`).then(_ => {
2760
- this._UpdateValue(this._value);
2761
- this.value_signal.set(this._value);
2762
- });
2763
- }
2764
- /** */
2765
- KeyupEnter(indexColumn, row, input, value) {
2766
- if (['coer-textbox', 'coer-numberbox', 'coer-selectbox'].includes(input)) {
2767
- this.onKeyupEnter.emit({
2768
- id: this._GetId(indexColumn, row.indexRow, input),
2769
- input, row: Tools.BreakReference(row), value
2770
- });
2771
- this.NextInput(indexColumn, row.indexRow);
2772
- }
2773
- else if (input == 'coer-textbox-search') {
2774
- this.onKeyupEnter.emit({
2775
- id: this._GetId(indexColumn, row.indexRow, input),
2776
- input, row: null, value
2777
- });
2778
- }
2779
- }
2780
- /** */
2781
- NextInput(indexColumn, indexRow) {
2782
- const INPUT_TEXT = this.columns().filter(x => Tools.IsNotNull(x.coerTextbox)).map(x => x.property);
2783
- const INPUT_NUMBER = this.columns().filter(x => Tools.IsNotNull(x.coerNumberbox)).map(x => x.property);
2784
- const INPUT_SELECT = this.columns().filter(x => Tools.IsNotNull(x.coerSelectbox)).map(x => x.property);
2785
- let index = 0;
2786
- const COLUMNS = [];
2787
- const INPUT_COLUMNS = [];
2788
- for (const { columnName } of this.gridColumns()) {
2789
- if (INPUT_TEXT.some(property => property.toUpperCase() == columnName.toUpperCase())) {
2790
- COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerTextbox' });
2791
- INPUT_COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerTextbox' });
2792
- }
2793
- else if (INPUT_NUMBER.some(property => property.toUpperCase() == columnName.toUpperCase())) {
2794
- COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerNumberbox' });
2795
- INPUT_COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerNumberbox' });
2796
- }
2797
- else if (INPUT_SELECT.some(property => property.toUpperCase() == columnName.toUpperCase())) {
2798
- COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerSelectbox' });
2799
- INPUT_COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerSelectbox' });
2800
- }
2801
- else {
2802
- COLUMNS.push({ indexColumn: index, property: columnName, type: 'default-cell' });
2803
- }
2804
- ++index;
2805
- }
2806
- let lastRow = -1;
2807
- for (const { rows } of this.gridDataSource()) {
2808
- lastRow += rows.length;
2809
- }
2810
- let firstColumn = -1;
2811
- if (INPUT_COLUMNS.length > 0) {
2812
- firstColumn = [...INPUT_COLUMNS].shift().indexColumn;
2813
- }
2814
- let lastColumn = -1;
2815
- if (INPUT_COLUMNS.length > 0) {
2816
- lastColumn = [...INPUT_COLUMNS].pop().indexColumn;
2817
- }
2818
- //Is Last Row & Last Input Column?
2819
- if (indexRow == lastRow && indexColumn == lastColumn) {
2820
- this.onKeyupEnterLast.emit();
2821
- }
2822
- //Is Last Input Column?
2823
- else if (indexColumn == lastColumn) {
2824
- this.FocusInput((indexRow + 1), firstColumn);
2825
- }
2826
- //Next Column?
2827
- else {
2828
- for (index = (indexColumn + 1); index < COLUMNS.length; index++) {
2829
- for (const input of COLUMNS) {
2830
- if (index == input.indexColumn && ['coerTextbox', 'coerNumberbox', 'coerSelectbox'].includes(input.type)) {
2831
- this.FocusInput(indexRow, input.indexColumn);
2832
- return;
2833
- }
2834
- }
2835
- }
2836
- }
2837
- }
2838
- /** */
2839
- FocusInput(indexRow = -1, indexColumn = -1) {
2840
- Tools.Sleep(0, 'FocusInput').then(() => {
2841
- if (this._isDisabled())
2842
- return;
2843
- if (indexRow < 0 || indexColumn < 0) {
2844
- const INPUT_TEXT = this.columns().filter(x => Tools.IsNotNull(x.coerTextbox)).map(x => x.property);
2845
- const INPUT_NUMBER = this.columns().filter(x => Tools.IsNotNull(x.coerNumberbox)).map(x => x.property);
2846
- const INPUT_SELECT = this.columns().filter(x => Tools.IsNotNull(x.coerSelectbox)).map(x => x.property);
2847
- let index = 0;
2848
- const COLUMNS = [];
2849
- for (const { columnName } of this.gridColumns()) {
2850
- if (INPUT_TEXT.some(property => property.toUpperCase() == columnName.toUpperCase())) {
2851
- COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerTextbox' });
2852
- }
2853
- else if (INPUT_NUMBER.some(property => property.toUpperCase() == columnName.toUpperCase())) {
2854
- COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerNumberbox' });
2855
- }
2856
- else if (INPUT_SELECT.some(property => property.toUpperCase() == columnName.toUpperCase())) {
2857
- COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerSelectbox' });
2858
- }
2859
- else {
2860
- COLUMNS.push({ indexColumn: index, property: columnName, type: 'default-cell' });
2861
- }
2862
- ++index;
2863
- }
2864
- if (this.gridLength().dataSourceFiltered > 0) {
2865
- const FIRST_INPUT_COLUMN = COLUMNS.find(x => ['coerTextbox', 'coerNumberbox', 'coerSelectbox'].includes(x.type));
2866
- if (Tools.IsNotNull(FIRST_INPUT_COLUMN)) {
2867
- this.FocusInput(0, FIRST_INPUT_COLUMN.indexColumn);
2868
- }
2869
- }
2870
- }
2871
- else {
2872
- const id = this._GetId(indexRow, indexColumn);
2873
- let element;
2874
- this._indexFocus.set(indexRow);
2875
- //Focus Textbox
2876
- element = this.coerTextboxList().find(x => x.id == id);
2877
- if (element) {
2878
- element.Select();
2879
- return;
2880
- }
2881
- //Focus Numberbox
2882
- element = this.coerNumberboxList().find(x => x.id == id);
2883
- if (element) {
2884
- element.Select();
2885
- return;
2886
- }
2887
- //Focus Selectbox
2888
- element = this.coerSelectboxList().find(x => x.id == id);
2889
- if (element) {
2890
- Tools.Sleep(100).then(_ => element.Focus());
2891
- return;
2892
- }
2893
- }
2894
- });
2895
- }
2896
- /** */
2897
- FocusRow(callback) {
2898
- Tools.Sleep().then(_ => {
2899
- if (this._value.length > 0) {
2900
- const row = Tools.BreakReference(this._value.find(callback));
2901
- if (Tools.IsNotNull(row))
2902
- this._indexFocus.set(row.indexRow);
2903
- }
2904
- });
2905
- }
2906
- /** */
2907
- async Sort(columnName) {
2908
- if (this.enableSort()) {
2909
- if (this._isLoading)
2910
- return;
2911
- this._isLoading = true;
2912
- this._isLoadingMessage = true;
2913
- const { direction } = this._sort();
2914
- let dataSource = Tools.BreakReference(this._value);
2915
- for (const checkbox of this.coerCheckboxList())
2916
- checkbox.Uncheck();
2917
- if (direction == 'descendant') {
2918
- Tools.SortByDesc(dataSource, columnName);
2919
- this._sort.set({ columnName, direction: 'ascendant', icon: 'fa-solid fa-arrow-down-short-wide' });
2920
- }
2921
- else {
2922
- Tools.SortBy(dataSource, columnName);
2923
- this._sort.set({ columnName, direction: 'descendant', icon: 'fa-solid fa-arrow-up-wide-short' });
2924
- }
2925
- let indexRow = 0;
2926
- dataSource = Tools.BreakReference(dataSource).map((item) => Object.assign(item, { indexRow: indexRow++ }));
2927
- this.SetValue(dataSource);
2928
- this._isLoading = false;
2929
- await Tools.Sleep();
2930
- for (const row of dataSource.filter((x) => x.checked)) {
2931
- this.CheckBy((x) => x.indexRow == row.indexRow);
2932
- }
2933
- this._isLoadingMessage = false;
2934
- }
2935
- return;
2936
- }
2937
- /** */
2938
- ClickCheck(id, checked, all, row = null) {
2939
- if (!this._isLoading)
2940
- Tools.Sleep().then(async (_) => {
2941
- this._isLoading = true;
2942
- let element = this.coerCheckboxList().find(x => x.id() == id);
2943
- if (Tools.IsNotNull(element)) {
2944
- let response = { all, checked, rows: [] };
2945
- //All Checkbox
2946
- if (all) {
2947
- if (checked)
2948
- this.CheckAll();
2949
- else
2950
- this.UncheckAll();
2951
- //Event
2952
- response.rows = this.selectedItems();
2953
- this.onCheckboxChange.emit(response);
2954
- }
2955
- //One Checkbox
2956
- else {
2957
- if (this._onlyOneCheck) {
2958
- for (const row of this._value) {
2959
- row.checked = false;
2960
- }
2961
- for (const checkbox of this.coerCheckboxList()) {
2962
- if (checkbox.id() != id)
2963
- checkbox.Uncheck();
2964
- }
2965
- }
2966
- this._value[row.indexRow].checked = checked;
2967
- this.SetValue(this._value);
2968
- //Mark All checkbox
2969
- const checkboxAll = this.coerCheckboxList().find(x => x.id() == this._GetId(0, 0, 'checkboxAll'));
2970
- if (this.value_signal().every((x) => x.checked)) {
2971
- checkboxAll?.Check();
2972
- }
2973
- else {
2974
- checkboxAll?.Uncheck();
2975
- }
2976
- //Event
2977
- response.rows = [{ ...row }];
2978
- this.onCheckboxChange.emit(response);
2979
- this._isLoading = false;
2980
- }
2981
- }
2982
- });
2983
- }
2984
- /** */
2985
- CheckAll() {
2986
- this._isLoading = true;
2987
- for (const row of this._value) {
2988
- row.checked = true;
2989
- }
2990
- this.SetValue(this._value);
2991
- for (const checkbox of this.coerCheckboxList()) {
2992
- checkbox.Check();
2993
- }
2994
- this._isLoading = false;
2995
- }
2996
- /** */
2997
- UncheckAll() {
2998
- this._isLoading = true;
2999
- for (const row of this._value) {
3000
- row.checked = false;
3001
- }
3002
- this.SetValue(this._value);
3003
- for (const checkbox of this.coerCheckboxList()) {
3004
- checkbox.Uncheck();
3005
- }
3006
- this._isLoading = false;
3007
- }
3008
- /** */
3009
- CheckBy(callback) {
3010
- Tools.Sleep().then(_ => {
3011
- if (this._value.length > 0) {
3012
- const rowList = Tools.BreakReference(this._value.filter(callback));
3013
- let element;
3014
- for (const { indexRow } of rowList) {
3015
- element = this.coerCheckboxList().find(x => x.id() == this._GetId(indexRow, 0, 'checkbox'));
3016
- if (Tools.IsNotNull(element)) {
3017
- element?.Check();
3018
- }
3019
- }
3020
- }
3021
- });
3022
- }
3023
- /** */
3024
- UncheckBy(callback) {
3025
- Tools.Sleep().then(_ => {
3026
- if (this._value.length > 0) {
3027
- const rowList = Tools.BreakReference(this._value.filter(callback));
3028
- let element;
3029
- for (const { indexRow } of rowList) {
3030
- element = this.coerCheckboxList().find(x => x.id() == this._GetId(indexRow, 0, 'checkbox'));
3031
- if (Tools.IsNotNull(element)) {
3032
- element?.Uncheck();
3033
- }
3034
- }
3035
- }
3036
- });
3037
- }
3038
- /** */
3039
- ClickOnRow(row) {
3040
- if (this._isDisabled())
3041
- return;
3042
- if (Tools.IsNotNull(this.checkbox.checkOnRow) && this.checkbox.checkOnRow) {
3043
- this.CheckBy((x) => x.indexRow == row.indexRow);
3044
- }
3045
- this.onClickRow.emit(row);
3046
- }
3047
- /** Inserts new elements at the start */
3048
- Unshift(row) {
3049
- const dataSource = Tools.BreakReference(this._value);
3050
- dataSource.unshift(row);
3051
- this.SetValue(dataSource);
3052
- this.FocusInput();
3053
- }
3054
- /** Appends new elements to the end */
3055
- Push(row) {
3056
- const dataSource = Tools.BreakReference(this._value);
3057
- dataSource.push(row);
3058
- this.SetValue(dataSource);
3059
- this.FocusInput();
3060
- }
3061
- /** Delete Row By index */
3062
- async DeleteRow(indexRow) {
3063
- const dataSource = Tools.BreakReference(this._value);
3064
- dataSource.splice(indexRow, 1);
3065
- this.SetValue(dataSource);
3066
- }
3067
- /** Delete row list by callback */
3068
- async DeleteRowsBy(callback) {
3069
- const indexList = Tools.BreakReference(this._value.filter(callback).map((item) => item.indexRow));
3070
- let dataSource = [];
3071
- for (const indexRow of indexList) {
3072
- dataSource = Tools.BreakReference(this._value);
3073
- dataSource.splice(indexRow, 1);
3074
- this.SetValue(dataSource);
3075
- await Tools.Sleep();
3076
- }
3077
- }
3078
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerGrid, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3079
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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" }] }); }
3080
- }
3081
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerGrid, decorators: [{
3082
- type: Component,
3083
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }]
3084
- }] });
3085
-
3086
- class Menu {
3087
- static { this.storage = 'COER-System'; }
3088
- /** */
3089
- static Set(menu) {
3090
- let storage = sessionStorage.getItem(this.storage);
3091
- if (storage)
3092
- storage = JSON.parse(storage);
3093
- storage = Object.assign({}, storage, { menu });
3094
- sessionStorage.setItem(this.storage, JSON.stringify(storage));
3095
- }
3096
- /** */
3097
- static Get() {
3098
- let storage = sessionStorage.getItem(this.storage);
3099
- if (storage) {
3100
- storage = JSON.parse(storage);
3101
- if (storage.hasOwnProperty('menu')) {
3102
- return storage.menu;
3103
- }
3104
- }
3105
- return null;
3106
- }
3107
- }
3108
-
3109
- //import { navigation } from 'src/app/app-routing.sidenav';
3110
- //import { Source } from 'src/app/modules/home/classes';
3111
- //import { IAppNavigation, IGoBack } from 'src/app/modules/home/interfaces';
3112
- class CoerPageTitle {
3113
- constructor() {
3114
- this.title = null;
3115
- this.showNavigation = true;
3116
- this.breadcrumbs = [];
3117
- this.goBack = { show: false };
3118
- this.showInformation = false;
3119
- }
3120
- get _icon() {
3121
- const MENU = Menu.Get();
3122
- if (MENU) {
3123
- const MENU_SELECTED = MENU.tree.shift();
3124
- if (MENU_SELECTED && MENU_SELECTED.icon) {
3125
- return MENU_SELECTED.icon;
3126
- }
3127
- }
3128
- return 'bi bi-house-door-fill';
3129
- }
3130
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerPageTitle, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3131
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }] }); }
3132
- }
3133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerPageTitle, decorators: [{
3134
- type: Component,
3135
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }]
3136
- }], propDecorators: { title: [{
3137
- type: Input
3138
- }], showNavigation: [{
3139
- type: Input
3140
- }], breadcrumbs: [{
3141
- type: Input
3142
- }], goBack: [{
3143
- type: Input
3144
- }], showInformation: [{
3145
- type: Input
3146
- }] } });
3147
-
3148
- class CoerTab {
3149
- constructor() {
3150
- //Variables
3151
- this._id = Tools.GetGuid('coer-tab');
3152
- this._selectedIndex = 0;
3153
- this.matTabGroup = viewChild.required('matTabGroup');
3154
- this._tooltipList = [];
3155
- //Inputs
3156
- this.height = input('auto');
3157
- this.minHeight = input('300px');
3158
- this.maxHeight = input('auto');
3159
- //Computed
3160
- this.contentList = computed(() => Array.from(this.contentRef._results));
3161
- //Outputs
3162
- this.onSelectedTab = output();
3163
- }
3164
- set selectedIndex(value) {
3165
- if (Tools.IsNotNull(value)) {
3166
- this._selectedIndex = value;
3167
- }
3168
- }
3169
- set alignTabs(value) {
3170
- if (Tools.IsNotNull(this._matTabGroup)) {
3171
- if (Tools.IsNotNull(value)) {
3172
- this._matTabGroup.removeAttribute('mat-align-tabs');
3173
- Tools.Sleep().then(() => {
3174
- this._matTabGroup.setAttribute('mat-align-tabs', value);
3175
- });
3176
- }
3177
- }
3178
- else
3179
- Tools.Sleep().then(() => this.alignTabs = value);
3180
- }
3181
- ngOnInit() {
3182
- this._matTabGroup = this.matTabGroup()._elementRef.nativeElement;
3183
- }
3184
- ngOnDestroy() {
3185
- for (const _tooltip of this._tooltipList) {
3186
- _tooltip.tooltip?.dispose();
3187
- }
3188
- }
3189
- /** */
3190
- SelectedIndexChange(selectedIndex) {
3191
- this._selectedIndex = selectedIndex;
3192
- this.onSelectedTab.emit(this.contentList()[selectedIndex]);
3193
- }
3194
- /** */
3195
- GetTitle(tab) {
3196
- const ref = this.contentList().find(x => x.coerRef() == tab.coerRef());
3197
- return (ref.title().length > 0) ? ref.title() : ref.coerRef();
3198
- }
3199
- /** */
3200
- GetIcon(tab) {
3201
- return this.contentList().find(x => x.coerRef() == tab.coerRef()).icon();
3202
- }
3203
- /** */
3204
- SelectTabBy(callback) {
3205
- const index = this.contentList().findIndex(callback);
3206
- if (index >= 0)
3207
- this._selectedIndex = index;
3208
- }
3209
- /** */
3210
- SetToolTip(tab) {
3211
- const id = `${this._id}-${tab.coerRef()}`;
3212
- if (!this._tooltipList.some(x => x.id == id) && tab.tooltip().length > 0) {
3213
- this._tooltipList.push({ id });
3214
- Tools.Sleep().then(() => {
3215
- const htmlElement = document.getElementById(id);
3216
- if (htmlElement) {
3217
- const tooltip = new Tooltip(htmlElement, {
3218
- html: true,
3219
- title: tab.tooltip(),
3220
- placement: 'top'
3221
- });
3222
- htmlElement.addEventListener('mouseleave', () => {
3223
- if (htmlElement)
3224
- tooltip.hide();
3225
- });
3226
- const index = this._tooltipList.findIndex(x => x.id == id);
3227
- if (index >= 0)
3228
- this._tooltipList[index].tooltip = tooltip;
3229
- }
3230
- });
3231
- }
3232
- return id;
3233
- }
3234
- /** */
3235
- RemoveTooltip(element) {
3236
- const id = element.getAttribute('id');
3237
- const index = this._tooltipList.findIndex(x => x.id == id);
3238
- if (index >= 0)
3239
- this._tooltipList.splice(index, 1);
3240
- }
3241
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTab, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3242
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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: ["OnChanges", "onInit", "afterViewInit", "onDestroy"] }] }); }
3243
- }
3244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTab, decorators: [{
3245
- type: Component,
3246
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }]
3247
- }], propDecorators: { contentRef: [{
3248
- type: ContentChildren,
3249
- args: [CoerRefDirective]
3250
- }], selectedIndex: [{
3251
- type: Input
3252
- }], alignTabs: [{
3253
- type: Input
3254
- }] } });
3255
-
3256
- class CoerTextarea extends ControlValue {
3257
- constructor() {
3258
- super(...arguments);
3259
- //Component Value
3260
- this._value = '';
3261
- this.matFormField = viewChild.required('matFormField');
3262
- this.coerTextBox = viewChild.required('coerTextArea');
3263
- //Variables
3264
- this._id = Tools.GetGuid('coer-textArea');
3265
- this._isLoadingEvent = signal(false);
3266
- this.id = '';
3267
- this.label = input('');
3268
- this.placeholder = input('');
3269
- this.minLength = input(0);
3270
- this.maxLength = input(2500);
3271
- this.width = input('100%');
3272
- this.minWidth = input('190px');
3273
- this.maxWidth = input('100%');
3274
- this.marginTop = input('0px');
3275
- this.marginRight = input('0px');
3276
- this.marginBottom = input('0px');
3277
- this.marginLeft = input('0px');
3278
- this.isInvalid = input(false);
3279
- this.isValid = input(false);
3280
- this.isDisabled = input(false);
3281
- this.isReadonly = input(false);
3282
- this.isLoading = input(false);
3283
- this.showFooter = input(true);
3284
- this.resize = input(false);
3285
- this.textPosition = input('left');
3286
- //Outputs
3287
- this.onInput = output();
3288
- //computed
3289
- this._isEnable = computed(() => {
3290
- return !this.isDisabled() && !this.isLoading() && !this.isReadonly();
3291
- });
3292
- //computed
3293
- this.floatLabel = computed(() => {
3294
- return this.label() == '' ? 'always' : 'auto';
3295
- });
3296
- //computed
3297
- this.paddingRight = computed(() => {
3298
- return this.isInvalid() || this.isValid()
3299
- ? '18px' : '0px';
3300
- });
3301
- }
3302
- //Inputs
3303
- set value(value) {
3304
- if (Tools.IsNull(value))
3305
- value = '';
3306
- this.SetValue(value);
3307
- }
3308
- ngOnInit() {
3309
- this.SetEvents();
3310
- }
3311
- //getter
3312
- get value() {
3313
- return this._value;
3314
- }
3315
- //getter
3316
- get footer() {
3317
- return `${Tools.IsNotNull(this._value) ? String(this._value).length : '0'} / ${this.maxLength()}`;
3318
- }
3319
- /** */
3320
- SetEvents() {
3321
- Tools.Sleep().then(() => {
3322
- this.element = document.getElementById(this._id);
3323
- if (this.element) {
3324
- this.element.addEventListener('focus', () => {
3325
- if (!this._isEnable())
3326
- this.Blur();
3327
- });
3328
- this.element.addEventListener('blur', () => this.Blur());
3329
- this.element.addEventListener('input', () => {
3330
- Tools.Sleep().then(() => {
3331
- const value = this.coerTextBox().nativeElement.value;
3332
- if (this._isEnable())
3333
- this.onInput.emit(value);
3334
- });
3335
- });
3336
- this.element.addEventListener('paste', () => {
3337
- Tools.Sleep().then(() => {
3338
- this.SetValue(this._value.toString().trim());
3339
- });
3340
- });
3341
- }
3342
- });
3343
- }
3344
- /** */
3345
- Focus(timeout = 0) {
3346
- if (this._isLoadingEvent())
3347
- return;
3348
- else
3349
- this._isLoadingEvent.set(true);
3350
- Tools.Sleep(timeout).then(() => {
3351
- if (this._isEnable()) {
3352
- this.element.focus();
3353
- }
3354
- this._isLoadingEvent.set(false);
3355
- });
3356
- }
3357
- /** */
3358
- Select(timeout = 0) {
3359
- if (this._isLoadingEvent())
3360
- return;
3361
- else
3362
- this._isLoadingEvent.set(true);
3363
- Tools.Sleep(timeout).then(() => {
3364
- if (this._isEnable()) {
3365
- this.element.focus();
3366
- this.element.select();
3367
- }
3368
- this._isLoadingEvent.set(false);
3369
- });
3370
- }
3371
- /** */
3372
- Blur() {
3373
- if (this._isLoadingEvent())
3374
- return;
3375
- else
3376
- this._isLoadingEvent.set(true);
3377
- Tools.Sleep().then(() => {
3378
- if (this.element) {
3379
- this.element.blur();
3380
- Tools.Sleep().then(() => {
3381
- const element = document.querySelector(`#${this._id}-container .mdc-line-ripple--active`);
3382
- if (element)
3383
- element.classList.remove('mdc-line-ripple--active');
3384
- });
3385
- }
3386
- this._isLoadingEvent.set(false);
3387
- });
3388
- }
3389
- /** */
3390
- Clear() {
3391
- this.SetValue('');
3392
- this.Focus();
3393
- }
3394
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTextarea, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3395
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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" }] }); }
3396
- }
3397
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerTextarea, decorators: [{
3398
- type: Component,
3399
- 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 *{--blue: #0d6efd;--gray: #6c757d;--green: #198754;--yellow: #ffc107;--red: #dc3545;--white: #f5f5f5;--black: #252525;--orange: #fd6031}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"] }]
3400
- }], propDecorators: { value: [{
3401
- type: Input
3402
- }], id: [{
3403
- type: Input
3404
- }] } });
3405
-
3406
- class ComponentsModule {
3407
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3408
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, declarations: [CoerAlert,
3409
- CoerButton,
3410
- CoerCheckbox,
3411
- CoerFilebox,
3412
- CoerForm,
3413
- CoerGrid,
3414
- CoerModal,
3415
- CoerNumberBox,
3416
- CoerPageTitle,
3417
- CoerSelectbox,
3418
- CoerSwitch,
3419
- CoerTab,
3420
- CoerTextarea,
3421
- CoerTextBox], imports: [CommonModule,
3422
- RouterModule,
3423
- FormsModule,
3424
- ReactiveFormsModule,
3425
- PipesModule,
3426
- MatButtonModule,
3427
- MatCheckboxModule,
3428
- MatInputModule,
3429
- MatFormFieldModule,
3430
- MatSlideToggleModule,
3431
- MatTabsModule,
3432
- DirectivesModule], exports: [CoerAlert,
3433
- CoerButton,
3434
- CoerCheckbox,
3435
- CoerFilebox,
3436
- CoerForm,
3437
- CoerGrid,
3438
- CoerModal,
3439
- CoerNumberBox,
3440
- CoerPageTitle,
3441
- CoerSelectbox,
3442
- CoerSwitch,
3443
- CoerTab,
3444
- CoerTextarea,
3445
- CoerTextBox] }); }
3446
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, imports: [CommonModule,
3447
- RouterModule,
3448
- FormsModule,
3449
- ReactiveFormsModule,
3450
- PipesModule,
3451
- MatButtonModule,
3452
- MatCheckboxModule,
3453
- MatInputModule,
3454
- MatFormFieldModule,
3455
- MatSlideToggleModule,
3456
- MatTabsModule,
3457
- DirectivesModule] }); }
3458
- }
3459
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ComponentsModule, decorators: [{
3460
- type: NgModule,
3461
- args: [{
3462
- imports: [
3463
- CommonModule,
3464
- RouterModule,
3465
- FormsModule,
3466
- ReactiveFormsModule,
3467
- PipesModule,
3468
- MatButtonModule,
3469
- MatCheckboxModule,
3470
- MatInputModule,
3471
- MatFormFieldModule,
3472
- MatSlideToggleModule,
3473
- MatTabsModule,
3474
- DirectivesModule
3475
- ],
3476
- declarations: [
3477
- CoerAlert,
3478
- CoerButton,
3479
- CoerCheckbox,
3480
- CoerFilebox,
3481
- CoerForm,
3482
- CoerGrid,
3483
- CoerModal,
3484
- CoerNumberBox,
3485
- CoerPageTitle,
3486
- CoerSelectbox,
3487
- CoerSwitch,
3488
- CoerTab,
3489
- CoerTextarea,
3490
- CoerTextBox,
3491
- ],
3492
- exports: [
3493
- CoerAlert,
3494
- CoerButton,
3495
- CoerCheckbox,
3496
- CoerFilebox,
3497
- CoerForm,
3498
- CoerGrid,
3499
- CoerModal,
3500
- CoerNumberBox,
3501
- CoerPageTitle,
3502
- CoerSelectbox,
3503
- CoerSwitch,
3504
- CoerTab,
3505
- CoerTextarea,
3506
- CoerTextBox,
3507
- ]
3508
- }]
3509
- }] });
3510
-
3511
- const GridTemplates = {
3512
- /** Template for boolean property */
3513
- isActiveTemplate: (item) => {
3514
- if (item.value) {
3515
- return `
3516
- <span class='text-green-bold'>
3517
- <i class="fa-solid fa-circle-check"></i> Active
3518
- </span>
3519
- `;
3520
- }
3521
- else {
3522
- return `
3523
- <span class='text-gray-bold'>
3524
- <i class="fa-solid fa-circle-minus"></i> Disabled
3525
- </span>
3526
- `;
3527
- }
3528
- },
3529
- /** Template for boolean property */
3530
- coerSwitchTemplate: (item) => ({
3531
- isInput: true,
3532
- tooltip: `${item.value ? 'Active' : 'Disabled'}`
3533
- }),
3534
- /** Template for text property */
3535
- coerTextboxTemplate: (item) => ({
3536
- isInput: true,
3537
- isInvalid: item.value.length <= 0
3538
- })
3539
- };
3540
-
3541
- const breakpointSIGNAL = signal(Screen?.BREAKPOINT || 'xs');
3542
-
3543
- const isLoadingSIGNAL = signal(false);
3544
-
3545
- const isMenuOpenSIGNAL = signal(false);
3546
-
3547
- const menuSIGNAL = signal([]);
3548
-
3549
- class Breadcrumbs {
3550
- static { this.storage = 'COER-System'; }
3551
- /** */
3552
- static Add(page, path) {
3553
- const breadcrumbs = this.Get();
3554
- const paths = breadcrumbs.map(item => item.path);
3555
- if (!paths.includes(path)) {
3556
- breadcrumbs.push({ page, path });
3557
- this.Save(breadcrumbs);
3558
- }
3559
- }
3560
- /** */
3561
- static Get() {
3562
- let storage = sessionStorage.getItem(this.storage);
3563
- if (storage) {
3564
- storage = JSON.parse(storage);
3565
- if (storage.hasOwnProperty('breadcrumbs')) {
3566
- return Tools.BreakReference(storage.breadcrumbs);
3567
- }
3568
- }
3569
- return [];
3570
- }
3571
- /** */
3572
- static GetFirst() {
3573
- const breadcrumbs = this.Get();
3574
- return (breadcrumbs.length > 0) ? breadcrumbs.shift() : null;
3575
- }
3576
- /** */
3577
- static Save(breadcrumbs) {
3578
- let storage = sessionStorage.getItem(this.storage);
3579
- if (storage)
3580
- storage = JSON.parse(storage);
3581
- storage = Object.assign({}, storage, { breadcrumbs });
3582
- sessionStorage.setItem(this.storage, JSON.stringify(storage));
3583
- }
3584
- /** */
3585
- static Remove(path) {
3586
- let breadcrumbs = this.Get();
3587
- const index = breadcrumbs.findIndex(x => x.path.toLowerCase().trim() === path.toLowerCase().trim());
3588
- if (index >= 0) {
3589
- breadcrumbs = Tools.BreakReference(breadcrumbs).splice(0, index + 1);
3590
- this.Save(breadcrumbs);
3591
- }
3592
- }
3593
- /** */
3594
- static SetLast(page, path) {
3595
- const breadcrumbs = this.Get();
3596
- if (breadcrumbs.length > 0) {
3597
- breadcrumbs[breadcrumbs.length - 1] = { page, path };
3598
- this.Save(breadcrumbs);
3599
- }
3600
- }
3601
- /** */
3602
- static RemoveLast() {
3603
- const breadcrumbs = this.Get();
3604
- if (breadcrumbs.length > 0) {
3605
- breadcrumbs.pop();
3606
- this.Save(breadcrumbs);
3607
- }
3608
- }
3609
- }
3610
-
3611
- class Source {
3612
- static { this.storage = 'COER-System'; }
3613
- /** */
3614
- static Set(page) {
3615
- const ROUTER = inject(Router);
3616
- let path = ROUTER.url;
3617
- if (path.includes('?'))
3618
- path = path.split('?')[0];
3619
- Breadcrumbs.Add(page, path);
3620
- const breadcrumbs = Breadcrumbs.Get();
3621
- if (breadcrumbs.length >= 2) {
3622
- breadcrumbs.pop();
3623
- const breadcrumb = breadcrumbs.pop();
3624
- this.Save({ page: breadcrumb.page, path: breadcrumb.path });
3625
- }
3626
- else
3627
- this.Save(null);
3628
- }
3629
- /** */
3630
- static Save(source) {
3631
- let storage = sessionStorage.getItem(this.storage);
3632
- if (storage)
3633
- storage = JSON.parse(storage);
3634
- storage = Object.assign({}, storage, { source });
3635
- sessionStorage.setItem(this.storage, JSON.stringify(storage));
3636
- }
3637
- /** */
3638
- static Get() {
3639
- let storage = sessionStorage.getItem(this.storage);
3640
- if (storage) {
3641
- storage = JSON.parse(storage);
3642
- if (storage.hasOwnProperty('source')) {
3643
- return storage.source;
3644
- }
3645
- }
3646
- return null;
3647
- }
3648
- /** */
3649
- static GetRoot() {
3650
- const breadcrumbs = Breadcrumbs.Get();
3651
- return (breadcrumbs.length > 0) ? breadcrumbs.shift() : null;
3652
- }
3653
- /** */
3654
- static SetPageResponse(pageResponse) {
3655
- let storage = sessionStorage.getItem(this.storage);
3656
- storage = JSON.parse(storage);
3657
- storage = Object.assign({}, storage, { pageResponse });
3658
- sessionStorage.setItem(this.storage, JSON.stringify(storage));
3659
- }
3660
- /** */
3661
- static GetPageResponse() {
3662
- let storage = sessionStorage.getItem(this.storage);
3663
- if (storage) {
3664
- storage = JSON.parse(storage);
3665
- if (storage.hasOwnProperty('pageResponse')) {
3666
- return Tools.BreakReference(storage.pageResponse);
3667
- }
3668
- }
3669
- return null;
3670
- }
3671
- /** */
3672
- static ClearPageResponse() {
3673
- let storage = sessionStorage.getItem(this.storage);
3674
- storage = JSON.parse(storage);
3675
- if (storage.hasOwnProperty('pageResponse')) {
3676
- delete storage.pageResponse;
3677
- }
3678
- storage = Object.assign({}, storage);
3679
- sessionStorage.setItem(this.storage, JSON.stringify(storage));
3680
- }
3681
- /** */
3682
- static Reset() {
3683
- sessionStorage.removeItem(this.storage);
3684
- }
3685
- }
3686
-
3687
- class Page {
3688
- constructor(page) {
3689
- //Injection
3690
- this.alert = inject(CoerAlert);
3691
- this.router = inject(Router);
3692
- this.activatedRoute = inject(ActivatedRoute);
3693
- /** */
3694
- this.isUpdate = false;
3695
- /** */
3696
- this.isLoading = false;
3697
- /** */
3698
- this.isReadyPage = false;
3699
- /** */
3700
- this.enableAnimations = false;
3701
- /** */
3702
- this.breadcrumbs = [];
3703
- /** */
3704
- this.pageResponse = null;
3705
- /** */
3706
- this.goBack = { show: false };
3707
- //Private Variables
3708
- this._page = '';
3709
- this._source = null;
3710
- this._preventDestroy = false;
3711
- /** */
3712
- this.GoBack = (path) => (() => {
3713
- if (path)
3714
- Breadcrumbs.Remove(path);
3715
- else
3716
- Breadcrumbs.RemoveLast();
3717
- });
3718
- this.SetPageName(page);
3719
- this.SetSource();
3720
- this.GetSource();
3721
- this.GetNavigation();
3722
- this.SetGoBack();
3723
- this.GetPageResponse();
3724
- }
3725
- ngAfterViewInit() {
3726
- this.routeParams = this.activatedRoute.snapshot.params;
3727
- this.queryParams = this.activatedRoute.snapshot.queryParams;
3728
- setTimeout(() => {
3729
- this.isReadyPage = true;
3730
- this.RunPage();
3731
- setTimeout(() => { this.enableAnimations = true; }, 1000);
3732
- });
3733
- }
3734
- ngOnDestroy() {
3735
- if (!this._preventDestroy)
3736
- Source.ClearPageResponse();
3737
- }
3738
- /** Main method. Starts after ngAfterViewInit() */
3739
- RunPage() { }
3740
- ;
3741
- /** Rename the last breadcrumb and update the url id */
3742
- SetPageName(name, id = null) {
3743
- this._page = name;
3744
- let path = this.router.url;
3745
- if (path.includes('?'))
3746
- path = path.split('?')[0];
3747
- if (id) {
3748
- const PATH_ARRAY = path.split('/');
3749
- const PATH_ID = Tools.BreakReference(PATH_ARRAY).pop();
3750
- if (PATH_ID) {
3751
- PATH_ARRAY[PATH_ARRAY.length - 1] = String(id);
3752
- path = PATH_ARRAY.join('/');
3753
- }
3754
- }
3755
- if (this.breadcrumbs.length > 0) {
3756
- this.breadcrumbs[this.breadcrumbs.length - 1].page = name;
3757
- this.breadcrumbs[this.breadcrumbs.length - 1].path = path;
3758
- Breadcrumbs.SetLast(name, path);
3759
- }
3760
- this.router.navigateByUrl(path);
3761
- }
3762
- /** */
3763
- SetSource() {
3764
- Source.Set(this._page);
3765
- }
3766
- /** */
3767
- GetSource() {
3768
- this._source = Source.Get();
3769
- }
3770
- /** */
3771
- GetPageResponse() {
3772
- this.pageResponse = Source.GetPageResponse();
3773
- }
3774
- /** */
3775
- GetNavigation() {
3776
- if (this._source) {
3777
- this.breadcrumbs = Breadcrumbs.Get().map(item => Object.assign({
3778
- page: item.page,
3779
- path: item.path,
3780
- click: this.GoBack(item.path)
3781
- }));
3782
- }
3783
- else
3784
- this.breadcrumbs = [{ page: this._page }];
3785
- }
3786
- /** */
3787
- SetGoBack() {
3788
- if (this._source) {
3789
- this.goBack = {
3790
- show: true,
3791
- path: this._source.path,
3792
- click: this.GoBack()
3793
- };
3794
- }
3795
- }
3796
- /** Navigate to previous page */
3797
- GoToSource(pageResponse = null) {
3798
- if (this._source) {
3799
- Breadcrumbs.RemoveLast();
3800
- this.SetPageResponse(pageResponse);
3801
- Tools.Sleep().then(_ => this.router.navigateByUrl(this._source.path));
3802
- }
3803
- }
3804
- ;
3805
- /** */
3806
- SetPageResponse(pageResponse = null) {
3807
- if (Tools.IsNotNull(pageResponse)) {
3808
- this._preventDestroy = true;
3809
- Source.SetPageResponse(pageResponse);
3810
- }
3811
- }
3812
- ;
3813
- /** */
3814
- ReloadPage() {
3815
- Breadcrumbs.RemoveLast();
3816
- setTimeout(() => window.location.reload());
3817
- }
3818
- /** */
3819
- Log(value, log = null) {
3820
- if (Tools.IsNotNull(log))
3821
- console.log({ log, value });
3822
- else
3823
- console.log(value);
3824
- }
3825
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: Page, deps: [{ token: String }], target: i0.ɵɵFactoryTarget.Component }); }
3826
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: Page, selector: "ng-component", ngImport: i0, template: '', isInline: true }); }
3827
- }
3828
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: Page, decorators: [{
3829
- type: Component,
3830
- args: [{ template: '' }]
3831
- }], ctorParameters: () => [{ type: undefined, decorators: [{
3832
- type: Inject,
3833
- args: [String]
3834
- }] }] });
3835
-
3836
- class Service {
3837
- constructor() {
3838
- //Injections
3839
- this.alert = inject(CoerAlert);
3840
- this.http = inject(HttpClient);
3841
- this.httpCode = {
3842
- Ok: 200,
3843
- Created: 201,
3844
- NoContent: 204,
3845
- BadRequest: 400,
3846
- Unauthorize: 401,
3847
- NotFound: 404,
3848
- NotAllowed: 405,
3849
- NotAcceptable: 406,
3850
- Conflict: 409,
3851
- PayloadTooLarge: 413,
3852
- InnerError: 500
3853
- };
3854
- }
3855
- /** */
3856
- ReleaseSubscription(subscription) {
3857
- if (subscription && !subscription.closed)
3858
- subscription.unsubscribe();
3859
- }
3860
- /** HTTP GET */
3861
- HTTP_GET(request) {
3862
- return new Promise(Resolve => {
3863
- this.ReleaseSubscription(this._GET$);
3864
- this._GET$ = this.http.request(new HttpRequest("GET", request.url, { params: request.queryParams, headers: request.headers })).subscribe({
3865
- next: (response) => {
3866
- if (response.type > 0) {
3867
- Resolve({
3868
- body: Tools.BreakReference(response.body),
3869
- status: response.status,
3870
- message: response.statusText,
3871
- ok: true
3872
- });
3873
- }
3874
- },
3875
- error: (httpError) => {
3876
- this.ReleaseSubscription(this._GET$);
3877
- this.AlertError(httpError, request.alertError);
3878
- Resolve({
3879
- body: {},
3880
- status: httpError.status,
3881
- message: httpError.error?.message || httpError.error,
3882
- ok: false
3883
- });
3884
- },
3885
- complete: () => {
3886
- this.ReleaseSubscription(this._GET$);
3887
- if (Tools.IsNotOnlyWhiteSpace(request.alertSuccess)) {
3888
- this.alert.Success(request.alertSuccess);
3889
- }
3890
- }
3891
- });
3892
- });
3893
- }
3894
- /** HTTP POST */
3895
- HTTP_POST(request) {
3896
- return new Promise(Resolve => {
3897
- this.ReleaseSubscription(this._POST$);
3898
- this._POST$ = this.http.request(new HttpRequest("POST", request.url, request.body, { params: request.queryParams, headers: request.headers })).subscribe({
3899
- next: (response) => {
3900
- if (response.type > 0) {
3901
- Resolve({
3902
- body: Tools.BreakReference(response.body),
3903
- status: response.status,
3904
- message: response.statusText,
3905
- ok: true
3906
- });
3907
- }
3908
- },
3909
- error: (httpError) => {
3910
- this.ReleaseSubscription(this._POST$);
3911
- this.AlertError(httpError, request.alertError);
3912
- Resolve({
3913
- body: {},
3914
- status: httpError.status,
3915
- message: httpError.error?.message || httpError.error,
3916
- ok: false
3917
- });
3918
- },
3919
- complete: () => {
3920
- this.ReleaseSubscription(this._POST$);
3921
- if (Tools.IsNotOnlyWhiteSpace(request.alertSuccess)) {
3922
- this.alert.Success(request.alertSuccess);
3923
- }
3924
- }
3925
- });
3926
- });
3927
- }
3928
- /** HTTP PUT */
3929
- HTTP_PUT(request) {
3930
- return new Promise(Resolve => {
3931
- this.ReleaseSubscription(this._PUT$);
3932
- this._PUT$ = this.http.request(new HttpRequest("PUT", request.url, request.body, { params: request.queryParams, headers: request.headers })).subscribe({
3933
- next: (response) => {
3934
- if (response.type > 0) {
3935
- Resolve({
3936
- body: {},
3937
- status: response.status,
3938
- message: response.statusText,
3939
- ok: true
3940
- });
3941
- }
3942
- },
3943
- error: (httpError) => {
3944
- this.ReleaseSubscription(this._PUT$);
3945
- this.AlertError(httpError, request.alertError);
3946
- Resolve({
3947
- body: {},
3948
- status: httpError.status,
3949
- message: httpError.error?.message || httpError.error,
3950
- ok: false
3951
- });
3952
- },
3953
- complete: () => {
3954
- this.ReleaseSubscription(this._PUT$);
3955
- if (Tools.IsNotOnlyWhiteSpace(request.alertSuccess)) {
3956
- this.alert.Success(request.alertSuccess, 'Updated', 'fa-solid fa-arrows-rotate fa-spin');
3957
- }
3958
- }
3959
- });
3960
- });
3961
- }
3962
- /** HTTP PATCH */
3963
- HTTP_PATCH(request) {
3964
- return new Promise(Resolve => {
3965
- this.ReleaseSubscription(this._PATCH$);
3966
- this._PATCH$ = this.http.request(new HttpRequest("PATCH", request.url, request.body, { params: request.queryParams, headers: request.headers })).subscribe({
3967
- next: (response) => {
3968
- if (response.type > 0) {
3969
- Resolve({
3970
- body: {},
3971
- status: response.status,
3972
- message: response.statusText,
3973
- ok: true
3974
- });
3975
- }
3976
- },
3977
- error: (httpError) => {
3978
- this.ReleaseSubscription(this._PATCH$);
3979
- this.AlertError(httpError, request.alertError);
3980
- Resolve({
3981
- body: {},
3982
- status: httpError.status,
3983
- message: httpError.error?.message || httpError.error,
3984
- ok: false
3985
- });
3986
- },
3987
- complete: () => {
3988
- this.ReleaseSubscription(this._PATCH$);
3989
- if (Tools.IsNotOnlyWhiteSpace(request.alertSuccess)) {
3990
- this.alert.Success(request.alertSuccess, 'Updated', 'fa-solid fa-arrows-rotate fa-spin');
3991
- }
3992
- }
3993
- });
3994
- });
3995
- }
3996
- /** HTTP DELETE */
3997
- HTTP_DELETE(request) {
3998
- return new Promise(Resolve => {
3999
- this.ReleaseSubscription(this._DELETE$);
4000
- this._DELETE$ = this.http.request(new HttpRequest("DELETE", request.url, { params: request.queryParams, headers: request.headers })).subscribe({
4001
- next: (response) => {
4002
- if (response.type > 0) {
4003
- Resolve({
4004
- body: {},
4005
- status: response.status,
4006
- message: response.statusText,
4007
- ok: true
4008
- });
4009
- }
4010
- },
4011
- error: (httpError) => {
4012
- this.ReleaseSubscription(this._DELETE$);
4013
- this.AlertError(httpError, request.alertError);
4014
- Resolve({
4015
- body: {},
4016
- status: httpError.status,
4017
- message: httpError.error?.message || httpError.error,
4018
- ok: false
4019
- });
4020
- },
4021
- complete: () => {
4022
- this.ReleaseSubscription(this._DELETE$);
4023
- if (Tools.IsNotOnlyWhiteSpace(request.alertSuccess)) {
4024
- this.alert.Success(request.alertSuccess, 'Deleted', 'fa-regular fa-trash-can');
4025
- }
4026
- }
4027
- });
4028
- });
4029
- }
4030
- /** */
4031
- AlertError(httpError, message) {
4032
- if (httpError.status >= 500) {
4033
- if (Tools.IsNotOnlyWhiteSpace(message)) {
4034
- this.alert.Error('', message, 'fa-solid fa-bug', null);
4035
- }
4036
- }
4037
- else if (httpError.status < 500) {
4038
- switch (httpError.status) {
4039
- case 400: {
4040
- this.alert.Warning(httpError.error?.message || httpError.error, 'Bad Request', 'fa-regular fa-face-grin-beam-sweat fa-lg');
4041
- break;
4042
- }
4043
- case 401: {
4044
- this.alert.Warning(httpError.error?.message || httpError.error, 'Unauthorize', 'fa-regular fa-face-rolling-eyes fa-lg');
4045
- break;
4046
- }
4047
- case 404: {
4048
- this.alert.Warning(httpError.error?.message || httpError.error, 'Not Found', 'fa-regular fa-face-meh fa-lg');
4049
- break;
4050
- }
4051
- case 405: {
4052
- this.alert.Warning(httpError.error?.message || httpError.error, 'Not Allowed', 'fa-regular fa-face-grimace fa-lg');
4053
- break;
4054
- }
4055
- case 406: {
4056
- this.alert.Warning(httpError.error?.message || httpError.error, 'Not Acceptable', 'fa-regular fa-face-frown-open fa-lg');
4057
- break;
4058
- }
4059
- case 409: {
4060
- this.alert.Warning(httpError.error?.message || httpError.error, 'Conflict', 'fa-regular fa-face-dizzy fa-lg');
4061
- break;
4062
- }
4063
- case 413: {
4064
- this.alert.Warning(httpError.error?.message || httpError.error, 'Too Large', 'fa-regular fa-face-flushed fa-lg');
4065
- break;
4066
- }
4067
- default: {
4068
- if (httpError.status <= 0) {
4069
- this.alert.Warning('Without Connection', 'WEB API DOWN', 'fa-solid fa-plug-circle-xmark fa-lg', null);
4070
- }
4071
- else
4072
- this.alert.Warning(httpError.error?.message || httpError.error);
4073
- break;
4074
- }
4075
- }
4076
- }
4077
- }
4078
- }
4079
-
4080
1
  /**
4081
2
  * Generated bundle index. Do not edit.
4082
3
  */
4083
-
4084
- export { Breadcrumbs, CONTROL_VALUE, CoerAlert, CoerButton, CoerCheckbox, CoerFilebox, CoerForm, CoerGrid, CoerModal, CoerNumberBox, CoerPageTitle, CoerRefDirective, CoerSelectbox, CoerSwitch, CoerTab, CoerTextBox, CoerTextarea, ComponentsModule, ControlValue, DateTime, DirectivesModule, Files, GridTemplates, HtmlPipe, LifeCycleDirective, Menu, NoImagePipe, NumericFormatPipe, Page, PipesModule, Screen, Service, Source, Tools, breakpointSIGNAL, isLoadingSIGNAL, isMenuOpenSIGNAL, isModalOpenSIGNAL, menuSIGNAL };
4085
4
  //# sourceMappingURL=coer-elements.mjs.map