@jooler/inputs 0.0.50 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/{esm2020 → esm2022}/inputs.mjs +4 -4
  2. package/esm2022/lib/add-asterisk.directive.mjs +42 -0
  3. package/esm2022/lib/ag-grid-select-mixin.mjs +73 -0
  4. package/esm2022/lib/choose-enum/choose-enum.component.mjs +205 -0
  5. package/esm2022/lib/choose-enum-renderer/choose-enum-renderer.component.mjs +45 -0
  6. package/esm2022/lib/choose-general-item/choose-general-item.component.mjs +149 -0
  7. package/esm2022/lib/choose-general-item/choose-general-item.service.mjs +45 -0
  8. package/esm2022/lib/choose-general-item-renderer/choose-general-item-renderer.component.mjs +37 -0
  9. package/esm2022/lib/choose-line-type/choose-line-type.component.mjs +53 -0
  10. package/esm2022/lib/choose-yes-or-no/choose-yes-or-no.component.mjs +69 -0
  11. package/esm2022/lib/choose-yes-or-no-renderer/choose-yes-or-no-renderer.component.mjs +33 -0
  12. package/{esm2020 → esm2022}/lib/dropdown-actions/dropdown-action-type.model.mjs +5 -5
  13. package/esm2022/lib/dropdown-actions/dropdown-actions.component.mjs +75 -0
  14. package/{esm2020 → esm2022}/lib/dropdown-actions/label-and-route.model.mjs +1 -1
  15. package/{esm2020 → esm2022}/lib/editable-savable-input/dynamicPipe.mjs +20 -20
  16. package/{esm2020 → esm2022}/lib/editable-savable-input/dynamicPipeMapping.mjs +4 -4
  17. package/esm2022/lib/editable-savable-input/editable-savable-input.component.mjs +128 -0
  18. package/esm2022/lib/enum-helper.model.mjs +14 -0
  19. package/esm2022/lib/formcontrol-validation-msg.directive.mjs +150 -0
  20. package/esm2022/lib/general-input-renderer/custom-decimal-point-two-digits.directive.mjs +63 -0
  21. package/esm2022/lib/general-input-renderer/general-input-renderer.component.mjs +50 -0
  22. package/{esm2020 → esm2022}/lib/inputs.module.mjs +122 -122
  23. package/{esm2020 → esm2022}/lib/models/label-and-field.model.mjs +5 -3
  24. package/esm2022/lib/models/line-type-model-helper.mjs +51 -0
  25. package/{esm2020 → esm2022}/lib/models/line-type.model.mjs +5 -5
  26. package/esm2022/lib/models/yes-or-no.model.mjs +6 -0
  27. package/esm2022/lib/primary-colors.mjs +12 -0
  28. package/esm2022/lib/services/validation-message.service.mjs +111 -0
  29. package/esm2022/lib/show-table-errors/show-table-errors.component.mjs +25 -0
  30. package/{esm2020 → esm2022}/public-api.mjs +23 -23
  31. package/fesm2022/inputs.mjs +1494 -0
  32. package/fesm2022/inputs.mjs.map +1 -0
  33. package/index.d.ts +5 -5
  34. package/lib/add-asterisk.directive.d.ts +12 -12
  35. package/lib/ag-grid-select-mixin.d.ts +22 -0
  36. package/lib/choose-enum/choose-enum.component.d.ts +57 -51
  37. package/lib/choose-enum-renderer/choose-enum-renderer.component.d.ts +13 -15
  38. package/lib/choose-general-item/choose-general-item.component.d.ts +49 -49
  39. package/lib/choose-general-item/choose-general-item.service.d.ts +18 -18
  40. package/lib/choose-general-item-renderer/choose-general-item-renderer.component.d.ts +15 -15
  41. package/lib/choose-line-type/choose-line-type.component.d.ts +19 -19
  42. package/lib/choose-yes-or-no/choose-yes-or-no.component.d.ts +24 -24
  43. package/lib/choose-yes-or-no-renderer/choose-yes-or-no-renderer.component.d.ts +16 -16
  44. package/lib/dropdown-actions/dropdown-action-type.model.d.ts +4 -4
  45. package/lib/dropdown-actions/dropdown-actions.component.d.ts +22 -22
  46. package/lib/dropdown-actions/label-and-route.model.d.ts +4 -4
  47. package/lib/editable-savable-input/dynamicPipe.d.ts +7 -7
  48. package/lib/editable-savable-input/dynamicPipeMapping.d.ts +5 -5
  49. package/lib/editable-savable-input/editable-savable-input.component.d.ts +37 -37
  50. package/lib/enum-helper.model.d.ts +8 -0
  51. package/lib/formcontrol-validation-msg.directive.d.ts +25 -25
  52. package/lib/general-input-renderer/custom-decimal-point-two-digits.directive.d.ts +13 -13
  53. package/lib/general-input-renderer/general-input-renderer.component.d.ts +15 -15
  54. package/lib/inputs.module.d.ts +29 -29
  55. package/lib/models/label-and-field.model.d.ts +4 -4
  56. package/lib/models/line-type-model-helper.d.ts +12 -12
  57. package/lib/models/line-type.model.d.ts +4 -4
  58. package/lib/models/yes-or-no.model.d.ts +5 -5
  59. package/lib/primary-colors.d.ts +11 -11
  60. package/lib/services/validation-message.service.d.ts +50 -50
  61. package/lib/show-table-errors/show-table-errors.component.d.ts +11 -11
  62. package/package.json +10 -16
  63. package/public-api.d.ts +20 -20
  64. package/esm2020/lib/add-asterisk.directive.mjs +0 -41
  65. package/esm2020/lib/choose-enum/choose-enum.component.mjs +0 -176
  66. package/esm2020/lib/choose-enum-renderer/choose-enum-renderer.component.mjs +0 -26
  67. package/esm2020/lib/choose-general-item/choose-general-item.component.mjs +0 -133
  68. package/esm2020/lib/choose-general-item/choose-general-item.service.mjs +0 -43
  69. package/esm2020/lib/choose-general-item-renderer/choose-general-item-renderer.component.mjs +0 -32
  70. package/esm2020/lib/choose-line-type/choose-line-type.component.mjs +0 -52
  71. package/esm2020/lib/choose-yes-or-no/choose-yes-or-no.component.mjs +0 -69
  72. package/esm2020/lib/choose-yes-or-no-renderer/choose-yes-or-no-renderer.component.mjs +0 -27
  73. package/esm2020/lib/custom-theme.mjs +0 -104
  74. package/esm2020/lib/dropdown-actions/dropdown-actions.component.mjs +0 -72
  75. package/esm2020/lib/editable-savable-input/editable-savable-input.component.mjs +0 -123
  76. package/esm2020/lib/formcontrol-validation-msg.directive.mjs +0 -144
  77. package/esm2020/lib/general-input-renderer/custom-decimal-point-two-digits.directive.mjs +0 -61
  78. package/esm2020/lib/general-input-renderer/general-input-renderer.component.mjs +0 -45
  79. package/esm2020/lib/models/enum-helper-functions.mjs +0 -57
  80. package/esm2020/lib/models/enum-helper.model.mjs +0 -2
  81. package/esm2020/lib/models/line-type-model-helper.mjs +0 -47
  82. package/esm2020/lib/models/yes-or-no.model.mjs +0 -3
  83. package/esm2020/lib/primary-colors.mjs +0 -12
  84. package/esm2020/lib/services/validation-message.service.mjs +0 -106
  85. package/esm2020/lib/show-table-errors/show-table-errors.component.mjs +0 -23
  86. package/fesm2015/inputs.mjs +0 -1475
  87. package/fesm2015/inputs.mjs.map +0 -1
  88. package/fesm2020/inputs.mjs +0 -1471
  89. package/fesm2020/inputs.mjs.map +0 -1
  90. package/lib/custom-theme.d.ts +0 -8
  91. package/lib/models/enum-helper-functions.d.ts +0 -5
  92. package/lib/models/enum-helper.model.d.ts +0 -6
@@ -1,1475 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, forwardRef, Component, Input, Output, Injectable, Inject, Pipe, Directive, HostListener, NgModule } from '@angular/core';
3
- import * as i2$1 from '@angular/forms';
4
- import { NG_VALUE_ACCESSOR, NgModel, FormsModule, ReactiveFormsModule } from '@angular/forms';
5
- import * as i1 from '@angular/common';
6
- import { CurrencyPipe, DecimalPipe, CommonModule } from '@angular/common';
7
- import * as i2 from '@ng-select/ng-select';
8
- import { NgSelectModule } from '@ng-select/ng-select';
9
- import * as i4 from '@jooler/shared-general-components';
10
- import { SharedGeneralComponentsModule } from '@jooler/shared-general-components';
11
- import * as i2$2 from '@fortawesome/angular-fontawesome';
12
- import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
13
- import * as i1$1 from '@angular/common/http';
14
- import { HttpHeaders } from '@angular/common/http';
15
- import * as i3 from '@angular/material/button';
16
- import { AppMaterialModule } from '@jooler/app-material';
17
- import * as i1$2 from '@angular/router';
18
- import * as i3$1 from '@angular/material/menu';
19
-
20
- class CustomTheme {
21
- }
22
- CustomTheme.$joolerBlue = [
23
- '#e3ecfa',
24
- '#b9cff2',
25
- '#8aafea',
26
- '#5b8ee1',
27
- '#3876da',
28
- '#155ed4',
29
- '#1256cf',
30
- '#0f4cc9',
31
- '#0c42c3',
32
- '#0631b9',
33
- '#e3e8ff',
34
- '#b0bfff',
35
- '#7d95ff',
36
- '#6481ff',
37
- ];
38
- CustomTheme.$joolerTeal = [
39
- '#b8dfd8',
40
- '#89cabf',
41
- '#59b5a5',
42
- '#36a591',
43
- '#12957e',
44
- '#108d76',
45
- '#0d826b',
46
- '#0a7861',
47
- '#05674e',
48
- '#97ffe1',
49
- '#64ffd2',
50
- '#31ffc3',
51
- '#18ffbc',
52
- ];
53
- CustomTheme.$joolerRed = [
54
- '#f5e0e1',
55
- '#e5b3b3',
56
- '#d48081',
57
- '#c24d4e',
58
- '#b52628',
59
- '#a80002',
60
- '#a00002',
61
- '#970001',
62
- '#8d0001',
63
- '#7d0001',
64
- '#ffaaaa',
65
- '#ff7777',
66
- '#ff4444',
67
- '#ff2a2a',
68
- ];
69
- CustomTheme.$joolerPink = [
70
- '#fdeaf3',
71
- '#fbcbe1',
72
- '#f8a8ce',
73
- '#f585ba',
74
- '#f26aab',
75
- '#f0509c',
76
- '#ee4994',
77
- '#ec408a',
78
- '#e93780',
79
- '#e5276e',
80
- '#ffffff',
81
- '#ffeef4',
82
- '#ffbbd3',
83
- '#ffa1c2',
84
- ];
85
- CustomTheme.$joolerPurple = [
86
- '#fcf6fd',
87
- '#f7e8f9',
88
- '#f1d8f5',
89
- '#ebc8f1',
90
- '#e7bdee',
91
- '#e3b1eb',
92
- '#e0aae9',
93
- '#dca1e5',
94
- '#d898e2',
95
- '#d088dd',
96
- '#ffffff',
97
- '#ffffff',
98
- '#ffffff',
99
- '#fcecff',
100
- ];
101
- CustomTheme.$joolerCombo = [
102
- '#b9cff2',
103
- '#b8dfd8',
104
- '#ffaaaa',
105
- '#fbcbe1',
106
- '#f1d8f5',
107
- '#8aafea',
108
- '#97ffe1',
109
- '#ff7777',
110
- '#f585ba',
111
- '#e7bdee',
112
- '#6481ff',
113
- '#18ffbc',
114
- '#ff4444',
115
- '#ffa1c2',
116
- '#e0aae9',
117
- '#1256cf',
118
- '#108d76',
119
- '#df0000',
120
- '#ec408a',
121
- '#d088dd',
122
- ];
123
-
124
- class EnumHelperBaseClass {
125
- static getEnumOptionsFromEnumClass(enumClass, customColors, isAllCaps) {
126
- let colors = CustomTheme.$joolerCombo;
127
- if (customColors && customColors.length > 0) {
128
- colors = customColors;
129
- }
130
- let stringValues = [];
131
- let enumOption;
132
- let enumOptions = [];
133
- for (let item in enumClass) {
134
- if (isNaN(Number(item))) {
135
- let joinedString;
136
- stringValues.push(item);
137
- let splitStr = item.toLowerCase().split('_');
138
- if (!isAllCaps) {
139
- for (let i = 0; i < splitStr.length; i++) {
140
- splitStr[i] =
141
- splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);
142
- }
143
- }
144
- else {
145
- for (let i = 0; i < splitStr.length; i++) {
146
- splitStr[i] = splitStr[i].toUpperCase();
147
- }
148
- }
149
- joinedString = splitStr.join(' ');
150
- stringValues.splice(stringValues.indexOf(item), 1, joinedString);
151
- }
152
- }
153
- let repeatedColors = [];
154
- let i = 0;
155
- for (let label of stringValues) {
156
- // in case the array of colors is smaller than the stringValues array, we repeat the the colors so that they are enough
157
- repeatedColors.push(colors[stringValues.indexOf(label) % colors.length]);
158
- enumOption = {
159
- value: Object.keys(enumClass).map(Number)[i],
160
- label: label,
161
- color: repeatedColors[i],
162
- };
163
- enumOptions.push(enumOption);
164
- i++;
165
- }
166
- return enumOptions;
167
- }
168
- static getLabelAndColorFromEnumValue(enumClass, enumValue, customColors) {
169
- let enumOptions = EnumHelperBaseClass.getEnumOptionsFromEnumClass(enumClass, customColors);
170
- let enumOption;
171
- for (let item of enumOptions) {
172
- if (enumValue == item.value) {
173
- enumOption = enumOptions[enumOptions.indexOf(item)];
174
- }
175
- }
176
- return enumOption;
177
- }
178
- }
179
-
180
- class ChooseEnumComponent {
181
- constructor() {
182
- this.appendTo = 'body';
183
- this.allowAllCapsValues = false;
184
- this.clearable = true;
185
- this.getValuesArrayFromEnum = EnumHelperBaseClass.getEnumOptionsFromEnumClass;
186
- this.indexesToDisable = [];
187
- this.isChip = true;
188
- this.isDropdownDisabled = false;
189
- this.label = 'label';
190
- this.labelTextAlign = 'left';
191
- this.percentWidth = false;
192
- this.change = new EventEmitter();
193
- this.close = new EventEmitter();
194
- this.propagateChange = (_) => { };
195
- this.propogateTouch = () => { };
196
- }
197
- ngOnChanges() {
198
- if (this.getValuesArrayFromEnum != null) {
199
- this.items = this.getValuesArrayFromEnum(this.enumChoices, this.customColors, this.allowAllCapsValues);
200
- }
201
- if (this.isItemDisabled == true) {
202
- if (this.indexesToDisable.length > 0) {
203
- for (let index of this.indexesToDisable) {
204
- this.items[index].disabled = true;
205
- }
206
- }
207
- }
208
- if (this.isItemHidden == true) {
209
- if (this.indexesToDisable.length > 0) {
210
- for (let index of this.indexesToDisable) {
211
- let itemIndex = this.items.findIndex((item) => item.value == index);
212
- this.items.splice(itemIndex, 1);
213
- }
214
- }
215
- }
216
- }
217
- ngOnInit() {
218
- if (this.getValuesArrayFromEnum != null) {
219
- this.items = this.getValuesArrayFromEnum(this.enumChoices, this.customColors, this.allowAllCapsValues);
220
- }
221
- if (this.isItemDisabled == true) {
222
- if (this.indexesToDisable.length > 0) {
223
- for (let index of this.indexesToDisable) {
224
- this.items[index].disabled = true;
225
- }
226
- }
227
- }
228
- if (this.isItemHidden == true) {
229
- if (this.indexesToDisable.length > 0) {
230
- for (let index of this.indexesToDisable) {
231
- let itemIndex = this.items.findIndex((item) => item.value == index);
232
- this.items.splice(itemIndex, 1);
233
- }
234
- }
235
- }
236
- }
237
- writeValue(type) {
238
- if (type != undefined) {
239
- this.selectedItem = type;
240
- }
241
- else if (type == null) {
242
- this.selectedItem = type;
243
- }
244
- }
245
- registerOnChange(fn) {
246
- this.propagateChange = fn;
247
- }
248
- registerOnTouched(fn) {
249
- this.propogateTouch = fn;
250
- }
251
- updateBlur() {
252
- this.propogateTouch();
253
- this.close.emit();
254
- }
255
- onSelectedItemChanged() {
256
- this.propagateChange(this.selectedItem);
257
- this.change.emit(this.selectedItem);
258
- }
259
- setDisabledState(isDisabled) {
260
- this.isDropdownDisabled = isDisabled;
261
- }
262
- clear() {
263
- this.selectedItem = null;
264
- }
265
- setStyles() {
266
- let style = {
267
- paddingTop: this.paddingTop + 'rem',
268
- };
269
- if (this.width) {
270
- style['width'] = this.width + 'rem';
271
- }
272
- return style;
273
- }
274
- setLabelStyle() {
275
- let style = {
276
- textAlign: this.labelTextAlign,
277
- fontWeight: this.labelTextFontWeight,
278
- fontSize: this.labelTextFontSize + 'rem',
279
- };
280
- return style;
281
- }
282
- }
283
- ChooseEnumComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseEnumComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
284
- ChooseEnumComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChooseEnumComponent, selector: "choose-enum", inputs: { appendTo: "appendTo", allowAllCapsValues: "allowAllCapsValues", clearable: "clearable", customColors: "customColors", enumChoices: "enumChoices", getValuesArrayFromEnum: "getValuesArrayFromEnum", indexesToDisable: "indexesToDisable", isChip: "isChip", isDropdownDisabled: "isDropdownDisabled", isItemHidden: "isItemHidden", isItemDisabled: "isItemDisabled", isMultiple: "isMultiple", label: "label", labelTextAlign: "labelTextAlign", labelTextFontWeight: "labelTextFontWeight", labelTextFontSize: "labelTextFontSize", paddingTop: "paddingTop", placeholder: "placeholder", percentWidth: "percentWidth", selectedItem: "selectedItem", width: "width" }, outputs: { change: "change", close: "close" }, providers: [
285
- {
286
- provide: NG_VALUE_ACCESSOR,
287
- useExisting: forwardRef(() => ChooseEnumComponent),
288
- multi: true,
289
- },
290
- ], usesOnChanges: true, ngImport: i0, template: "<div class=\"select\">\r\n <ng-select\r\n [ngStyle]=\"setStyles()\"\r\n (blur)=\"updateBlur()\"\r\n bindLabel=\"label\"\r\n bindValue=\"value\"\r\n [items]=\"items\"\r\n [placeholder]=\"placeholder\"\r\n (change)=\"onSelectedItemChanged()\"\r\n [(ngModel)]=\"selectedItem\"\r\n [multiple]=\"isMultiple\"\r\n [disabled]=\"isDropdownDisabled\"\r\n [clearable]=\"clearable\"\r\n [clearAllText]=\"'clear everything'\"\r\n (clear)=\"clear()\"\r\n [appendTo]=\"appendTo\"\r\n dropdownPosition=\"bottom\">\r\n <ng-template\r\n class=\"template\"\r\n ng-option-tmp\r\n ng-label-tmp\r\n let-item=\"item\"\r\n let-index=\"index\"\r\n let-search=\"searchTerm\">\r\n <div *ngIf=\"isChip\">\r\n <ng-chip [enumClass]=\"enumChoices\" [enumValue]=\"item.value\" [customColors]=\"customColors\">\r\n </ng-chip>\r\n </div>\r\n <div [ngStyle]=\"setLabelStyle()\" *ngIf=\"!isChip\">{{ item.label }}</div>\r\n </ng-template>\r\n </ng-select>\r\n</div>\r\n", styles: [".select{width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i2.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { 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: i4.NgChipComponent, selector: "ng-chip", inputs: ["backgroundColor", "size", "clear", "customColors", "enumClass", "enumValue", "inputType", "item", "isClickable", "label", "width", "withCross"] }] });
291
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseEnumComponent, decorators: [{
292
- type: Component,
293
- args: [{ selector: 'choose-enum', providers: [
294
- {
295
- provide: NG_VALUE_ACCESSOR,
296
- useExisting: forwardRef(() => ChooseEnumComponent),
297
- multi: true,
298
- },
299
- ], template: "<div class=\"select\">\r\n <ng-select\r\n [ngStyle]=\"setStyles()\"\r\n (blur)=\"updateBlur()\"\r\n bindLabel=\"label\"\r\n bindValue=\"value\"\r\n [items]=\"items\"\r\n [placeholder]=\"placeholder\"\r\n (change)=\"onSelectedItemChanged()\"\r\n [(ngModel)]=\"selectedItem\"\r\n [multiple]=\"isMultiple\"\r\n [disabled]=\"isDropdownDisabled\"\r\n [clearable]=\"clearable\"\r\n [clearAllText]=\"'clear everything'\"\r\n (clear)=\"clear()\"\r\n [appendTo]=\"appendTo\"\r\n dropdownPosition=\"bottom\">\r\n <ng-template\r\n class=\"template\"\r\n ng-option-tmp\r\n ng-label-tmp\r\n let-item=\"item\"\r\n let-index=\"index\"\r\n let-search=\"searchTerm\">\r\n <div *ngIf=\"isChip\">\r\n <ng-chip [enumClass]=\"enumChoices\" [enumValue]=\"item.value\" [customColors]=\"customColors\">\r\n </ng-chip>\r\n </div>\r\n <div [ngStyle]=\"setLabelStyle()\" *ngIf=\"!isChip\">{{ item.label }}</div>\r\n </ng-template>\r\n </ng-select>\r\n</div>\r\n", styles: [".select{width:100%}\n"] }]
300
- }], ctorParameters: function () { return []; }, propDecorators: { appendTo: [{
301
- type: Input
302
- }], allowAllCapsValues: [{
303
- type: Input
304
- }], clearable: [{
305
- type: Input
306
- }], customColors: [{
307
- type: Input
308
- }], enumChoices: [{
309
- type: Input
310
- }], getValuesArrayFromEnum: [{
311
- type: Input
312
- }], indexesToDisable: [{
313
- type: Input
314
- }], isChip: [{
315
- type: Input
316
- }], isDropdownDisabled: [{
317
- type: Input
318
- }], isItemHidden: [{
319
- type: Input
320
- }], isItemDisabled: [{
321
- type: Input
322
- }], isMultiple: [{
323
- type: Input
324
- }], label: [{
325
- type: Input
326
- }], labelTextAlign: [{
327
- type: Input
328
- }], labelTextFontWeight: [{
329
- type: Input
330
- }], labelTextFontSize: [{
331
- type: Input
332
- }], paddingTop: [{
333
- type: Input
334
- }], placeholder: [{
335
- type: Input
336
- }], percentWidth: [{
337
- type: Input
338
- }], selectedItem: [{
339
- type: Input
340
- }], width: [{
341
- type: Input
342
- }], change: [{
343
- type: Output
344
- }], close: [{
345
- type: Output
346
- }] } });
347
-
348
- class ShowTableErrorsComponent {
349
- ngOnInit() {
350
- }
351
- onMouseEnter() {
352
- this.showDetails = true;
353
- }
354
- onMouseLeave() {
355
- this.showDetails = false;
356
- }
357
- }
358
- ShowTableErrorsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ShowTableErrorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
359
- ShowTableErrorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ShowTableErrorsComponent, selector: "show-table-errors", inputs: { message: "message" }, ngImport: i0, template: "<div (mouseenter)=\"onMouseEnter()\"(mouseleave)=\"onMouseLeave()\" class=\"icon\">\r\n <fa-icon class=\"icon\" icon=\"info-circle\" ></fa-icon>\r\n <span *ngIf=\"message\" class=\"message\"\r\n [ngClass]=\"{'no-details' : !showDetails , 'details': showDetails}\">{{message}}</span>\r\n</div>", styles: [".icon{color:#a80002;cursor:pointer;display:inline-block}.no-details{display:none}.details{display:block;z-index:100;background-color:#ffdbdb;color:#a80002;border-radius:.5rem;border:.1rem solid #A80002;border-left:.5rem solid #A80002;position:fixed;padding:1rem;bottom:45%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$2.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }] });
360
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ShowTableErrorsComponent, decorators: [{
361
- type: Component,
362
- args: [{ selector: 'show-table-errors', template: "<div (mouseenter)=\"onMouseEnter()\"(mouseleave)=\"onMouseLeave()\" class=\"icon\">\r\n <fa-icon class=\"icon\" icon=\"info-circle\" ></fa-icon>\r\n <span *ngIf=\"message\" class=\"message\"\r\n [ngClass]=\"{'no-details' : !showDetails , 'details': showDetails}\">{{message}}</span>\r\n</div>", styles: [".icon{color:#a80002;cursor:pointer;display:inline-block}.no-details{display:none}.details{display:block;z-index:100;background-color:#ffdbdb;color:#a80002;border-radius:.5rem;border:.1rem solid #A80002;border-left:.5rem solid #A80002;position:fixed;padding:1rem;bottom:45%}\n"] }]
363
- }], propDecorators: { message: [{
364
- type: Input
365
- }] } });
366
-
367
- class ChooseEnumRendererComponent {
368
- constructor() { }
369
- agInit(params) {
370
- this.params = params;
371
- this.enumValue = params.value;
372
- this.key = params.context.createKey(params.columnApi, params.column);
373
- }
374
- onCellDataChanged($event) {
375
- var _a;
376
- let value = $event;
377
- this.formControlValue = this.params.context.formGroup.get("entries").at(this.params.node.rowIndex);
378
- (_a = this.formControlValue) === null || _a === void 0 ? void 0 : _a.get(this.key).setValue(value);
379
- }
380
- refresh(params) {
381
- return false;
382
- }
383
- }
384
- ChooseEnumRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseEnumRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
385
- ChooseEnumRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChooseEnumRendererComponent, selector: "choose-enum-renderer", ngImport: i0, template: "<choose-enum [label]=\"params.label\" [appendTo]=\"'body'\" [isItemHidden]=\"params.isItemHidden\"\r\n [isItemDisabled]=\"params.isItemDisabled\" [labelTextAlign]=\"params.labelTextAlign\"\r\n [labelTextFontWeight]=\"params.labelTextFontWeight\" [labelTextFontSize]=\"params.labelTextFontSize\"\r\n [selectedItem]=\"params.value\" [indexesToDisable]=\"params.indexesToDisable\"\r\n [isDropdownDisabled]=\"params.isDropdownDisabled\" [getValuesArrayFromEnum]=\"params.getLabelAndColorFromEnumValue\"\r\n [enumChoices]=\"params.enumChoices\" [placeholder]=\"params.placeholder\" [width]=\"params.width\"\r\n [isChip]=\"params.isChip\" [paddingTop]=\"params.paddingTop\" [allowAllCapsValues]=\"params.allowAllCapsValues\"\r\n (change)=\"onCellDataChanged($event)\">\r\n</choose-enum>", styles: [""], dependencies: [{ kind: "component", type: ChooseEnumComponent, selector: "choose-enum", inputs: ["appendTo", "allowAllCapsValues", "clearable", "customColors", "enumChoices", "getValuesArrayFromEnum", "indexesToDisable", "isChip", "isDropdownDisabled", "isItemHidden", "isItemDisabled", "isMultiple", "label", "labelTextAlign", "labelTextFontWeight", "labelTextFontSize", "paddingTop", "placeholder", "percentWidth", "selectedItem", "width"], outputs: ["change", "close"] }] });
386
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseEnumRendererComponent, decorators: [{
387
- type: Component,
388
- args: [{ selector: 'choose-enum-renderer', template: "<choose-enum [label]=\"params.label\" [appendTo]=\"'body'\" [isItemHidden]=\"params.isItemHidden\"\r\n [isItemDisabled]=\"params.isItemDisabled\" [labelTextAlign]=\"params.labelTextAlign\"\r\n [labelTextFontWeight]=\"params.labelTextFontWeight\" [labelTextFontSize]=\"params.labelTextFontSize\"\r\n [selectedItem]=\"params.value\" [indexesToDisable]=\"params.indexesToDisable\"\r\n [isDropdownDisabled]=\"params.isDropdownDisabled\" [getValuesArrayFromEnum]=\"params.getLabelAndColorFromEnumValue\"\r\n [enumChoices]=\"params.enumChoices\" [placeholder]=\"params.placeholder\" [width]=\"params.width\"\r\n [isChip]=\"params.isChip\" [paddingTop]=\"params.paddingTop\" [allowAllCapsValues]=\"params.allowAllCapsValues\"\r\n (change)=\"onCellDataChanged($event)\">\r\n</choose-enum>" }]
389
- }], ctorParameters: function () { return []; } });
390
-
391
- // import { environment } from '../../environments/environment';
392
- class ChooseGeneralItemService {
393
- // baseUrl: string = environment.apiURL;
394
- constructor(http, env) {
395
- this.http = http;
396
- this.env = env;
397
- } //we have an issue with this line of code...can we meet to resolve it!
398
- getHeaders() {
399
- const token = localStorage.getItem("token");
400
- const httpHeaders = new HttpHeaders({
401
- 'Content-Type': "application/json",
402
- 'Authorization': 'Token ' + token
403
- });
404
- return { headers: httpHeaders };
405
- }
406
- getAuthenticationHeadersWithQueryParams(params) {
407
- const token = localStorage.getItem("token");
408
- const httpHeaders = new HttpHeaders({
409
- 'Content-Type': "application/json",
410
- 'Authorization': 'Token ' + token
411
- });
412
- return { headers: httpHeaders, params: params };
413
- }
414
- getData(apiPath) {
415
- return this.http.get(`${this.env.apiURL}${apiPath}`, this.getHeaders());
416
- }
417
- }
418
- ChooseGeneralItemService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemService, deps: [{ token: i1$1.HttpClient }, { token: 'env' }], target: i0.ɵɵFactoryTarget.Injectable });
419
- ChooseGeneralItemService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemService, providedIn: 'root' });
420
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemService, decorators: [{
421
- type: Injectable,
422
- args: [{
423
- providedIn: 'root'
424
- }]
425
- }], ctorParameters: function () {
426
- return [{ type: i1$1.HttpClient }, { type: undefined, decorators: [{
427
- type: Inject,
428
- args: ['env']
429
- }] }];
430
- } });
431
-
432
- class ChooseGeneralItemComponent {
433
- constructor(_ChooseGeneralItemService) {
434
- this._ChooseGeneralItemService = _ChooseGeneralItemService;
435
- this.change = new EventEmitter();
436
- this.width = 20;
437
- this.isChip = false;
438
- this.chipColor = 'black';
439
- this.chipTextColor = 'white';
440
- this.chipWidth = 11;
441
- this.useFullObject = false;
442
- this.propagateChange = (_) => { };
443
- this.propogateTouch = () => { };
444
- }
445
- ngOnInit() {
446
- if (!this.items)
447
- this.getData();
448
- }
449
- writeValue(item) {
450
- if (item != undefined) {
451
- this.selectedItemId = item;
452
- }
453
- else if (item == null) {
454
- this.selectedItemId = item;
455
- }
456
- }
457
- registerOnChange(fn) {
458
- this.propagateChange = fn;
459
- }
460
- registerOnTouched(fn) {
461
- this.propogateTouch = fn;
462
- }
463
- updateBlur() {
464
- this.propogateTouch();
465
- }
466
- onSelectedItemChanged($event) {
467
- this.propagateChange(this.useFullObject ? $event : this.selectedItemId);
468
- this.change.emit(this.useFullObject ? $event : this.selectedItemId);
469
- }
470
- getData() {
471
- if (this.apiPath) {
472
- this._ChooseGeneralItemService.getData(this.apiPath).subscribe({
473
- next: (response) => {
474
- this.items = response;
475
- },
476
- error: (error) => console.error("error", error)
477
- });
478
- }
479
- }
480
- setWidth() {
481
- let style = {
482
- width: this.width + "rem"
483
- };
484
- return style;
485
- }
486
- setFontStyles() {
487
- let fontStyle = {
488
- fontWeight: this.fontWeight,
489
- fontSize: this.fontSize + "rem",
490
- };
491
- return fontStyle;
492
- }
493
- }
494
- ChooseGeneralItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemComponent, deps: [{ token: ChooseGeneralItemService }], target: i0.ɵɵFactoryTarget.Component });
495
- ChooseGeneralItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChooseGeneralItemComponent, selector: "choose-general-item", inputs: { items: "items", label: "label", appendTo: "appendTo", placeholder: "placeholder", apiPath: "apiPath", isMultiple: "isMultiple", hideSelectedItem: "hideSelectedItem", objects: "objects", showLabel: "showLabel", separator: "separator", width: "width", fontWeight: "fontWeight", fontSize: "fontSize", isChip: "isChip", isTypeDate: "isTypeDate", chipColor: "chipColor", chipTextColor: "chipTextColor", chipWidth: "chipWidth", selectedItemId: "selectedItemId", disabled: "disabled", useFullObject: "useFullObject" }, outputs: { change: "change" }, providers: [
496
- {
497
- provide: NG_VALUE_ACCESSOR,
498
- useExisting: forwardRef(() => ChooseGeneralItemComponent),
499
- multi: true,
500
- },
501
- ], ngImport: i0, template: "<div class=\"select\">\r\n <ng-select [hideSelected]=\"hideSelectedItem\" [closeOnSelect]=\"!isMultiple\" [ngStyle]=\"setWidth()\" class=\"component\"\r\n [disabled]=\"disabled\" [appendTo]=\"appendTo\" dropdownPosition=\"bottom\" (blur)=\"updateBlur()\" [bindLabel]=\"label\"\r\n bindValue=\"id\" [compareWith]=\"\" [items]=\"items\" [placeholder]=\"placeholder\"\r\n (change)=\"onSelectedItemChanged($event)\" [(ngModel)]=\"selectedItemId\" [multiple]=\"isMultiple\">\r\n <ng-template *ngIf=\"!isChip\" class=\"template\" ng-option-tmp ng-label-tmp let-item=\"item\" let-index=\"index\"\r\n let-search=\"searchTerm\">\r\n <span [ngStyle]=\"setFontStyles()\" *ngFor=\"let object of objects let isLast = last\">\r\n <span *ngIf=\"showLabel && !isTypeDate\">\r\n {{object.label}}: {{item[object.field]}} {{isLast ? \"\" : separator}}\r\n </span>\r\n <span *ngIf=\"showLabel && isTypeDate\">\r\n {{object.label}}: {{item[object.field]| date: 'mediumDate'}} {{isLast ? \"\" : separator}}\r\n </span>\r\n <span *ngIf=\"!showLabel && isTypeDate\">\r\n {{item[object.field]| date: 'mediumDate'}} {{isLast ? \"\" : separator}}\r\n </span>\r\n <span *ngIf=\"!showLabel && !isTypeDate\">{{item[object.field]}}{{isLast ? \"\" : separator}}\r\n </span>\r\n </span>\r\n </ng-template>\r\n <ng-template *ngIf=\"isChip\" ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [clear]=\"clear\" [withCross]=\"isMultiple\" [item]=\"item\"\r\n class=\"chip\" [backgroundColor]=\"chipColor\" [label]=\"item[objects[0].field]\"\r\n [width]=\"chipWidth\">\r\n </ng-chip>\r\n </ng-template>\r\n <ng-template *ngIf=\"isChip\" ng-option-tmp let-clear=\"clear\" let-item=\"item\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [clear]=\"clear\" [withCross]=\"false\" [item]=\"item\"\r\n class=\"chip\" [backgroundColor]=\"chipColor\" [label]=\"item[objects[0].field]\"\r\n [width]=\"chipWidth\">\r\n </ng-chip>\r\n </ng-template>\r\n </ng-select>\r\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i2.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { 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: i4.NgChipComponent, selector: "ng-chip", inputs: ["backgroundColor", "size", "clear", "customColors", "enumClass", "enumValue", "inputType", "item", "isClickable", "label", "width", "withCross"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
502
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemComponent, decorators: [{
503
- type: Component,
504
- args: [{ selector: 'choose-general-item', providers: [
505
- {
506
- provide: NG_VALUE_ACCESSOR,
507
- useExisting: forwardRef(() => ChooseGeneralItemComponent),
508
- multi: true,
509
- },
510
- ], template: "<div class=\"select\">\r\n <ng-select [hideSelected]=\"hideSelectedItem\" [closeOnSelect]=\"!isMultiple\" [ngStyle]=\"setWidth()\" class=\"component\"\r\n [disabled]=\"disabled\" [appendTo]=\"appendTo\" dropdownPosition=\"bottom\" (blur)=\"updateBlur()\" [bindLabel]=\"label\"\r\n bindValue=\"id\" [compareWith]=\"\" [items]=\"items\" [placeholder]=\"placeholder\"\r\n (change)=\"onSelectedItemChanged($event)\" [(ngModel)]=\"selectedItemId\" [multiple]=\"isMultiple\">\r\n <ng-template *ngIf=\"!isChip\" class=\"template\" ng-option-tmp ng-label-tmp let-item=\"item\" let-index=\"index\"\r\n let-search=\"searchTerm\">\r\n <span [ngStyle]=\"setFontStyles()\" *ngFor=\"let object of objects let isLast = last\">\r\n <span *ngIf=\"showLabel && !isTypeDate\">\r\n {{object.label}}: {{item[object.field]}} {{isLast ? \"\" : separator}}\r\n </span>\r\n <span *ngIf=\"showLabel && isTypeDate\">\r\n {{object.label}}: {{item[object.field]| date: 'mediumDate'}} {{isLast ? \"\" : separator}}\r\n </span>\r\n <span *ngIf=\"!showLabel && isTypeDate\">\r\n {{item[object.field]| date: 'mediumDate'}} {{isLast ? \"\" : separator}}\r\n </span>\r\n <span *ngIf=\"!showLabel && !isTypeDate\">{{item[object.field]}}{{isLast ? \"\" : separator}}\r\n </span>\r\n </span>\r\n </ng-template>\r\n <ng-template *ngIf=\"isChip\" ng-label-tmp let-item=\"item\" let-clear=\"clear\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [clear]=\"clear\" [withCross]=\"isMultiple\" [item]=\"item\"\r\n class=\"chip\" [backgroundColor]=\"chipColor\" [label]=\"item[objects[0].field]\"\r\n [width]=\"chipWidth\">\r\n </ng-chip>\r\n </ng-template>\r\n <ng-template *ngIf=\"isChip\" ng-option-tmp let-clear=\"clear\" let-item=\"item\">\r\n <ng-chip (mousedown)=\"$event.stopPropagation()\" [clear]=\"clear\" [withCross]=\"false\" [item]=\"item\"\r\n class=\"chip\" [backgroundColor]=\"chipColor\" [label]=\"item[objects[0].field]\"\r\n [width]=\"chipWidth\">\r\n </ng-chip>\r\n </ng-template>\r\n </ng-select>\r\n</div>" }]
511
- }], ctorParameters: function () { return [{ type: ChooseGeneralItemService }]; }, propDecorators: { change: [{
512
- type: Output
513
- }], items: [{
514
- type: Input
515
- }], label: [{
516
- type: Input
517
- }], appendTo: [{
518
- type: Input
519
- }], placeholder: [{
520
- type: Input
521
- }], apiPath: [{
522
- type: Input
523
- }], isMultiple: [{
524
- type: Input
525
- }], hideSelectedItem: [{
526
- type: Input
527
- }], objects: [{
528
- type: Input
529
- }], showLabel: [{
530
- type: Input
531
- }], separator: [{
532
- type: Input
533
- }], width: [{
534
- type: Input
535
- }], fontWeight: [{
536
- type: Input
537
- }], fontSize: [{
538
- type: Input
539
- }], isChip: [{
540
- type: Input
541
- }], isTypeDate: [{
542
- type: Input
543
- }], chipColor: [{
544
- type: Input
545
- }], chipTextColor: [{
546
- type: Input
547
- }], chipWidth: [{
548
- type: Input
549
- }], selectedItemId: [{
550
- type: Input
551
- }], disabled: [{
552
- type: Input
553
- }], useFullObject: [{
554
- type: Input
555
- }] } });
556
-
557
- class ChooseGeneralItemRendererComponent {
558
- constructor() { }
559
- agInit(params) {
560
- this.params = params;
561
- this.itemId = params.data.id;
562
- this.key = params.context.createKey(params.columnApi, params.column);
563
- this.rowId = params.node.id;
564
- }
565
- onCellDataChanged($event) {
566
- let value = $event;
567
- this.formControlValue = this.params.context.formGroup.get("entries").at(this.rowId);
568
- this.formControlValue.get(this.key).setValue(value);
569
- const params = {
570
- value: value,
571
- rowNode: this.params.node,
572
- };
573
- this.params.onCellValueChanged(params);
574
- }
575
- refresh(params) {
576
- return true;
577
- }
578
- }
579
- ChooseGeneralItemRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
580
- ChooseGeneralItemRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChooseGeneralItemRendererComponent, selector: "choose-general-item-renderer", ngImport: i0, template: "<choose-general-item [label]=\"params.label\" [appendTo]=\"'body'\" [placeholder]=\"params.placeholder\"\r\n [apiPath]=\"params.apiPath\" [isMultiple]=\"params.isMultiple\" [objects]=\"params.objects\"\r\n [showLabel]=\"params.showLabel\" [separator]=\"params.separator\" [width]=\"params.width\"\r\n [fontWeight]=\"params.fontWeight\" [fontSize]=\"params.fontSize\" [isChip]=\"params.isChip\"\r\n [isTypeDate]=\"params.isTypeDate\" [chipColor]=\"params.chipColor\" [chipTextColor]=\"params.chipTextColor\"\r\n [chipWidth]=\"params.chipWidth\" [selectedItemId]=\"itemId\" [disabled]=\"params.disabled\"\r\n (change)=\"onCellDataChanged($event)\">\r\n</choose-general-item>", styles: [""], dependencies: [{ kind: "component", type: ChooseGeneralItemComponent, selector: "choose-general-item", inputs: ["items", "label", "appendTo", "placeholder", "apiPath", "isMultiple", "hideSelectedItem", "objects", "showLabel", "separator", "width", "fontWeight", "fontSize", "isChip", "isTypeDate", "chipColor", "chipTextColor", "chipWidth", "selectedItemId", "disabled", "useFullObject"], outputs: ["change"] }] });
581
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemRendererComponent, decorators: [{
582
- type: Component,
583
- args: [{ selector: 'choose-general-item-renderer', template: "<choose-general-item [label]=\"params.label\" [appendTo]=\"'body'\" [placeholder]=\"params.placeholder\"\r\n [apiPath]=\"params.apiPath\" [isMultiple]=\"params.isMultiple\" [objects]=\"params.objects\"\r\n [showLabel]=\"params.showLabel\" [separator]=\"params.separator\" [width]=\"params.width\"\r\n [fontWeight]=\"params.fontWeight\" [fontSize]=\"params.fontSize\" [isChip]=\"params.isChip\"\r\n [isTypeDate]=\"params.isTypeDate\" [chipColor]=\"params.chipColor\" [chipTextColor]=\"params.chipTextColor\"\r\n [chipWidth]=\"params.chipWidth\" [selectedItemId]=\"itemId\" [disabled]=\"params.disabled\"\r\n (change)=\"onCellDataChanged($event)\">\r\n</choose-general-item>" }]
584
- }], ctorParameters: function () { return []; } });
585
-
586
- var LineType;
587
- (function (LineType) {
588
- LineType[LineType["INCLUDE"] = 0] = "INCLUDE";
589
- LineType[LineType["DO_NOT_INCLUDE"] = 1] = "DO_NOT_INCLUDE";
590
- })(LineType || (LineType = {}));
591
-
592
- class LineTypeModelHelper {
593
- static getItems() {
594
- let items = [];
595
- let values = Object.values(LineType);
596
- let types = values.filter(value => typeof value === 'number');
597
- for (let value of types) {
598
- this.setStringValueAndColor(value);
599
- items.push({ value: value, label: this.label, color: this.color, description: this.description });
600
- }
601
- return items;
602
- }
603
- static setStringValueAndColor(type) {
604
- switch (type) {
605
- case LineType.INCLUDE:
606
- return this.label = "Include", this.color = "gold";
607
- break;
608
- case LineType.DO_NOT_INCLUDE:
609
- return this.label = "Do Not Include", this.color = "platinum";
610
- break;
611
- default:
612
- return this.label = "Undefined", this.color = "Gray";
613
- }
614
- }
615
- getValue(label) {
616
- let value;
617
- switch (label) {
618
- case "Include":
619
- return value = 0;
620
- break;
621
- case "Do Not Include":
622
- return value = 1;
623
- break;
624
- default:
625
- return null;
626
- }
627
- }
628
- static getLabelAndColorForValue(value) {
629
- for (let item of this.getItems()) {
630
- if (item.value == value) {
631
- this.value = item;
632
- return this.value;
633
- }
634
- }
635
- }
636
- }
637
-
638
- class ChooseLineTypeComponent {
639
- constructor() {
640
- this.items = LineTypeModelHelper;
641
- this.propagateChange = (_) => { };
642
- this.propogateTouch = () => { };
643
- }
644
- ngOnInit() {
645
- this.types = this.items.getItems();
646
- }
647
- writeValue(type) {
648
- if (type != undefined || type != null) {
649
- this.selectedItem = type;
650
- }
651
- }
652
- registerOnChange(fn) {
653
- this.propagateChange = fn;
654
- }
655
- registerOnTouched(fn) {
656
- this.propogateTouch = fn;
657
- }
658
- updateBlur() {
659
- this.propogateTouch();
660
- }
661
- onSelectedItemChanged() {
662
- this.propagateChange(this.selectedItem);
663
- }
664
- }
665
- ChooseLineTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseLineTypeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
666
- ChooseLineTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChooseLineTypeComponent, selector: "choose-line-type", providers: [
667
- {
668
- provide: NG_VALUE_ACCESSOR,
669
- useExisting: forwardRef(() => ChooseLineTypeComponent),
670
- multi: true,
671
- },
672
- ], ngImport: i0, template: "<div class=\"select\">\r\n <ng-select class=\"type\" appendTo=\"body\" (blur)=\"updateBlur()\" bindLabel=\"label\" bindValue=\"label\" [items]=\"types\"\r\n [placeholder]=\"'Choose A Component'\" (change)=\"onSelectedItemChanged()\" [(ngModel)]=\"selectedItem\">\r\n <ng-template class=\"template\" ng-option-tmp ng-label-tmp let-item=\"item\" let-index=\"index\">\r\n {{item.label}}\r\n </ng-template>\r\n </ng-select>\r\n</div>", styles: [".type{width:250px}\n"], dependencies: [{ kind: "component", type: i2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i2.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { 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"] }] });
673
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseLineTypeComponent, decorators: [{
674
- type: Component,
675
- args: [{ selector: 'choose-line-type', providers: [
676
- {
677
- provide: NG_VALUE_ACCESSOR,
678
- useExisting: forwardRef(() => ChooseLineTypeComponent),
679
- multi: true,
680
- },
681
- ], template: "<div class=\"select\">\r\n <ng-select class=\"type\" appendTo=\"body\" (blur)=\"updateBlur()\" bindLabel=\"label\" bindValue=\"label\" [items]=\"types\"\r\n [placeholder]=\"'Choose A Component'\" (change)=\"onSelectedItemChanged()\" [(ngModel)]=\"selectedItem\">\r\n <ng-template class=\"template\" ng-option-tmp ng-label-tmp let-item=\"item\" let-index=\"index\">\r\n {{item.label}}\r\n </ng-template>\r\n </ng-select>\r\n</div>", styles: [".type{width:250px}\n"] }]
682
- }], ctorParameters: function () { return []; } });
683
-
684
- class ChooseYesOrNoComponent {
685
- constructor() {
686
- this.change = new EventEmitter();
687
- this.items = [{ value: true, label: "Yes", color: "green" }, { value: false, label: "No", color: "red" }];
688
- this.width = 200;
689
- this.placeholder = "Choose either Yes or No";
690
- this.propagateChange = (_) => { };
691
- this.propogateTouch = () => { };
692
- }
693
- ngOnInit() {
694
- }
695
- writeValue(item) {
696
- if (item != undefined || item != null) {
697
- this.selectedItemValue = item;
698
- }
699
- }
700
- registerOnChange(fn) {
701
- this.propagateChange = fn;
702
- }
703
- registerOnTouched(fn) {
704
- this.propogateTouch = fn;
705
- }
706
- updateBlur() {
707
- this.propogateTouch();
708
- }
709
- onSelectedItemChanged() {
710
- this.propagateChange(this.selectedItemValue);
711
- this.change.emit(this.selectedItemValue);
712
- }
713
- setWidth() {
714
- let style = {
715
- width: this.width + "px"
716
- };
717
- return style;
718
- }
719
- }
720
- ChooseYesOrNoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseYesOrNoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
721
- ChooseYesOrNoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChooseYesOrNoComponent, selector: "choose-yes-or-no", inputs: { width: "width", selectedItemValue: "selectedItemValue", placeholder: "placeholder" }, outputs: { change: "change" }, providers: [
722
- {
723
- provide: NG_VALUE_ACCESSOR,
724
- useExisting: forwardRef(() => ChooseYesOrNoComponent),
725
- multi: true
726
- }
727
- ], ngImport: i0, template: "<div class=\"select\">\r\n <ng-select [ngStyle]=\"setWidth()\" class=\"component\" appendTo=\"body\" (blur)=\"updateBlur()\" [placeholder]=\"placeholder\" bindLabel=\"label\"\r\n bindValue=\"value\" [items]=\"items\" [placeholder]=\"placeholder\" (change)=\"onSelectedItemChanged()\"\r\n [(ngModel)]=\"selectedItemValue\" >\r\n <ng-template class=\"template\" ng-option-tmp ng-label-tmp let-item=\"item\" let-index=\"index\"\r\n let-search=\"searchTerm\">\r\n <span [style.color]=\"item.color\">\r\n {{item.label}}\r\n </span>\r\n </ng-template>\r\n </ng-select>\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "directive", type: i2.NgLabelTemplateDirective, selector: "[ng-label-tmp]" }, { 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"] }] });
728
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseYesOrNoComponent, decorators: [{
729
- type: Component,
730
- args: [{ selector: 'choose-yes-or-no', providers: [
731
- {
732
- provide: NG_VALUE_ACCESSOR,
733
- useExisting: forwardRef(() => ChooseYesOrNoComponent),
734
- multi: true
735
- }
736
- ], template: "<div class=\"select\">\r\n <ng-select [ngStyle]=\"setWidth()\" class=\"component\" appendTo=\"body\" (blur)=\"updateBlur()\" [placeholder]=\"placeholder\" bindLabel=\"label\"\r\n bindValue=\"value\" [items]=\"items\" [placeholder]=\"placeholder\" (change)=\"onSelectedItemChanged()\"\r\n [(ngModel)]=\"selectedItemValue\" >\r\n <ng-template class=\"template\" ng-option-tmp ng-label-tmp let-item=\"item\" let-index=\"index\"\r\n let-search=\"searchTerm\">\r\n <span [style.color]=\"item.color\">\r\n {{item.label}}\r\n </span>\r\n </ng-template>\r\n </ng-select>\r\n</div>\r\n" }]
737
- }], ctorParameters: function () { return []; }, propDecorators: { change: [{
738
- type: Output
739
- }], width: [{
740
- type: Input
741
- }], selectedItemValue: [{
742
- type: Input
743
- }], placeholder: [{
744
- type: Input
745
- }] } });
746
-
747
- class ChooseYesOrNoRendererComponent {
748
- constructor() { }
749
- agInit(params) {
750
- this.params = params;
751
- this.booleanValue = params.value;
752
- this.key = params.context.createKey(params.columnApi, params.column);
753
- this.rowId = params.node.id;
754
- }
755
- onCellDataChanged($event) {
756
- let value = $event;
757
- this.formControlValue = this.params.context.formGroup.get("entries").at(this.rowId);
758
- this.formControlValue.get(this.key).setValue(value);
759
- }
760
- refresh(params) {
761
- return false;
762
- }
763
- }
764
- ChooseYesOrNoRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseYesOrNoRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
765
- ChooseYesOrNoRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChooseYesOrNoRendererComponent, selector: "choose-yes-or-no-renderer", ngImport: i0, template: "<choose-yes-or-no [selectedItemValue]=\"booleanValue\" [width]=\"params.width\" (change) =\"onCellDataChanged($event)\" [placeholder]=\"params.placeholder\" ></choose-yes-or-no>", styles: [""], dependencies: [{ kind: "component", type: ChooseYesOrNoComponent, selector: "choose-yes-or-no", inputs: ["width", "selectedItemValue", "placeholder"], outputs: ["change"] }] });
766
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseYesOrNoRendererComponent, decorators: [{
767
- type: Component,
768
- args: [{ selector: 'choose-yes-or-no-renderer', template: "<choose-yes-or-no [selectedItemValue]=\"booleanValue\" [width]=\"params.width\" (change) =\"onCellDataChanged($event)\" [placeholder]=\"params.placeholder\" ></choose-yes-or-no>" }]
769
- }], ctorParameters: function () { return []; } });
770
-
771
- const PIPEMAPPINGS = [
772
- { value: '$', pipe: new CurrencyPipe('en-US') }
773
- ];
774
-
775
- class DynamicPipe {
776
- transform(value, args) {
777
- for (let val of PIPEMAPPINGS) {
778
- if (val.value === args) {
779
- return val.pipe.transform(value);
780
- }
781
- }
782
- return '';
783
- }
784
- }
785
- DynamicPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DynamicPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
786
- DynamicPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DynamicPipe, name: "dynamicPipe" });
787
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DynamicPipe, decorators: [{
788
- type: Pipe,
789
- args: [{ name: 'dynamicPipe' }]
790
- }] });
791
-
792
- class EditableSavableInputComponent {
793
- constructor() {
794
- this.saveWasClicked = new EventEmitter();
795
- this.showUnit = false;
796
- this.isEditable = true;
797
- this.showHeader = true;
798
- this.value = "";
799
- this.isAddClickedOn = false;
800
- this.isUpdated = false;
801
- this.showEdit = false;
802
- // the method set in registerOnChange to emit changes back to the form
803
- this.propagateChange = (_) => { };
804
- this.propogateTouch = () => { };
805
- }
806
- ngOnInit() {
807
- this.initialize();
808
- }
809
- initialize() {
810
- if (this.value == "") {
811
- this.isUpdated = false;
812
- }
813
- else {
814
- this.isUpdated = true;
815
- }
816
- }
817
- onClickAdd() {
818
- this.isAddClickedOn = true;
819
- }
820
- onClickCancel() {
821
- this.isAddClickedOn = false;
822
- }
823
- onClickSave(input) {
824
- this.isAddClickedOn = false;
825
- let value = input.value;
826
- if (value.trim().length == 0) {
827
- this.isUpdated = false;
828
- }
829
- else {
830
- this.isUpdated = true;
831
- }
832
- this.value = value;
833
- this.saveWasClicked.emit(value);
834
- this.propagateChange(this.value);
835
- }
836
- onClickEdit() {
837
- this.isAddClickedOn = true;
838
- }
839
- onMouseEnter() {
840
- this.showEdit = true;
841
- }
842
- onMouseLeave() {
843
- this.showEdit = false;
844
- }
845
- writeValue(value) {
846
- if (value) {
847
- this.value = value;
848
- this.isUpdated = true;
849
- }
850
- }
851
- // registers 'fn' that will be fired wheb changes are made
852
- // this is how we emit the changes back to the form
853
- registerOnChange(fn) {
854
- this.propagateChange = fn;
855
- }
856
- registerOnTouched(fn) {
857
- this.propogateTouch = fn;
858
- }
859
- onChange($event) {
860
- //this.propagateChange(this.value);
861
- }
862
- updateBlur() {
863
- this.propogateTouch();
864
- }
865
- }
866
- EditableSavableInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EditableSavableInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
867
- EditableSavableInputComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: EditableSavableInputComponent, selector: "editable-savable-input", inputs: { defaultvalue: "defaultvalue", inputType: "inputType", newLabel: "newLabel", headerLabel: "headerLabel", showUnit: "showUnit", unit: "unit", unitType: "unitType", isEditable: "isEditable", showHeader: "showHeader", value: "value" }, outputs: { saveWasClicked: "saveWasClicked" }, providers: [DynamicPipe,
868
- {
869
- provide: NG_VALUE_ACCESSOR,
870
- useExisting: forwardRef(() => EditableSavableInputComponent),
871
- multi: true
872
- }
873
- ], ngImport: i0, template: "<div *ngIf=\"showHeader\" class=\"header\">\r\n {{headerLabel}}\r\n</div>\r\n<div class=\"container\" [ngClass]=\"{'closed':!isAddClickedOn, 'open': isAddClickedOn}\">\r\n <div class=\"content\">\r\n <div class=\"default-content\" *ngIf=\"!isAddClickedOn && !isUpdated && isEditable\">\r\n <div class=\"add\" (click)=\"onClickAdd()\">\r\n {{defaultvalue}} </div>\r\n </div>\r\n <div class=\"edit-content\" *ngIf=\"isAddClickedOn\">\r\n <label class=\"input-label\" for=\"input\">{{newLabel}}</label>\r\n <div class=\"input \" [ngClass]=\"{'input-with-appended-unit': showUnit}\">\r\n <span *ngIf=\"showUnit\">{{unit}}</span>\r\n <input (change)=\"onChange($event)\" (blur)=\"updateBlur()\" [ngModel]=\"value\" [value]=\"value\" id=\"input\" #input\r\n class=\"form-control\" [ngClass]=\"{'input-box': showUnit}\" [type]=\"inputType\">\r\n </div>\r\n <div class=\"edit-actions\">\r\n <button type=\"button\" class=\"btn cancel\" (click)=\"onClickCancel()\" mat-raised-button>Cancel</button>\r\n <button type=\"button\" class=\"save\" (click)=\"onClickSave(input)\" mat-raised-button color=\"primary\">Save</button>\r\n </div>\r\n </div>\r\n <div class=\"updated-content closed\" *ngIf=\"!isAddClickedOn && isUpdated\" (mouseenter)=\"onMouseEnter()\"\r\n (mouseleave)=\"onMouseLeave()\">\r\n <div class=\"edit-icon-container\" *ngIf=\"showEdit && isEditable\" (click)=\"onClickEdit()\">\r\n <i class=\"fas fa-pencil-alt\"></i>\r\n </div>\r\n <div class=\"updated\">\r\n <span class=\"updated-label\">\r\n <label for=\"input\">{{newLabel}}</label>\r\n </span>\r\n <span *ngIf=\"!showUnit\">{{value}}</span>\r\n <span *ngIf=\"showUnit\" class=\"updated-value\">\r\n {{value | dynamicPipe: unitType}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".container{display:block;width:100%}.open{height:120px}.closed{height:40px}.edit-icon-container{position:absolute;right:0%;transform:translate(0);top:0;cursor:pointer}.edit-icon-container:hover{background-color:gray;color:#fff;padding:2px}label,.updated-label{color:gray;margin-right:5px}#input{display:inline}.cancel{grid-column:1;grid-row:2;height:80%;width:80px}.save{grid-column:2;grid-row:2;height:80%;width:80px}.default-content{position:absolute}.input{width:280px;grid-column:2;grid-row:1}.input-box{width:200px}.input-label{grid-column:1;grid-row:1}.updated{position:absolute}.add{color:#00f}.add:hover{text-decoration:underline;cursor:pointer}.content{position:relative}.btn:focus{outline:none!important}.edit-content{position:absolute;left:50%;transform:translate(-50%);display:grid;grid-template-columns:150px 200px;grid-template-rows:50px 50px}.updated-content{display:block}.header{color:gray;border-bottom:1px solid grey;height:30px;font-size:20px;margin-bottom:10px;margin-top:10px}.input-with-appended-unit input{padding-left:20px;text-align:left}.input-with-appended-unit span{position:relative;left:20px;color:gray}.edit-actions{grid-column:2;grid-row:2;display:grid;grid-template-columns:50% 50%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$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.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "pipe", type: DynamicPipe, name: "dynamicPipe" }] });
874
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EditableSavableInputComponent, decorators: [{
875
- type: Component,
876
- args: [{ selector: 'editable-savable-input', providers: [DynamicPipe,
877
- {
878
- provide: NG_VALUE_ACCESSOR,
879
- useExisting: forwardRef(() => EditableSavableInputComponent),
880
- multi: true
881
- }
882
- ], template: "<div *ngIf=\"showHeader\" class=\"header\">\r\n {{headerLabel}}\r\n</div>\r\n<div class=\"container\" [ngClass]=\"{'closed':!isAddClickedOn, 'open': isAddClickedOn}\">\r\n <div class=\"content\">\r\n <div class=\"default-content\" *ngIf=\"!isAddClickedOn && !isUpdated && isEditable\">\r\n <div class=\"add\" (click)=\"onClickAdd()\">\r\n {{defaultvalue}} </div>\r\n </div>\r\n <div class=\"edit-content\" *ngIf=\"isAddClickedOn\">\r\n <label class=\"input-label\" for=\"input\">{{newLabel}}</label>\r\n <div class=\"input \" [ngClass]=\"{'input-with-appended-unit': showUnit}\">\r\n <span *ngIf=\"showUnit\">{{unit}}</span>\r\n <input (change)=\"onChange($event)\" (blur)=\"updateBlur()\" [ngModel]=\"value\" [value]=\"value\" id=\"input\" #input\r\n class=\"form-control\" [ngClass]=\"{'input-box': showUnit}\" [type]=\"inputType\">\r\n </div>\r\n <div class=\"edit-actions\">\r\n <button type=\"button\" class=\"btn cancel\" (click)=\"onClickCancel()\" mat-raised-button>Cancel</button>\r\n <button type=\"button\" class=\"save\" (click)=\"onClickSave(input)\" mat-raised-button color=\"primary\">Save</button>\r\n </div>\r\n </div>\r\n <div class=\"updated-content closed\" *ngIf=\"!isAddClickedOn && isUpdated\" (mouseenter)=\"onMouseEnter()\"\r\n (mouseleave)=\"onMouseLeave()\">\r\n <div class=\"edit-icon-container\" *ngIf=\"showEdit && isEditable\" (click)=\"onClickEdit()\">\r\n <i class=\"fas fa-pencil-alt\"></i>\r\n </div>\r\n <div class=\"updated\">\r\n <span class=\"updated-label\">\r\n <label for=\"input\">{{newLabel}}</label>\r\n </span>\r\n <span *ngIf=\"!showUnit\">{{value}}</span>\r\n <span *ngIf=\"showUnit\" class=\"updated-value\">\r\n {{value | dynamicPipe: unitType}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".container{display:block;width:100%}.open{height:120px}.closed{height:40px}.edit-icon-container{position:absolute;right:0%;transform:translate(0);top:0;cursor:pointer}.edit-icon-container:hover{background-color:gray;color:#fff;padding:2px}label,.updated-label{color:gray;margin-right:5px}#input{display:inline}.cancel{grid-column:1;grid-row:2;height:80%;width:80px}.save{grid-column:2;grid-row:2;height:80%;width:80px}.default-content{position:absolute}.input{width:280px;grid-column:2;grid-row:1}.input-box{width:200px}.input-label{grid-column:1;grid-row:1}.updated{position:absolute}.add{color:#00f}.add:hover{text-decoration:underline;cursor:pointer}.content{position:relative}.btn:focus{outline:none!important}.edit-content{position:absolute;left:50%;transform:translate(-50%);display:grid;grid-template-columns:150px 200px;grid-template-rows:50px 50px}.updated-content{display:block}.header{color:gray;border-bottom:1px solid grey;height:30px;font-size:20px;margin-bottom:10px;margin-top:10px}.input-with-appended-unit input{padding-left:20px;text-align:left}.input-with-appended-unit span{position:relative;left:20px;color:gray}.edit-actions{grid-column:2;grid-row:2;display:grid;grid-template-columns:50% 50%}\n"] }]
883
- }], ctorParameters: function () { return []; }, propDecorators: { saveWasClicked: [{
884
- type: Output
885
- }], defaultvalue: [{
886
- type: Input
887
- }], inputType: [{
888
- type: Input
889
- }], newLabel: [{
890
- type: Input
891
- }], headerLabel: [{
892
- type: Input
893
- }], showUnit: [{
894
- type: Input
895
- }], unit: [{
896
- type: Input
897
- }], unitType: [{
898
- type: Input
899
- }], isEditable: [{
900
- type: Input
901
- }], showHeader: [{
902
- type: Input
903
- }], value: [{
904
- type: Input
905
- }] } });
906
-
907
- class CustomDecimalPointTwoDigitsDirective {
908
- constructor(control) {
909
- this.control = control;
910
- }
911
- ngOnInit() {
912
- if (this.control.value) {
913
- this.control.valueAccessor.writeValue(this.transformToCommasAndPoint(this.control.value));
914
- }
915
- this.valueSubscription = this.control.control.valueChanges.subscribe(value => {
916
- if (value.length > 0) {
917
- let removeCommas = this.control.value.replace(/,/g, '');
918
- this.control.control.setValue(removeCommas, { emitEvent: false, emitModelToViewChange: false });
919
- }
920
- else {
921
- this.control.control.setValue(null, { emitEvent: false, emitModelToViewChange: false });
922
- }
923
- });
924
- }
925
- onEvent($event) {
926
- if (this.control.value) {
927
- const item = $event.target;
928
- item.value = this.transformToCommasAndPoint(this.control.value);
929
- let removeCommas = this.control.value.replace(/,/g, '');
930
- this.control.control.setValue(removeCommas, { emitEvent: false, emitModelToViewChange: false });
931
- }
932
- }
933
- transformToCommasAndPoint(value) {
934
- if (value.indexOf(".") == -1) {
935
- value = value.toString().replace(/\D/g, "")
936
- .replace(/\B(?=(\d{3})+(?!\d))/g, ",");
937
- return value;
938
- }
939
- else {
940
- let val = value.split(".");
941
- let valueBeforeDecimal = val[0];
942
- let valueAfterDecimal = val[1];
943
- valueBeforeDecimal = valueBeforeDecimal.toString().replace(/\D/g, "")
944
- .replace(/\B(?=(\d{3})+(?!\d))/g, ",");
945
- let newValue = `${valueBeforeDecimal}.${valueAfterDecimal}`;
946
- return newValue;
947
- }
948
- }
949
- }
950
- CustomDecimalPointTwoDigitsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CustomDecimalPointTwoDigitsDirective, deps: [{ token: i2$1.NgControl }], target: i0.ɵɵFactoryTarget.Directive });
951
- CustomDecimalPointTwoDigitsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: CustomDecimalPointTwoDigitsDirective, selector: "[customDecimalPointTwoDigits]", host: { listeners: { "input": "onEvent($event)" } }, providers: [NgModel, DecimalPipe], ngImport: i0 });
952
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CustomDecimalPointTwoDigitsDirective, decorators: [{
953
- type: Directive,
954
- args: [{
955
- selector: '[customDecimalPointTwoDigits]',
956
- providers: [NgModel, DecimalPipe],
957
- }]
958
- }], ctorParameters: function () { return [{ type: i2$1.NgControl }]; }, propDecorators: { onEvent: [{
959
- type: HostListener,
960
- args: ["input", ["$event"]]
961
- }] } });
962
-
963
- class ValidationMessageService {
964
- }
965
- ValidationMessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidationMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
966
- ValidationMessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidationMessageService, providedIn: 'root' });
967
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidationMessageService, decorators: [{
968
- type: Injectable,
969
- args: [{
970
- providedIn: 'root'
971
- }]
972
- }] });
973
- class MinLengthValidationError {
974
- constructor(requirement) {
975
- this.requirement = requirement;
976
- }
977
- buildMessage() {
978
- return "Must be a minimum length of " + this.requirement + " letters!";
979
- }
980
- }
981
- class InvalidIntegerNumberValidatorEerror {
982
- buildMessage() {
983
- return "Must only contain numbers, no decimals or words allowed";
984
- }
985
- }
986
- class PositiveIntegerNumberValidatorError {
987
- buildMessage() {
988
- return "Must be a positive integer";
989
- }
990
- }
991
- class MaxLengthValidationError {
992
- constructor(requirement) {
993
- this.requirement = requirement;
994
- }
995
- buildMessage() {
996
- return "Must be a maximum length of " + this.requirement + " letters!";
997
- }
998
- }
999
- class MaxValidationError {
1000
- constructor(requirement) {
1001
- this.requirement = requirement;
1002
- }
1003
- buildMessage() {
1004
- return "The largest acceptable input is " + this.requirement;
1005
- }
1006
- }
1007
- class MinValidationError {
1008
- constructor(requirement) {
1009
- this.requirement = requirement;
1010
- }
1011
- buildMessage() {
1012
- return "The smallest acceptable input is " + this.requirement;
1013
- }
1014
- }
1015
- class PatternValidatorError {
1016
- constructor(requirement) {
1017
- this.requirement = requirement;
1018
- }
1019
- buildMessage() {
1020
- if (this.requirement == '^[a-zA-Z ]*$') {
1021
- return "This field must only contain words ";
1022
- }
1023
- else if (this.requirement == '/[0-9]-[0-9]+$/') {
1024
- return "This field must only contain numbers and a - " + "<br>" + "Example: 71-716971";
1025
- }
1026
- else if (this.requirement = 'forDate') {
1027
- return "Date needs to be DD/MM/YYYY";
1028
- }
1029
- }
1030
- }
1031
- class RequiredValidatorError {
1032
- buildMessage() {
1033
- return "This Field Is Required";
1034
- }
1035
- }
1036
- class EmailValidatorError {
1037
- buildMessage() {
1038
- return "Make Sure It Is An Email Format" + "<br>" + "example@jooler.io";
1039
- }
1040
- }
1041
- class ValidationError {
1042
- static getRelevantError(validationType, validationValue) {
1043
- let validationMessage;
1044
- validationMessage = this.MessageDictionary(validationValue, validationType);
1045
- return validationMessage;
1046
- }
1047
- static MessageDictionary(value, validationType) {
1048
- let ValidationMessageForInput = {
1049
- 'minlength': new MinLengthValidationError(value).buildMessage(),
1050
- 'maxlength': new MaxLengthValidationError(value).buildMessage(),
1051
- 'max': new MaxValidationError(value).buildMessage(),
1052
- 'min': new MinValidationError(value).buildMessage(),
1053
- 'pattern': new PatternValidatorError(value).buildMessage(),
1054
- 'required': new RequiredValidatorError().buildMessage(),
1055
- 'email': new EmailValidatorError().buildMessage(),
1056
- 'invalidIntegerNumber': new InvalidIntegerNumberValidatorEerror().buildMessage(),
1057
- 'invalidPositiveInteger': new PositiveIntegerNumberValidatorError().buildMessage(),
1058
- };
1059
- return ValidationMessageForInput[validationType];
1060
- }
1061
- }
1062
- ValidationError.validationMessageForDate = {
1063
- 'required': new RequiredValidatorError().buildMessage(),
1064
- 'pattern': new PatternValidatorError('forDate').buildMessage(),
1065
- };
1066
-
1067
- class FormControlValidationMsgDirectiveForInput {
1068
- constructor(elRef, control) {
1069
- this.elRef = elRef;
1070
- this.control = control;
1071
- this.showBoxError = true;
1072
- this.beforeBegin = false;
1073
- this.afterEnd = false;
1074
- this.validationError = ValidationError;
1075
- }
1076
- ngOnInit() {
1077
- this.statusChangeSubscription = this.control.statusChanges.subscribe((status) => {
1078
- if (status == 'INVALID') {
1079
- this.showError();
1080
- }
1081
- else {
1082
- this.removeError();
1083
- }
1084
- });
1085
- this.control.valueChanges.subscribe({
1086
- next: (response) => {
1087
- if (this.control.errors) {
1088
- this.showError();
1089
- }
1090
- }
1091
- });
1092
- }
1093
- ngOnDestroy() {
1094
- this.statusChangeSubscription.unsubscribe();
1095
- }
1096
- handleBlurEvent(event) {
1097
- if (this.control.errors) {
1098
- this.showError();
1099
- }
1100
- else {
1101
- this.removeError();
1102
- }
1103
- }
1104
- showError() {
1105
- this.removeError();
1106
- const valErrors = this.control.errors;
1107
- const keys = Object.keys(valErrors);
1108
- for (let i = 0; i < keys.length; i++) {
1109
- switch (keys[i]) {
1110
- case 'minlength': {
1111
- let message = this.validationError.getRelevantError(keys[i], valErrors.minlength.requiredLength);
1112
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1113
- break;
1114
- }
1115
- case 'required': {
1116
- let message = this.validationError.getRelevantError(keys[i], valErrors);
1117
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1118
- this.control.control.setErrors({ 'required': true, 'message': message }, { emitEvent: false });
1119
- break;
1120
- }
1121
- case 'maxlength': {
1122
- let message = this.validationError.getRelevantError(keys[i], valErrors.maxlength.requiredLength);
1123
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1124
- this.control.control.setErrors({ 'maxlength': { 'requiredLength': valErrors.maxlength.requiredLength }, 'message': message }, { emitEvent: false });
1125
- break;
1126
- }
1127
- case 'max': {
1128
- let message = this.validationError.getRelevantError(keys[i], valErrors.max.max);
1129
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1130
- this.control.control.setErrors({ 'message': message, 'max': { 'max': valErrors.max.max } }, { emitEvent: false });
1131
- break;
1132
- }
1133
- case 'min': {
1134
- let message = this.validationError.getRelevantError(keys[i], valErrors.min.min);
1135
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1136
- break;
1137
- }
1138
- case 'pattern': {
1139
- let message = this.validationError.getRelevantError(keys[i], valErrors.pattern.requiredPattern);
1140
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1141
- break;
1142
- }
1143
- case 'email': {
1144
- let message = this.validationError.getRelevantError(keys[i], valErrors);
1145
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1146
- break;
1147
- }
1148
- case 'invalidIntegerNumber': {
1149
- let message = this.validationError.getRelevantError(keys[i], valErrors);
1150
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1151
- break;
1152
- }
1153
- case 'invalidPositiveInteger': {
1154
- let message = this.validationError.getRelevantError(keys[i], valErrors);
1155
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1156
- this.control.control.setErrors({ 'invalidPositiveInteger': true, 'message': message }, { emitEvent: false });
1157
- break;
1158
- }
1159
- }
1160
- }
1161
- if (this.showBoxError) {
1162
- const errDiv = '<div style="color:#C34243; width=100%; background-color: #FFDBDB; padding: 1rem; border-radius: .5rem; border: .1rem solid #A80002 ;border-left: .75rem solid #A80002; margin-top:.5rem; font-size: 1.2rem; " id="' + this.errorDivId + '">' + '<h3 style= " font-size: 1.3rem; margin-bottom:.5rem; margin:0; color: #A80002; font-weight: 700; line-height: 1.6rem;">' + 'Please Complete all details' + '</h3>' + this.errorMessage + '</div>';
1163
- if (!this.beforeBegin && !this.afterEnd)
1164
- this.elRef.nativeElement.parentElement.parentElement.parentElement.parentElement.insertAdjacentHTML('afterend', errDiv);
1165
- else if (this.beforeBegin)
1166
- this.elRef.nativeElement.insertAdjacentHTML('beforebegin', errDiv);
1167
- else if (this.afterEnd)
1168
- this.elRef.nativeElement.insertAdjacentHTML('afterend', errDiv);
1169
- else
1170
- throw Error("Adjustment not specified ");
1171
- }
1172
- }
1173
- removeError() {
1174
- this.errorMessage = "";
1175
- const errorElement = document.getElementById(this.errorDivId);
1176
- if (errorElement) {
1177
- errorElement.remove();
1178
- }
1179
- }
1180
- }
1181
- FormControlValidationMsgDirectiveForInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormControlValidationMsgDirectiveForInput, deps: [{ token: i0.ElementRef }, { token: i2$1.NgControl }], target: i0.ɵɵFactoryTarget.Directive });
1182
- FormControlValidationMsgDirectiveForInput.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: FormControlValidationMsgDirectiveForInput, selector: "[appFormControlValidationMsgForInputs]", inputs: { showBoxError: "showBoxError", errorDivId: "errorDivId", beforeBegin: "beforeBegin", afterEnd: "afterEnd" }, host: { listeners: { "blur": "handleBlurEvent($event)" } }, providers: [NgModel], ngImport: i0 });
1183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormControlValidationMsgDirectiveForInput, decorators: [{
1184
- type: Directive,
1185
- args: [{
1186
- selector: '[appFormControlValidationMsgForInputs]',
1187
- providers: [NgModel],
1188
- }]
1189
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2$1.NgControl }]; }, propDecorators: { showBoxError: [{
1190
- type: Input,
1191
- args: ['showBoxError']
1192
- }], errorDivId: [{
1193
- type: Input,
1194
- args: ['errorDivId']
1195
- }], beforeBegin: [{
1196
- type: Input,
1197
- args: ['beforeBegin']
1198
- }], afterEnd: [{
1199
- type: Input,
1200
- args: ['afterEnd']
1201
- }], handleBlurEvent: [{
1202
- type: HostListener,
1203
- args: ['blur', ["$event"]]
1204
- }] } });
1205
-
1206
- class GeneralInputRendererComponent {
1207
- constructor() { }
1208
- agInit(params) {
1209
- this.params = params;
1210
- this.formGroup = this.params.context.formGroup.get('entries').at(params.node.rowIndex);
1211
- this.key = params.context.createKey(params.columnApi, params.column);
1212
- if (params.isTypeNumber) {
1213
- if (params.value) {
1214
- this.value = new DecimalPipe("en-US").transform(+params.value, "1.0-0");
1215
- }
1216
- }
1217
- else {
1218
- this.value = params.value;
1219
- }
1220
- }
1221
- onCellDataChanged($event) {
1222
- var _a;
1223
- let value = $event.target.value;
1224
- let newAndOldValue = {
1225
- newValue: value,
1226
- oldValue: (_a = this.params) === null || _a === void 0 ? void 0 : _a.value
1227
- };
1228
- if (this.params.allowUpdateRowData) {
1229
- this.params.onChange(newAndOldValue);
1230
- }
1231
- }
1232
- refresh(params) {
1233
- this.formGroup = this.params.context.formGroup.get('entries').at(params.node.rowIndex);
1234
- return true;
1235
- }
1236
- }
1237
- GeneralInputRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GeneralInputRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1238
- GeneralInputRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: GeneralInputRendererComponent, selector: "general-input-renderer-test", ngImport: i0, template: "<div *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\r\n <div *ngIf=\"params.isTypeText\">\r\n <input [placeholder]=\"params.fieldLabel\"appFormControlValidationMsgForInputs [showBoxError]=\"false\"\r\n [errorDivId]=\"'text'\" \r\n (change)=\"onCellDataChanged($event)\" [formControlName]=\"key\" />\r\n <span *ngIf=\"params.showSymbol\"\r\n style=\"margin-left:-20px ;\">{{params.symbol}}</span>\r\n <show-table-errors\r\n *ngIf=\"formGroup.get(this.key).errors && formGroup.get(this.key) && formGroup.get(this.key).touched\"\r\n [message]=\"formGroup.get(this.key).errors.message\"></show-table-errors>\r\n </div>\r\n <div *ngIf=\"params.isTypeNumber\">\r\n <input customDecimalPointTwoDigits appFormControlValidationMsgForInputs [showBoxError]=\"false\"\r\n [errorDivId]=\"'number'\" [placeholder]=\"params.fieldLabel\"\r\n (change)=\"onCellDataChanged($event)\" [formControlName]=\"key\" />\r\n <span *ngIf=\"params.showSymbol\"\r\n style=\"margin-left:-20px ;\">{{params.symbol}}</span>\r\n <show-table-errors\r\n *ngIf=\"formGroup.get(this.key).errors && formGroup.get(this.key).touched\"\r\n [message]=\"formGroup.get(this.key).errors.message\"></show-table-errors>\r\n </div>\r\n <div *ngIf=\"params.isTypeIntegerNumber\">\r\n <input appFormControlValidationMsgForInputs [showBoxError]=\"false\"type=\"number\"\r\n [errorDivId]=\"'integer'\" [placeholder]=\"params.fieldLabel\"\r\n (change)=\"onCellDataChanged($event)\" [formControlName]=\"key\" />\r\n <span *ngIf=\"params.showSymbol\"\r\n style=\"margin-left:-20px ;\">{{params.symbol}}</span>\r\n <show-table-errors\r\n *ngIf=\"formGroup.get(this.key).errors && formGroup.get(this.key).touched\"\r\n [message]=\"formGroup.get(this.key).errors.message\"></show-table-errors>\r\n </div>\r\n <div *ngIf=\"params.isTypeTextArea\">\r\n <textarea class=\"text-area\" (change)=\"onCellDataChanged($event)\"\r\n [placeholder]=\"params.fieldLabel\" class=\"main-height\"\r\n [formControlName]=\"key\"></textarea>\r\n </div>\r\n</div>", styles: ["textarea{padding-left:.5rem;border-radius:.3rem;height:3.5rem;font-size:1.2rem;border:solid #BEBEBE .1rem}textarea:focus{outline:none}textarea::placeholder{color:#676767}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { 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"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: CustomDecimalPointTwoDigitsDirective, selector: "[customDecimalPointTwoDigits]" }, { kind: "component", type: ShowTableErrorsComponent, selector: "show-table-errors", inputs: ["message"] }, { kind: "directive", type: FormControlValidationMsgDirectiveForInput, selector: "[appFormControlValidationMsgForInputs]", inputs: ["showBoxError", "errorDivId", "beforeBegin", "afterEnd"] }] });
1239
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GeneralInputRendererComponent, decorators: [{
1240
- type: Component,
1241
- args: [{ selector: 'general-input-renderer-test', template: "<div *ngIf=\"formGroup\" [formGroup]=\"formGroup\">\r\n <div *ngIf=\"params.isTypeText\">\r\n <input [placeholder]=\"params.fieldLabel\"appFormControlValidationMsgForInputs [showBoxError]=\"false\"\r\n [errorDivId]=\"'text'\" \r\n (change)=\"onCellDataChanged($event)\" [formControlName]=\"key\" />\r\n <span *ngIf=\"params.showSymbol\"\r\n style=\"margin-left:-20px ;\">{{params.symbol}}</span>\r\n <show-table-errors\r\n *ngIf=\"formGroup.get(this.key).errors && formGroup.get(this.key) && formGroup.get(this.key).touched\"\r\n [message]=\"formGroup.get(this.key).errors.message\"></show-table-errors>\r\n </div>\r\n <div *ngIf=\"params.isTypeNumber\">\r\n <input customDecimalPointTwoDigits appFormControlValidationMsgForInputs [showBoxError]=\"false\"\r\n [errorDivId]=\"'number'\" [placeholder]=\"params.fieldLabel\"\r\n (change)=\"onCellDataChanged($event)\" [formControlName]=\"key\" />\r\n <span *ngIf=\"params.showSymbol\"\r\n style=\"margin-left:-20px ;\">{{params.symbol}}</span>\r\n <show-table-errors\r\n *ngIf=\"formGroup.get(this.key).errors && formGroup.get(this.key).touched\"\r\n [message]=\"formGroup.get(this.key).errors.message\"></show-table-errors>\r\n </div>\r\n <div *ngIf=\"params.isTypeIntegerNumber\">\r\n <input appFormControlValidationMsgForInputs [showBoxError]=\"false\"type=\"number\"\r\n [errorDivId]=\"'integer'\" [placeholder]=\"params.fieldLabel\"\r\n (change)=\"onCellDataChanged($event)\" [formControlName]=\"key\" />\r\n <span *ngIf=\"params.showSymbol\"\r\n style=\"margin-left:-20px ;\">{{params.symbol}}</span>\r\n <show-table-errors\r\n *ngIf=\"formGroup.get(this.key).errors && formGroup.get(this.key).touched\"\r\n [message]=\"formGroup.get(this.key).errors.message\"></show-table-errors>\r\n </div>\r\n <div *ngIf=\"params.isTypeTextArea\">\r\n <textarea class=\"text-area\" (change)=\"onCellDataChanged($event)\"\r\n [placeholder]=\"params.fieldLabel\" class=\"main-height\"\r\n [formControlName]=\"key\"></textarea>\r\n </div>\r\n</div>", styles: ["textarea{padding-left:.5rem;border-radius:.3rem;height:3.5rem;font-size:1.2rem;border:solid #BEBEBE .1rem}textarea:focus{outline:none}textarea::placeholder{color:#676767}\n"] }]
1242
- }], ctorParameters: function () { return []; } });
1243
-
1244
- class LabelAndField {
1245
- }
1246
-
1247
- var DropdownActionType;
1248
- (function (DropdownActionType) {
1249
- DropdownActionType[DropdownActionType["ADD"] = 0] = "ADD";
1250
- DropdownActionType[DropdownActionType["MENU"] = 1] = "MENU";
1251
- })(DropdownActionType || (DropdownActionType = {}));
1252
-
1253
- class DropdownActionsComponent {
1254
- constructor(_Router) {
1255
- this._Router = _Router;
1256
- this.dropdownActionTypes = DropdownActionType;
1257
- this.canRoute = true;
1258
- this.labelsAndRoutes = [];
1259
- this.dropdownActionType = this.dropdownActionTypes.ADD;
1260
- this.addClicked = new EventEmitter();
1261
- }
1262
- ngOnInit() {
1263
- this.validateActions();
1264
- }
1265
- validateActions() {
1266
- if (this.dropdownActionType == this.dropdownActionTypes.ADD) {
1267
- if (this.canRoute) {
1268
- if (this.route == "" || this.route == undefined || this.route == null) {
1269
- throw Error("Route needs to be provided.");
1270
- }
1271
- }
1272
- else {
1273
- if (this.route) {
1274
- throw Error("Route shouldn't be provided since canRoute is false");
1275
- }
1276
- }
1277
- }
1278
- else if (this.dropdownActionType == this.dropdownActionTypes.MENU) {
1279
- if (!this.labelsAndRoutes.length) {
1280
- throw Error("A list of labels & Routes need to be provided for the actions menu.");
1281
- }
1282
- }
1283
- else {
1284
- throw Error("Dropdown Action Type is not recognized.");
1285
- }
1286
- }
1287
- onClickAdd($event) {
1288
- $event.preventDefault();
1289
- if (this.canRoute && this.route) {
1290
- this._Router.navigate([this.route]);
1291
- }
1292
- this.addClicked.emit();
1293
- }
1294
- onClickLabel(route, $event) {
1295
- $event.preventDefault();
1296
- this._Router.navigate([route]);
1297
- }
1298
- }
1299
- DropdownActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DropdownActionsComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component });
1300
- DropdownActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: DropdownActionsComponent, selector: "dropdown-actions", inputs: { canRoute: "canRoute", disabled: "disabled", labelsAndRoutes: "labelsAndRoutes", route: "route", dropdownActionType: "dropdownActionType" }, outputs: { addClicked: "addClicked" }, ngImport: i0, template: "<div [ngSwitch]=\"dropdownActionType\">\r\n <a *ngSwitchCase=\"dropdownActionTypes.ADD\" [href]=\"route\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n (click)=\"onClickAdd($event)\">\r\n <fa-icon icon=\"plus\"></fa-icon>\r\n </a>\r\n <fa-icon *ngSwitchCase=\"dropdownActionTypes.MENU\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n class=\"menu\" [matMenuTriggerFor]=\"menu\"\r\n icon=\"ellipsis-vertical\"></fa-icon>\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let labelAndRoute of labelsAndRoutes\" mat-menu-item>\r\n <a [href]=\"labelAndRoute.route\"\r\n (click)=\"onClickLabel(labelAndRoute.route, $event)\">{{labelAndRoute.label}}</a>\r\n </button>\r\n </mat-menu>\r\n</div>", styles: [".action-enabled{cursor:pointer;color:#155ed4}.action-enabled:hover{color:#3178eb}.disabled{color:#676767;cursor:initial;pointer-events:none}.menu{font-size:1.8rem;display:flex;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i3$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { kind: "component", type: i3$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i3$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }, { kind: "component", type: i2$2.FaIconComponent, selector: "fa-icon", inputs: ["icon", "title", "spin", "pulse", "mask", "styles", "flip", "size", "pull", "border", "inverse", "symbol", "rotate", "fixedWidth", "classes", "transform", "a11yRole"] }] });
1301
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DropdownActionsComponent, decorators: [{
1302
- type: Component,
1303
- args: [{ selector: 'dropdown-actions', template: "<div [ngSwitch]=\"dropdownActionType\">\r\n <a *ngSwitchCase=\"dropdownActionTypes.ADD\" [href]=\"route\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n (click)=\"onClickAdd($event)\">\r\n <fa-icon icon=\"plus\"></fa-icon>\r\n </a>\r\n <fa-icon *ngSwitchCase=\"dropdownActionTypes.MENU\"\r\n [ngClass]=\"{'action-enabled':!disabled, 'disabled': disabled}\"\r\n class=\"menu\" [matMenuTriggerFor]=\"menu\"\r\n icon=\"ellipsis-vertical\"></fa-icon>\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngFor=\"let labelAndRoute of labelsAndRoutes\" mat-menu-item>\r\n <a [href]=\"labelAndRoute.route\"\r\n (click)=\"onClickLabel(labelAndRoute.route, $event)\">{{labelAndRoute.label}}</a>\r\n </button>\r\n </mat-menu>\r\n</div>", styles: [".action-enabled{cursor:pointer;color:#155ed4}.action-enabled:hover{color:#3178eb}.disabled{color:#676767;cursor:initial;pointer-events:none}.menu{font-size:1.8rem;display:flex;align-items:center}\n"] }]
1304
- }], ctorParameters: function () { return [{ type: i1$2.Router }]; }, propDecorators: { canRoute: [{
1305
- type: Input
1306
- }], disabled: [{
1307
- type: Input
1308
- }], labelsAndRoutes: [{
1309
- type: Input
1310
- }], route: [{
1311
- type: Input
1312
- }], dropdownActionType: [{
1313
- type: Input
1314
- }], addClicked: [{
1315
- type: Output
1316
- }] } });
1317
-
1318
- class PrimaryColors {
1319
- }
1320
- PrimaryColors.$primaryBlueColor = '#155ED4';
1321
- PrimaryColors.$primaryPinkColor = '#F0509C';
1322
- PrimaryColors.$primaryTealColor = '#12957E';
1323
- PrimaryColors.$primaryCarbonColor = '#32353B';
1324
- PrimaryColors.$primaryPurpleColor = '#E3B1EB';
1325
- PrimaryColors.$primaryRedColor = '#A80002';
1326
- PrimaryColors.$primaryLightRedColor = '#FFDBDB';
1327
- PrimaryColors.$primaryLightGrayBlueColor = '#f7f8f9';
1328
- PrimaryColors.$primaryLightGrayColor = '#f0f0f0';
1329
-
1330
- class AddAsteriskDirective {
1331
- constructor(elem) {
1332
- this.elem = elem;
1333
- this.show = true;
1334
- }
1335
- ngOnInit() {
1336
- this.toggleAsterisk();
1337
- }
1338
- ngOnChanges(changes) {
1339
- this.toggleAsterisk();
1340
- }
1341
- toggleAsterisk() {
1342
- const existingAsterisk = this.elem.nativeElement.querySelector('.custom-asterisk');
1343
- if (this.show) {
1344
- if (!existingAsterisk) {
1345
- const customAsterisk = `<span class="custom-asterisk" style="color:${PrimaryColors.$primaryRedColor};"> *</span> `;
1346
- this.elem.nativeElement.insertAdjacentHTML('beforeend', customAsterisk);
1347
- }
1348
- }
1349
- else {
1350
- if (existingAsterisk) {
1351
- existingAsterisk.remove();
1352
- }
1353
- }
1354
- }
1355
- }
1356
- AddAsteriskDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AddAsteriskDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1357
- AddAsteriskDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: AddAsteriskDirective, selector: "[addAsterisk]", inputs: { show: "show" }, usesOnChanges: true, ngImport: i0 });
1358
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AddAsteriskDirective, decorators: [{
1359
- type: Directive,
1360
- args: [{
1361
- selector: '[addAsterisk]'
1362
- }]
1363
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { show: [{
1364
- type: Input,
1365
- args: ['show']
1366
- }] } });
1367
-
1368
- class InputsModule {
1369
- static forRoot(environment) {
1370
- return {
1371
- ngModule: InputsModule,
1372
- providers: [
1373
- ChooseGeneralItemService,
1374
- {
1375
- provide: 'env',
1376
- useValue: environment
1377
- }
1378
- ]
1379
- };
1380
- }
1381
- }
1382
- InputsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: InputsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1383
- InputsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: InputsModule, declarations: [ChooseEnumComponent,
1384
- ChooseEnumRendererComponent,
1385
- ChooseGeneralItemComponent,
1386
- GeneralInputRendererComponent,
1387
- ChooseLineTypeComponent,
1388
- ChooseYesOrNoComponent,
1389
- ChooseYesOrNoRendererComponent,
1390
- EditableSavableInputComponent,
1391
- DynamicPipe,
1392
- ChooseGeneralItemRendererComponent,
1393
- CustomDecimalPointTwoDigitsDirective,
1394
- ShowTableErrorsComponent,
1395
- FormControlValidationMsgDirectiveForInput,
1396
- DropdownActionsComponent,
1397
- AddAsteriskDirective], imports: [CommonModule,
1398
- NgSelectModule,
1399
- FormsModule,
1400
- ReactiveFormsModule,
1401
- AppMaterialModule,
1402
- SharedGeneralComponentsModule,
1403
- FontAwesomeModule], exports: [ChooseEnumComponent,
1404
- ChooseEnumRendererComponent,
1405
- ChooseGeneralItemComponent,
1406
- GeneralInputRendererComponent,
1407
- ChooseLineTypeComponent,
1408
- ChooseYesOrNoComponent,
1409
- ChooseYesOrNoRendererComponent,
1410
- EditableSavableInputComponent,
1411
- DropdownActionsComponent,
1412
- DynamicPipe,
1413
- AddAsteriskDirective] });
1414
- InputsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: InputsModule, imports: [CommonModule,
1415
- NgSelectModule,
1416
- FormsModule,
1417
- ReactiveFormsModule,
1418
- AppMaterialModule,
1419
- SharedGeneralComponentsModule,
1420
- FontAwesomeModule] });
1421
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: InputsModule, decorators: [{
1422
- type: NgModule,
1423
- args: [{
1424
- declarations: [
1425
- ChooseEnumComponent,
1426
- ChooseEnumRendererComponent,
1427
- ChooseGeneralItemComponent,
1428
- GeneralInputRendererComponent,
1429
- ChooseLineTypeComponent,
1430
- ChooseYesOrNoComponent,
1431
- ChooseYesOrNoRendererComponent,
1432
- EditableSavableInputComponent,
1433
- DynamicPipe,
1434
- ChooseGeneralItemRendererComponent,
1435
- CustomDecimalPointTwoDigitsDirective,
1436
- ShowTableErrorsComponent,
1437
- FormControlValidationMsgDirectiveForInput,
1438
- DropdownActionsComponent,
1439
- AddAsteriskDirective
1440
- ],
1441
- imports: [
1442
- CommonModule,
1443
- NgSelectModule,
1444
- FormsModule,
1445
- ReactiveFormsModule,
1446
- AppMaterialModule,
1447
- SharedGeneralComponentsModule,
1448
- FontAwesomeModule,
1449
- ],
1450
- exports: [
1451
- ChooseEnumComponent,
1452
- ChooseEnumRendererComponent,
1453
- ChooseGeneralItemComponent,
1454
- GeneralInputRendererComponent,
1455
- ChooseLineTypeComponent,
1456
- ChooseYesOrNoComponent,
1457
- ChooseYesOrNoRendererComponent,
1458
- EditableSavableInputComponent,
1459
- DropdownActionsComponent,
1460
- DynamicPipe,
1461
- AddAsteriskDirective
1462
- ]
1463
- }]
1464
- }] });
1465
-
1466
- /*
1467
- * Public API Surface of inputs
1468
- */
1469
-
1470
- /**
1471
- * Generated bundle index. Do not edit.
1472
- */
1473
-
1474
- export { AddAsteriskDirective, ChooseEnumComponent, ChooseEnumRendererComponent, ChooseGeneralItemComponent, ChooseGeneralItemRendererComponent, ChooseGeneralItemService, ChooseLineTypeComponent, ChooseYesOrNoComponent, ChooseYesOrNoRendererComponent, DropdownActionType, DropdownActionsComponent, DynamicPipe, EditableSavableInputComponent, FormControlValidationMsgDirectiveForInput, GeneralInputRendererComponent, InputsModule, LabelAndField, PrimaryColors, ShowTableErrorsComponent };
1475
- //# sourceMappingURL=inputs.mjs.map