@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,1471 +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
- let value = $event;
376
- this.formControlValue = this.params.context.formGroup.get("entries").at(this.params.node.rowIndex);
377
- this.formControlValue?.get(this.key).setValue(value);
378
- }
379
- refresh(params) {
380
- return false;
381
- }
382
- }
383
- ChooseEnumRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseEnumRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
384
- 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"] }] });
385
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseEnumRendererComponent, decorators: [{
386
- type: Component,
387
- 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>" }]
388
- }], ctorParameters: function () { return []; } });
389
-
390
- // import { environment } from '../../environments/environment';
391
- class ChooseGeneralItemService {
392
- // baseUrl: string = environment.apiURL;
393
- constructor(http, env) {
394
- this.http = http;
395
- this.env = env;
396
- } //we have an issue with this line of code...can we meet to resolve it!
397
- getHeaders() {
398
- const token = localStorage.getItem("token");
399
- const httpHeaders = new HttpHeaders({
400
- 'Content-Type': "application/json",
401
- 'Authorization': 'Token ' + token
402
- });
403
- return { headers: httpHeaders };
404
- }
405
- getAuthenticationHeadersWithQueryParams(params) {
406
- const token = localStorage.getItem("token");
407
- const httpHeaders = new HttpHeaders({
408
- 'Content-Type': "application/json",
409
- 'Authorization': 'Token ' + token
410
- });
411
- return { headers: httpHeaders, params: params };
412
- }
413
- getData(apiPath) {
414
- return this.http.get(`${this.env.apiURL}${apiPath}`, this.getHeaders());
415
- }
416
- }
417
- 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 });
418
- ChooseGeneralItemService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemService, providedIn: 'root' });
419
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemService, decorators: [{
420
- type: Injectable,
421
- args: [{
422
- providedIn: 'root'
423
- }]
424
- }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: undefined, decorators: [{
425
- type: Inject,
426
- args: ['env']
427
- }] }]; } });
428
-
429
- class ChooseGeneralItemComponent {
430
- constructor(_ChooseGeneralItemService) {
431
- this._ChooseGeneralItemService = _ChooseGeneralItemService;
432
- this.change = new EventEmitter();
433
- this.width = 20;
434
- this.isChip = false;
435
- this.chipColor = 'black';
436
- this.chipTextColor = 'white';
437
- this.chipWidth = 11;
438
- this.useFullObject = false;
439
- this.propagateChange = (_) => { };
440
- this.propogateTouch = () => { };
441
- }
442
- ngOnInit() {
443
- if (!this.items)
444
- this.getData();
445
- }
446
- writeValue(item) {
447
- if (item != undefined) {
448
- this.selectedItemId = item;
449
- }
450
- else if (item == null) {
451
- this.selectedItemId = item;
452
- }
453
- }
454
- registerOnChange(fn) {
455
- this.propagateChange = fn;
456
- }
457
- registerOnTouched(fn) {
458
- this.propogateTouch = fn;
459
- }
460
- updateBlur() {
461
- this.propogateTouch();
462
- }
463
- onSelectedItemChanged($event) {
464
- this.propagateChange(this.useFullObject ? $event : this.selectedItemId);
465
- this.change.emit(this.useFullObject ? $event : this.selectedItemId);
466
- }
467
- getData() {
468
- if (this.apiPath) {
469
- this._ChooseGeneralItemService.getData(this.apiPath).subscribe({
470
- next: (response) => {
471
- this.items = response;
472
- },
473
- error: (error) => console.error("error", error)
474
- });
475
- }
476
- }
477
- setWidth() {
478
- let style = {
479
- width: this.width + "rem"
480
- };
481
- return style;
482
- }
483
- setFontStyles() {
484
- let fontStyle = {
485
- fontWeight: this.fontWeight,
486
- fontSize: this.fontSize + "rem",
487
- };
488
- return fontStyle;
489
- }
490
- }
491
- ChooseGeneralItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemComponent, deps: [{ token: ChooseGeneralItemService }], target: i0.ɵɵFactoryTarget.Component });
492
- 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: [
493
- {
494
- provide: NG_VALUE_ACCESSOR,
495
- useExisting: forwardRef(() => ChooseGeneralItemComponent),
496
- multi: true,
497
- },
498
- ], 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" }] });
499
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemComponent, decorators: [{
500
- type: Component,
501
- args: [{ selector: 'choose-general-item', providers: [
502
- {
503
- provide: NG_VALUE_ACCESSOR,
504
- useExisting: forwardRef(() => ChooseGeneralItemComponent),
505
- multi: true,
506
- },
507
- ], 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>" }]
508
- }], ctorParameters: function () { return [{ type: ChooseGeneralItemService }]; }, propDecorators: { change: [{
509
- type: Output
510
- }], items: [{
511
- type: Input
512
- }], label: [{
513
- type: Input
514
- }], appendTo: [{
515
- type: Input
516
- }], placeholder: [{
517
- type: Input
518
- }], apiPath: [{
519
- type: Input
520
- }], isMultiple: [{
521
- type: Input
522
- }], hideSelectedItem: [{
523
- type: Input
524
- }], objects: [{
525
- type: Input
526
- }], showLabel: [{
527
- type: Input
528
- }], separator: [{
529
- type: Input
530
- }], width: [{
531
- type: Input
532
- }], fontWeight: [{
533
- type: Input
534
- }], fontSize: [{
535
- type: Input
536
- }], isChip: [{
537
- type: Input
538
- }], isTypeDate: [{
539
- type: Input
540
- }], chipColor: [{
541
- type: Input
542
- }], chipTextColor: [{
543
- type: Input
544
- }], chipWidth: [{
545
- type: Input
546
- }], selectedItemId: [{
547
- type: Input
548
- }], disabled: [{
549
- type: Input
550
- }], useFullObject: [{
551
- type: Input
552
- }] } });
553
-
554
- class ChooseGeneralItemRendererComponent {
555
- constructor() { }
556
- agInit(params) {
557
- this.params = params;
558
- this.itemId = params.data.id;
559
- this.key = params.context.createKey(params.columnApi, params.column);
560
- this.rowId = params.node.id;
561
- }
562
- onCellDataChanged($event) {
563
- let value = $event;
564
- this.formControlValue = this.params.context.formGroup.get("entries").at(this.rowId);
565
- this.formControlValue.get(this.key).setValue(value);
566
- const params = {
567
- value: value,
568
- rowNode: this.params.node,
569
- };
570
- this.params.onCellValueChanged(params);
571
- }
572
- refresh(params) {
573
- return true;
574
- }
575
- }
576
- ChooseGeneralItemRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
577
- 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"] }] });
578
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseGeneralItemRendererComponent, decorators: [{
579
- type: Component,
580
- 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>" }]
581
- }], ctorParameters: function () { return []; } });
582
-
583
- var LineType;
584
- (function (LineType) {
585
- LineType[LineType["INCLUDE"] = 0] = "INCLUDE";
586
- LineType[LineType["DO_NOT_INCLUDE"] = 1] = "DO_NOT_INCLUDE";
587
- })(LineType || (LineType = {}));
588
-
589
- class LineTypeModelHelper {
590
- static getItems() {
591
- let items = [];
592
- let values = Object.values(LineType);
593
- let types = values.filter(value => typeof value === 'number');
594
- for (let value of types) {
595
- this.setStringValueAndColor(value);
596
- items.push({ value: value, label: this.label, color: this.color, description: this.description });
597
- }
598
- return items;
599
- }
600
- static setStringValueAndColor(type) {
601
- switch (type) {
602
- case LineType.INCLUDE:
603
- return this.label = "Include", this.color = "gold";
604
- break;
605
- case LineType.DO_NOT_INCLUDE:
606
- return this.label = "Do Not Include", this.color = "platinum";
607
- break;
608
- default:
609
- return this.label = "Undefined", this.color = "Gray";
610
- }
611
- }
612
- getValue(label) {
613
- let value;
614
- switch (label) {
615
- case "Include":
616
- return value = 0;
617
- break;
618
- case "Do Not Include":
619
- return value = 1;
620
- break;
621
- default:
622
- return null;
623
- }
624
- }
625
- static getLabelAndColorForValue(value) {
626
- for (let item of this.getItems()) {
627
- if (item.value == value) {
628
- this.value = item;
629
- return this.value;
630
- }
631
- }
632
- }
633
- }
634
-
635
- class ChooseLineTypeComponent {
636
- constructor() {
637
- this.items = LineTypeModelHelper;
638
- this.propagateChange = (_) => { };
639
- this.propogateTouch = () => { };
640
- }
641
- ngOnInit() {
642
- this.types = this.items.getItems();
643
- }
644
- writeValue(type) {
645
- if (type != undefined || type != null) {
646
- this.selectedItem = type;
647
- }
648
- }
649
- registerOnChange(fn) {
650
- this.propagateChange = fn;
651
- }
652
- registerOnTouched(fn) {
653
- this.propogateTouch = fn;
654
- }
655
- updateBlur() {
656
- this.propogateTouch();
657
- }
658
- onSelectedItemChanged() {
659
- this.propagateChange(this.selectedItem);
660
- }
661
- }
662
- ChooseLineTypeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseLineTypeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
663
- ChooseLineTypeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: ChooseLineTypeComponent, selector: "choose-line-type", providers: [
664
- {
665
- provide: NG_VALUE_ACCESSOR,
666
- useExisting: forwardRef(() => ChooseLineTypeComponent),
667
- multi: true,
668
- },
669
- ], 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"] }] });
670
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseLineTypeComponent, decorators: [{
671
- type: Component,
672
- args: [{ selector: 'choose-line-type', providers: [
673
- {
674
- provide: NG_VALUE_ACCESSOR,
675
- useExisting: forwardRef(() => ChooseLineTypeComponent),
676
- multi: true,
677
- },
678
- ], 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"] }]
679
- }], ctorParameters: function () { return []; } });
680
-
681
- class ChooseYesOrNoComponent {
682
- constructor() {
683
- this.change = new EventEmitter();
684
- this.items = [{ value: true, label: "Yes", color: "green" }, { value: false, label: "No", color: "red" }];
685
- this.width = 200;
686
- this.placeholder = "Choose either Yes or No";
687
- this.propagateChange = (_) => { };
688
- this.propogateTouch = () => { };
689
- }
690
- ngOnInit() {
691
- }
692
- writeValue(item) {
693
- if (item != undefined || item != null) {
694
- this.selectedItemValue = item;
695
- }
696
- }
697
- registerOnChange(fn) {
698
- this.propagateChange = fn;
699
- }
700
- registerOnTouched(fn) {
701
- this.propogateTouch = fn;
702
- }
703
- updateBlur() {
704
- this.propogateTouch();
705
- }
706
- onSelectedItemChanged() {
707
- this.propagateChange(this.selectedItemValue);
708
- this.change.emit(this.selectedItemValue);
709
- }
710
- setWidth() {
711
- let style = {
712
- width: this.width + "px"
713
- };
714
- return style;
715
- }
716
- }
717
- ChooseYesOrNoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseYesOrNoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
718
- 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: [
719
- {
720
- provide: NG_VALUE_ACCESSOR,
721
- useExisting: forwardRef(() => ChooseYesOrNoComponent),
722
- multi: true
723
- }
724
- ], 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"] }] });
725
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseYesOrNoComponent, decorators: [{
726
- type: Component,
727
- args: [{ selector: 'choose-yes-or-no', providers: [
728
- {
729
- provide: NG_VALUE_ACCESSOR,
730
- useExisting: forwardRef(() => ChooseYesOrNoComponent),
731
- multi: true
732
- }
733
- ], 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" }]
734
- }], ctorParameters: function () { return []; }, propDecorators: { change: [{
735
- type: Output
736
- }], width: [{
737
- type: Input
738
- }], selectedItemValue: [{
739
- type: Input
740
- }], placeholder: [{
741
- type: Input
742
- }] } });
743
-
744
- class ChooseYesOrNoRendererComponent {
745
- constructor() { }
746
- agInit(params) {
747
- this.params = params;
748
- this.booleanValue = params.value;
749
- this.key = params.context.createKey(params.columnApi, params.column);
750
- this.rowId = params.node.id;
751
- }
752
- onCellDataChanged($event) {
753
- let value = $event;
754
- this.formControlValue = this.params.context.formGroup.get("entries").at(this.rowId);
755
- this.formControlValue.get(this.key).setValue(value);
756
- }
757
- refresh(params) {
758
- return false;
759
- }
760
- }
761
- ChooseYesOrNoRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseYesOrNoRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
762
- 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"] }] });
763
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ChooseYesOrNoRendererComponent, decorators: [{
764
- type: Component,
765
- 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>" }]
766
- }], ctorParameters: function () { return []; } });
767
-
768
- const PIPEMAPPINGS = [
769
- { value: '$', pipe: new CurrencyPipe('en-US') }
770
- ];
771
-
772
- class DynamicPipe {
773
- transform(value, args) {
774
- for (let val of PIPEMAPPINGS) {
775
- if (val.value === args) {
776
- return val.pipe.transform(value);
777
- }
778
- }
779
- return '';
780
- }
781
- }
782
- DynamicPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DynamicPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
783
- DynamicPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: DynamicPipe, name: "dynamicPipe" });
784
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DynamicPipe, decorators: [{
785
- type: Pipe,
786
- args: [{ name: 'dynamicPipe' }]
787
- }] });
788
-
789
- class EditableSavableInputComponent {
790
- constructor() {
791
- this.saveWasClicked = new EventEmitter();
792
- this.showUnit = false;
793
- this.isEditable = true;
794
- this.showHeader = true;
795
- this.value = "";
796
- this.isAddClickedOn = false;
797
- this.isUpdated = false;
798
- this.showEdit = false;
799
- // the method set in registerOnChange to emit changes back to the form
800
- this.propagateChange = (_) => { };
801
- this.propogateTouch = () => { };
802
- }
803
- ngOnInit() {
804
- this.initialize();
805
- }
806
- initialize() {
807
- if (this.value == "") {
808
- this.isUpdated = false;
809
- }
810
- else {
811
- this.isUpdated = true;
812
- }
813
- }
814
- onClickAdd() {
815
- this.isAddClickedOn = true;
816
- }
817
- onClickCancel() {
818
- this.isAddClickedOn = false;
819
- }
820
- onClickSave(input) {
821
- this.isAddClickedOn = false;
822
- let value = input.value;
823
- if (value.trim().length == 0) {
824
- this.isUpdated = false;
825
- }
826
- else {
827
- this.isUpdated = true;
828
- }
829
- this.value = value;
830
- this.saveWasClicked.emit(value);
831
- this.propagateChange(this.value);
832
- }
833
- onClickEdit() {
834
- this.isAddClickedOn = true;
835
- }
836
- onMouseEnter() {
837
- this.showEdit = true;
838
- }
839
- onMouseLeave() {
840
- this.showEdit = false;
841
- }
842
- writeValue(value) {
843
- if (value) {
844
- this.value = value;
845
- this.isUpdated = true;
846
- }
847
- }
848
- // registers 'fn' that will be fired wheb changes are made
849
- // this is how we emit the changes back to the form
850
- registerOnChange(fn) {
851
- this.propagateChange = fn;
852
- }
853
- registerOnTouched(fn) {
854
- this.propogateTouch = fn;
855
- }
856
- onChange($event) {
857
- //this.propagateChange(this.value);
858
- }
859
- updateBlur() {
860
- this.propogateTouch();
861
- }
862
- }
863
- EditableSavableInputComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EditableSavableInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
864
- 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,
865
- {
866
- provide: NG_VALUE_ACCESSOR,
867
- useExisting: forwardRef(() => EditableSavableInputComponent),
868
- multi: true
869
- }
870
- ], 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" }] });
871
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: EditableSavableInputComponent, decorators: [{
872
- type: Component,
873
- args: [{ selector: 'editable-savable-input', providers: [DynamicPipe,
874
- {
875
- provide: NG_VALUE_ACCESSOR,
876
- useExisting: forwardRef(() => EditableSavableInputComponent),
877
- multi: true
878
- }
879
- ], 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"] }]
880
- }], ctorParameters: function () { return []; }, propDecorators: { saveWasClicked: [{
881
- type: Output
882
- }], defaultvalue: [{
883
- type: Input
884
- }], inputType: [{
885
- type: Input
886
- }], newLabel: [{
887
- type: Input
888
- }], headerLabel: [{
889
- type: Input
890
- }], showUnit: [{
891
- type: Input
892
- }], unit: [{
893
- type: Input
894
- }], unitType: [{
895
- type: Input
896
- }], isEditable: [{
897
- type: Input
898
- }], showHeader: [{
899
- type: Input
900
- }], value: [{
901
- type: Input
902
- }] } });
903
-
904
- class CustomDecimalPointTwoDigitsDirective {
905
- constructor(control) {
906
- this.control = control;
907
- }
908
- ngOnInit() {
909
- if (this.control.value) {
910
- this.control.valueAccessor.writeValue(this.transformToCommasAndPoint(this.control.value));
911
- }
912
- this.valueSubscription = this.control.control.valueChanges.subscribe(value => {
913
- if (value.length > 0) {
914
- let removeCommas = this.control.value.replace(/,/g, '');
915
- this.control.control.setValue(removeCommas, { emitEvent: false, emitModelToViewChange: false });
916
- }
917
- else {
918
- this.control.control.setValue(null, { emitEvent: false, emitModelToViewChange: false });
919
- }
920
- });
921
- }
922
- onEvent($event) {
923
- if (this.control.value) {
924
- const item = $event.target;
925
- item.value = this.transformToCommasAndPoint(this.control.value);
926
- let removeCommas = this.control.value.replace(/,/g, '');
927
- this.control.control.setValue(removeCommas, { emitEvent: false, emitModelToViewChange: false });
928
- }
929
- }
930
- transformToCommasAndPoint(value) {
931
- if (value.indexOf(".") == -1) {
932
- value = value.toString().replace(/\D/g, "")
933
- .replace(/\B(?=(\d{3})+(?!\d))/g, ",");
934
- return value;
935
- }
936
- else {
937
- let val = value.split(".");
938
- let valueBeforeDecimal = val[0];
939
- let valueAfterDecimal = val[1];
940
- valueBeforeDecimal = valueBeforeDecimal.toString().replace(/\D/g, "")
941
- .replace(/\B(?=(\d{3})+(?!\d))/g, ",");
942
- let newValue = `${valueBeforeDecimal}.${valueAfterDecimal}`;
943
- return newValue;
944
- }
945
- }
946
- }
947
- 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 });
948
- 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 });
949
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: CustomDecimalPointTwoDigitsDirective, decorators: [{
950
- type: Directive,
951
- args: [{
952
- selector: '[customDecimalPointTwoDigits]',
953
- providers: [NgModel, DecimalPipe],
954
- }]
955
- }], ctorParameters: function () { return [{ type: i2$1.NgControl }]; }, propDecorators: { onEvent: [{
956
- type: HostListener,
957
- args: ["input", ["$event"]]
958
- }] } });
959
-
960
- class ValidationMessageService {
961
- }
962
- ValidationMessageService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidationMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
963
- ValidationMessageService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidationMessageService, providedIn: 'root' });
964
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: ValidationMessageService, decorators: [{
965
- type: Injectable,
966
- args: [{
967
- providedIn: 'root'
968
- }]
969
- }] });
970
- class MinLengthValidationError {
971
- constructor(requirement) {
972
- this.requirement = requirement;
973
- }
974
- buildMessage() {
975
- return "Must be a minimum length of " + this.requirement + " letters!";
976
- }
977
- }
978
- class InvalidIntegerNumberValidatorEerror {
979
- buildMessage() {
980
- return "Must only contain numbers, no decimals or words allowed";
981
- }
982
- }
983
- class PositiveIntegerNumberValidatorError {
984
- buildMessage() {
985
- return "Must be a positive integer";
986
- }
987
- }
988
- class MaxLengthValidationError {
989
- constructor(requirement) {
990
- this.requirement = requirement;
991
- }
992
- buildMessage() {
993
- return "Must be a maximum length of " + this.requirement + " letters!";
994
- }
995
- }
996
- class MaxValidationError {
997
- constructor(requirement) {
998
- this.requirement = requirement;
999
- }
1000
- buildMessage() {
1001
- return "The largest acceptable input is " + this.requirement;
1002
- }
1003
- }
1004
- class MinValidationError {
1005
- constructor(requirement) {
1006
- this.requirement = requirement;
1007
- }
1008
- buildMessage() {
1009
- return "The smallest acceptable input is " + this.requirement;
1010
- }
1011
- }
1012
- class PatternValidatorError {
1013
- constructor(requirement) {
1014
- this.requirement = requirement;
1015
- }
1016
- buildMessage() {
1017
- if (this.requirement == '^[a-zA-Z ]*$') {
1018
- return "This field must only contain words ";
1019
- }
1020
- else if (this.requirement == '/[0-9]-[0-9]+$/') {
1021
- return "This field must only contain numbers and a - " + "<br>" + "Example: 71-716971";
1022
- }
1023
- else if (this.requirement = 'forDate') {
1024
- return "Date needs to be DD/MM/YYYY";
1025
- }
1026
- }
1027
- }
1028
- class RequiredValidatorError {
1029
- buildMessage() {
1030
- return "This Field Is Required";
1031
- }
1032
- }
1033
- class EmailValidatorError {
1034
- buildMessage() {
1035
- return "Make Sure It Is An Email Format" + "<br>" + "example@jooler.io";
1036
- }
1037
- }
1038
- class ValidationError {
1039
- static getRelevantError(validationType, validationValue) {
1040
- let validationMessage;
1041
- validationMessage = this.MessageDictionary(validationValue, validationType);
1042
- return validationMessage;
1043
- }
1044
- static MessageDictionary(value, validationType) {
1045
- let ValidationMessageForInput = {
1046
- 'minlength': new MinLengthValidationError(value).buildMessage(),
1047
- 'maxlength': new MaxLengthValidationError(value).buildMessage(),
1048
- 'max': new MaxValidationError(value).buildMessage(),
1049
- 'min': new MinValidationError(value).buildMessage(),
1050
- 'pattern': new PatternValidatorError(value).buildMessage(),
1051
- 'required': new RequiredValidatorError().buildMessage(),
1052
- 'email': new EmailValidatorError().buildMessage(),
1053
- 'invalidIntegerNumber': new InvalidIntegerNumberValidatorEerror().buildMessage(),
1054
- 'invalidPositiveInteger': new PositiveIntegerNumberValidatorError().buildMessage(),
1055
- };
1056
- return ValidationMessageForInput[validationType];
1057
- }
1058
- }
1059
- ValidationError.validationMessageForDate = {
1060
- 'required': new RequiredValidatorError().buildMessage(),
1061
- 'pattern': new PatternValidatorError('forDate').buildMessage(),
1062
- };
1063
-
1064
- class FormControlValidationMsgDirectiveForInput {
1065
- constructor(elRef, control) {
1066
- this.elRef = elRef;
1067
- this.control = control;
1068
- this.showBoxError = true;
1069
- this.beforeBegin = false;
1070
- this.afterEnd = false;
1071
- this.validationError = ValidationError;
1072
- }
1073
- ngOnInit() {
1074
- this.statusChangeSubscription = this.control.statusChanges.subscribe((status) => {
1075
- if (status == 'INVALID') {
1076
- this.showError();
1077
- }
1078
- else {
1079
- this.removeError();
1080
- }
1081
- });
1082
- this.control.valueChanges.subscribe({
1083
- next: (response) => {
1084
- if (this.control.errors) {
1085
- this.showError();
1086
- }
1087
- }
1088
- });
1089
- }
1090
- ngOnDestroy() {
1091
- this.statusChangeSubscription.unsubscribe();
1092
- }
1093
- handleBlurEvent(event) {
1094
- if (this.control.errors) {
1095
- this.showError();
1096
- }
1097
- else {
1098
- this.removeError();
1099
- }
1100
- }
1101
- showError() {
1102
- this.removeError();
1103
- const valErrors = this.control.errors;
1104
- const keys = Object.keys(valErrors);
1105
- for (let i = 0; i < keys.length; i++) {
1106
- switch (keys[i]) {
1107
- case 'minlength': {
1108
- let message = this.validationError.getRelevantError(keys[i], valErrors.minlength.requiredLength);
1109
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1110
- break;
1111
- }
1112
- case 'required': {
1113
- let message = this.validationError.getRelevantError(keys[i], valErrors);
1114
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1115
- this.control.control.setErrors({ 'required': true, 'message': message }, { emitEvent: false });
1116
- break;
1117
- }
1118
- case 'maxlength': {
1119
- let message = this.validationError.getRelevantError(keys[i], valErrors.maxlength.requiredLength);
1120
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1121
- this.control.control.setErrors({ 'maxlength': { 'requiredLength': valErrors.maxlength.requiredLength }, 'message': message }, { emitEvent: false });
1122
- break;
1123
- }
1124
- case 'max': {
1125
- let message = this.validationError.getRelevantError(keys[i], valErrors.max.max);
1126
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1127
- this.control.control.setErrors({ 'message': message, 'max': { 'max': valErrors.max.max } }, { emitEvent: false });
1128
- break;
1129
- }
1130
- case 'min': {
1131
- let message = this.validationError.getRelevantError(keys[i], valErrors.min.min);
1132
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1133
- break;
1134
- }
1135
- case 'pattern': {
1136
- let message = this.validationError.getRelevantError(keys[i], valErrors.pattern.requiredPattern);
1137
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1138
- break;
1139
- }
1140
- case 'email': {
1141
- let message = this.validationError.getRelevantError(keys[i], valErrors);
1142
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1143
- break;
1144
- }
1145
- case 'invalidIntegerNumber': {
1146
- let message = this.validationError.getRelevantError(keys[i], valErrors);
1147
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1148
- break;
1149
- }
1150
- case 'invalidPositiveInteger': {
1151
- let message = this.validationError.getRelevantError(keys[i], valErrors);
1152
- this.errorMessage += ` ${this.errorMessage ? "<br>" : ""}${"\u25CF " + message}`;
1153
- this.control.control.setErrors({ 'invalidPositiveInteger': true, 'message': message }, { emitEvent: false });
1154
- break;
1155
- }
1156
- }
1157
- }
1158
- if (this.showBoxError) {
1159
- 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>';
1160
- if (!this.beforeBegin && !this.afterEnd)
1161
- this.elRef.nativeElement.parentElement.parentElement.parentElement.parentElement.insertAdjacentHTML('afterend', errDiv);
1162
- else if (this.beforeBegin)
1163
- this.elRef.nativeElement.insertAdjacentHTML('beforebegin', errDiv);
1164
- else if (this.afterEnd)
1165
- this.elRef.nativeElement.insertAdjacentHTML('afterend', errDiv);
1166
- else
1167
- throw Error("Adjustment not specified ");
1168
- }
1169
- }
1170
- removeError() {
1171
- this.errorMessage = "";
1172
- const errorElement = document.getElementById(this.errorDivId);
1173
- if (errorElement) {
1174
- errorElement.remove();
1175
- }
1176
- }
1177
- }
1178
- 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 });
1179
- 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 });
1180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: FormControlValidationMsgDirectiveForInput, decorators: [{
1181
- type: Directive,
1182
- args: [{
1183
- selector: '[appFormControlValidationMsgForInputs]',
1184
- providers: [NgModel],
1185
- }]
1186
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2$1.NgControl }]; }, propDecorators: { showBoxError: [{
1187
- type: Input,
1188
- args: ['showBoxError']
1189
- }], errorDivId: [{
1190
- type: Input,
1191
- args: ['errorDivId']
1192
- }], beforeBegin: [{
1193
- type: Input,
1194
- args: ['beforeBegin']
1195
- }], afterEnd: [{
1196
- type: Input,
1197
- args: ['afterEnd']
1198
- }], handleBlurEvent: [{
1199
- type: HostListener,
1200
- args: ['blur', ["$event"]]
1201
- }] } });
1202
-
1203
- class GeneralInputRendererComponent {
1204
- constructor() { }
1205
- agInit(params) {
1206
- this.params = params;
1207
- this.formGroup = this.params.context.formGroup.get('entries').at(params.node.rowIndex);
1208
- this.key = params.context.createKey(params.columnApi, params.column);
1209
- if (params.isTypeNumber) {
1210
- if (params.value) {
1211
- this.value = new DecimalPipe("en-US").transform(+params.value, "1.0-0");
1212
- }
1213
- }
1214
- else {
1215
- this.value = params.value;
1216
- }
1217
- }
1218
- onCellDataChanged($event) {
1219
- let value = $event.target.value;
1220
- let newAndOldValue = {
1221
- newValue: value,
1222
- oldValue: this.params?.value
1223
- };
1224
- if (this.params.allowUpdateRowData) {
1225
- this.params.onChange(newAndOldValue);
1226
- }
1227
- }
1228
- refresh(params) {
1229
- this.formGroup = this.params.context.formGroup.get('entries').at(params.node.rowIndex);
1230
- return true;
1231
- }
1232
- }
1233
- GeneralInputRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GeneralInputRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1234
- 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"] }] });
1235
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: GeneralInputRendererComponent, decorators: [{
1236
- type: Component,
1237
- 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"] }]
1238
- }], ctorParameters: function () { return []; } });
1239
-
1240
- class LabelAndField {
1241
- }
1242
-
1243
- var DropdownActionType;
1244
- (function (DropdownActionType) {
1245
- DropdownActionType[DropdownActionType["ADD"] = 0] = "ADD";
1246
- DropdownActionType[DropdownActionType["MENU"] = 1] = "MENU";
1247
- })(DropdownActionType || (DropdownActionType = {}));
1248
-
1249
- class DropdownActionsComponent {
1250
- constructor(_Router) {
1251
- this._Router = _Router;
1252
- this.dropdownActionTypes = DropdownActionType;
1253
- this.canRoute = true;
1254
- this.labelsAndRoutes = [];
1255
- this.dropdownActionType = this.dropdownActionTypes.ADD;
1256
- this.addClicked = new EventEmitter();
1257
- }
1258
- ngOnInit() {
1259
- this.validateActions();
1260
- }
1261
- validateActions() {
1262
- if (this.dropdownActionType == this.dropdownActionTypes.ADD) {
1263
- if (this.canRoute) {
1264
- if (this.route == "" || this.route == undefined || this.route == null) {
1265
- throw Error("Route needs to be provided.");
1266
- }
1267
- }
1268
- else {
1269
- if (this.route) {
1270
- throw Error("Route shouldn't be provided since canRoute is false");
1271
- }
1272
- }
1273
- }
1274
- else if (this.dropdownActionType == this.dropdownActionTypes.MENU) {
1275
- if (!this.labelsAndRoutes.length) {
1276
- throw Error("A list of labels & Routes need to be provided for the actions menu.");
1277
- }
1278
- }
1279
- else {
1280
- throw Error("Dropdown Action Type is not recognized.");
1281
- }
1282
- }
1283
- onClickAdd($event) {
1284
- $event.preventDefault();
1285
- if (this.canRoute && this.route) {
1286
- this._Router.navigate([this.route]);
1287
- }
1288
- this.addClicked.emit();
1289
- }
1290
- onClickLabel(route, $event) {
1291
- $event.preventDefault();
1292
- this._Router.navigate([route]);
1293
- }
1294
- }
1295
- 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 });
1296
- 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"] }] });
1297
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: DropdownActionsComponent, decorators: [{
1298
- type: Component,
1299
- 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"] }]
1300
- }], ctorParameters: function () { return [{ type: i1$2.Router }]; }, propDecorators: { canRoute: [{
1301
- type: Input
1302
- }], disabled: [{
1303
- type: Input
1304
- }], labelsAndRoutes: [{
1305
- type: Input
1306
- }], route: [{
1307
- type: Input
1308
- }], dropdownActionType: [{
1309
- type: Input
1310
- }], addClicked: [{
1311
- type: Output
1312
- }] } });
1313
-
1314
- class PrimaryColors {
1315
- }
1316
- PrimaryColors.$primaryBlueColor = '#155ED4';
1317
- PrimaryColors.$primaryPinkColor = '#F0509C';
1318
- PrimaryColors.$primaryTealColor = '#12957E';
1319
- PrimaryColors.$primaryCarbonColor = '#32353B';
1320
- PrimaryColors.$primaryPurpleColor = '#E3B1EB';
1321
- PrimaryColors.$primaryRedColor = '#A80002';
1322
- PrimaryColors.$primaryLightRedColor = '#FFDBDB';
1323
- PrimaryColors.$primaryLightGrayBlueColor = '#f7f8f9';
1324
- PrimaryColors.$primaryLightGrayColor = '#f0f0f0';
1325
-
1326
- class AddAsteriskDirective {
1327
- constructor(elem) {
1328
- this.elem = elem;
1329
- this.show = true;
1330
- }
1331
- ngOnInit() {
1332
- this.toggleAsterisk();
1333
- }
1334
- ngOnChanges(changes) {
1335
- this.toggleAsterisk();
1336
- }
1337
- toggleAsterisk() {
1338
- const existingAsterisk = this.elem.nativeElement.querySelector('.custom-asterisk');
1339
- if (this.show) {
1340
- if (!existingAsterisk) {
1341
- const customAsterisk = `<span class="custom-asterisk" style="color:${PrimaryColors.$primaryRedColor};"> *</span> `;
1342
- this.elem.nativeElement.insertAdjacentHTML('beforeend', customAsterisk);
1343
- }
1344
- }
1345
- else {
1346
- if (existingAsterisk) {
1347
- existingAsterisk.remove();
1348
- }
1349
- }
1350
- }
1351
- }
1352
- AddAsteriskDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AddAsteriskDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1353
- AddAsteriskDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: AddAsteriskDirective, selector: "[addAsterisk]", inputs: { show: "show" }, usesOnChanges: true, ngImport: i0 });
1354
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: AddAsteriskDirective, decorators: [{
1355
- type: Directive,
1356
- args: [{
1357
- selector: '[addAsterisk]'
1358
- }]
1359
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { show: [{
1360
- type: Input,
1361
- args: ['show']
1362
- }] } });
1363
-
1364
- class InputsModule {
1365
- static forRoot(environment) {
1366
- return {
1367
- ngModule: InputsModule,
1368
- providers: [
1369
- ChooseGeneralItemService,
1370
- {
1371
- provide: 'env',
1372
- useValue: environment
1373
- }
1374
- ]
1375
- };
1376
- }
1377
- }
1378
- InputsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: InputsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1379
- InputsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: InputsModule, declarations: [ChooseEnumComponent,
1380
- ChooseEnumRendererComponent,
1381
- ChooseGeneralItemComponent,
1382
- GeneralInputRendererComponent,
1383
- ChooseLineTypeComponent,
1384
- ChooseYesOrNoComponent,
1385
- ChooseYesOrNoRendererComponent,
1386
- EditableSavableInputComponent,
1387
- DynamicPipe,
1388
- ChooseGeneralItemRendererComponent,
1389
- CustomDecimalPointTwoDigitsDirective,
1390
- ShowTableErrorsComponent,
1391
- FormControlValidationMsgDirectiveForInput,
1392
- DropdownActionsComponent,
1393
- AddAsteriskDirective], imports: [CommonModule,
1394
- NgSelectModule,
1395
- FormsModule,
1396
- ReactiveFormsModule,
1397
- AppMaterialModule,
1398
- SharedGeneralComponentsModule,
1399
- FontAwesomeModule], exports: [ChooseEnumComponent,
1400
- ChooseEnumRendererComponent,
1401
- ChooseGeneralItemComponent,
1402
- GeneralInputRendererComponent,
1403
- ChooseLineTypeComponent,
1404
- ChooseYesOrNoComponent,
1405
- ChooseYesOrNoRendererComponent,
1406
- EditableSavableInputComponent,
1407
- DropdownActionsComponent,
1408
- DynamicPipe,
1409
- AddAsteriskDirective] });
1410
- InputsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: InputsModule, imports: [CommonModule,
1411
- NgSelectModule,
1412
- FormsModule,
1413
- ReactiveFormsModule,
1414
- AppMaterialModule,
1415
- SharedGeneralComponentsModule,
1416
- FontAwesomeModule] });
1417
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: InputsModule, decorators: [{
1418
- type: NgModule,
1419
- args: [{
1420
- declarations: [
1421
- ChooseEnumComponent,
1422
- ChooseEnumRendererComponent,
1423
- ChooseGeneralItemComponent,
1424
- GeneralInputRendererComponent,
1425
- ChooseLineTypeComponent,
1426
- ChooseYesOrNoComponent,
1427
- ChooseYesOrNoRendererComponent,
1428
- EditableSavableInputComponent,
1429
- DynamicPipe,
1430
- ChooseGeneralItemRendererComponent,
1431
- CustomDecimalPointTwoDigitsDirective,
1432
- ShowTableErrorsComponent,
1433
- FormControlValidationMsgDirectiveForInput,
1434
- DropdownActionsComponent,
1435
- AddAsteriskDirective
1436
- ],
1437
- imports: [
1438
- CommonModule,
1439
- NgSelectModule,
1440
- FormsModule,
1441
- ReactiveFormsModule,
1442
- AppMaterialModule,
1443
- SharedGeneralComponentsModule,
1444
- FontAwesomeModule,
1445
- ],
1446
- exports: [
1447
- ChooseEnumComponent,
1448
- ChooseEnumRendererComponent,
1449
- ChooseGeneralItemComponent,
1450
- GeneralInputRendererComponent,
1451
- ChooseLineTypeComponent,
1452
- ChooseYesOrNoComponent,
1453
- ChooseYesOrNoRendererComponent,
1454
- EditableSavableInputComponent,
1455
- DropdownActionsComponent,
1456
- DynamicPipe,
1457
- AddAsteriskDirective
1458
- ]
1459
- }]
1460
- }] });
1461
-
1462
- /*
1463
- * Public API Surface of inputs
1464
- */
1465
-
1466
- /**
1467
- * Generated bundle index. Do not edit.
1468
- */
1469
-
1470
- export { AddAsteriskDirective, ChooseEnumComponent, ChooseEnumRendererComponent, ChooseGeneralItemComponent, ChooseGeneralItemRendererComponent, ChooseGeneralItemService, ChooseLineTypeComponent, ChooseYesOrNoComponent, ChooseYesOrNoRendererComponent, DropdownActionType, DropdownActionsComponent, DynamicPipe, EditableSavableInputComponent, FormControlValidationMsgDirectiveForInput, GeneralInputRendererComponent, InputsModule, LabelAndField, PrimaryColors, ShowTableErrorsComponent };
1471
- //# sourceMappingURL=inputs.mjs.map