@rlucan/ui 14.2.5 → 14.2.6

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 (105) hide show
  1. package/{esm2020 → esm2022}/lib/action-button/action-button.component.mjs +99 -99
  2. package/esm2022/lib/action-icon/action-icon.component.mjs +37 -0
  3. package/esm2022/lib/autocomplete/autocomplete.component.mjs +391 -0
  4. package/esm2022/lib/avatar/avatar.component.mjs +34 -0
  5. package/esm2022/lib/button/button.component.mjs +57 -0
  6. package/esm2022/lib/checkbox/checkbox.component.mjs +39 -0
  7. package/{esm2020 → esm2022}/lib/checkbox-group/checkbox-group.component.mjs +91 -91
  8. package/esm2022/lib/currency/currency.component.mjs +151 -0
  9. package/esm2022/lib/date/date.component.mjs +68 -0
  10. package/{esm2020 → esm2022}/lib/dialog/dialog.component.mjs +37 -37
  11. package/esm2022/lib/directives/force-visibility/force-visibility.directive.mjs +104 -0
  12. package/esm2022/lib/editor/editor.component.mjs +119 -0
  13. package/{esm2020 → esm2022}/lib/elements/burger/burger.component.mjs +21 -21
  14. package/{esm2020 → esm2022}/lib/elements/expander/expander.component.mjs +28 -28
  15. package/{esm2020 → esm2022}/lib/elements/validation-message/validation-message.component.mjs +47 -47
  16. package/esm2022/lib/file/file.component.mjs +145 -0
  17. package/esm2022/lib/file-uploader/ui-file-uploader.component.mjs +405 -0
  18. package/esm2022/lib/input/input.component.mjs +265 -0
  19. package/esm2022/lib/input-autocomplete/input-autocomplete.component.mjs +277 -0
  20. package/esm2022/lib/layouts/base/ui-base-layout.component.mjs +22 -0
  21. package/esm2022/lib/layouts/base/ui-base.component.mjs +74 -0
  22. package/esm2022/lib/layouts/simple/ui-simple-layout.component.mjs +18 -0
  23. package/esm2022/lib/layouts/simple/ui-simple.component.mjs +166 -0
  24. package/{esm2020 → esm2022}/lib/radio/radio.component.mjs +21 -21
  25. package/esm2022/lib/radio-group/radio-group.component.mjs +53 -0
  26. package/esm2022/lib/select/select.component.mjs +115 -0
  27. package/{esm2020 → esm2022}/lib/services/message-box.service.mjs +112 -112
  28. package/{esm2020 → esm2022}/lib/services/toast.service.mjs +23 -23
  29. package/{esm2020 → esm2022}/lib/services/ui-file.service.mjs +71 -71
  30. package/{esm2020 → esm2022}/lib/services/ui-translate.service.mjs +32 -32
  31. package/{esm2020 → esm2022}/lib/submit-button/submit-button.component.mjs +72 -72
  32. package/esm2022/lib/table/table.component.mjs +97 -0
  33. package/esm2022/lib/text-area/text-area.component.mjs +46 -0
  34. package/{esm2020 → esm2022}/lib/ui.model.mjs +1 -1
  35. package/esm2022/lib/ui.module.mjs +269 -0
  36. package/esm2022/public-api.mjs +35 -0
  37. package/{esm2020 → esm2022}/rlucan-ui.mjs +4 -4
  38. package/fesm2022/rlucan-ui.mjs +3442 -0
  39. package/fesm2022/rlucan-ui.mjs.map +1 -0
  40. package/index.d.ts +5 -5
  41. package/lib/action-button/action-button.component.d.ts +32 -32
  42. package/lib/action-icon/action-icon.component.d.ts +15 -15
  43. package/lib/autocomplete/autocomplete.component.d.ts +57 -57
  44. package/lib/avatar/avatar.component.d.ts +14 -14
  45. package/lib/button/button.component.d.ts +18 -18
  46. package/lib/checkbox/checkbox.component.d.ts +15 -15
  47. package/lib/checkbox-group/checkbox-group.component.d.ts +18 -18
  48. package/lib/currency/currency.component.d.ts +31 -30
  49. package/lib/date/date.component.d.ts +24 -24
  50. package/lib/dialog/dialog.component.d.ts +13 -13
  51. package/lib/directives/force-visibility/force-visibility.directive.d.ts +22 -20
  52. package/lib/editor/editor.component.d.ts +24 -0
  53. package/lib/elements/burger/burger.component.d.ts +9 -9
  54. package/lib/elements/expander/expander.component.d.ts +10 -10
  55. package/lib/elements/validation-message/validation-message.component.d.ts +12 -12
  56. package/lib/file/file.component.d.ts +35 -35
  57. package/lib/file-uploader/ui-file-uploader.component.d.ts +102 -102
  58. package/lib/input/input.component.d.ts +42 -41
  59. package/lib/input-autocomplete/input-autocomplete.component.d.ts +44 -0
  60. package/lib/{base → layouts/base}/ui-base-layout.component.d.ts +8 -8
  61. package/lib/{base → layouts/base}/ui-base.component.d.ts +23 -23
  62. package/lib/{simple → layouts/simple}/ui-simple-layout.component.d.ts +8 -7
  63. package/lib/{simple → layouts/simple}/ui-simple.component.d.ts +40 -39
  64. package/lib/radio/radio.component.d.ts +8 -8
  65. package/lib/radio-group/radio-group.component.d.ts +18 -18
  66. package/lib/select/select.component.d.ts +35 -33
  67. package/lib/services/message-box.service.d.ts +58 -58
  68. package/lib/services/toast.service.d.ts +13 -13
  69. package/lib/services/ui-file.service.d.ts +33 -33
  70. package/lib/services/ui-translate.service.d.ts +11 -11
  71. package/lib/submit-button/submit-button.component.d.ts +21 -21
  72. package/lib/table/table.component.d.ts +36 -36
  73. package/lib/text-area/text-area.component.d.ts +18 -18
  74. package/lib/ui.model.d.ts +2 -2
  75. package/lib/ui.module.d.ts +59 -56
  76. package/package.json +22 -24
  77. package/public-api.d.ts +29 -27
  78. package/scss/ui-defaults.scss +1 -1
  79. package/src/js/editorjs.mjs +9634 -0
  80. package/ui.scss +41 -14
  81. package/esm2020/lib/action-icon/action-icon.component.mjs +0 -37
  82. package/esm2020/lib/autocomplete/autocomplete.component.mjs +0 -391
  83. package/esm2020/lib/avatar/avatar.component.mjs +0 -34
  84. package/esm2020/lib/base/ui-base-layout.component.mjs +0 -22
  85. package/esm2020/lib/base/ui-base.component.mjs +0 -74
  86. package/esm2020/lib/button/button.component.mjs +0 -57
  87. package/esm2020/lib/checkbox/checkbox.component.mjs +0 -39
  88. package/esm2020/lib/currency/currency.component.mjs +0 -148
  89. package/esm2020/lib/date/date.component.mjs +0 -68
  90. package/esm2020/lib/directives/force-visibility/force-visibility.directive.mjs +0 -96
  91. package/esm2020/lib/file/file.component.mjs +0 -145
  92. package/esm2020/lib/file-uploader/ui-file-uploader.component.mjs +0 -394
  93. package/esm2020/lib/input/input.component.mjs +0 -258
  94. package/esm2020/lib/radio-group/radio-group.component.mjs +0 -53
  95. package/esm2020/lib/select/select.component.mjs +0 -91
  96. package/esm2020/lib/simple/ui-simple-layout.component.mjs +0 -15
  97. package/esm2020/lib/simple/ui-simple.component.mjs +0 -154
  98. package/esm2020/lib/table/table.component.mjs +0 -97
  99. package/esm2020/lib/text-area/text-area.component.mjs +0 -46
  100. package/esm2020/lib/ui.module.mjs +0 -255
  101. package/esm2020/public-api.mjs +0 -33
  102. package/fesm2015/rlucan-ui.mjs +0 -3017
  103. package/fesm2015/rlucan-ui.mjs.map +0 -1
  104. package/fesm2020/rlucan-ui.mjs +0 -2982
  105. package/fesm2020/rlucan-ui.mjs.map +0 -1
@@ -0,0 +1,3442 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, Input, HostBinding, InjectionToken, Injectable, Inject, EventEmitter, Optional, Host, SkipSelf, ViewChild, Output, Self, Directive, HostListener, NgModule } from '@angular/core';
3
+ import * as i2 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i3 from '@angular/material/icon';
6
+ import { MatIconModule } from '@angular/material/icon';
7
+ import * as i3$1 from '@angular/material/progress-bar';
8
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
9
+ import * as i4 from '@angular/material/core';
10
+ import { MatRippleModule, MAT_DATE_LOCALE } from '@angular/material/core';
11
+ import * as i1$2 from '@angular/material/dialog';
12
+ import { MAT_DIALOG_DATA, MatDialogConfig, MatDialogModule } from '@angular/material/dialog';
13
+ import { MatButtonModule } from '@angular/material/button';
14
+ import * as i3$3 from '@angular/material/checkbox';
15
+ import { MatCheckboxModule, MAT_CHECKBOX_DEFAULT_OPTIONS } from '@angular/material/checkbox';
16
+ import * as i4$5 from '@angular/material/datepicker';
17
+ import { MatDatepickerModule } from '@angular/material/datepicker';
18
+ import * as i3$2 from '@angular/cdk/drag-drop';
19
+ import { DragDropModule } from '@angular/cdk/drag-drop';
20
+ import * as i1 from '@angular/forms';
21
+ import { FormControl, Validators, NG_VALUE_ACCESSOR, NG_VALIDATORS, UntypedFormGroup, UntypedFormControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
22
+ import * as i4$1 from '@angular/material/tooltip';
23
+ import { MatTooltipModule } from '@angular/material/tooltip';
24
+ import * as i3$5 from '@angular/material/table';
25
+ import { MatTableModule } from '@angular/material/table';
26
+ import * as i4$6 from '@angular/material/sort';
27
+ import { MatSort, MatSortModule } from '@angular/material/sort';
28
+ import * as i4$2 from '@angular/material/select';
29
+ import { MatSelectModule } from '@angular/material/select';
30
+ import * as i4$3 from '@angular/material/progress-spinner';
31
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
32
+ import { MatMenuModule } from '@angular/material/menu';
33
+ import * as i8 from 'ngx-image-cropper';
34
+ import { ImageCropperModule } from 'ngx-image-cropper';
35
+ import { RouterModule } from '@angular/router';
36
+ import * as i5 from '@angular/cdk/overlay';
37
+ import { OverlayModule } from '@angular/cdk/overlay';
38
+ import * as i6 from 'ngx-uploader';
39
+ import { NgxUploaderModule } from 'ngx-uploader';
40
+ import { MatMomentDateModule, MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular/material-moment-adapter';
41
+ import { Subscription, Subject } from 'rxjs';
42
+ import * as i1$1 from '@angular/platform-browser';
43
+ import * as i3$4 from '@angular/material/input';
44
+ import { MatInputModule } from '@angular/material/input';
45
+ import * as i4$4 from '@angular/cdk/text-field';
46
+ import { debounceTime } from 'rxjs/operators';
47
+ import * as i3$6 from '@angular/material/radio';
48
+ import { MatRadioModule, MAT_RADIO_DEFAULT_OPTIONS } from '@angular/material/radio';
49
+ import * as i1$3 from '@angular/material/snack-bar';
50
+ import { MatSnackBarModule } from '@angular/material/snack-bar';
51
+ import EditorJS from '@editorjs/editorjs';
52
+ import List from '@editorjs/list';
53
+ import Header from '@editorjs/header';
54
+ import * as i7 from '@angular/material/autocomplete';
55
+ import { MatAutocompleteModule } from '@angular/material/autocomplete';
56
+
57
+ class ButtonComponent {
58
+ get class() {
59
+ return this.kind +
60
+ (this.color ? ' ' + this.color : '') +
61
+ (this.size ? ' ' + this.size : '') +
62
+ ((this.disabled || this.busy) ? ' disabled' : '');
63
+ }
64
+ constructor() {
65
+ this.type = 'button';
66
+ this.disabled = false;
67
+ this.busy = false;
68
+ this.kind = 'flat';
69
+ this.color = 'primary';
70
+ this.size = 'normal';
71
+ this.formInvalid = false;
72
+ }
73
+ get isDisabled() {
74
+ return this.disabled || this.busy;
75
+ }
76
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
77
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: ButtonComponent, selector: "ui-button", inputs: { type: "type", matIconPrefix: "matIconPrefix", label: "label", disabled: "disabled", busy: "busy", kind: "kind", color: "color", size: "size", formInvalid: "formInvalid" }, host: { properties: { "class": "this.class", "class.formInvalid": "this.formInvalid" } }, ngImport: i0, template: "<button matRipple [type]=\"type\" [disabled]=\"isDisabled || busy\" [ngClass]=\"{busy: busy}\" [class]=\"class\">\r\n <mat-icon *ngIf=\"matIconPrefix\">{{matIconPrefix}}</mat-icon>\r\n {{label}}\r\n <mat-progress-bar *ngIf=\"busy\" mode=\"indeterminate\" [color]=\"color\"></mat-progress-bar>\r\n</button>\r\n", styles: [":host{display:flex;align-items:center}:host button{font-size:1em;width:100%;cursor:pointer;outline:none;position:relative;display:flex;align-items:center;justify-content:center;border:1px solid transparent;transition:all .15s ease-in-out}:host button mat-progress-bar{position:absolute;bottom:1px;height:2px;border-bottom-left-radius:10px;border-bottom-right-radius:10px}:host button mat-icon{margin-right:4px;height:16px;width:16px;font-size:16px}:host.small button mat-icon{width:14px;height:14px;font-size:14px;margin-right:2px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i4.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }] }); }
78
+ }
79
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ButtonComponent, decorators: [{
80
+ type: Component,
81
+ args: [{ selector: 'ui-button', template: "<button matRipple [type]=\"type\" [disabled]=\"isDisabled || busy\" [ngClass]=\"{busy: busy}\" [class]=\"class\">\r\n <mat-icon *ngIf=\"matIconPrefix\">{{matIconPrefix}}</mat-icon>\r\n {{label}}\r\n <mat-progress-bar *ngIf=\"busy\" mode=\"indeterminate\" [color]=\"color\"></mat-progress-bar>\r\n</button>\r\n", styles: [":host{display:flex;align-items:center}:host button{font-size:1em;width:100%;cursor:pointer;outline:none;position:relative;display:flex;align-items:center;justify-content:center;border:1px solid transparent;transition:all .15s ease-in-out}:host button mat-progress-bar{position:absolute;bottom:1px;height:2px;border-bottom-left-radius:10px;border-bottom-right-radius:10px}:host button mat-icon{margin-right:4px;height:16px;width:16px;font-size:16px}:host.small button mat-icon{width:14px;height:14px;font-size:14px;margin-right:2px}\n"] }]
82
+ }], ctorParameters: function () { return []; }, propDecorators: { type: [{
83
+ type: Input
84
+ }], matIconPrefix: [{
85
+ type: Input
86
+ }], label: [{
87
+ type: Input
88
+ }], disabled: [{
89
+ type: Input
90
+ }], busy: [{
91
+ type: Input
92
+ }], kind: [{
93
+ type: Input
94
+ }], color: [{
95
+ type: Input
96
+ }], size: [{
97
+ type: Input
98
+ }], class: [{
99
+ type: HostBinding,
100
+ args: ['class']
101
+ }], formInvalid: [{
102
+ type: HostBinding,
103
+ args: ['class.formInvalid']
104
+ }, {
105
+ type: Input
106
+ }] } });
107
+
108
+ class UiBaseComponent {
109
+ // get control() {
110
+ // return this.controlFormGroup.get('text');
111
+ // }
112
+ constructor() {
113
+ this.placeholder = '';
114
+ this.useInputMessages = 'always';
115
+ this.inputMessagesPosition = 'relative';
116
+ this.size = 'normal';
117
+ // control = new FormControl();
118
+ // controlFormGroup;
119
+ this.required = false;
120
+ // this.ngControl.valueAccessor = this;
121
+ }
122
+ ngOnInit() {
123
+ // console.log(this.controlContainer);
124
+ // this.controlFormGroup.valueChanges.subscribe(v => {
125
+ // this.onChange(v);
126
+ // });
127
+ // this.ngControl.control.statusChanges.subscribe(v => console.log(v));
128
+ //
129
+ // this.ngControl.control.markAsTouched = (opts?: {
130
+ // onlySelf?: boolean;
131
+ // }) => {
132
+ // if (!this.control.touched) {
133
+ // console.log('marking as touched');
134
+ // this.control.markAsTouched(opts);
135
+ // }
136
+ // this.control.updateValueAndValidity({onlySelf: opts?.onlySelf, emitEvent: false});
137
+ // }
138
+ // setTimeout(() => {
139
+ // this.applyValidators(this.validators);
140
+ // });
141
+ }
142
+ // bindValidators(validators: ValidatorFn[]): void {
143
+ // this.control.setValidators(validators);
144
+ // }
145
+ get validationErrors() {
146
+ return null;
147
+ }
148
+ get validationMessage() {
149
+ return 'obsolete...';
150
+ }
151
+ get isInvalid() {
152
+ return false;
153
+ }
154
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
155
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: UiBaseComponent, selector: "ui-abstract-base-component", inputs: { placeholder: "placeholder", label: "label", useInputMessages: "useInputMessages", inputMessagesPosition: "inputMessagesPosition", hint: "hint", size: "size" }, host: { properties: { "class": "this.size" } }, ngImport: i0, template: '** abstract **', isInline: true }); }
156
+ }
157
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiBaseComponent, decorators: [{
158
+ type: Component,
159
+ args: [{
160
+ selector: 'ui-abstract-base-component',
161
+ template: '** abstract **'
162
+ }]
163
+ }], ctorParameters: function () { return []; }, propDecorators: { placeholder: [{
164
+ type: Input
165
+ }], label: [{
166
+ type: Input
167
+ }], useInputMessages: [{
168
+ type: Input
169
+ }], inputMessagesPosition: [{
170
+ type: Input
171
+ }], hint: [{
172
+ type: Input
173
+ }], size: [{
174
+ type: HostBinding,
175
+ args: ['class']
176
+ }, {
177
+ type: Input
178
+ }] } });
179
+
180
+ class UiSimpleComponent extends UiBaseComponent {
181
+ constructor(ngControl, // <-- obsolete
182
+ controlContainer = null) {
183
+ super();
184
+ this.ngControl = ngControl;
185
+ this.controlContainer = controlContainer;
186
+ this.sub = new Subscription();
187
+ this.onChange = (val) => { };
188
+ this.onTouched = () => { };
189
+ this.onValidatorChange = () => { };
190
+ if (ngControl) {
191
+ ngControl.valueAccessor = this;
192
+ }
193
+ else {
194
+ this.componentFormControl = new FormControl();
195
+ // this.componentFormControl.markAsUntouched();
196
+ this.sub.add(this.componentFormControl.valueChanges.subscribe(v => {
197
+ try {
198
+ // console.log(v, this.componentFormControl.value);
199
+ this.onChange(v);
200
+ }
201
+ catch (e) { /*console.error(e);*/
202
+ }
203
+ }));
204
+ }
205
+ // this.ngControl.valueAccessor = this;
206
+ }
207
+ get maxLenRequired() {
208
+ return this.componentFormControl.value && (this.componentFormControl.value.length > (this.validators?.maxLength || 0));
209
+ }
210
+ get isInvalid() {
211
+ // console.log(this.label, this.componentFormControl.touched);
212
+ return this.componentFormControl.touched && !!this.componentFormControl.errors;
213
+ }
214
+ get validationErrors() {
215
+ return this.componentFormControl?.errors;
216
+ }
217
+ ngOnDestroy() {
218
+ this.sub.unsubscribe();
219
+ }
220
+ ngOnInit() {
221
+ if (this.ngControl) {
222
+ if (this.formControl) {
223
+ this.componentFormControl = this.formControl;
224
+ }
225
+ else {
226
+ this.componentFormControl = this.ngControl.control;
227
+ }
228
+ setTimeout(() => this.applyTemplateValidators());
229
+ }
230
+ else {
231
+ this.parentFormControl = this.formControlName ?
232
+ this.controlContainer.control.get(this.formControlName) : this.formControl;
233
+ if (this.parentFormControl) {
234
+ this.componentFormControl.setValidators(this.parentFormControl.validator);
235
+ this.parentFormControl._componentFormControl = this.componentFormControl;
236
+ if (this.parentFormControl._markAsTouched === undefined) {
237
+ this.parentFormControl._markAsTouched = this.parentFormControl.markAsTouched;
238
+ this.parentFormControl._setErrors = this.parentFormControl.setErrors;
239
+ this.parentFormControl.markAsTouched = ({ onlySelf } = {}) => {
240
+ this.parentFormControl._markAsTouched({ onlySelf });
241
+ this.parentFormControl._componentFormControl.markAsTouched({ onlySelf });
242
+ this.componentFormControl.setErrors(this.parentFormControl.errors);
243
+ };
244
+ this.parentFormControl.setErrors = (errors) => {
245
+ this.parentFormControl._setErrors(errors);
246
+ this.parentFormControl._componentFormControl.setErrors(errors);
247
+ };
248
+ }
249
+ setTimeout(() => this.applyTemplateValidators());
250
+ }
251
+ }
252
+ }
253
+ applyTemplateValidators() {
254
+ const inputValidators = this.validators;
255
+ if (inputValidators) {
256
+ const validators = [];
257
+ Object.keys(inputValidators).forEach(v => {
258
+ switch (v) {
259
+ case 'required':
260
+ validators.push(Validators.required);
261
+ this.required = true;
262
+ break;
263
+ case 'maxLength':
264
+ validators.push((c) => {
265
+ const requiredLength = inputValidators.maxLength || 0;
266
+ if (this.inputLength() > requiredLength) {
267
+ return { maxlength: { requiredLength } };
268
+ }
269
+ else {
270
+ return null;
271
+ }
272
+ }); // Validators.maxLength(inputValidators.maxLength || 0));
273
+ break;
274
+ }
275
+ });
276
+ if (this.parentFormControl) {
277
+ this.parentFormControl.setValidators(validators);
278
+ this.parentFormControl.updateValueAndValidity({ emitEvent: false });
279
+ this.componentFormControl.setValidators(this.parentFormControl.validator);
280
+ }
281
+ else {
282
+ this.componentFormControl.addValidators(validators);
283
+ this.componentFormControl.updateValueAndValidity();
284
+ }
285
+ }
286
+ }
287
+ ngOnChanges(changes) {
288
+ if (changes.validators && this.componentFormControl) {
289
+ this.applyTemplateValidators(); // changes.validators.currentValue as UiValidators);
290
+ }
291
+ }
292
+ registerOnChange(fn) {
293
+ this.onChange = fn;
294
+ }
295
+ registerOnTouched(fn) {
296
+ this.onTouched = fn;
297
+ }
298
+ setDisabledState(isDisabled) {
299
+ if (this.componentFormControl) {
300
+ isDisabled ? this.componentFormControl.disable({ emitEvent: false }) : this.componentFormControl.enable({ emitEvent: false });
301
+ }
302
+ }
303
+ writeValue(obj) {
304
+ if (!this.ngControl) {
305
+ if (obj && obj.error) {
306
+ console.log('setting error', obj, obj.error);
307
+ this.componentFormControl.setErrors(obj.error === 'clear' ? null : { custom: obj.error }, { emitEvent: false });
308
+ }
309
+ else {
310
+ this.componentFormControl.setValue(obj);
311
+ }
312
+ }
313
+ }
314
+ registerOnValidatorChange(fn) {
315
+ this.onValidatorChange = fn;
316
+ }
317
+ validate(control) {
318
+ return null;
319
+ }
320
+ inputLength() {
321
+ return this.componentFormControl.value ? this.componentFormControl.value.length : 0;
322
+ }
323
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiSimpleComponent, deps: [{ token: i1.NgControl }, { token: i1.ControlContainer }], target: i0.ɵɵFactoryTarget.Component }); }
324
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: UiSimpleComponent, selector: "ui-abstract-simple-component", inputs: { validators: "validators", formControl: "formControl", formControlName: "formControlName" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '** abstract **', isInline: true }); }
325
+ }
326
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiSimpleComponent, decorators: [{
327
+ type: Component,
328
+ args: [{
329
+ selector: 'ui-abstract-simple-component',
330
+ template: '** abstract **'
331
+ }]
332
+ }], ctorParameters: function () { return [{ type: i1.NgControl }, { type: i1.ControlContainer }]; }, propDecorators: { validators: [{
333
+ type: Input
334
+ }], formControl: [{
335
+ type: Input
336
+ }], formControlName: [{
337
+ type: Input
338
+ }] } });
339
+
340
+ const UI_TRANSLATESERVICE = new InjectionToken('IUiTranslateService');
341
+ class UiTranslateService {
342
+ instant(code, data) {
343
+ switch (code) {
344
+ case 'ui.controls.ui-file-uploader.menu.change': return 'Změnit';
345
+ case 'ui.controls.ui-file-uploader.menu.delete': return 'Smazat';
346
+ case 'ui.controls.ui-file-uploader.uploadError': return 'Chyba při ukládání souboru';
347
+ case 'ui.controls.validation.required': return 'Povinná položka';
348
+ case 'ui.controls.validation.email': return 'Neplatný email';
349
+ case 'ui.controls.validation.matDatepickerParse': return 'Neplatné datum';
350
+ case 'ui.controls.validation.maxlength': return 'Zadej maximálně ' + data.requiredLength + ' znaků';
351
+ case 'ui.controls.validation.minlength': return 'Zadej minimálně ' + data.requiredLength + ' znaků';
352
+ case 'ui.controls.validation.invalidNumber': return 'Neplatné číslo';
353
+ case 'ui.controls.validation.positive': return 'Musí být větší než 0';
354
+ case 'ui.controls.validation.cbGroupRequired': return 'Zaškrtni alespoň jednu položku';
355
+ case 'ui.controls.ui-select.clear-selection': return 'Zrušit výběr';
356
+ case 'ui.controls.ui-select.all': return 'Vše';
357
+ case 'ui.controls.ui-select.apply-selection': return 'Použít výběr';
358
+ case 'ui.messagebox.button.cancel': return 'Zrušit';
359
+ case 'ui.messagebox.button.delete': return 'Smazat';
360
+ default: return code;
361
+ }
362
+ }
363
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiTranslateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
364
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiTranslateService }); }
365
+ }
366
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiTranslateService, decorators: [{
367
+ type: Injectable
368
+ }] });
369
+
370
+ class ValidationMessageComponent {
371
+ constructor(translateService) {
372
+ this.translateService = translateService;
373
+ }
374
+ ngOnInit() {
375
+ }
376
+ get errorMessage() {
377
+ let e = { code: 'Neznámá chyba' };
378
+ const errors = this.validationErrors;
379
+ if (errors) {
380
+ Object.keys(errors).find(a => {
381
+ e = { code: a, data: errors[a] };
382
+ return true;
383
+ });
384
+ switch (e.code) {
385
+ case 'required':
386
+ case 'cbGroupRequired':
387
+ case 'email':
388
+ case 'matDatepickerParse':
389
+ case 'maxlength':
390
+ case 'minlength':
391
+ return this.translateService.instant('ui.controls.validation.' + e.code, e.data);
392
+ case 'positive':
393
+ return this.translateService.instant(isNaN(Number(e.data)) ? 'ui.controls.validation.invalidNumber' : 'ui.controls.validation.positive');
394
+ case 'custom':
395
+ return this.translateService.instant(e.data);
396
+ default:
397
+ return this.translateService.instant(e.code);
398
+ }
399
+ }
400
+ }
401
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ValidationMessageComponent, deps: [{ token: UI_TRANSLATESERVICE }], target: i0.ɵɵFactoryTarget.Component }); }
402
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: ValidationMessageComponent, selector: "ui-validation-message", inputs: { validationErrors: "validationErrors" }, ngImport: i0, template: "{{ errorMessage }}\r\n" }); }
403
+ }
404
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ValidationMessageComponent, decorators: [{
405
+ type: Component,
406
+ args: [{ selector: 'ui-validation-message', template: "{{ errorMessage }}\r\n" }]
407
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
408
+ type: Inject,
409
+ args: [UI_TRANSLATESERVICE]
410
+ }] }]; }, propDecorators: { validationErrors: [{
411
+ type: Input
412
+ }] } });
413
+
414
+ class UiBaseLayoutComponent {
415
+ get class() {
416
+ return `${this.ctx.isInvalid ? 'invalid ' : ''} ${this.ctx.inputMessagesPosition}`;
417
+ }
418
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiBaseLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
419
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: UiBaseLayoutComponent, selector: "ui-base-layout", inputs: { ctx: "ctx" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<div class=\"label\" *ngIf=\"ctx.label\">\r\n <div class=\"text-container\" [matTooltip]=\"false && ctx.required ? 'Povinn\u00E1 polo\u017Eka' : undefined\" [matTooltipPosition]=\"'above'\">\r\n <div class=\"text\" >{{ctx.label}}</div>\r\n <div *ngIf=\"false && ctx.required\" class=\"required\">*</div>\r\n </div>\r\n <ng-content select=\".counter-top\"></ng-content>\r\n</div>\r\n\r\n<ng-content></ng-content>\r\n\r\n<div class=\"hint-container\" *ngIf=\"ctx.useInputMessages === 'always' || (ctx.useInputMessages === 'ondemand' && (ctx.isInvalid || ctx.hint))\">\r\n <ui-validation-message class=\"invalid\" *ngIf=\"ctx.isInvalid\" [validationErrors]=\"ctx.validationErrors\"></ui-validation-message>\r\n <div class=\"hint\" *ngIf=\"!ctx.isInvalid && ctx.hint\" [innerHTML]=\"ctx.hint\"></div>\r\n <ng-container *ngIf=\"!ctx.label\">\r\n <ng-content select=\".counter-bottom\"></ng-content>\r\n </ng-container>\r\n</div>\r\n", styles: [":host{width:100%;display:flex;flex-direction:column}:host .label{display:flex;align-items:center}:host .label .text-container{display:flex;align-items:center}:host .label .text-container .text{font-size:.9em;line-height:1em;padding:6px 0 4px}:host .label .text-container .required{align-self:baseline;padding:0 4px;font-size:1.2em}:host ::ng-deep .counter{margin-left:auto;padding-right:.4em}:host ::ng-deep .counter.counter-top{font-size:.8em}:host.absolute{position:relative}:host.absolute .hint-container{position:absolute;bottom:-1.2em;width:100vw}:host .hint-container{display:flex;height:1.2em;text-align:left;font-size:.8em;margin-top:.1em}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: ValidationMessageComponent, selector: "ui-validation-message", inputs: ["validationErrors"] }] }); }
420
+ }
421
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiBaseLayoutComponent, decorators: [{
422
+ type: Component,
423
+ args: [{ selector: 'ui-base-layout', template: "<div class=\"label\" *ngIf=\"ctx.label\">\r\n <div class=\"text-container\" [matTooltip]=\"false && ctx.required ? 'Povinn\u00E1 polo\u017Eka' : undefined\" [matTooltipPosition]=\"'above'\">\r\n <div class=\"text\" >{{ctx.label}}</div>\r\n <div *ngIf=\"false && ctx.required\" class=\"required\">*</div>\r\n </div>\r\n <ng-content select=\".counter-top\"></ng-content>\r\n</div>\r\n\r\n<ng-content></ng-content>\r\n\r\n<div class=\"hint-container\" *ngIf=\"ctx.useInputMessages === 'always' || (ctx.useInputMessages === 'ondemand' && (ctx.isInvalid || ctx.hint))\">\r\n <ui-validation-message class=\"invalid\" *ngIf=\"ctx.isInvalid\" [validationErrors]=\"ctx.validationErrors\"></ui-validation-message>\r\n <div class=\"hint\" *ngIf=\"!ctx.isInvalid && ctx.hint\" [innerHTML]=\"ctx.hint\"></div>\r\n <ng-container *ngIf=\"!ctx.label\">\r\n <ng-content select=\".counter-bottom\"></ng-content>\r\n </ng-container>\r\n</div>\r\n", styles: [":host{width:100%;display:flex;flex-direction:column}:host .label{display:flex;align-items:center}:host .label .text-container{display:flex;align-items:center}:host .label .text-container .text{font-size:.9em;line-height:1em;padding:6px 0 4px}:host .label .text-container .required{align-self:baseline;padding:0 4px;font-size:1.2em}:host ::ng-deep .counter{margin-left:auto;padding-right:.4em}:host ::ng-deep .counter.counter-top{font-size:.8em}:host.absolute{position:relative}:host.absolute .hint-container{position:absolute;bottom:-1.2em;width:100vw}:host .hint-container{display:flex;height:1.2em;text-align:left;font-size:.8em;margin-top:.1em}\n"] }]
424
+ }], propDecorators: { ctx: [{
425
+ type: Input
426
+ }], class: [{
427
+ type: HostBinding,
428
+ args: ['class']
429
+ }] } });
430
+
431
+ class UiSimpleLayoutComponent {
432
+ length() {
433
+ return this.ctx.inputLength();
434
+ }
435
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiSimpleLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
436
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: UiSimpleLayoutComponent, selector: "ui-simple-layout", inputs: { ctx: "ctx" }, ngImport: i0, template: "<ui-base-layout [ctx]=\"ctx\">\r\n\r\n <div *ngIf=\"ctx.validators?.maxLength\" class=\"counter counter-top\">\r\n {{ length() }} / {{ ctx.validators?.maxLength }}\r\n </div>\r\n\r\n <div *ngIf=\"ctx.validators?.maxLength\" class=\"counter counter-bottom\">\r\n {{ length() }} / {{ ctx.validators?.maxLength }}\r\n </div>\r\n\r\n <ng-content></ng-content>\r\n\r\n</ui-base-layout>\r\n", dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: UiBaseLayoutComponent, selector: "ui-base-layout", inputs: ["ctx"] }] }); }
437
+ }
438
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiSimpleLayoutComponent, decorators: [{
439
+ type: Component,
440
+ args: [{ selector: 'ui-simple-layout', template: "<ui-base-layout [ctx]=\"ctx\">\r\n\r\n <div *ngIf=\"ctx.validators?.maxLength\" class=\"counter counter-top\">\r\n {{ length() }} / {{ ctx.validators?.maxLength }}\r\n </div>\r\n\r\n <div *ngIf=\"ctx.validators?.maxLength\" class=\"counter counter-bottom\">\r\n {{ length() }} / {{ ctx.validators?.maxLength }}\r\n </div>\r\n\r\n <ng-content></ng-content>\r\n\r\n</ui-base-layout>\r\n" }]
441
+ }], propDecorators: { ctx: [{
442
+ type: Input
443
+ }] } });
444
+
445
+ class ActionIconComponent {
446
+ get class() {
447
+ return `${this.size} ${this.color}${this.disabled ? ' disabled' : ''}${this.busy ? ' busy' : ''}`;
448
+ }
449
+ constructor() {
450
+ this.size = 'normal';
451
+ this.color = 'primary';
452
+ this.disabled = false;
453
+ this.busy = false;
454
+ this.matIcon = 'close';
455
+ }
456
+ ngOnInit() {
457
+ }
458
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ActionIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
459
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: ActionIconComponent, selector: "ui-action-icon", inputs: { size: "size", color: "color", disabled: "disabled", busy: "busy", matIcon: "matIcon" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<mat-icon>{{matIcon}}</mat-icon>\r\n", styles: [":host{display:flex}:host:not(.disabled){cursor:pointer}:host mat-icon{width:1em;height:1em;transition:color .25s}:host.small mat-icon{font-size:1em}:host.smaller mat-icon{font-size:1.25em}:host.normal mat-icon{font-size:1.5em}:host.larger mat-icon{font-size:1.75em}:host.large mat-icon{font-size:2em}\n"], dependencies: [{ kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
460
+ }
461
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ActionIconComponent, decorators: [{
462
+ type: Component,
463
+ args: [{ selector: 'ui-action-icon', template: "<mat-icon>{{matIcon}}</mat-icon>\r\n", styles: [":host{display:flex}:host:not(.disabled){cursor:pointer}:host mat-icon{width:1em;height:1em;transition:color .25s}:host.small mat-icon{font-size:1em}:host.smaller mat-icon{font-size:1.25em}:host.normal mat-icon{font-size:1.5em}:host.larger mat-icon{font-size:1.75em}:host.large mat-icon{font-size:2em}\n"] }]
464
+ }], ctorParameters: function () { return []; }, propDecorators: { size: [{
465
+ type: Input
466
+ }], color: [{
467
+ type: Input
468
+ }], disabled: [{
469
+ type: Input
470
+ }], busy: [{
471
+ type: Input
472
+ }], matIcon: [{
473
+ type: Input
474
+ }], class: [{
475
+ type: HostBinding,
476
+ args: ['class']
477
+ }] } });
478
+
479
+ class InputComponent extends UiSimpleComponent {
480
+ get textAlignClass() {
481
+ return `text-align-${this.textAlign}`;
482
+ }
483
+ get hasPrefix() {
484
+ return (this.prefixIcon && this.prefixIcon.icon !== '') || this.prefix?.nativeElement?.innerText !== '' || this.forceHasPrefix;
485
+ }
486
+ get hasSuffix() {
487
+ return (this.suffixIcon && this.suffixIcon.icon !== '') || this.suffix?.nativeElement?.innerText !== '' || this.forceHasSuffix;
488
+ }
489
+ // control;
490
+ // onTouched = () => {};
491
+ // onChange = (value) => {};
492
+ // get showInvalid(): boolean {
493
+ // return true;
494
+ // // return this.control.touched && !!this.control.errors;
495
+ // }
496
+ // get validationMessage(): string {
497
+ // // console.log(this.control?.errors);
498
+ // let e: any = {code: 'Neznámá chyba'};
499
+ // const errors = this.control?.errors || {};
500
+ // Object.keys(errors).find(a => {
501
+ // e = {code: a, data: errors[a]};
502
+ // return true;
503
+ // });
504
+ // switch (e.code) {
505
+ // case 'required':
506
+ // return this.translateService.instant('ui.controls.validation.required');
507
+ // case 'email':
508
+ // return this.translateService.instant('ui.controls.validation.email');
509
+ // case 'matDatepickerParse':
510
+ // return this.translateService.instant('ui.controls.validation.matDatepickerParse');
511
+ // case 'maxlength':
512
+ // return this.translateService.instant('ui.controls.validation.maxlength', e.data);
513
+ // case 'minlength':
514
+ // return this.translateService.instant('ui.controls.validation.minlength', e.data);
515
+ // case 'positive':
516
+ // return this.translateService.instant(isNaN(Number(e.data)) ? 'ui.controls.validation.invalidNumber' : 'ui.controls.validation.positive');
517
+ // case 'custom':
518
+ // return this.translateService.instant(e.data);
519
+ // default:
520
+ // return this.translateService.instant(e.code);
521
+ // }
522
+ // }
523
+ get maxLenRequired() {
524
+ return true;
525
+ // return this.control.value && (this.control.value.length > (this.validators?.maxLength || 0));
526
+ }
527
+ constructor(controlContainer) {
528
+ super(null, controlContainer);
529
+ this.controlContainer = controlContainer;
530
+ this.type = 'text';
531
+ this.clearButton = false;
532
+ this.activeIcons = true;
533
+ this.forceHasPrefix = false;
534
+ this.forceHasSuffix = false;
535
+ this.textAlign = 'left';
536
+ this.focusChanged = new EventEmitter();
537
+ this.keyPressed = new EventEmitter();
538
+ // control = new FormControl();
539
+ this.required = false;
540
+ this.hasFocus = false;
541
+ // this.componentFormControl = new FormControl();
542
+ // super();
543
+ // super(undefined, /*ngControl*/ translateService);
544
+ // super(control);
545
+ // console.log(control);
546
+ // if (control) {
547
+ // control.valueAccessor = this;
548
+ // }
549
+ // if (ngControl != null) {
550
+ // // Setting the value accessor directly (instead of using
551
+ // // the providers) to avoid running into a circular import.
552
+ // ngControl.valueAccessor = this;
553
+ // }
554
+ }
555
+ get showClearButton() {
556
+ return this.clearButton && this.componentFormControl?.value !== '';
557
+ }
558
+ ngOnInit() {
559
+ super.ngOnInit();
560
+ // console.log('probiha vubec oninit?');
561
+ // if (this.ngControl) {
562
+ // console.log('from ngControl....??');
563
+ // if (this.formControl) {
564
+ // this.componentFormControl = this.formControl;
565
+ // } else {
566
+ // this.componentFormControl = this.ngControl.control as UntypedFormControl;
567
+ // }
568
+ // setTimeout(() => {
569
+ // this.applyValidators();
570
+ // });
571
+ // } else {
572
+ // const control = this.formControlName ?
573
+ // (this.controlContainer as FormGroupDirective).control.get(this.formControlName) : this.formControl;
574
+ // this.componentFormControl.setValidators(control.validator);
575
+ // this.componentFormControl.valueChanges.subscribe(v => console.log('onitin sub', v));
576
+ // control._componentFormControl = this.componentFormControl;
577
+ // if (control._markAsTouched === undefined) {
578
+ // // control._componentFormControl = this.componentFormControl;
579
+ // console.log('overriding markAsTouched for', this.formControlName);
580
+ // control._markAsTouched = control.markAsTouched;
581
+ // control.markAsTouched = ({onlySelf}: { onlySelf?: boolean } = {}): void => {
582
+ // console.log('marking as touched', this.componentFormControl.value, control.value, this.xxx.value, control._componentFormControl.value);
583
+ // control._markAsTouched({onlySelf});
584
+ // setTimeout(() => control._componentFormControl.markAsTouched(), 1000);
585
+ // }
586
+ // }
587
+ // }
588
+ }
589
+ clearValue() {
590
+ this.componentFormControl?.setValue('');
591
+ this.input?.nativeElement.focus();
592
+ }
593
+ focus() {
594
+ this.input?.nativeElement.focus();
595
+ }
596
+ onFocus(focus) {
597
+ setTimeout(() => {
598
+ this.hasFocus = focus;
599
+ this.focusChanged.emit(focus);
600
+ });
601
+ }
602
+ onKeypressed($event) {
603
+ this.keyPressed.emit($event);
604
+ }
605
+ // registerOnChange(onChange: any): void {
606
+ // this.onChange = onChange;
607
+ // }
608
+ //
609
+ // registerOnTouched(onTouched: any): void {
610
+ // this.onTouched = onTouched;
611
+ // }
612
+ // registerOnValidatorChange(fn: () => void): void {
613
+ // }
614
+ // setDisabledState(isDisabled: boolean): void {
615
+ // // isDisabled ? this.control.disable() : this.control.enable();
616
+ // }
617
+ // validate(control: AbstractControl): ValidationErrors | null {
618
+ // // this.control = control;
619
+ // // console.log(control, control.value, control.errors);
620
+ // if (this.value === 'error') {
621
+ // return { customError: 'muj error'}
622
+ // } else {
623
+ // return null;
624
+ // }
625
+ // // console.log('custom validate');
626
+ // // return null;
627
+ // }
628
+ //
629
+ // writeValue(obj: any): void {
630
+ // console.log('writevalue: ', obj);
631
+ // this.componentFormControl.setValue(obj);
632
+ // // this.value = obj;
633
+ // // this.control.setValue(obj);
634
+ // }
635
+ //
636
+ // registerOnChange(fn: any): void {
637
+ // }
638
+ //
639
+ // registerOnTouched(fn: any): void {
640
+ // }
641
+ //
642
+ // setDisabledState(isDisabled: boolean): void {
643
+ // }
644
+ // modelChange($event: any) {
645
+ // console.log($event);
646
+ // this.onTouched();
647
+ // this.onChange($event)
648
+ // }
649
+ // validate(control: AbstractControl): ValidationErrors | null {
650
+ // console.log(this.label, 'validate');
651
+ // return this.componentFormControl.errors;
652
+ // // return undefined;
653
+ // }
654
+ validate(control) {
655
+ if (this.parentFormControl) {
656
+ return this.parentFormControl._componentFormControl.errors;
657
+ }
658
+ // console.log('validate', this.componentFormControl.errors);
659
+ // // this.componentFormControl.setErrors( { custom: 'xxx' });
660
+ // this.componentFormControl.setErrors( this.componentFormControl.errors);
661
+ // console.log('validate 2', this.componentFormControl.errors);
662
+ // return this.componentFormControl.errors;
663
+ // console.log(this.componentFormControl.errors, control.errors, this.parentFormControl.errors, this);
664
+ // return this.componentFormControl.errors;
665
+ }
666
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: InputComponent, deps: [{ token: i1.ControlContainer, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); }
667
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: InputComponent, selector: "ui-input", inputs: { prefixIcon: "prefixIcon", suffixIcon: "suffixIcon", type: "type", clearButton: "clearButton", activeIcons: "activeIcons", forceHasPrefix: "forceHasPrefix", forceHasSuffix: "forceHasSuffix", textAlign: "textAlign" }, outputs: { focusChanged: "focusChanged", keyPressed: "keyPressed" }, host: { properties: { "class": "this.textAlignClass" } }, providers: [
668
+ {
669
+ provide: NG_VALUE_ACCESSOR,
670
+ multi: true,
671
+ useExisting: InputComponent
672
+ },
673
+ {
674
+ provide: NG_VALIDATORS,
675
+ multi: true,
676
+ useExisting: InputComponent
677
+ }
678
+ ], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "prefix", first: true, predicate: ["prefix"], descendants: true, static: true }, { propertyName: "suffix", first: true, predicate: ["suffix"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<div class=\"control-container\" [ngClass]=\"{'has-suffix': hasSuffix, 'has-prefix': hasPrefix, 'has-clear-icon': showClearButton, 'active-icons': activeIcons, 'has-focus': hasFocus}\">\r\n <input #input [type]=\"type\" [formControl]=\"componentFormControl\" [placeholder]=\"placeholder\" (keydown)=\"onKeypressed($event)\" (focus)=\"onFocus(true)\" (blur)=\"onFocus(false)\" />\r\n <div #prefix><ng-content select=\"[slot=prefix]\"></ng-content></div>\r\n <div #suffix><ng-content select=\"[slot=suffix]\"></ng-content></div>\r\n <mat-icon *ngIf=\"prefixIcon\" class=\"prefix-icon\" [matTooltip]=\"prefixIcon.tooltip\">{{ prefixIcon.icon }}</mat-icon>\r\n <mat-icon *ngIf=\"suffixIcon\" class=\"suffix-icon\" [matTooltip]=\"suffixIcon.tooltip\">{{ suffixIcon.icon }}</mat-icon>\r\n <ui-action-icon [size]=\"'small'\" [color]=\"'warn'\" *ngIf=\"showClearButton\" (click)=\"clearValue()\" [matIcon]=\"'clear'\" class=\"clear-icon\"></ui-action-icon>\r\n</div>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n", ":host.text-align-left ::ng-deep input{text-align:left}:host.text-align-right ::ng-deep input{text-align:right}:host.text-align-center ::ng-deep input{text-align:center}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: UiSimpleLayoutComponent, selector: "ui-simple-layout", inputs: ["ctx"] }, { kind: "component", type: ActionIconComponent, selector: "ui-action-icon", inputs: ["size", "color", "disabled", "busy", "matIcon"] }] }); }
679
+ }
680
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: InputComponent, decorators: [{
681
+ type: Component,
682
+ args: [{ selector: 'ui-input', providers: [
683
+ {
684
+ provide: NG_VALUE_ACCESSOR,
685
+ multi: true,
686
+ useExisting: InputComponent
687
+ },
688
+ {
689
+ provide: NG_VALIDATORS,
690
+ multi: true,
691
+ useExisting: InputComponent
692
+ }
693
+ ], template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<div class=\"control-container\" [ngClass]=\"{'has-suffix': hasSuffix, 'has-prefix': hasPrefix, 'has-clear-icon': showClearButton, 'active-icons': activeIcons, 'has-focus': hasFocus}\">\r\n <input #input [type]=\"type\" [formControl]=\"componentFormControl\" [placeholder]=\"placeholder\" (keydown)=\"onKeypressed($event)\" (focus)=\"onFocus(true)\" (blur)=\"onFocus(false)\" />\r\n <div #prefix><ng-content select=\"[slot=prefix]\"></ng-content></div>\r\n <div #suffix><ng-content select=\"[slot=suffix]\"></ng-content></div>\r\n <mat-icon *ngIf=\"prefixIcon\" class=\"prefix-icon\" [matTooltip]=\"prefixIcon.tooltip\">{{ prefixIcon.icon }}</mat-icon>\r\n <mat-icon *ngIf=\"suffixIcon\" class=\"suffix-icon\" [matTooltip]=\"suffixIcon.tooltip\">{{ suffixIcon.icon }}</mat-icon>\r\n <ui-action-icon [size]=\"'small'\" [color]=\"'warn'\" *ngIf=\"showClearButton\" (click)=\"clearValue()\" [matIcon]=\"'clear'\" class=\"clear-icon\"></ui-action-icon>\r\n</div>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n", ":host.text-align-left ::ng-deep input{text-align:left}:host.text-align-right ::ng-deep input{text-align:right}:host.text-align-center ::ng-deep input{text-align:center}\n"] }]
694
+ }], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
695
+ type: Optional
696
+ }, {
697
+ type: Host
698
+ }, {
699
+ type: SkipSelf
700
+ }] }]; }, propDecorators: { prefixIcon: [{
701
+ type: Input
702
+ }], suffixIcon: [{
703
+ type: Input
704
+ }], type: [{
705
+ type: Input
706
+ }], clearButton: [{
707
+ type: Input
708
+ }], activeIcons: [{
709
+ type: Input
710
+ }], forceHasPrefix: [{
711
+ type: Input
712
+ }], forceHasSuffix: [{
713
+ type: Input
714
+ }], textAlignClass: [{
715
+ type: HostBinding,
716
+ args: ['class']
717
+ }], textAlign: [{
718
+ type: Input
719
+ }], input: [{
720
+ type: ViewChild,
721
+ args: ['input']
722
+ }], prefix: [{
723
+ type: ViewChild,
724
+ args: ['prefix', { static: true }]
725
+ }], suffix: [{
726
+ type: ViewChild,
727
+ args: ['suffix', { static: true }]
728
+ }], focusChanged: [{
729
+ type: Output
730
+ }], keyPressed: [{
731
+ type: Output
732
+ }] } });
733
+
734
+ class SelectComponent extends UiSimpleComponent {
735
+ constructor(ngControl, translateService) {
736
+ super(ngControl);
737
+ this.ngControl = ngControl;
738
+ this.translateService = translateService;
739
+ this.multiple = false;
740
+ this.options = [];
741
+ this.allowEmptySelection = false;
742
+ this.lastCount = -1;
743
+ this.overoption = false;
744
+ this.optionToValue = (o) => this.valueAttribute ? o[this.valueAttribute] : o;
745
+ }
746
+ ngOnInit() {
747
+ super.ngOnInit();
748
+ if (this.optionFormatter === undefined) {
749
+ this.optionFormatter = o => this.displayAttribute ? o[this.displayAttribute] : o;
750
+ }
751
+ if (this.multiple && this.componentFormControl) {
752
+ this.lastCount = this.componentFormControl.value.length;
753
+ this.componentFormControl.valueChanges.subscribe(v => {
754
+ if (v.length === 1 && this.lastCount === 0 && this.overoption) {
755
+ this.select.selectionChange.emit(this.optionToValue(v));
756
+ this.select.close();
757
+ }
758
+ this.lastCount = v.length;
759
+ });
760
+ }
761
+ if (this.trackBy && this.componentFormControl) {
762
+ const v = this.componentFormControl.value;
763
+ if (v) {
764
+ if (this.multiple) {
765
+ this.componentFormControl.setValue(this.options.filter(o => v.find(v => v[this.trackBy] === o[this.trackBy])), { emitEvent: false });
766
+ }
767
+ else {
768
+ this.componentFormControl.setValue(this.options.find(o => o[this.trackBy] === v[this.trackBy]), { emitEvent: false });
769
+ }
770
+ }
771
+ }
772
+ }
773
+ selectOption(o, select) {
774
+ select.selectionChange.emit(this.optionToValue(o));
775
+ select.close();
776
+ }
777
+ selectAll() {
778
+ this.componentFormControl.setValue(this.options.map(o => this.optionToValue(o)));
779
+ }
780
+ clearAll() {
781
+ this.componentFormControl.setValue([]);
782
+ }
783
+ setDisabledState(isDisabled) {
784
+ }
785
+ writeValue(obj) {
786
+ if (!this.ngControl) {
787
+ if (obj && obj.error) {
788
+ console.log('setting error', obj, obj.error);
789
+ this.componentFormControl.setErrors(obj.error === 'clear' ? null : { custom: obj.error }, { emitEvent: false });
790
+ }
791
+ else {
792
+ this.componentFormControl.setValue(obj);
793
+ }
794
+ }
795
+ }
796
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: SelectComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: UI_TRANSLATESERVICE }], target: i0.ɵɵFactoryTarget.Component }); }
797
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: SelectComponent, selector: "ui-select", inputs: { multiple: "multiple", triggerFormatter: "triggerFormatter", valueAttribute: "valueAttribute", resetText: "resetText", displayAttribute: "displayAttribute", options: "options", optionFormatter: "optionFormatter", optionTemplateRef: "optionTemplateRef", triggerTemplateRef: "triggerTemplateRef", panelClass: "panelClass", allowEmptySelection: "allowEmptySelection", trackBy: "trackBy" }, viewQueries: [{ propertyName: "select", first: true, predicate: ["select"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<mat-select class=\"control-container\" #select [panelClass]=\"panelClass\" [placeholder]=\"placeholder\" [formControl]=\"componentFormControl\" [multiple]=\"multiple\">\r\n\r\n <mat-select-trigger *ngIf=\"triggerTemplateRef\">\r\n <ng-template [ngTemplateOutlet]=\"triggerTemplateRef\" [ngTemplateOutletContext]=\"{option:componentFormControl?.value}\" ></ng-template>\r\n </mat-select-trigger>\r\n\r\n <mat-select-trigger *ngIf=\"triggerFormatter\">{{componentFormControl?.value ? triggerFormatter(componentFormControl?.value) : ''}}</mat-select-trigger>\r\n\r\n <mat-option *ngIf=\"resetText\">{{resetText}}</mat-option>\r\n\r\n <mat-option *ngFor=\"let o of options\" [value]=\"optionToValue(o)\" >\r\n\r\n <div class=\"option-container\" (mouseenter)=\"overoption = true;\" (mouseleave)=\"overoption = false\">\r\n\r\n <ng-container *ngIf=\"optionTemplateRef\">\r\n <ng-template [ngTemplateOutlet]=\"optionTemplateRef\" [ngTemplateOutletContext]=\"{option:o}\" ></ng-template>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!optionTemplateRef\">\r\n {{optionFormatter(o)}}\r\n </ng-container>\r\n\r\n <mat-icon class=\"select-one\" *ngIf=\"multiple && componentFormControl?.value?.length === 0\" (click)=\"selectOption(o, select)\">north_west</mat-icon>\r\n </div>\r\n\r\n </mat-option>\r\n\r\n <div class=\"buttons\" *ngIf=\"multiple\">\r\n <ui-button style=\"margin-right: auto;\" [kind]=\"'basic'\" [size]=\"'smaller'\" [label]=\"translateService.instant('ui.controls.ui-select.clear-selection')\" (click)=\"clearAll()\"></ui-button>\r\n <ui-button [size]=\"'smaller'\" [label]=\"translateService.instant('ui.controls.ui-select.all')\" (click)=\"selectAll()\"></ui-button>\r\n <ui-button [size]=\"'smaller'\" style=\"padding-left: 0.2em;\" [disabled]=\"componentFormControl?.value?.length === 0 && !allowEmptySelection\" [label]=\"translateService.instant('ui.controls.ui-select.apply-selection') + (componentFormControl?.value?.length > 0 ? ' (' + componentFormControl.value.length + ')' : '')\" (click)=\"select.close()\"></ui-button>\r\n </div>\r\n\r\n</mat-select>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n", "::ng-deep .mat-mdc-select-panel{padding:0!important}::ng-deep .mat-mdc-select-arrow-wrapper{height:1px!important}::ng-deep .mat-select-panel .select-one,::ng-deep .mat-mdc-select-panel .select-one{position:absolute;right:0;top:.3em;display:none}::ng-deep .mat-select-panel .mat-option-text:hover .select-one,::ng-deep .mat-select-panel .mat-mdc-option:hover .select-one,::ng-deep .mat-mdc-select-panel .mat-option-text:hover .select-one,::ng-deep .mat-mdc-select-panel .mat-mdc-option:hover .select-one{display:block}::ng-deep .mat-select-panel .buttons,::ng-deep .mat-mdc-select-panel .buttons{padding:.2em;background-color:#fff;display:flex;position:sticky;bottom:0}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i4$2.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex", "panelWidth", "hideSingleSelectionIndicator"], exportAs: ["matSelect"] }, { kind: "directive", type: i4$2.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i4.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["type", "matIconPrefix", "label", "disabled", "busy", "kind", "color", "size", "formInvalid"] }, { kind: "component", type: UiSimpleLayoutComponent, selector: "ui-simple-layout", inputs: ["ctx"] }] }); }
798
+ }
799
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: SelectComponent, decorators: [{
800
+ type: Component,
801
+ args: [{ selector: 'ui-select', template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<mat-select class=\"control-container\" #select [panelClass]=\"panelClass\" [placeholder]=\"placeholder\" [formControl]=\"componentFormControl\" [multiple]=\"multiple\">\r\n\r\n <mat-select-trigger *ngIf=\"triggerTemplateRef\">\r\n <ng-template [ngTemplateOutlet]=\"triggerTemplateRef\" [ngTemplateOutletContext]=\"{option:componentFormControl?.value}\" ></ng-template>\r\n </mat-select-trigger>\r\n\r\n <mat-select-trigger *ngIf=\"triggerFormatter\">{{componentFormControl?.value ? triggerFormatter(componentFormControl?.value) : ''}}</mat-select-trigger>\r\n\r\n <mat-option *ngIf=\"resetText\">{{resetText}}</mat-option>\r\n\r\n <mat-option *ngFor=\"let o of options\" [value]=\"optionToValue(o)\" >\r\n\r\n <div class=\"option-container\" (mouseenter)=\"overoption = true;\" (mouseleave)=\"overoption = false\">\r\n\r\n <ng-container *ngIf=\"optionTemplateRef\">\r\n <ng-template [ngTemplateOutlet]=\"optionTemplateRef\" [ngTemplateOutletContext]=\"{option:o}\" ></ng-template>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!optionTemplateRef\">\r\n {{optionFormatter(o)}}\r\n </ng-container>\r\n\r\n <mat-icon class=\"select-one\" *ngIf=\"multiple && componentFormControl?.value?.length === 0\" (click)=\"selectOption(o, select)\">north_west</mat-icon>\r\n </div>\r\n\r\n </mat-option>\r\n\r\n <div class=\"buttons\" *ngIf=\"multiple\">\r\n <ui-button style=\"margin-right: auto;\" [kind]=\"'basic'\" [size]=\"'smaller'\" [label]=\"translateService.instant('ui.controls.ui-select.clear-selection')\" (click)=\"clearAll()\"></ui-button>\r\n <ui-button [size]=\"'smaller'\" [label]=\"translateService.instant('ui.controls.ui-select.all')\" (click)=\"selectAll()\"></ui-button>\r\n <ui-button [size]=\"'smaller'\" style=\"padding-left: 0.2em;\" [disabled]=\"componentFormControl?.value?.length === 0 && !allowEmptySelection\" [label]=\"translateService.instant('ui.controls.ui-select.apply-selection') + (componentFormControl?.value?.length > 0 ? ' (' + componentFormControl.value.length + ')' : '')\" (click)=\"select.close()\"></ui-button>\r\n </div>\r\n\r\n</mat-select>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n", "::ng-deep .mat-mdc-select-panel{padding:0!important}::ng-deep .mat-mdc-select-arrow-wrapper{height:1px!important}::ng-deep .mat-select-panel .select-one,::ng-deep .mat-mdc-select-panel .select-one{position:absolute;right:0;top:.3em;display:none}::ng-deep .mat-select-panel .mat-option-text:hover .select-one,::ng-deep .mat-select-panel .mat-mdc-option:hover .select-one,::ng-deep .mat-mdc-select-panel .mat-option-text:hover .select-one,::ng-deep .mat-mdc-select-panel .mat-mdc-option:hover .select-one{display:block}::ng-deep .mat-select-panel .buttons,::ng-deep .mat-mdc-select-panel .buttons{padding:.2em;background-color:#fff;display:flex;position:sticky;bottom:0}\n"] }]
802
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
803
+ type: Optional
804
+ }, {
805
+ type: Self
806
+ }] }, { type: undefined, decorators: [{
807
+ type: Inject,
808
+ args: [UI_TRANSLATESERVICE]
809
+ }] }]; }, propDecorators: { multiple: [{
810
+ type: Input
811
+ }], triggerFormatter: [{
812
+ type: Input
813
+ }], valueAttribute: [{
814
+ type: Input
815
+ }], resetText: [{
816
+ type: Input
817
+ }], displayAttribute: [{
818
+ type: Input
819
+ }], options: [{
820
+ type: Input
821
+ }], optionFormatter: [{
822
+ type: Input
823
+ }], optionTemplateRef: [{
824
+ type: Input
825
+ }], triggerTemplateRef: [{
826
+ type: Input
827
+ }], panelClass: [{
828
+ type: Input
829
+ }], allowEmptySelection: [{
830
+ type: Input
831
+ }], trackBy: [{
832
+ type: Input
833
+ }], select: [{
834
+ type: ViewChild,
835
+ args: ['select']
836
+ }] } });
837
+
838
+ const UI_FILESERVICE = new InjectionToken('IUiFileService');
839
+ // export const FileServiceConfigService = new InjectionToken<FileServiceConfig>('FileServiceConfig');
840
+ class UiFileService {
841
+ constructor(fileServiceConfig) {
842
+ this.fileServiceConfig = fileServiceConfig;
843
+ this.uploadInput = new EventEmitter();
844
+ this.uploadSubscription = new Subject();
845
+ this.filesToRemove = [];
846
+ this.controls = new Set();
847
+ this.uploadSubscription.subscribe((v) => {
848
+ switch (v.action) {
849
+ case 'register':
850
+ this.controls.add(v.data);
851
+ return;
852
+ case 'destroy':
853
+ this.controls.delete(v.data);
854
+ return;
855
+ case 'uploadStarted':
856
+ let cnt = 0;
857
+ this.controls.forEach(c => cnt += c.hasFilesToUpload ? 1 : 0);
858
+ if (cnt === 0) {
859
+ this.uploadSubscription.next({ action: 'uploadSuccess' });
860
+ }
861
+ break;
862
+ case 'uploadControlFailed':
863
+ case 'uploadControlSuccess':
864
+ let cnt2 = 0;
865
+ this.controls.forEach(c => cnt2 += c.hasFilesToUpload ? 1 : 0);
866
+ if (cnt2 === 0) {
867
+ this.uploadSubscription.next({ action: v.action === 'uploadControlFailed' ? 'uploadFailed' : 'uploadSuccess' });
868
+ }
869
+ break;
870
+ }
871
+ });
872
+ }
873
+ upload() {
874
+ const promises = [];
875
+ this.controls.forEach(c => promises.push(c.beforeSave()));
876
+ return new Promise((res, rej) => {
877
+ this.uploadSubscription.subscribe((v) => {
878
+ if (v.action === 'uploadSuccess' || v.action === 'uploadFailed') {
879
+ res(v.action);
880
+ }
881
+ });
882
+ this.uploadSubscription.next({ action: 'uploadStarted' });
883
+ Promise.all(promises).then((r) => {
884
+ const event = {
885
+ type: 'uploadAll',
886
+ url: this.fileServiceConfig.uploadUrl,
887
+ method: 'POST',
888
+ headers: this.fileServiceConfig.getAuthHeader()
889
+ };
890
+ this.uploadInput.emit(event);
891
+ });
892
+ });
893
+ }
894
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiFileService, deps: [{ token: UI_FILESERVICE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
895
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiFileService }); }
896
+ }
897
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiFileService, decorators: [{
898
+ type: Injectable
899
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
900
+ type: Optional
901
+ }, {
902
+ type: Inject,
903
+ args: [UI_FILESERVICE]
904
+ }] }]; } });
905
+
906
+ class FileComponent {
907
+ get fitImageFileSize() {
908
+ if (!this.fileServiceConfig.imageSizes[this.fileSize]) {
909
+ console.error('Missing filesize for ' + this.fileSize);
910
+ }
911
+ return this.fileServiceConfig.imageSizes[this.fileSize][0] < 0 || this.fileServiceConfig.imageSizes[this.fileSize][1] < 0;
912
+ }
913
+ get width() {
914
+ if (this.fitImageFileSize) {
915
+ if (this.nativeFileSizeRatio === -1) {
916
+ return '100%';
917
+ }
918
+ else {
919
+ return this.nativeFileWidth + 'px';
920
+ }
921
+ }
922
+ else {
923
+ return this.fileServiceConfig.imageSizes[this.fileSize] ? this.fileServiceConfig.imageSizes[this.fileSize][0] + 'px' : undefined;
924
+ }
925
+ }
926
+ get maxWidth() {
927
+ if (this.fileServiceConfig.imageSizes[this.fileSize][0] < 0) {
928
+ return this.width;
929
+ }
930
+ return this.fileServiceConfig.imageSizes[this.fileSize] ? this.fileServiceConfig.imageSizes[this.fileSize][0] + 'px' : undefined;
931
+ }
932
+ get height() {
933
+ if (this.fitImageFileSize) {
934
+ if (this.nativeFileSizeRatio === -1) {
935
+ return '100%';
936
+ }
937
+ else {
938
+ return this.nativeFileHeight + 'px';
939
+ }
940
+ }
941
+ else {
942
+ return this.fileServiceConfig.imageSizes[this.fileSize] ? this.fileServiceConfig.imageSizes[this.fileSize][1] + 'px' : undefined;
943
+ }
944
+ }
945
+ get maxHeight() {
946
+ if (this.fileServiceConfig.imageSizes[this.fileSize][1] < 0) {
947
+ return this.height;
948
+ }
949
+ return this.fileServiceConfig.imageSizes[this.fileSize] ? this.fileServiceConfig.imageSizes[this.fileSize][1] + 'px' : undefined;
950
+ }
951
+ get isVideo() {
952
+ return this.mime.startsWith('video/');
953
+ }
954
+ get mime() {
955
+ if (this.srcUrlMimeType) {
956
+ return this.srcUrlMimeType;
957
+ }
958
+ else {
959
+ if (this.srcData.nativeFile) {
960
+ return this.srcData.nativeFile.type;
961
+ }
962
+ return this.fileServiceConfig.getMimeType(this.srcData);
963
+ }
964
+ }
965
+ get useRetinaSrc() {
966
+ return this.fileServiceConfig.useRetinaSrc;
967
+ }
968
+ constructor(fileServiceConfig, domSanitizer, fileService) {
969
+ this.fileServiceConfig = fileServiceConfig;
970
+ this.domSanitizer = domSanitizer;
971
+ this.fileService = fileService;
972
+ this.fileSize = 'default';
973
+ this.visible = false;
974
+ this.nativeFileSizeRatio = -1;
975
+ }
976
+ ngOnInit() {
977
+ }
978
+ ngOnChanges(changes) {
979
+ if (changes.srcData) {
980
+ this.nativeFileSizeRatio = -1;
981
+ if (changes.srcData.currentValue.nativeFile) {
982
+ this.src = this.domSanitizer.bypassSecurityTrustUrl(URL.createObjectURL(changes.srcData.currentValue.nativeFile));
983
+ const img = new Image();
984
+ img.onload = () => {
985
+ if (this.fitImageFileSize) {
986
+ this.nativeFileSizeRatio = Math.max(img.width / this.fileServiceConfig.imageSizes[this.fileSize][0], img.height / this.fileServiceConfig.imageSizes[this.fileSize][1], 1);
987
+ }
988
+ else {
989
+ this.nativeFileSizeRatio = 1;
990
+ }
991
+ this.nativeFileWidth = img.width / this.nativeFileSizeRatio;
992
+ this.nativeFileHeight = img.height / this.nativeFileSizeRatio;
993
+ URL.revokeObjectURL(img.src);
994
+ };
995
+ img.src = URL.createObjectURL(changes.srcData.currentValue.nativeFile);
996
+ }
997
+ else {
998
+ this.src = this.fileServiceConfig.getMediaSrc(this.fileSize, changes.srcData.currentValue, this.srcOptions);
999
+ }
1000
+ }
1001
+ if (changes.srcUrl) {
1002
+ this.src = changes.srcUrl.currentValue?.src;
1003
+ if (this.src) {
1004
+ this.srcUrlMimeType = changes.srcUrl.currentValue?.mimeType || 'image/png';
1005
+ }
1006
+ else {
1007
+ this.srcUrlMimeType = undefined;
1008
+ }
1009
+ }
1010
+ }
1011
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: FileComponent, deps: [{ token: UI_FILESERVICE, optional: true }, { token: i1$1.DomSanitizer }, { token: UiFileService }], target: i0.ɵɵFactoryTarget.Component }); }
1012
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: FileComponent, selector: "ui-file", inputs: { fileSize: "fileSize", srcOptions: "srcOptions", srcData: "srcData", srcUrl: "srcUrl" }, host: { properties: { "style.width": "this.width", "style.maxWidth": "this.maxWidth", "style.height": "this.height", "style.maxHeight": "this.maxHeight" } }, usesOnChanges: true, ngImport: i0, template: "<mat-spinner *ngIf=\"visible\"></mat-spinner>\r\n<img *ngIf=\"!isVideo && useRetinaSrc\" [src]=\"src\" [srcset]=\"src + ' 2x'\"/>\r\n<img *ngIf=\"!isVideo && !useRetinaSrc\" [src]=\"src\"/>\r\n<video *ngIf=\"isVideo\" muted controls [src]=\"src\"></video>\r\n\r\n", styles: [":host{display:flex;align-items:center;justify-content:center;position:relative}:host img,:host video{max-width:100%;max-height:100%}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4$3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] }); }
1013
+ }
1014
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: FileComponent, decorators: [{
1015
+ type: Component,
1016
+ args: [{ selector: 'ui-file', template: "<mat-spinner *ngIf=\"visible\"></mat-spinner>\r\n<img *ngIf=\"!isVideo && useRetinaSrc\" [src]=\"src\" [srcset]=\"src + ' 2x'\"/>\r\n<img *ngIf=\"!isVideo && !useRetinaSrc\" [src]=\"src\"/>\r\n<video *ngIf=\"isVideo\" muted controls [src]=\"src\"></video>\r\n\r\n", styles: [":host{display:flex;align-items:center;justify-content:center;position:relative}:host img,:host video{max-width:100%;max-height:100%}\n"] }]
1017
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1018
+ type: Optional
1019
+ }, {
1020
+ type: Inject,
1021
+ args: [UI_FILESERVICE]
1022
+ }] }, { type: i1$1.DomSanitizer }, { type: UiFileService }]; }, propDecorators: { fileSize: [{
1023
+ type: Input
1024
+ }], srcOptions: [{
1025
+ type: Input
1026
+ }], srcData: [{
1027
+ type: Input
1028
+ }], srcUrl: [{
1029
+ type: Input
1030
+ }], width: [{
1031
+ type: HostBinding,
1032
+ args: ['style.width']
1033
+ }], maxWidth: [{
1034
+ type: HostBinding,
1035
+ args: ['style.maxWidth']
1036
+ }], height: [{
1037
+ type: HostBinding,
1038
+ args: ['style.height']
1039
+ }], maxHeight: [{
1040
+ type: HostBinding,
1041
+ args: ['style.maxHeight']
1042
+ }] } });
1043
+
1044
+ class UiFileUploaderComponent extends UiSimpleComponent {
1045
+ get menuTemplate() {
1046
+ return this.templates?.menuTemplate;
1047
+ }
1048
+ get addFileTemplate() {
1049
+ return this.templates?.addFileTemplate;
1050
+ }
1051
+ get fileTemplate() {
1052
+ return this.templates?.fileTemplate;
1053
+ }
1054
+ constructor(fileServiceConfig, translateService, controlContainer, fileService) {
1055
+ super(null, controlContainer);
1056
+ this.fileServiceConfig = fileServiceConfig;
1057
+ this.translateService = translateService;
1058
+ this.controlContainer = controlContainer;
1059
+ this.fileService = fileService;
1060
+ this.maxFiles = 1;
1061
+ this.multiple = true;
1062
+ this.crop = false;
1063
+ this.cropRounded = false;
1064
+ this.fileSize = 'default';
1065
+ this.customFileMenu = false;
1066
+ this.newFilePosition = 'last';
1067
+ this.templates = {};
1068
+ this.previewPosition = 'bottom';
1069
+ this.imageCropped = new EventEmitter();
1070
+ this.fileEvent = new EventEmitter();
1071
+ this.uploadOptions = {
1072
+ concurrency: this.fileServiceConfig.concurrentUploads
1073
+ };
1074
+ this.uploading = false;
1075
+ this.showCropper = false;
1076
+ this.showCropPreview = {};
1077
+ this.cropPreviewTimeouts = {};
1078
+ this.cropSourceImages = {};
1079
+ this.cropperImageLoaded = {};
1080
+ this.imagesDone = {};
1081
+ this.transform = {};
1082
+ this.canvasRotation = {};
1083
+ this.refreshAddInput = false;
1084
+ this.patchingValues = false;
1085
+ this.inputArray = false;
1086
+ this.dragging = false;
1087
+ this.uploaderId = Math.round(Math.random() * 1000000);
1088
+ this.croppedImages = {};
1089
+ this.fileService.uploadSubscription.next({ action: 'register', data: this });
1090
+ this.fileService.uploadSubscription.subscribe((v) => {
1091
+ switch (v.action) {
1092
+ case 'uploadStarted':
1093
+ this.uploading = true;
1094
+ break;
1095
+ case 'uploadFailed':
1096
+ case 'uploadSuccess':
1097
+ setTimeout(() => {
1098
+ this.uploading = false;
1099
+ });
1100
+ this.patchValues();
1101
+ }
1102
+ });
1103
+ }
1104
+ get uploadInput() {
1105
+ return this.fileService.uploadInput;
1106
+ }
1107
+ get editable() {
1108
+ return this.componentFormControl.enabled;
1109
+ }
1110
+ get ngAddStyle() {
1111
+ return {
1112
+ width: Math.abs(this.fileServiceConfig.imageSizes[this.fileSize][0]) + 'px',
1113
+ height: Math.abs(this.fileServiceConfig.imageSizes[this.fileSize][1]) + 'px',
1114
+ };
1115
+ }
1116
+ get aspectRatio() {
1117
+ return this.fileServiceConfig.imageSizes[this.fileSize][0] / this.fileServiceConfig.imageSizes[this.fileSize][1];
1118
+ }
1119
+ get addFileImgSrc() {
1120
+ return this.fileServiceConfig.addFileImgSrc;
1121
+ }
1122
+ cropDone(f) {
1123
+ return !f.$newFile || this.imagesDone[f.$newFile.id];
1124
+ }
1125
+ // ngOnInit(): void {
1126
+ // super.ngOnInit();
1127
+ // }
1128
+ ngOnDestroy() {
1129
+ this.fileService.uploadSubscription.next({ action: 'destroy', data: this });
1130
+ }
1131
+ remove(f) {
1132
+ if (f.$newFile) {
1133
+ this.uploadInput.emit({ type: 'remove', id: f.$newFile.id });
1134
+ }
1135
+ this.files.splice(this.files.indexOf(f), 1);
1136
+ this.prepareResponse();
1137
+ // this.onChange(this.inputArray ? this.files : (this.files.length > 0 ? this.files[0] : null));
1138
+ this.fileEvent.emit({ message: 'fileRemoved', data: f });
1139
+ // this.patchValues();
1140
+ }
1141
+ patchValues() {
1142
+ this.patchingValues = true;
1143
+ // if (this.inputArray) {
1144
+ // this.componentFormControl.setValue(this.files.map(f => f.custom));
1145
+ // } else {
1146
+ // this.componentFormControl.setValue(this.files.length === 0 ? null : this.files[0].custom);
1147
+ // }
1148
+ this.patchingValues = false;
1149
+ }
1150
+ get hasFilesToUpload() {
1151
+ return !!this.files.find(f => f.$newFile && f.$newFile.progress.status !== 2);
1152
+ }
1153
+ canImagePreview(type) {
1154
+ return type.startsWith('image/') || type.startsWith('video/');
1155
+ }
1156
+ onUploadOutput($event, skipCustomValidation = false) {
1157
+ // console.log($event);
1158
+ switch ($event.type) {
1159
+ case 'start':
1160
+ break;
1161
+ case 'dragOver':
1162
+ this.dragging = true;
1163
+ break;
1164
+ case 'dragOut':
1165
+ case 'drop':
1166
+ this.dragging = false;
1167
+ break;
1168
+ case 'addedToQueue':
1169
+ if (this.crop && !$event.file.type.startsWith('image/')) {
1170
+ this.uploadInput.emit({ type: 'remove', id: $event.file.id });
1171
+ this.fileEvent.emit({ message: 'cropInvalidFileType', data: $event.file });
1172
+ return;
1173
+ }
1174
+ if (!skipCustomValidation && this.fileServiceConfig.fileValidation) {
1175
+ this.fileServiceConfig.fileValidation(this.fileSize, $event.file).then(valid => {
1176
+ if (valid) {
1177
+ this.onUploadOutput($event, true);
1178
+ }
1179
+ else {
1180
+ this.uploadInput.emit({ type: 'remove', id: $event.file.id });
1181
+ // this.fileEvent.emit({ message: 'cropInvalidFileType', data: $event.file });
1182
+ }
1183
+ });
1184
+ }
1185
+ else {
1186
+ let f;
1187
+ if (this.changeFileIndex !== undefined) {
1188
+ f = this.files[this.changeFileIndex];
1189
+ if (f.$newFile) {
1190
+ this.uploadInput.emit({ type: 'remove', id: f.$newFile.id });
1191
+ }
1192
+ f.$newFile = $event.file;
1193
+ f.custom = $event.file;
1194
+ this.changeFileIndex = undefined;
1195
+ }
1196
+ else {
1197
+ f = { custom: $event.file, $newFile: $event.file };
1198
+ if (this.newFilePosition === 'last') {
1199
+ this.files.push(f);
1200
+ }
1201
+ else {
1202
+ this.files.unshift(f);
1203
+ }
1204
+ }
1205
+ if (this.canImagePreview($event.file.type)) {
1206
+ if (this.crop) {
1207
+ this.canvasRotation[$event.file.id] = 0;
1208
+ this.cropSourceImages[$event.file.id] = $event.file.nativeFile;
1209
+ this.cropperImageLoaded[$event.file.id] = false;
1210
+ }
1211
+ }
1212
+ this.prepareResponse();
1213
+ this.fileEvent.emit({ message: 'fileAdded', data: f });
1214
+ }
1215
+ break;
1216
+ case 'done':
1217
+ const df = this.files.find(f => f.$newFile === $event.file);
1218
+ if (df) {
1219
+ if (df.$newFile.responseStatus === 200) {
1220
+ this.files[this.files.indexOf(df)].custom = df.$newFile.response;
1221
+ df.$newFile = null;
1222
+ }
1223
+ else {
1224
+ // console.log('error on upload', df.$event);
1225
+ }
1226
+ }
1227
+ if (!this.hasFilesToUpload) {
1228
+ this.prepareResponse(false);
1229
+ this.fileService.uploadSubscription.next({
1230
+ action: this.files.find(f => !!f.$newFile) ? 'uploadControlFailed' : 'uploadControlSuccess'
1231
+ });
1232
+ }
1233
+ break;
1234
+ }
1235
+ }
1236
+ prepareResponse(doemit = true) {
1237
+ if (this.inputArray) {
1238
+ if (!this.responseFiles) {
1239
+ this.responseFiles = [];
1240
+ }
1241
+ this.responseFiles.length = 0;
1242
+ this.files.forEach(f => this.responseFiles.push({ ...f.custom, $newFile: f.$newFile }));
1243
+ }
1244
+ else {
1245
+ if (this.files.length === 0) {
1246
+ this.responseFiles = null;
1247
+ }
1248
+ else {
1249
+ if (!this.responseFiles) {
1250
+ this.responseFiles = {};
1251
+ }
1252
+ Object.keys(this.files[0].custom).forEach(k => {
1253
+ this.responseFiles[k] = this.files[0].custom[k];
1254
+ });
1255
+ this.responseFiles.$newFile = this.files[0].$newFile;
1256
+ }
1257
+ }
1258
+ if (doemit) {
1259
+ this.onChange(this.responseFiles);
1260
+ }
1261
+ // console.log('emit', this.files[1], { ...this.files[1].custom, $newFile: this.files[1].$newFile });
1262
+ // this.onChange(this.inputArray ?
1263
+ // this.files.map(f => ({ ...f.custom, $newFile: f.$newFile})) :
1264
+ // (this.files.length > 0 ? { ...this.files[0].custom, $newFile: this.files[0].$newFile } : null));
1265
+ // this.onChange(this.inputArray ?
1266
+ // this.files :
1267
+ // (this.files.length > 0 ? this.files[0] : null));
1268
+ }
1269
+ beforeSave() {
1270
+ return new Promise((res, rej) => {
1271
+ this.files.forEach(f => {
1272
+ if (f.$newFile && f.$newFile.progress.status === 2) {
1273
+ f.$newFile.progress.status = 0;
1274
+ }
1275
+ if (this.crop && f.$newFile && !this.imagesDone[f.$newFile.id]) {
1276
+ this.cropperDone(f.$newFile.id);
1277
+ }
1278
+ });
1279
+ setTimeout(() => {
1280
+ res('done');
1281
+ }, 250);
1282
+ });
1283
+ }
1284
+ fileChangeEvent(event, f) {
1285
+ this.changeFileIndex = this.files.indexOf(f);
1286
+ }
1287
+ startCropPreview(id) {
1288
+ clearTimeout(this.cropPreviewTimeouts[id]);
1289
+ this.showCropPreview[id] = !!this.cropSourceImages[id];
1290
+ }
1291
+ stopCropPreview(id) {
1292
+ this.cropPreviewTimeouts[id] = setTimeout(() => {
1293
+ this.showCropPreview[id] = false;
1294
+ }, 250);
1295
+ }
1296
+ zoomCroppedImage(dir, id) {
1297
+ let scale = this.transform[id].scale;
1298
+ scale += dir;
1299
+ if (scale < 0.1) {
1300
+ scale = 0.1;
1301
+ }
1302
+ this.transform[id] = {
1303
+ ...this.transform[id],
1304
+ scale
1305
+ };
1306
+ }
1307
+ rotateCroppedImage(dir, id) {
1308
+ this.canvasRotation[id] += dir;
1309
+ const flippedH = this.transform[id].flipH;
1310
+ const flippedV = this.transform[id].flipV;
1311
+ this.transform[id] = {
1312
+ ...this.transform[id],
1313
+ flipH: flippedV,
1314
+ flipV: flippedH
1315
+ };
1316
+ }
1317
+ onImageCropped(event, id) {
1318
+ this.croppedImages[id] = event;
1319
+ this.imageCropped.emit(event);
1320
+ }
1321
+ imageLoaded(id) {
1322
+ this.showCropper = true;
1323
+ setTimeout(() => {
1324
+ this.transform[id] = {
1325
+ scale: 1
1326
+ };
1327
+ });
1328
+ }
1329
+ cropperReady(sourceImageDimensions, id) {
1330
+ this.cropperImageLoaded[id] = true;
1331
+ }
1332
+ loadImageFailed() {
1333
+ }
1334
+ toggleMenuVisibility(f) {
1335
+ this.fileMenuOpened = f;
1336
+ }
1337
+ menuClick() {
1338
+ this.fileMenuOpened = undefined;
1339
+ }
1340
+ writeValue(obj) {
1341
+ this.inputArray = obj instanceof Array;
1342
+ if (this.inputArray) {
1343
+ this.files = obj.map(f => ({ custom: f, $newFile: null }));
1344
+ }
1345
+ else {
1346
+ this.files = obj ? [{ custom: obj, $newFile: null }] : [];
1347
+ }
1348
+ this.cropSourceImages = {};
1349
+ }
1350
+ cropperDone(id) {
1351
+ const f = this.files.find(fx => fx.$newFile && fx.$newFile.id === id);
1352
+ if (f) {
1353
+ // const url = this.croppedImages[id];
1354
+ // console.log(url);
1355
+ // fetch(url)
1356
+ // .then(res => res.blob())
1357
+ // .then(blob => {
1358
+ // f.$newFile.nativeFile = new File([ blob ], 'crop.png', {
1359
+ // type: 'image/png'
1360
+ // });
1361
+ // f.$newFile.name = 'crop.png';
1362
+ // f.$newFile.size = f.$newFile.nativeFile.size;
1363
+ // f.$newFile.type = f.$newFile.nativeFile.type;
1364
+ // this.imagesDone[id] = true;
1365
+ // console.log(f);
1366
+ // })
1367
+ const croppedImage = this.croppedImages[id];
1368
+ f.$newFile.nativeFile = new File([croppedImage.blob], 'crop.png', {
1369
+ type: 'image/png'
1370
+ });
1371
+ f.$newFile.name = 'crop.png';
1372
+ f.$newFile.size = f.$newFile.nativeFile.size;
1373
+ f.$newFile.type = f.$newFile.nativeFile.type;
1374
+ this.imagesDone[id] = true;
1375
+ console.log(f);
1376
+ }
1377
+ }
1378
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiFileUploaderComponent, deps: [{ token: UI_FILESERVICE, optional: true }, { token: UI_TRANSLATESERVICE }, { token: i1.ControlContainer, host: true, optional: true, skipSelf: true }, { token: UiFileService }], target: i0.ɵɵFactoryTarget.Component }); }
1379
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: UiFileUploaderComponent, selector: "ui-file-uploader", inputs: { maxFiles: "maxFiles", multiple: "multiple", crop: "crop", cropRounded: "cropRounded", cropMaxWidth: "cropMaxWidth", fileSize: "fileSize", customFileMenu: "customFileMenu", addHint: "addHint", newFilePosition: "newFilePosition", templates: "templates", previewPosition: "previewPosition" }, outputs: { imageCropped: "imageCropped", fileEvent: "fileEvent" }, providers: [{
1380
+ provide: NG_VALUE_ACCESSOR,
1381
+ multi: true,
1382
+ useExisting: UiFileUploaderComponent,
1383
+ }], usesInheritance: true, ngImport: i0, template: "<div class=\"label\" *ngIf=\"label\">\r\n <div class=\"text-container\" [matTooltip]=\"required ? translateService.instant('ui.controls.validation.required') : undefined\" [matTooltipPosition]=\"'above'\">\r\n <div class=\"text\">{{label}}</div>\r\n <div *ngIf=\"required\" class=\"required\">*</div>\r\n </div>\r\n</div>\r\n\r\n<div class=\"files-container\" [ngClass]=\"{dragging: dragging, disabled: uploading || !editable}\">\r\n\r\n <div class=\"existing-files\">\r\n\r\n <div class=\"file-container\" *ngFor=\"let f of files\">\r\n\r\n <div class=\"file-menu\" (click)=\"toggleMenuVisibility(f)\" *ngIf=\"!customFileMenu && editable && !uploading\">\r\n <mat-icon>menu</mat-icon>\r\n </div>\r\n <div class=\"file-menu-container mat-elevation-z2\" [ngClass]=\"{visible: f === fileMenuOpened}\" (click)=\"menuClick()\" (mouseleave)=\"menuClick()\">\r\n <ng-container *ngIf=\"!menuTemplate\">\r\n <label class=\"menu-item\">{{ translateService.instant('ui.controls.ui-file-uploader.menu.change') }}\r\n <input *ngIf=\"!refreshAddInput\" style=\"display: none;\" type=\"file\" ngFileSelect [options]=\"uploadOptions\" (change)=\"fileChangeEvent($event, f)\"\r\n (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\">\r\n </label>\r\n <div class=\"menu-item\" (click)=\"remove(f)\">{{ translateService.instant('ui.controls.ui-file-uploader.menu.delete') }}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"menuTemplate\">\r\n <ng-template [ngTemplateOutlet]=\"menuTemplate\" [ngTemplateOutletContext]=\"{fileInput: fileInput}\"></ng-template>\r\n <ng-template #fileInput>\r\n <input style=\"display: none;\" type=\"file\" ngFileSelect [options]=\"uploadOptions\" (change)=\"fileChangeEvent($event, f)\"\r\n (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\">\r\n </ng-template>\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"crop && !cropDone(f)\" (mouseenter)=\"startCropPreview(f.$newFile.id)\" (mouseleave)=\"stopCropPreview(f.$newFile.id)\">\r\n <div class=\"crop-container\" [ngStyle]=\"ngAddStyle\">\r\n\r\n <ui-file *ngIf=\"false && files.length > 0 && !cropSourceImages\" [fileSize]=\"fileSize\" [srcData]=\"files[0].custom\" [ngClass]=\"{rounded: cropRounded}\"></ui-file>\r\n\r\n <mat-spinner *ngIf=\"!cropperImageLoaded[f.$newFile.id] && cropSourceImages[f.$newFile.id]\" [diameter]=\"75\"></mat-spinner>\r\n\r\n <image-cropper *ngIf=\"cropSourceImages[f.$newFile.id]\"\r\n [imageFile]=\"cropSourceImages[f.$newFile.id]\"\r\n [maintainAspectRatio]=\"true\"\r\n [containWithinAspectRatio]=\"false\"\r\n [aspectRatio]=\"aspectRatio\"\r\n [resizeToWidth]=\"cropMaxWidth\"\r\n [onlyScaleDown]=\"false\"\r\n [roundCropper]=\"cropRounded\"\r\n [canvasRotation]=\"canvasRotation[f.$newFile.id]\"\r\n [transform]=\"transform[f.$newFile.id]\"\r\n [alignImage]=\"'center'\"\r\n [style.display]=\"showCropper ? null : 'none'\"\r\n [format]=\"'png'\"\r\n (imageCropped)=\"onImageCropped($event, f.$newFile.id)\"\r\n (imageLoaded)=\"imageLoaded(f.$newFile.id)\"\r\n (cropperReady)=\"cropperReady($event, f.$newFile.id)\"\r\n (loadImageFailed)=\"loadImageFailed()\"\r\n ></image-cropper>\r\n\r\n <div class=\"crop-preview mat-elevation-z2\" [class]=\"previewPosition\" *ngIf=\"true || (showCropPreview[f.$newFile.id] && cropperImageLoaded[f.$newFile.id])\">\r\n <div class=\"crop-menu\">\r\n <mat-icon (click)=\"zoomCroppedImage(.1, f.$newFile.id)\">zoom_in</mat-icon>\r\n <mat-icon (click)=\"zoomCroppedImage(- .1, f.$newFile.id)\">zoom_out</mat-icon>\r\n <mat-icon (click)=\"rotateCroppedImage(-1, f.$newFile.id)\">rotate_left</mat-icon>\r\n <mat-icon (click)=\"rotateCroppedImage(1, f.$newFile.id)\">rotate_right</mat-icon>\r\n <div style=\"flex: 1 1 100%\"></div>\r\n <label class=\"menu-item\">\r\n <mat-icon>upload_file</mat-icon>\r\n <input style=\"display: none;\" type=\"file\" ngFileSelect [options]=\"uploadOptions\" (change)=\"fileChangeEvent($event, f)\"\r\n (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\">\r\n </label>\r\n <mat-icon (click)=\"remove(f)\">delete_outline</mat-icon>\r\n <div style=\"flex: 1 1 100%\"></div>\r\n <mat-icon (click)=\"cropperDone(f.$newFile.id)\">done</mat-icon>\r\n </div>\r\n <img *ngIf=\"croppedImages[f.$newFile.id]\" [src]=\"croppedImages[f.$newFile.id].objectUrl\" [ngClass]=\"{rounded: cropRounded}\"/>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n\r\n <ng-container *ngIf=\"!crop || cropDone(f)\">\r\n <ng-container *ngIf=\"fileTemplate\">\r\n <ng-template [ngTemplateOutlet]=\"fileTemplate\" [ngTemplateOutletContext]=\"{file: f, fileInput: fileInput2}\"></ng-template>\r\n <ng-template #fileInput2>\r\n <input style=\"display: none;\" type=\"file\" ngFileSelect [options]=\"uploadOptions\" (change)=\"fileChangeEvent($event, f)\"\r\n (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\">\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ui-file *ngIf=\"!fileTemplate\" [fileSize]=\"fileSize\" [srcData]=\"f.$newFile ? f.$newFile: f.custom\" [ngClass]=\"{rounded: crop && cropRounded}\">\r\n </ui-file>\r\n\r\n <ng-container *ngIf=\"f.$newFile\">\r\n <div *ngIf=\"f.$newFile.responseStatus && f.$newFile.responseStatus !== 200\" class=\"progress-container error\">\r\n {{ translateService.instant('ui.controls.ui-file-uploader.uploadError', f.$newFile.response) }}\r\n </div>\r\n <div *ngIf=\"!f.$newFile.responseStatus && f.$newFile.progress.status === 1\" class=\"progress-container\">\r\n <div class=\"progress\" [ngStyle]=\"{width: f.$newFile.progress.data.percentage + '%'}\"></div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"file-container add\" ngFileDrop [options]=\"uploadOptions\" (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\" [ngClass]=\"{visible: files.length < maxFiles || maxFiles === 0}\" [ngStyle]=\"addFileTemplate ? {} : ngAddStyle\">\r\n <label>\r\n <ng-container *ngIf=\"addFileTemplate\">\r\n <ng-template [ngTemplateOutlet]=\"addFileTemplate\"></ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"!addFileTemplate\">\r\n <div class=\"upload-image-container\"></div>\r\n <img [src]=\"addFileImgSrc\" [ngClass]=\"{'with-hint': addHint}\" />\r\n <div *ngIf=\"addHint\" class=\"add-hint\">{{addHint}}</div>\r\n </ng-container>\r\n <input style=\"display: none;\" type=\"file\" ngFileSelect [options]=\"uploadOptions\" (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\" [multiple]=\"maxFiles === 0 && multiple\">\r\n </label>\r\n </div>\r\n\r\n</div>\r\n", styles: [":host{display:flex;flex-wrap:wrap}:host .label .text{font-size:.9em;line-height:1em;padding:6px 0 4px}:host .files-container{display:flex;flex-wrap:wrap;border-style:solid}:host .files-container .existing-files{display:flex;flex-wrap:wrap}:host .files-container.dragging .add label{border:2px dashed grey;background-color:#0000001a}:host .files-container.disabled .add{opacity:.5;pointer-events:none}:host .file-container{max-width:100%;max-height:100%;position:relative;display:flex;align-items:center;justify-content:center}:host .file-container .progress-container{position:absolute;bottom:0;left:1px;right:1px;height:20%;max-height:20px;background-color:#0000001a}:host .file-container .progress-container.error{background-color:red;color:#fff;display:flex;align-items:center;justify-content:center}:host .file-container .progress-container .progress{background-color:#0000004d;height:100%}:host .file-container.add{display:flex;align-items:center;flex-direction:column;transition:opacity .25s;cursor:pointer}:host .file-container.add:not(.visible){display:none}:host .file-container.add img{max-width:100%;max-height:100%}:host .file-container.add img.with-hint{max-height:75%}:host .file-container.add .add-hint{margin-top:8px;font-size:80%;text-align:center}:host .file-container.add label{position:absolute;inset:0;cursor:pointer;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center}:host .file-container.add .upload-image-container{display:none}:host .file-container .file-menu-container{display:none;position:absolute;left:calc(100% - 45px);top:27px;z-index:1000}:host .file-container .file-menu-container ::ng-deep .menu-item{position:relative;padding:12px 24px;cursor:pointer;display:block}:host .file-container .file-menu-container.visible{display:block}:host .file-container .file-menu{display:flex;position:absolute;flex-direction:column;align-items:center;justify-content:center;padding:12px;right:10px;top:10px;background-color:#fff9;border-radius:50%;cursor:pointer;transition:all .25s;z-index:999}:host .file-container:hover .file-menu{background-color:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}:host .file-container mat-progress-bar{position:absolute;bottom:0;height:6px;left:0;right:0;z-index:1000}:host image-cropper{padding:0}:host ui-file.rounded ::ng-deep img{border-radius:50%}:host .crop-container{display:flex;align-items:center;justify-content:center;position:relative}:host .crop-container mat-spinner{position:absolute;z-index:1}:host .crop-container .crop-preview{position:absolute;top:100%;left:0;right:0;padding:6px;border:1px solid transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:1000;max-width:350px;margin-right:auto;margin-left:auto}:host .crop-container .crop-preview.left{right:calc(100% + 6px);left:unset;top:0}:host .crop-container .crop-preview.above{bottom:100%;top:unset}:host .crop-container .crop-preview .crop-menu{width:100%;flex:0 0 auto;display:flex}:host .crop-container .crop-preview .crop-menu mat-icon{margin:0 3px;width:calc(1em + 6px);height:1em;font-size:2em;cursor:pointer;user-select:none;flex:1 1 100%}:host .crop-container .crop-preview img{margin:16px 0;max-width:256px;max-height:256px}:host .crop-container .crop-preview img.rounded{border-radius:50%}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "directive", type: i6.NgFileDropDirective, selector: "[ngFileDrop]", inputs: ["options", "uploadInput"], outputs: ["uploadOutput"] }, { kind: "directive", type: i6.NgFileSelectDirective, selector: "[ngFileSelect]", inputs: ["options", "uploadInput"], outputs: ["uploadOutput"] }, { kind: "component", type: i4$3.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: i8.ImageCropperComponent, selector: "image-cropper", inputs: ["imageChangedEvent", "imageURL", "imageBase64", "imageFile", "imageAltText", "cropperFrameAriaLabel", "output", "format", "transform", "maintainAspectRatio", "aspectRatio", "resetCropOnAspectRatioChange", "resizeToWidth", "resizeToHeight", "cropperMinWidth", "cropperMinHeight", "cropperMaxHeight", "cropperMaxWidth", "cropperStaticWidth", "cropperStaticHeight", "canvasRotation", "initialStepSize", "roundCropper", "onlyScaleDown", "imageQuality", "autoCrop", "backgroundColor", "containWithinAspectRatio", "hideResizeSquares", "allowMoveImage", "cropper", "alignImage", "disabled", "hidden"], outputs: ["imageCropped", "startCropImage", "imageLoaded", "cropperReady", "loadImageFailed", "transformChange"] }, { kind: "component", type: FileComponent, selector: "ui-file", inputs: ["fileSize", "srcOptions", "srcData", "srcUrl"] }] }); }
1384
+ }
1385
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiFileUploaderComponent, decorators: [{
1386
+ type: Component,
1387
+ args: [{ selector: 'ui-file-uploader', providers: [{
1388
+ provide: NG_VALUE_ACCESSOR,
1389
+ multi: true,
1390
+ useExisting: UiFileUploaderComponent,
1391
+ }], template: "<div class=\"label\" *ngIf=\"label\">\r\n <div class=\"text-container\" [matTooltip]=\"required ? translateService.instant('ui.controls.validation.required') : undefined\" [matTooltipPosition]=\"'above'\">\r\n <div class=\"text\">{{label}}</div>\r\n <div *ngIf=\"required\" class=\"required\">*</div>\r\n </div>\r\n</div>\r\n\r\n<div class=\"files-container\" [ngClass]=\"{dragging: dragging, disabled: uploading || !editable}\">\r\n\r\n <div class=\"existing-files\">\r\n\r\n <div class=\"file-container\" *ngFor=\"let f of files\">\r\n\r\n <div class=\"file-menu\" (click)=\"toggleMenuVisibility(f)\" *ngIf=\"!customFileMenu && editable && !uploading\">\r\n <mat-icon>menu</mat-icon>\r\n </div>\r\n <div class=\"file-menu-container mat-elevation-z2\" [ngClass]=\"{visible: f === fileMenuOpened}\" (click)=\"menuClick()\" (mouseleave)=\"menuClick()\">\r\n <ng-container *ngIf=\"!menuTemplate\">\r\n <label class=\"menu-item\">{{ translateService.instant('ui.controls.ui-file-uploader.menu.change') }}\r\n <input *ngIf=\"!refreshAddInput\" style=\"display: none;\" type=\"file\" ngFileSelect [options]=\"uploadOptions\" (change)=\"fileChangeEvent($event, f)\"\r\n (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\">\r\n </label>\r\n <div class=\"menu-item\" (click)=\"remove(f)\">{{ translateService.instant('ui.controls.ui-file-uploader.menu.delete') }}</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"menuTemplate\">\r\n <ng-template [ngTemplateOutlet]=\"menuTemplate\" [ngTemplateOutletContext]=\"{fileInput: fileInput}\"></ng-template>\r\n <ng-template #fileInput>\r\n <input style=\"display: none;\" type=\"file\" ngFileSelect [options]=\"uploadOptions\" (change)=\"fileChangeEvent($event, f)\"\r\n (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\">\r\n </ng-template>\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"crop && !cropDone(f)\" (mouseenter)=\"startCropPreview(f.$newFile.id)\" (mouseleave)=\"stopCropPreview(f.$newFile.id)\">\r\n <div class=\"crop-container\" [ngStyle]=\"ngAddStyle\">\r\n\r\n <ui-file *ngIf=\"false && files.length > 0 && !cropSourceImages\" [fileSize]=\"fileSize\" [srcData]=\"files[0].custom\" [ngClass]=\"{rounded: cropRounded}\"></ui-file>\r\n\r\n <mat-spinner *ngIf=\"!cropperImageLoaded[f.$newFile.id] && cropSourceImages[f.$newFile.id]\" [diameter]=\"75\"></mat-spinner>\r\n\r\n <image-cropper *ngIf=\"cropSourceImages[f.$newFile.id]\"\r\n [imageFile]=\"cropSourceImages[f.$newFile.id]\"\r\n [maintainAspectRatio]=\"true\"\r\n [containWithinAspectRatio]=\"false\"\r\n [aspectRatio]=\"aspectRatio\"\r\n [resizeToWidth]=\"cropMaxWidth\"\r\n [onlyScaleDown]=\"false\"\r\n [roundCropper]=\"cropRounded\"\r\n [canvasRotation]=\"canvasRotation[f.$newFile.id]\"\r\n [transform]=\"transform[f.$newFile.id]\"\r\n [alignImage]=\"'center'\"\r\n [style.display]=\"showCropper ? null : 'none'\"\r\n [format]=\"'png'\"\r\n (imageCropped)=\"onImageCropped($event, f.$newFile.id)\"\r\n (imageLoaded)=\"imageLoaded(f.$newFile.id)\"\r\n (cropperReady)=\"cropperReady($event, f.$newFile.id)\"\r\n (loadImageFailed)=\"loadImageFailed()\"\r\n ></image-cropper>\r\n\r\n <div class=\"crop-preview mat-elevation-z2\" [class]=\"previewPosition\" *ngIf=\"true || (showCropPreview[f.$newFile.id] && cropperImageLoaded[f.$newFile.id])\">\r\n <div class=\"crop-menu\">\r\n <mat-icon (click)=\"zoomCroppedImage(.1, f.$newFile.id)\">zoom_in</mat-icon>\r\n <mat-icon (click)=\"zoomCroppedImage(- .1, f.$newFile.id)\">zoom_out</mat-icon>\r\n <mat-icon (click)=\"rotateCroppedImage(-1, f.$newFile.id)\">rotate_left</mat-icon>\r\n <mat-icon (click)=\"rotateCroppedImage(1, f.$newFile.id)\">rotate_right</mat-icon>\r\n <div style=\"flex: 1 1 100%\"></div>\r\n <label class=\"menu-item\">\r\n <mat-icon>upload_file</mat-icon>\r\n <input style=\"display: none;\" type=\"file\" ngFileSelect [options]=\"uploadOptions\" (change)=\"fileChangeEvent($event, f)\"\r\n (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\">\r\n </label>\r\n <mat-icon (click)=\"remove(f)\">delete_outline</mat-icon>\r\n <div style=\"flex: 1 1 100%\"></div>\r\n <mat-icon (click)=\"cropperDone(f.$newFile.id)\">done</mat-icon>\r\n </div>\r\n <img *ngIf=\"croppedImages[f.$newFile.id]\" [src]=\"croppedImages[f.$newFile.id].objectUrl\" [ngClass]=\"{rounded: cropRounded}\"/>\r\n </div>\r\n\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n\r\n <ng-container *ngIf=\"!crop || cropDone(f)\">\r\n <ng-container *ngIf=\"fileTemplate\">\r\n <ng-template [ngTemplateOutlet]=\"fileTemplate\" [ngTemplateOutletContext]=\"{file: f, fileInput: fileInput2}\"></ng-template>\r\n <ng-template #fileInput2>\r\n <input style=\"display: none;\" type=\"file\" ngFileSelect [options]=\"uploadOptions\" (change)=\"fileChangeEvent($event, f)\"\r\n (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\">\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ui-file *ngIf=\"!fileTemplate\" [fileSize]=\"fileSize\" [srcData]=\"f.$newFile ? f.$newFile: f.custom\" [ngClass]=\"{rounded: crop && cropRounded}\">\r\n </ui-file>\r\n\r\n <ng-container *ngIf=\"f.$newFile\">\r\n <div *ngIf=\"f.$newFile.responseStatus && f.$newFile.responseStatus !== 200\" class=\"progress-container error\">\r\n {{ translateService.instant('ui.controls.ui-file-uploader.uploadError', f.$newFile.response) }}\r\n </div>\r\n <div *ngIf=\"!f.$newFile.responseStatus && f.$newFile.progress.status === 1\" class=\"progress-container\">\r\n <div class=\"progress\" [ngStyle]=\"{width: f.$newFile.progress.data.percentage + '%'}\"></div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n\r\n </div>\r\n\r\n <div class=\"file-container add\" ngFileDrop [options]=\"uploadOptions\" (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\" [ngClass]=\"{visible: files.length < maxFiles || maxFiles === 0}\" [ngStyle]=\"addFileTemplate ? {} : ngAddStyle\">\r\n <label>\r\n <ng-container *ngIf=\"addFileTemplate\">\r\n <ng-template [ngTemplateOutlet]=\"addFileTemplate\"></ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"!addFileTemplate\">\r\n <div class=\"upload-image-container\"></div>\r\n <img [src]=\"addFileImgSrc\" [ngClass]=\"{'with-hint': addHint}\" />\r\n <div *ngIf=\"addHint\" class=\"add-hint\">{{addHint}}</div>\r\n </ng-container>\r\n <input style=\"display: none;\" type=\"file\" ngFileSelect [options]=\"uploadOptions\" (uploadOutput)=\"onUploadOutput($event)\" [uploadInput]=\"uploadInput\" [multiple]=\"maxFiles === 0 && multiple\">\r\n </label>\r\n </div>\r\n\r\n</div>\r\n", styles: [":host{display:flex;flex-wrap:wrap}:host .label .text{font-size:.9em;line-height:1em;padding:6px 0 4px}:host .files-container{display:flex;flex-wrap:wrap;border-style:solid}:host .files-container .existing-files{display:flex;flex-wrap:wrap}:host .files-container.dragging .add label{border:2px dashed grey;background-color:#0000001a}:host .files-container.disabled .add{opacity:.5;pointer-events:none}:host .file-container{max-width:100%;max-height:100%;position:relative;display:flex;align-items:center;justify-content:center}:host .file-container .progress-container{position:absolute;bottom:0;left:1px;right:1px;height:20%;max-height:20px;background-color:#0000001a}:host .file-container .progress-container.error{background-color:red;color:#fff;display:flex;align-items:center;justify-content:center}:host .file-container .progress-container .progress{background-color:#0000004d;height:100%}:host .file-container.add{display:flex;align-items:center;flex-direction:column;transition:opacity .25s;cursor:pointer}:host .file-container.add:not(.visible){display:none}:host .file-container.add img{max-width:100%;max-height:100%}:host .file-container.add img.with-hint{max-height:75%}:host .file-container.add .add-hint{margin-top:8px;font-size:80%;text-align:center}:host .file-container.add label{position:absolute;inset:0;cursor:pointer;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center}:host .file-container.add .upload-image-container{display:none}:host .file-container .file-menu-container{display:none;position:absolute;left:calc(100% - 45px);top:27px;z-index:1000}:host .file-container .file-menu-container ::ng-deep .menu-item{position:relative;padding:12px 24px;cursor:pointer;display:block}:host .file-container .file-menu-container.visible{display:block}:host .file-container .file-menu{display:flex;position:absolute;flex-direction:column;align-items:center;justify-content:center;padding:12px;right:10px;top:10px;background-color:#fff9;border-radius:50%;cursor:pointer;transition:all .25s;z-index:999}:host .file-container:hover .file-menu{background-color:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}:host .file-container mat-progress-bar{position:absolute;bottom:0;height:6px;left:0;right:0;z-index:1000}:host image-cropper{padding:0}:host ui-file.rounded ::ng-deep img{border-radius:50%}:host .crop-container{display:flex;align-items:center;justify-content:center;position:relative}:host .crop-container mat-spinner{position:absolute;z-index:1}:host .crop-container .crop-preview{position:absolute;top:100%;left:0;right:0;padding:6px;border:1px solid transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:1000;max-width:350px;margin-right:auto;margin-left:auto}:host .crop-container .crop-preview.left{right:calc(100% + 6px);left:unset;top:0}:host .crop-container .crop-preview.above{bottom:100%;top:unset}:host .crop-container .crop-preview .crop-menu{width:100%;flex:0 0 auto;display:flex}:host .crop-container .crop-preview .crop-menu mat-icon{margin:0 3px;width:calc(1em + 6px);height:1em;font-size:2em;cursor:pointer;user-select:none;flex:1 1 100%}:host .crop-container .crop-preview img{margin:16px 0;max-width:256px;max-height:256px}:host .crop-container .crop-preview img.rounded{border-radius:50%}\n"] }]
1392
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1393
+ type: Optional
1394
+ }, {
1395
+ type: Inject,
1396
+ args: [UI_FILESERVICE]
1397
+ }] }, { type: undefined, decorators: [{
1398
+ type: Inject,
1399
+ args: [UI_TRANSLATESERVICE]
1400
+ }] }, { type: i1.ControlContainer, decorators: [{
1401
+ type: Optional
1402
+ }, {
1403
+ type: Host
1404
+ }, {
1405
+ type: SkipSelf
1406
+ }] }, { type: UiFileService }]; }, propDecorators: { maxFiles: [{
1407
+ type: Input
1408
+ }], multiple: [{
1409
+ type: Input
1410
+ }], crop: [{
1411
+ type: Input
1412
+ }], cropRounded: [{
1413
+ type: Input
1414
+ }], cropMaxWidth: [{
1415
+ type: Input
1416
+ }], fileSize: [{
1417
+ type: Input
1418
+ }], customFileMenu: [{
1419
+ type: Input
1420
+ }], addHint: [{
1421
+ type: Input
1422
+ }], newFilePosition: [{
1423
+ type: Input
1424
+ }], templates: [{
1425
+ type: Input
1426
+ }], previewPosition: [{
1427
+ type: Input
1428
+ }], imageCropped: [{
1429
+ type: Output
1430
+ }], fileEvent: [{
1431
+ type: Output
1432
+ }] } });
1433
+
1434
+ class ExpanderComponent {
1435
+ constructor() {
1436
+ this.expanded = false;
1437
+ this.direction = 'right-down';
1438
+ }
1439
+ ngOnInit() {
1440
+ }
1441
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ExpanderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1442
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: ExpanderComponent, selector: "ui-expander", inputs: { expanded: "expanded", direction: "direction" }, host: { properties: { "class.expanded": "this.expanded", "class": "this.direction" } }, ngImport: i0, template: "<mat-icon>keyboard_arrow_up</mat-icon>\r\n", styles: [":host{display:inline-block;transition:transform .25s}:host.right-down{transform:rotate(90deg)}:host.expanded.up-down{transform:scaleY(-1)}:host.expanded.right-down{transform:rotate(180deg)}\n"], dependencies: [{ kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
1443
+ }
1444
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ExpanderComponent, decorators: [{
1445
+ type: Component,
1446
+ args: [{ selector: 'ui-expander', template: "<mat-icon>keyboard_arrow_up</mat-icon>\r\n", styles: [":host{display:inline-block;transition:transform .25s}:host.right-down{transform:rotate(90deg)}:host.expanded.up-down{transform:scaleY(-1)}:host.expanded.right-down{transform:rotate(180deg)}\n"] }]
1447
+ }], ctorParameters: function () { return []; }, propDecorators: { expanded: [{
1448
+ type: HostBinding,
1449
+ args: ['class.expanded']
1450
+ }, {
1451
+ type: Input
1452
+ }], direction: [{
1453
+ type: HostBinding,
1454
+ args: ['class']
1455
+ }, {
1456
+ type: Input
1457
+ }] } });
1458
+
1459
+ class ForceVisibilityDirective {
1460
+ static { this.disabled = false; }
1461
+ constructor(el) {
1462
+ this.el = el;
1463
+ this.visibilityPadding = 15;
1464
+ this.visibilityOnRequestOnly = false;
1465
+ this.visibilityEmitChange = false;
1466
+ this.visibilityFromTop = 0;
1467
+ this.visibilityCheckEnabled = true;
1468
+ this.visibilityChanged = new EventEmitter();
1469
+ }
1470
+ static disableFor(timeoutMs) {
1471
+ this.disabled = true;
1472
+ setTimeout(() => this.disabled = false, timeoutMs);
1473
+ }
1474
+ ngOnInit() {
1475
+ if (!this.visibilityOnRequestOnly && !this.visibilityEmitChange) {
1476
+ setTimeout(() => {
1477
+ this.forceVisibility();
1478
+ }, 125);
1479
+ }
1480
+ if (this.visibilityEmitChange) {
1481
+ if (!this.visibilityWithin) {
1482
+ throw Error('traceVisibilityChanged requires visibilityWithin');
1483
+ }
1484
+ else {
1485
+ this.visible = this.isVisible();
1486
+ this.visibilityWithin.onscroll = () => {
1487
+ const v = this.isVisible();
1488
+ if (v !== this.visible) {
1489
+ this.visible = v;
1490
+ this.visibilityChanged.emit(v);
1491
+ }
1492
+ };
1493
+ }
1494
+ }
1495
+ }
1496
+ ngOnChanges(changes) {
1497
+ if (changes.visibilityCheckEnabled && changes.visibilityCheckEnabled.currentValue !== changes.visibilityCheckEnabled.previousValue) {
1498
+ this.forceVisibility();
1499
+ }
1500
+ }
1501
+ isVisible() {
1502
+ const rect = this.el.nativeElement.getBoundingClientRect();
1503
+ const rectIn = this.visibilityWithin.getBoundingClientRect();
1504
+ return rect.top + +this.visibilityPadding - rectIn.bottom < 0;
1505
+ }
1506
+ forceVisibility() {
1507
+ if (ForceVisibilityDirective.disabled || !this.visibilityCheckEnabled) {
1508
+ return;
1509
+ }
1510
+ const rect = this.el.nativeElement.getBoundingClientRect();
1511
+ const padding = +this.visibilityPadding;
1512
+ if (this.visibilityWithin) {
1513
+ const rectIn = this.visibilityWithin.getBoundingClientRect();
1514
+ let diff = rect.top + rect.height + padding - rectIn.bottom;
1515
+ if (diff > 0) {
1516
+ this.visibilityWithin.scrollBy(0, diff);
1517
+ }
1518
+ else {
1519
+ diff = rect.top - rectIn.top - padding;
1520
+ if (diff < 0) {
1521
+ this.visibilityWithin.scrollBy(0, diff);
1522
+ }
1523
+ }
1524
+ }
1525
+ else {
1526
+ if (this.visibilityFromTop !== 0) {
1527
+ document.getElementsByTagName('app-root')[0].scrollTo(0, rect.top - +this.visibilityFromTop);
1528
+ }
1529
+ else {
1530
+ if (rect.bottom > window.innerHeight) {
1531
+ document.getElementsByTagName('app-root')[0].scrollBy(0, rect.bottom - window.innerHeight + 15);
1532
+ }
1533
+ }
1534
+ }
1535
+ }
1536
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ForceVisibilityDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
1537
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.11", type: ForceVisibilityDirective, selector: "[uiForceVisibility]", inputs: { visibilityWithin: "visibilityWithin", visibilityPadding: "visibilityPadding", visibilityOnRequestOnly: "visibilityOnRequestOnly", visibilityEmitChange: "visibilityEmitChange", visibilityFromTop: "visibilityFromTop", visibilityCheckEnabled: "visibilityCheckEnabled" }, outputs: { visibilityChanged: "visibilityChanged" }, exportAs: ["ForceVisibilityDirective"], usesOnChanges: true, ngImport: i0 }); }
1538
+ }
1539
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ForceVisibilityDirective, decorators: [{
1540
+ type: Directive,
1541
+ args: [{
1542
+ selector: '[uiForceVisibility]',
1543
+ exportAs: 'ForceVisibilityDirective'
1544
+ }]
1545
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { visibilityWithin: [{
1546
+ type: Input
1547
+ }], visibilityPadding: [{
1548
+ type: Input
1549
+ }], visibilityOnRequestOnly: [{
1550
+ type: Input
1551
+ }], visibilityEmitChange: [{
1552
+ type: Input
1553
+ }], visibilityFromTop: [{
1554
+ type: Input
1555
+ }], visibilityCheckEnabled: [{
1556
+ type: Input
1557
+ }], visibilityChanged: [{
1558
+ type: Output
1559
+ }] } });
1560
+
1561
+ class DialogComponent {
1562
+ constructor(dialogRef) {
1563
+ this.dialogRef = dialogRef;
1564
+ this.title = '';
1565
+ this.draggable = false; // true;
1566
+ this.hideCloseButton = false;
1567
+ }
1568
+ clickClose() {
1569
+ if (!this.close) {
1570
+ this.dialogRef.close();
1571
+ }
1572
+ else {
1573
+ this.close();
1574
+ }
1575
+ }
1576
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: DialogComponent, deps: [{ token: i1$2.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component }); }
1577
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: DialogComponent, selector: "ui-dialog", inputs: { title: "title", draggable: "draggable", hideCloseButton: "hideCloseButton", close: "close" }, ngImport: i0, template: "<ui-action-icon *ngIf=\"title && !hideCloseButton\" (click)=\"clickClose()\" class=\"close-icon\" [matIcon]=\"'close'\" [color]=\"'warn'\"></ui-action-icon>\r\n\r\n<ng-container *ngIf=\"title\">\r\n <h1 class=\"draggable\" cdkDrag cdkDragRootElement=\".cdk-overlay-pane\" cdkDragHandle mat-dialog-title *ngIf=\"draggable\">\r\n {{title}}\r\n </h1>\r\n <h1 mat-dialog-title *ngIf=\"!draggable\">\r\n {{title}}\r\n </h1>\r\n</ng-container>\r\n\r\n<ng-content></ng-content>\r\n", styles: [":host{height:100%;display:flex;flex-direction:column}::ng-deep .mat-mdc-dialog-container{position:relative;overflow:visible!important}::ng-deep .mat-mdc-dialog-container .mdc-dialog__content{line-height:unset!important;letter-spacing:unset!important;color:unset!important}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-title{font-size:24px;margin:0 0 5px;padding:12px 16px;border-bottom:1px solid transparent}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-title.draggable{cursor:move}::ng-deep .mat-mdc-dialog-container h1{display:flex;align-items:center}::ng-deep .mat-mdc-dialog-container .close-icon{position:absolute;right:16px;top:16px;z-index:1}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-actions{display:flex;flex-direction:column;border-top:1px solid transparent;margin-top:5px;padding:0}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-actions.mat-dialog-actions{margin:0 -12px -16px}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-actions .buttons{display:flex;flex:1 1 auto;justify-content:flex-end;align-items:center;width:100%;padding:8px}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-actions .message{flex:1 1 auto;display:flex;flex-wrap:wrap;font-weight:500;font-size:90%;width:100%;padding:6px 8px}::ng-deep .mat-mdc-dialog-container [mat-dialog-content]{position:relative;max-height:calc(100vh - 150px);overflow:auto;scroll-behavior:smooth;display:flex;flex-direction:column;padding:0 6px;outline:none;flex:1}::ng-deep .mat-mdc-dialog-container [mat-dialog-content].mat-dialog-content{margin:0 -12px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i3$2.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i3$2.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: ActionIconComponent, selector: "ui-action-icon", inputs: ["size", "color", "disabled", "busy", "matIcon"] }] }); }
1578
+ }
1579
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: DialogComponent, decorators: [{
1580
+ type: Component,
1581
+ args: [{ selector: 'ui-dialog', template: "<ui-action-icon *ngIf=\"title && !hideCloseButton\" (click)=\"clickClose()\" class=\"close-icon\" [matIcon]=\"'close'\" [color]=\"'warn'\"></ui-action-icon>\r\n\r\n<ng-container *ngIf=\"title\">\r\n <h1 class=\"draggable\" cdkDrag cdkDragRootElement=\".cdk-overlay-pane\" cdkDragHandle mat-dialog-title *ngIf=\"draggable\">\r\n {{title}}\r\n </h1>\r\n <h1 mat-dialog-title *ngIf=\"!draggable\">\r\n {{title}}\r\n </h1>\r\n</ng-container>\r\n\r\n<ng-content></ng-content>\r\n", styles: [":host{height:100%;display:flex;flex-direction:column}::ng-deep .mat-mdc-dialog-container{position:relative;overflow:visible!important}::ng-deep .mat-mdc-dialog-container .mdc-dialog__content{line-height:unset!important;letter-spacing:unset!important;color:unset!important}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-title{font-size:24px;margin:0 0 5px;padding:12px 16px;border-bottom:1px solid transparent}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-title.draggable{cursor:move}::ng-deep .mat-mdc-dialog-container h1{display:flex;align-items:center}::ng-deep .mat-mdc-dialog-container .close-icon{position:absolute;right:16px;top:16px;z-index:1}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-actions{display:flex;flex-direction:column;border-top:1px solid transparent;margin-top:5px;padding:0}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-actions.mat-dialog-actions{margin:0 -12px -16px}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-actions .buttons{display:flex;flex:1 1 auto;justify-content:flex-end;align-items:center;width:100%;padding:8px}::ng-deep .mat-mdc-dialog-container .mat-mdc-dialog-actions .message{flex:1 1 auto;display:flex;flex-wrap:wrap;font-weight:500;font-size:90%;width:100%;padding:6px 8px}::ng-deep .mat-mdc-dialog-container [mat-dialog-content]{position:relative;max-height:calc(100vh - 150px);overflow:auto;scroll-behavior:smooth;display:flex;flex-direction:column;padding:0 6px;outline:none;flex:1}::ng-deep .mat-mdc-dialog-container [mat-dialog-content].mat-dialog-content{margin:0 -12px}\n"] }]
1582
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }]; }, propDecorators: { title: [{
1583
+ type: Input
1584
+ }], draggable: [{
1585
+ type: Input
1586
+ }], hideCloseButton: [{
1587
+ type: Input
1588
+ }], close: [{
1589
+ type: Input
1590
+ }] } });
1591
+
1592
+ class MessageBoxModalComponent {
1593
+ constructor(dialogRef, sanitizer, data) {
1594
+ this.dialogRef = dialogRef;
1595
+ this.sanitizer = sanitizer;
1596
+ this.data = data;
1597
+ this.buttons = [];
1598
+ this.hideCloseButton = false;
1599
+ this.processing = null;
1600
+ if (data.message) {
1601
+ this.message = this.sanitizer.bypassSecurityTrustHtml(data.message);
1602
+ }
1603
+ if (this.data.options.template) {
1604
+ this.template = this.data.options.template;
1605
+ }
1606
+ if (this.data.options.errorMessage) {
1607
+ this.errorMessage = this.sanitizer.bypassSecurityTrustHtml(data.options.errorMessage);
1608
+ }
1609
+ if (this.data.options.errorDetail) {
1610
+ this.errorDetail = this.sanitizer.bypassSecurityTrustHtml(data.options.errorDetail);
1611
+ }
1612
+ if (this.data.options.hideCloseButton !== undefined) {
1613
+ this.hideCloseButton = this.data.options.hideCloseButton;
1614
+ }
1615
+ this.buttons = data.options.buttons ? data.options.buttons : [{ id: 'close', text: 'Close' }];
1616
+ this.title = data.options.title;
1617
+ }
1618
+ close(result) {
1619
+ this.dialogRef.close(result);
1620
+ }
1621
+ buttonClick(b) {
1622
+ if (b.process) {
1623
+ this.processing = b;
1624
+ b.process().then(r => {
1625
+ this.close(r);
1626
+ }).catch(e => {
1627
+ this.processing = null;
1628
+ });
1629
+ }
1630
+ else {
1631
+ this.close(b.id);
1632
+ }
1633
+ }
1634
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MessageBoxModalComponent, deps: [{ token: i1$2.MatDialogRef }, { token: i1$1.DomSanitizer }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
1635
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: MessageBoxModalComponent, selector: "ui-message-box-modal", ngImport: i0, template: `
1636
+ <ui-dialog [title]="title" [hideCloseButton]="hideCloseButton">
1637
+ <div mat-dialog-content *ngIf="message" style="padding: 7px 16px 12px 16px;">
1638
+ <div [innerHTML]="message" style="line-height: 24px;"></div>
1639
+ <pre *ngIf="errorMessage" [innerHTML]="errorMessage"></pre>
1640
+ <pre *ngIf="errorDetail" [innerHTML]="errorDetail"></pre>
1641
+ </div>
1642
+
1643
+ <div mat-dialog-content *ngIf="template" style="padding: 7px 16px 12px 16px;">
1644
+ <ng-template [ngTemplateOutlet]="template"></ng-template>
1645
+ </div>
1646
+
1647
+ <div mat-dialog-actions>
1648
+ <div class="buttons">
1649
+ <ui-button *ngFor="let b of buttons" [color]="b.color || 'primary'" [tabIndex]="-1"
1650
+ [kind]="b.kind || 'stroked'" [busy]="processing === b" [disabled]="!!processing || (b.disabled && b.disabled())" (click)="buttonClick(b)" [label]="b.text"></ui-button>
1651
+ </div>
1652
+ </div>
1653
+ </ui-dialog>
1654
+ `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["type", "matIconPrefix", "label", "disabled", "busy", "kind", "color", "size", "formInvalid"] }, { kind: "component", type: DialogComponent, selector: "ui-dialog", inputs: ["title", "draggable", "hideCloseButton", "close"] }] }); }
1655
+ }
1656
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MessageBoxModalComponent, decorators: [{
1657
+ type: Component,
1658
+ args: [{
1659
+ selector: 'ui-message-box-modal',
1660
+ template: `
1661
+ <ui-dialog [title]="title" [hideCloseButton]="hideCloseButton">
1662
+ <div mat-dialog-content *ngIf="message" style="padding: 7px 16px 12px 16px;">
1663
+ <div [innerHTML]="message" style="line-height: 24px;"></div>
1664
+ <pre *ngIf="errorMessage" [innerHTML]="errorMessage"></pre>
1665
+ <pre *ngIf="errorDetail" [innerHTML]="errorDetail"></pre>
1666
+ </div>
1667
+
1668
+ <div mat-dialog-content *ngIf="template" style="padding: 7px 16px 12px 16px;">
1669
+ <ng-template [ngTemplateOutlet]="template"></ng-template>
1670
+ </div>
1671
+
1672
+ <div mat-dialog-actions>
1673
+ <div class="buttons">
1674
+ <ui-button *ngFor="let b of buttons" [color]="b.color || 'primary'" [tabIndex]="-1"
1675
+ [kind]="b.kind || 'stroked'" [busy]="processing === b" [disabled]="!!processing || (b.disabled && b.disabled())" (click)="buttonClick(b)" [label]="b.text"></ui-button>
1676
+ </div>
1677
+ </div>
1678
+ </ui-dialog>
1679
+ `
1680
+ }]
1681
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: i1$1.DomSanitizer }, { type: undefined, decorators: [{
1682
+ type: Inject,
1683
+ args: [MAT_DIALOG_DATA]
1684
+ }] }]; } });
1685
+ class MessageBoxService {
1686
+ constructor(dialog, translateService) {
1687
+ this.dialog = dialog;
1688
+ this.translateService = translateService;
1689
+ }
1690
+ confirm(message, options = {}) {
1691
+ const config = new MatDialogConfig();
1692
+ config.disableClose = false;
1693
+ config.minWidth = '340px';
1694
+ config.maxWidth = options.maxWidth || '600px';
1695
+ config.width = '40vw';
1696
+ config.data = { message, options };
1697
+ return this.dialog.open(MessageBoxModalComponent, config).afterClosed();
1698
+ }
1699
+ open(options = {}) {
1700
+ const config = new MatDialogConfig();
1701
+ config.disableClose = true;
1702
+ config.minWidth = '340px';
1703
+ config.maxWidth = options.maxWidth || '600px';
1704
+ config.width = '40vw';
1705
+ config.data = { message: options.message, options };
1706
+ return this.dialog.open(MessageBoxModalComponent, config).afterClosed();
1707
+ }
1708
+ confirmDelete(title, message) {
1709
+ const options = {
1710
+ title,
1711
+ buttons: [
1712
+ { id: 'cancel', text: this.translateService.instant('ui.messagebox.button.cancel') },
1713
+ { id: 'delete', text: this.translateService.instant('ui.messagebox.button.delete'), color: 'warn', kind: 'flat' }
1714
+ ]
1715
+ };
1716
+ // @ts-ignore
1717
+ return this.confirm(message, options);
1718
+ }
1719
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MessageBoxService, deps: [{ token: i1$2.MatDialog }, { token: UI_TRANSLATESERVICE }], target: i0.ɵɵFactoryTarget.Injectable }); }
1720
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MessageBoxService, providedIn: 'root' }); }
1721
+ }
1722
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MessageBoxService, decorators: [{
1723
+ type: Injectable,
1724
+ args: [{
1725
+ providedIn: 'root'
1726
+ }]
1727
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialog }, { type: undefined, decorators: [{
1728
+ type: Inject,
1729
+ args: [UI_TRANSLATESERVICE]
1730
+ }] }]; } });
1731
+
1732
+ class CurrencyComponent extends UiBaseComponent {
1733
+ // @HostBinding('class')
1734
+ // get sizeClass(): string {
1735
+ // return this.size;
1736
+ // }
1737
+ constructor(controlContainer) {
1738
+ super();
1739
+ this.controlContainer = controlContainer;
1740
+ this.currencies = [];
1741
+ this.currencyDisabled = false;
1742
+ this.panelClass = 'ui-currency';
1743
+ this.amountHidden = false;
1744
+ this.formGroup = new UntypedFormGroup({
1745
+ amount: new UntypedFormControl(),
1746
+ currency: new UntypedFormControl()
1747
+ });
1748
+ this.hasFocus = false;
1749
+ this.onChange = (value) => { };
1750
+ }
1751
+ ngOnInit() {
1752
+ super.ngOnInit();
1753
+ this.formGroup.valueChanges.subscribe(v => this.onChange(v));
1754
+ // this.formGroup = new FormGroup({
1755
+ // amount: new FormControl(this.control?.value.amount),
1756
+ // currency: new FormControl(this.currencies.find(c => c.code === this.control?.value.currency.code))
1757
+ // });
1758
+ // this.formGroup.valueChanges.subscribe(v => {
1759
+ // this.onChange(this.formGroup?.getRawValue());
1760
+ // });
1761
+ if (this.currencyDisabled) {
1762
+ this.formGroup.get('currency')?.disable();
1763
+ }
1764
+ // this.ngControl.control.statusChanges.subscribe(s => {
1765
+ // if (s === 'INVALID') {
1766
+ // // this.formGroup?.get('amount')?.setErrors(this.control?.errors || null);
1767
+ // this.formGroup?.get('currency')?.markAsTouched();
1768
+ // // this.formGroup?.get('currency')?.setErrors(this.control?.errors || null);
1769
+ // }
1770
+ // if (s === 'DISABLED') {
1771
+ // this.formGroup?.disable({emitEvent: false});
1772
+ // }
1773
+ // if (s === 'VALID') {
1774
+ // this.formGroup?.enable({emitEvent: false});
1775
+ // if (this.currencyDisabled) {
1776
+ // this.formGroup?.get('currency')?.disable({emitEvent: false});
1777
+ // }
1778
+ // }
1779
+ // });
1780
+ this.parentFormControl = this.controlContainer.control.get(this.formControlName);
1781
+ }
1782
+ // bindValidators(validators) {
1783
+ // console.log('binding validators', validators);
1784
+ // if (this.formGroup) {
1785
+ // this.formGroup.get('amount').setValidators(validators);
1786
+ // this.formGroup.get('currency').markAsTouched();
1787
+ // this.formGroup.get('currency').setErrors(validators);
1788
+ // }
1789
+ // }
1790
+ get isInvalid() {
1791
+ return this.parentFormControl.invalid;
1792
+ }
1793
+ get validationErrors() {
1794
+ return this.parentFormControl.errors;
1795
+ }
1796
+ focusChanged(hasFocus) {
1797
+ this.hasFocus = hasFocus;
1798
+ }
1799
+ registerOnChange(fn) {
1800
+ this.onChange = fn;
1801
+ }
1802
+ registerOnTouched(fn) {
1803
+ }
1804
+ registerOnValidatorChange(fn) {
1805
+ }
1806
+ setDisabledState(isDisabled) {
1807
+ if (isDisabled) {
1808
+ this.formGroup.get('amount').disable();
1809
+ if (!this.currencyDisabled) {
1810
+ this.formGroup.get('currency').disable();
1811
+ }
1812
+ }
1813
+ else {
1814
+ this.formGroup.get('amount').enable();
1815
+ if (!this.currencyDisabled) {
1816
+ this.formGroup.get('currency').enable();
1817
+ }
1818
+ }
1819
+ }
1820
+ validate(control) {
1821
+ return undefined;
1822
+ }
1823
+ writeValue(obj) {
1824
+ this.formGroup.setValue(obj);
1825
+ }
1826
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: CurrencyComponent, deps: [{ token: i1.ControlContainer, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); }
1827
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: CurrencyComponent, selector: "ui-currency", inputs: { currencies: "currencies", currencyDisabled: "currencyDisabled", formControlName: "formControlName", panelClass: "panelClass", amountHidden: "amountHidden" }, host: { properties: { "class.amount-hidden": "this.amountHidden", "class.focus": "this.hasFocus" } }, providers: [{
1828
+ provide: NG_VALUE_ACCESSOR,
1829
+ multi: true,
1830
+ useExisting: CurrencyComponent
1831
+ }, {
1832
+ provide: NG_VALIDATORS,
1833
+ multi: true,
1834
+ useExisting: CurrencyComponent
1835
+ }
1836
+ ], usesInheritance: true, ngImport: i0, template: "<ui-base-layout [ctx]=\"this\">\r\n\r\n<div class=\"control-container\" [formGroup]=\"formGroup\">\r\n <ui-input *ngIf=\"!amountHidden\" [textAlign]=\"'right'\" [formControlName]=\"'amount'\" [placeholder]=\"placeholder\" #input [useInputMessages]=\"'never'\" (focusChanged)=\"focusChanged($event)\"></ui-input>\r\n <ui-select [panelClass]=\"panelClass\" [formControlName]=\"'currency'\" [displayAttribute]=\"'symbol'\" [options]=\"currencies\" [useInputMessages]=\"'never'\"></ui-select>\r\n</div>\r\n\r\n</ui-base-layout>\r\n\r\n", styles: [":host{display:block}:host.amount-hidden ui-select{padding-left:.7em}:host .control-container{display:flex;border-style:solid}:host .control-container ui-input{flex:1 1 100%}:host .control-container ui-select{flex-grow:0;flex-shrink:1}:host ::ng-deep .mat-mdc-select-trigger{padding-left:.2em}:host ::ng-deep input{text-align:right;padding-right:.2em}:host ::ng-deep input,:host ::ng-deep .mat-mdc-select-trigger{border-width:0}:host.large ui-select{flex-basis:4.5em}:host.larger ui-select{flex-basis:5em}:host.normal ui-select{flex-basis:5.5em}:host.smaller ui-select{flex-basis:6em}:host.small ui-select{flex-basis:6em}:host.amount-hidden.large ui-select{flex-basis:5.2em}:host.amount-hidden.larger ui-select{flex-basis:4.7em}:host.amount-hidden.normal ui-select{flex-basis:4.2em}:host.amount-hidden.smaller ui-select{flex-basis:3.8em}:host.amount-hidden.smaller ui-select ::ng-deep .mat-mdc-select-trigger{width:3.2em}:host.amount-hidden.small ui-select{flex-basis:3.5em}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: InputComponent, selector: "ui-input", inputs: ["prefixIcon", "suffixIcon", "type", "clearButton", "activeIcons", "forceHasPrefix", "forceHasSuffix", "textAlign"], outputs: ["focusChanged", "keyPressed"] }, { kind: "component", type: SelectComponent, selector: "ui-select", inputs: ["multiple", "triggerFormatter", "valueAttribute", "resetText", "displayAttribute", "options", "optionFormatter", "optionTemplateRef", "triggerTemplateRef", "panelClass", "allowEmptySelection", "trackBy"] }, { kind: "component", type: UiBaseLayoutComponent, selector: "ui-base-layout", inputs: ["ctx"] }] }); }
1837
+ }
1838
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: CurrencyComponent, decorators: [{
1839
+ type: Component,
1840
+ args: [{ selector: 'ui-currency', providers: [{
1841
+ provide: NG_VALUE_ACCESSOR,
1842
+ multi: true,
1843
+ useExisting: CurrencyComponent
1844
+ }, {
1845
+ provide: NG_VALIDATORS,
1846
+ multi: true,
1847
+ useExisting: CurrencyComponent
1848
+ }
1849
+ ], template: "<ui-base-layout [ctx]=\"this\">\r\n\r\n<div class=\"control-container\" [formGroup]=\"formGroup\">\r\n <ui-input *ngIf=\"!amountHidden\" [textAlign]=\"'right'\" [formControlName]=\"'amount'\" [placeholder]=\"placeholder\" #input [useInputMessages]=\"'never'\" (focusChanged)=\"focusChanged($event)\"></ui-input>\r\n <ui-select [panelClass]=\"panelClass\" [formControlName]=\"'currency'\" [displayAttribute]=\"'symbol'\" [options]=\"currencies\" [useInputMessages]=\"'never'\"></ui-select>\r\n</div>\r\n\r\n</ui-base-layout>\r\n\r\n", styles: [":host{display:block}:host.amount-hidden ui-select{padding-left:.7em}:host .control-container{display:flex;border-style:solid}:host .control-container ui-input{flex:1 1 100%}:host .control-container ui-select{flex-grow:0;flex-shrink:1}:host ::ng-deep .mat-mdc-select-trigger{padding-left:.2em}:host ::ng-deep input{text-align:right;padding-right:.2em}:host ::ng-deep input,:host ::ng-deep .mat-mdc-select-trigger{border-width:0}:host.large ui-select{flex-basis:4.5em}:host.larger ui-select{flex-basis:5em}:host.normal ui-select{flex-basis:5.5em}:host.smaller ui-select{flex-basis:6em}:host.small ui-select{flex-basis:6em}:host.amount-hidden.large ui-select{flex-basis:5.2em}:host.amount-hidden.larger ui-select{flex-basis:4.7em}:host.amount-hidden.normal ui-select{flex-basis:4.2em}:host.amount-hidden.smaller ui-select{flex-basis:3.8em}:host.amount-hidden.smaller ui-select ::ng-deep .mat-mdc-select-trigger{width:3.2em}:host.amount-hidden.small ui-select{flex-basis:3.5em}\n"] }]
1850
+ }], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
1851
+ type: Optional
1852
+ }, {
1853
+ type: Host
1854
+ }, {
1855
+ type: SkipSelf
1856
+ }] }]; }, propDecorators: { currencies: [{
1857
+ type: Input
1858
+ }], currencyDisabled: [{
1859
+ type: Input
1860
+ }], formControlName: [{
1861
+ type: Input
1862
+ }], panelClass: [{
1863
+ type: Input
1864
+ }], amountHidden: [{
1865
+ type: HostBinding,
1866
+ args: ['class.amount-hidden']
1867
+ }, {
1868
+ type: Input
1869
+ }], hasFocus: [{
1870
+ type: HostBinding,
1871
+ args: ['class.focus']
1872
+ }] } });
1873
+
1874
+ class CheckboxComponent extends UiSimpleComponent {
1875
+ constructor(ngControl) {
1876
+ super(ngControl);
1877
+ this.ngControl = ngControl;
1878
+ this.color = 'primary';
1879
+ this.useInputMessages = 'never';
1880
+ }
1881
+ ngOnInit() {
1882
+ super.ngOnInit();
1883
+ if (this.label) {
1884
+ this.text = this.label;
1885
+ this.label = undefined;
1886
+ }
1887
+ }
1888
+ setDisabledState(isDisabled) {
1889
+ }
1890
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: CheckboxComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
1891
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: CheckboxComponent, selector: "ui-checkbox", inputs: { color: "color", useInputMessages: "useInputMessages" }, usesInheritance: true, ngImport: i0, template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n <div class=\"control-container\">\r\n <mat-checkbox [formControl]=\"componentFormControl\" [color]=\"color\" [class]=\"size\">\r\n <div *ngIf=\"!text\"><ng-content></ng-content></div>\r\n <div *ngIf=\"text\" [innerHTML]=\"text\"></div>\r\n </mat-checkbox>\r\n <div *ngIf=\"hint\" class=\"hint\" [innerHTML]=\"hint\"></div>\r\n </div>\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex}:host ::ng-deep .mat-checkbox{display:flex}:host ::ng-deep .hint{font-size:.8em;padding-top:.1em;padding-left:2.05em}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: UiSimpleLayoutComponent, selector: "ui-simple-layout", inputs: ["ctx"] }] }); }
1892
+ }
1893
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: CheckboxComponent, decorators: [{
1894
+ type: Component,
1895
+ args: [{ selector: 'ui-checkbox', template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n <div class=\"control-container\">\r\n <mat-checkbox [formControl]=\"componentFormControl\" [color]=\"color\" [class]=\"size\">\r\n <div *ngIf=\"!text\"><ng-content></ng-content></div>\r\n <div *ngIf=\"text\" [innerHTML]=\"text\"></div>\r\n </mat-checkbox>\r\n <div *ngIf=\"hint\" class=\"hint\" [innerHTML]=\"hint\"></div>\r\n </div>\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex}:host ::ng-deep .mat-checkbox{display:flex}:host ::ng-deep .hint{font-size:.8em;padding-top:.1em;padding-left:2.05em}\n"] }]
1896
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
1897
+ type: Optional
1898
+ }, {
1899
+ type: Self
1900
+ }] }]; }, propDecorators: { color: [{
1901
+ type: Input
1902
+ }], useInputMessages: [{
1903
+ type: Input
1904
+ }] } });
1905
+
1906
+ class AvatarComponent {
1907
+ get contrast() {
1908
+ const hexCode = this.user.shortColour.substring(1, 7);
1909
+ const hexR = parseInt(hexCode.substring(0, 2), 16);
1910
+ const hexG = parseInt(hexCode.substring(2, 4), 16);
1911
+ const hexB = parseInt(hexCode.substring(4, 6), 16);
1912
+ const contrastRatio = hexR * 0.299 + hexG * 0.587 + hexB * 0.114;
1913
+ return contrastRatio >= 200 ? 'black' : 'white';
1914
+ }
1915
+ constructor() {
1916
+ this.user = {};
1917
+ this.size = 'normal';
1918
+ }
1919
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1920
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: AvatarComponent, selector: "ui-avatar", inputs: { user: "user", srcOptions: "srcOptions", size: "size" }, host: { properties: { "class": "this.size" } }, ngImport: i0, template: "<ui-file *ngIf=\"user.avatar || (!user.avatar && !user.shortName)\" [fileSize]=\"'avatar-' + size\" [srcData]=\"user.avatar || { mimeType: 'image/png'}\" [srcOptions]=\"srcOptions\" ></ui-file>\r\n<div *ngIf=\"!user.avatar && user.shortName\" [ngStyle]=\"{backgroundColor: user.shortColour, color: contrast}\">\r\n {{ user.shortName }}\r\n</div>\r\n", styles: [":host{display:block;flex:0 0 auto}:host.mini{height:16px;width:16px}:host.mini div{font-size:10px}:host.small{height:24px;width:24px}:host.small div{font-size:13px}:host.smaller{height:50px;width:50px}:host.smaller div{font-size:1.5em}:host.normal{height:74px;width:74px}:host.normal div{font-size:37px}:host.bigger{height:100px;width:100px}:host.bigger div{font-size:50px}:host.big{height:150px;width:150px}:host.big div{font-size:75px}:host ui-file ::ng-deep img{border-radius:50%}:host div{display:flex;align-items:center;justify-content:center;width:100%;font-weight:700;color:#fff;background-size:cover;height:100%;border-radius:50%}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: FileComponent, selector: "ui-file", inputs: ["fileSize", "srcOptions", "srcData", "srcUrl"] }] }); }
1921
+ }
1922
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: AvatarComponent, decorators: [{
1923
+ type: Component,
1924
+ args: [{ selector: 'ui-avatar', template: "<ui-file *ngIf=\"user.avatar || (!user.avatar && !user.shortName)\" [fileSize]=\"'avatar-' + size\" [srcData]=\"user.avatar || { mimeType: 'image/png'}\" [srcOptions]=\"srcOptions\" ></ui-file>\r\n<div *ngIf=\"!user.avatar && user.shortName\" [ngStyle]=\"{backgroundColor: user.shortColour, color: contrast}\">\r\n {{ user.shortName }}\r\n</div>\r\n", styles: [":host{display:block;flex:0 0 auto}:host.mini{height:16px;width:16px}:host.mini div{font-size:10px}:host.small{height:24px;width:24px}:host.small div{font-size:13px}:host.smaller{height:50px;width:50px}:host.smaller div{font-size:1.5em}:host.normal{height:74px;width:74px}:host.normal div{font-size:37px}:host.bigger{height:100px;width:100px}:host.bigger div{font-size:50px}:host.big{height:150px;width:150px}:host.big div{font-size:75px}:host ui-file ::ng-deep img{border-radius:50%}:host div{display:flex;align-items:center;justify-content:center;width:100%;font-weight:700;color:#fff;background-size:cover;height:100%;border-radius:50%}\n"] }]
1925
+ }], ctorParameters: function () { return []; }, propDecorators: { user: [{
1926
+ type: Input
1927
+ }], srcOptions: [{
1928
+ type: Input
1929
+ }], size: [{
1930
+ type: HostBinding,
1931
+ args: ['class']
1932
+ }, {
1933
+ type: Input
1934
+ }] } });
1935
+
1936
+ class SubmitButtonComponent {
1937
+ constructor(dialogRef, controlContainer) {
1938
+ this.dialogRef = dialogRef;
1939
+ this.controlContainer = controlContainer;
1940
+ this.busy = false;
1941
+ this.disabled = false;
1942
+ this.formGroups = [];
1943
+ this.label = 'Save';
1944
+ this.prependCloseButton = true;
1945
+ }
1946
+ ngOnInit() {
1947
+ if (this.formInvalid === undefined) {
1948
+ if (this.formGroups === undefined && this.controlContainer && this.controlContainer.control instanceof UntypedFormGroup) {
1949
+ this.formGroups = this.controlContainer.control;
1950
+ }
1951
+ if (!Array.isArray(this.formGroups)) {
1952
+ this.formGroups = [this.formGroups];
1953
+ }
1954
+ }
1955
+ }
1956
+ get formsValid() {
1957
+ if (this.formInvalid !== undefined) {
1958
+ return !this.formInvalid;
1959
+ }
1960
+ else {
1961
+ return !this.formGroups.find(f => f.invalid);
1962
+ }
1963
+ }
1964
+ doSubmit() {
1965
+ this.formGroups.forEach(f => f.markAllAsTouched());
1966
+ if (this.formsValid && this.submit) {
1967
+ this.submit();
1968
+ }
1969
+ }
1970
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: SubmitButtonComponent, deps: [{ token: i1$2.MatDialogRef }, { token: i1.ControlContainer, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); }
1971
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: SubmitButtonComponent, selector: "ui-submit-button", inputs: { busy: "busy", disabled: "disabled", formGroups: "formGroups", label: "label", submit: "submit", formInvalid: "formInvalid", prependCloseButton: "prependCloseButton" }, host: { properties: { "class.with-close": "this.prependCloseButton" } }, ngImport: i0, template: "<ui-button *ngIf=\"prependCloseButton\" [label]=\"'Close'\" (click)=\"dialogRef.close()\"></ui-button>\r\n\r\n<ui-button [busy]=\"busy\"\r\n [disabled]=\"disabled || busy\" [type]=\"'submit'\"\r\n [formInvalid]=\"!formsValid\"\r\n [label]=\"label\" (click)=\"doSubmit()\"></ui-button>\r\n", styles: [":host.with-close{display:flex;justify-content:flex-end;width:100%;margin-left:0!important}:host.with-close ui-button{margin-left:12px}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["type", "matIconPrefix", "label", "disabled", "busy", "kind", "color", "size", "formInvalid"] }] }); }
1972
+ }
1973
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: SubmitButtonComponent, decorators: [{
1974
+ type: Component,
1975
+ args: [{ selector: 'ui-submit-button', template: "<ui-button *ngIf=\"prependCloseButton\" [label]=\"'Close'\" (click)=\"dialogRef.close()\"></ui-button>\r\n\r\n<ui-button [busy]=\"busy\"\r\n [disabled]=\"disabled || busy\" [type]=\"'submit'\"\r\n [formInvalid]=\"!formsValid\"\r\n [label]=\"label\" (click)=\"doSubmit()\"></ui-button>\r\n", styles: [":host.with-close{display:flex;justify-content:flex-end;width:100%;margin-left:0!important}:host.with-close ui-button{margin-left:12px}\n"] }]
1976
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: i1.ControlContainer, decorators: [{
1977
+ type: Optional
1978
+ }, {
1979
+ type: Host
1980
+ }, {
1981
+ type: SkipSelf
1982
+ }] }]; }, propDecorators: { busy: [{
1983
+ type: Input
1984
+ }], disabled: [{
1985
+ type: Input
1986
+ }], formGroups: [{
1987
+ type: Input
1988
+ }], label: [{
1989
+ type: Input
1990
+ }], submit: [{
1991
+ type: Input
1992
+ }], formInvalid: [{
1993
+ type: Input
1994
+ }], prependCloseButton: [{
1995
+ type: HostBinding,
1996
+ args: ['class.with-close']
1997
+ }, {
1998
+ type: Input
1999
+ }] } });
2000
+
2001
+ class TextAreaComponent extends UiSimpleComponent {
2002
+ constructor(ngControl /*, private _ngZone: NgZone, private cdr: ChangeDetectorRef*/) {
2003
+ super(ngControl);
2004
+ this.ngControl = ngControl;
2005
+ this.rows = 5;
2006
+ this.autoResize = false;
2007
+ this.lastClientHeight = -1;
2008
+ this.focusChanged = new EventEmitter();
2009
+ }
2010
+ focus() {
2011
+ this.textarea.nativeElement.focus();
2012
+ }
2013
+ setDisabledState(isDisabled) {
2014
+ }
2015
+ onFocus(focus) {
2016
+ this.focusChanged.emit(focus);
2017
+ }
2018
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: TextAreaComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
2019
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: TextAreaComponent, selector: "ui-text-area", inputs: { rows: "rows", autoResize: "autoResize" }, outputs: { focusChanged: "focusChanged" }, viewQueries: [{ propertyName: "textarea", first: true, predicate: ["textarea"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<div class=\"input-wrapper\">\r\n <ng-container *ngIf=\"componentFormControl\">\r\n <textarea *ngIf=\"autoResize \"#textarea matInput\r\n cdkTextareaAutosize cdkAutosizeMinRows=\"rows\"\r\n class=\"autoresize\"\r\n [formControl]=\"componentFormControl\" [placeholder]=\"placeholder\" [rows]=\"rows\" (focus)=\"onFocus(true)\" (blur)=\"onFocus(false)\"></textarea>\r\n <textarea *ngIf=\"!autoResize \"#textarea matInput\r\n [formControl]=\"componentFormControl\" [placeholder]=\"placeholder\" [rows]=\"rows\" (focus)=\"onFocus(true)\" (blur)=\"onFocus(false)\"></textarea>\r\n </ng-container>\r\n</div>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i4$4.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: UiSimpleLayoutComponent, selector: "ui-simple-layout", inputs: ["ctx"] }] }); }
2020
+ }
2021
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: TextAreaComponent, decorators: [{
2022
+ type: Component,
2023
+ args: [{ selector: 'ui-text-area', template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<div class=\"input-wrapper\">\r\n <ng-container *ngIf=\"componentFormControl\">\r\n <textarea *ngIf=\"autoResize \"#textarea matInput\r\n cdkTextareaAutosize cdkAutosizeMinRows=\"rows\"\r\n class=\"autoresize\"\r\n [formControl]=\"componentFormControl\" [placeholder]=\"placeholder\" [rows]=\"rows\" (focus)=\"onFocus(true)\" (blur)=\"onFocus(false)\"></textarea>\r\n <textarea *ngIf=\"!autoResize \"#textarea matInput\r\n [formControl]=\"componentFormControl\" [placeholder]=\"placeholder\" [rows]=\"rows\" (focus)=\"onFocus(true)\" (blur)=\"onFocus(false)\"></textarea>\r\n </ng-container>\r\n</div>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n"] }]
2024
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2025
+ type: Optional
2026
+ }, {
2027
+ type: Self
2028
+ }] }]; }, propDecorators: { rows: [{
2029
+ type: Input
2030
+ }], autoResize: [{
2031
+ type: Input
2032
+ }], textarea: [{
2033
+ type: ViewChild,
2034
+ args: ['textarea']
2035
+ }], focusChanged: [{
2036
+ type: Output
2037
+ }] } });
2038
+
2039
+ class DateComponent extends UiSimpleComponent {
2040
+ constructor(ngControl) {
2041
+ super(ngControl);
2042
+ this.ngControl = ngControl;
2043
+ // @Input() placeholder: string | undefined;
2044
+ // @Input() control;
2045
+ // // @Input() controlName;
2046
+ // @Input() label;
2047
+ // @Input() type;
2048
+ // @Input() floatLabel;
2049
+ this.doKeyup = new EventEmitter();
2050
+ this.hasFocus = false;
2051
+ this.controlTypeName = 'date';
2052
+ this.opening = false;
2053
+ }
2054
+ open() {
2055
+ this.hasFocus = true;
2056
+ // this.opening = true;
2057
+ // this.picker.open();
2058
+ // setTimeout(() => {
2059
+ // this.input.nativeElement.focus();
2060
+ // this.opening = false;
2061
+ // }); // , 150);
2062
+ }
2063
+ close() {
2064
+ this.hasFocus = false;
2065
+ // if (!this.opening) {
2066
+ // this.picker.close();h
2067
+ // }
2068
+ }
2069
+ keyup() {
2070
+ this.doKeyup.emit();
2071
+ // this.onChange(this.control.value);
2072
+ }
2073
+ writeValue(obj) { }
2074
+ registerOnChange(fn) {
2075
+ this.onChange = fn;
2076
+ }
2077
+ registerOnTouched(fn) { }
2078
+ setDisabledState(isDisabled) { }
2079
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: DateComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
2080
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: DateComponent, selector: "ui-date", outputs: { doKeyup: "doKeyup" }, viewQueries: [{ propertyName: "picker", first: true, predicate: ["picker"], descendants: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<div class=\"control-container has-suffix active-icons\" [ngClass]=\"{'has-focus': hasFocus}\">\r\n <input #input (blur)=\"close()\" (focus)=\"open()\" [matDatepicker]=\"picker\" [placeholder]=\"placeholder\" [formControl]=\"componentFormControl\" (keyup)=\"keyup()\">\r\n <mat-icon slot=\"suffix\" (click)=\"picker.open()\" [ngClass]=\"{disabled: componentFormControl.disabled}\">today</mat-icon>\r\n <mat-datepicker #picker></mat-datepicker>\r\n</div>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$5.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i4$5.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: UiSimpleLayoutComponent, selector: "ui-simple-layout", inputs: ["ctx"] }] }); }
2081
+ }
2082
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: DateComponent, decorators: [{
2083
+ type: Component,
2084
+ args: [{ selector: 'ui-date', template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<div class=\"control-container has-suffix active-icons\" [ngClass]=\"{'has-focus': hasFocus}\">\r\n <input #input (blur)=\"close()\" (focus)=\"open()\" [matDatepicker]=\"picker\" [placeholder]=\"placeholder\" [formControl]=\"componentFormControl\" (keyup)=\"keyup()\">\r\n <mat-icon slot=\"suffix\" (click)=\"picker.open()\" [ngClass]=\"{disabled: componentFormControl.disabled}\">today</mat-icon>\r\n <mat-datepicker #picker></mat-datepicker>\r\n</div>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n"] }]
2085
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2086
+ type: Optional
2087
+ }, {
2088
+ type: Self
2089
+ }] }]; }, propDecorators: { doKeyup: [{
2090
+ type: Output
2091
+ }], picker: [{
2092
+ type: ViewChild,
2093
+ args: ['picker']
2094
+ }], input: [{
2095
+ type: ViewChild,
2096
+ args: ['input']
2097
+ }] } });
2098
+
2099
+ class TableComponent {
2100
+ get columnList() {
2101
+ return this.columns.map(c => c.name);
2102
+ }
2103
+ constructor(/*private persistService: PersistService, */ domSanitizer) {
2104
+ this.domSanitizer = domSanitizer;
2105
+ this.columns = [];
2106
+ this.rowTemplates = {};
2107
+ this.headerTemplates = {};
2108
+ this.stateStoreKey = '';
2109
+ }
2110
+ ngOnInit() {
2111
+ this.options = { ...{ sticky: false }, ...this.options };
2112
+ if (this.dataSource) {
2113
+ // if (this.stateStoreKey !== '') {
2114
+ // const storeKey = this.stateStoreKey + '.sort';
2115
+ // const ms = this.persistService.get(storeKey, { active: '', direction: ''});
2116
+ // this.matSort.active = ms.active;
2117
+ // this.matSort.direction = ms.direction;
2118
+ // this.matSort.sortChange.subscribe(sc => {
2119
+ // this.persistService.set(storeKey, sc.direction === '' ? { active: '', direction: ''} : sc);
2120
+ // });
2121
+ // }
2122
+ if (this.columns.find(c => c.sortable !== undefined)) {
2123
+ this.dataSource.sortData = (rows, sort) => {
2124
+ if (sort.direction) {
2125
+ const sortColumn = this.columns.find(c => c.name === sort.active);
2126
+ if (sortColumn) {
2127
+ const res = sort.direction === 'asc' ? 1 : -1;
2128
+ return rows.sort((r1, r2) => {
2129
+ if (sortColumn.sortable === true) {
2130
+ return r1[sortColumn.name] < r2[sortColumn.name] ? -res : res;
2131
+ }
2132
+ if (typeof sortColumn.sortable === 'function') {
2133
+ return sortColumn.sortable(r1, sort.direction) < sortColumn.sortable(r2, sort.direction) ? -res : res;
2134
+ }
2135
+ return 0;
2136
+ });
2137
+ }
2138
+ }
2139
+ return rows;
2140
+ };
2141
+ }
2142
+ }
2143
+ }
2144
+ ngAfterViewInit() {
2145
+ this.dataSource.sort = this.matSort;
2146
+ }
2147
+ display(row, col) {
2148
+ if (col.formatter) {
2149
+ return this.domSanitizer.bypassSecurityTrustHtml(col.formatter(row));
2150
+ }
2151
+ else {
2152
+ return row[col.name];
2153
+ }
2154
+ }
2155
+ rowClicked(row) {
2156
+ if (this.rowAction) {
2157
+ this.rowAction(row);
2158
+ }
2159
+ }
2160
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: TableComponent, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
2161
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: TableComponent, selector: "ui-table", inputs: { columns: "columns", dataSource: "dataSource", options: "options", rowTemplates: "rowTemplates", headerTemplates: "headerTemplates", stateStoreKey: "stateStoreKey", rowAction: "rowAction", matSortActive: "matSortActive", matSortDirection: "matSortDirection" }, viewQueries: [{ propertyName: "matSort", first: true, predicate: MatSort, descendants: true }], ngImport: i0, template: "<table mat-table matSort [dataSource]=\"dataSource\" style=\"width: 100%\" [matSortActive]=\"matSortActive\" [matSortDirection]=\"matSortDirection\">\n\n <ng-container *ngFor=\"let c of columns\" [matColumnDef]=\"c.name\">\n\n <ng-container *ngIf=\"c.sortable\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>{{c.label}}</th>\n </ng-container>\n\n <ng-container *ngIf=\"!c.sortable\">\n <ng-container *ngIf=\"!headerTemplates[c.name]\">\n <th mat-header-cell *matHeaderCellDef>{{c.label}}</th>\n </ng-container>\n\n <ng-container *ngIf=\"headerTemplates[c.name]\">\n <th mat-header-cell *matHeaderCellDef>\n <ng-template [ngTemplateOutlet]=\"headerTemplates[c.name]\"></ng-template>\n </th>\n </ng-container>\n </ng-container>\n\n <td mat-cell *matCellDef=\"let element\" [colSpan]=\"c.colSpan ? c.colSpan(element) : 1\" [class]=\"c.cellClass ? c.cellClass(element) : ''\">\n <ng-container *ngIf=\"!c.colSpan || c.colSpan(element) > 0\">\n <ng-container *ngIf=\"rowTemplates[c.name]\">\n <ng-template [ngTemplateOutlet]=\"rowTemplates[c.name]\" [ngTemplateOutletContext]=\"{row:element}\" ></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"!rowTemplates[c.name]\">\n <span [innerHTML]=\"display(element, c)\"></span>\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnList; sticky: options?.sticky\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnList;\" (click)=\"rowClicked(row)\"></tr>\n</table>\n", styles: [":host table{width:100%}:host td[colspan=\"0\"]{display:none}:host .mat-header-cell{font-weight:400;font-size:14px}:host.inverse .mat-header-row{background-color:#fff}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$5.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i3$5.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i3$5.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i3$5.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { kind: "directive", type: i3$5.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i3$5.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i3$5.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i3$5.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i3$5.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i3$5.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i4$6.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i4$6.MatSortHeader, selector: "[mat-sort-header]", inputs: ["disabled", "mat-sort-header", "arrowPosition", "start", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }] }); }
2162
+ }
2163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: TableComponent, decorators: [{
2164
+ type: Component,
2165
+ args: [{ selector: 'ui-table', template: "<table mat-table matSort [dataSource]=\"dataSource\" style=\"width: 100%\" [matSortActive]=\"matSortActive\" [matSortDirection]=\"matSortDirection\">\n\n <ng-container *ngFor=\"let c of columns\" [matColumnDef]=\"c.name\">\n\n <ng-container *ngIf=\"c.sortable\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>{{c.label}}</th>\n </ng-container>\n\n <ng-container *ngIf=\"!c.sortable\">\n <ng-container *ngIf=\"!headerTemplates[c.name]\">\n <th mat-header-cell *matHeaderCellDef>{{c.label}}</th>\n </ng-container>\n\n <ng-container *ngIf=\"headerTemplates[c.name]\">\n <th mat-header-cell *matHeaderCellDef>\n <ng-template [ngTemplateOutlet]=\"headerTemplates[c.name]\"></ng-template>\n </th>\n </ng-container>\n </ng-container>\n\n <td mat-cell *matCellDef=\"let element\" [colSpan]=\"c.colSpan ? c.colSpan(element) : 1\" [class]=\"c.cellClass ? c.cellClass(element) : ''\">\n <ng-container *ngIf=\"!c.colSpan || c.colSpan(element) > 0\">\n <ng-container *ngIf=\"rowTemplates[c.name]\">\n <ng-template [ngTemplateOutlet]=\"rowTemplates[c.name]\" [ngTemplateOutletContext]=\"{row:element}\" ></ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"!rowTemplates[c.name]\">\n <span [innerHTML]=\"display(element, c)\"></span>\n </ng-container>\n </ng-container>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnList; sticky: options?.sticky\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnList;\" (click)=\"rowClicked(row)\"></tr>\n</table>\n", styles: [":host table{width:100%}:host td[colspan=\"0\"]{display:none}:host .mat-header-cell{font-weight:400;font-size:14px}:host.inverse .mat-header-row{background-color:#fff}\n"] }]
2166
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; }, propDecorators: { columns: [{
2167
+ type: Input
2168
+ }], dataSource: [{
2169
+ type: Input
2170
+ }], options: [{
2171
+ type: Input
2172
+ }], rowTemplates: [{
2173
+ type: Input
2174
+ }], headerTemplates: [{
2175
+ type: Input
2176
+ }], stateStoreKey: [{
2177
+ type: Input
2178
+ }], rowAction: [{
2179
+ type: Input
2180
+ }], matSortActive: [{
2181
+ type: Input
2182
+ }], matSortDirection: [{
2183
+ type: Input
2184
+ }], matSort: [{
2185
+ type: ViewChild,
2186
+ args: [MatSort]
2187
+ }] } });
2188
+
2189
+ class BurgerComponent {
2190
+ constructor() {
2191
+ this.open = false;
2192
+ }
2193
+ ngOnInit() {
2194
+ }
2195
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BurgerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2196
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: BurgerComponent, selector: "ui-burger", inputs: { open: "open" }, host: { properties: { "class.open": "this.open" } }, ngImport: i0, template: " <span></span>\r\n <span></span>\r\n <span></span>\r\n <span></span>\r\n", styles: [":host{width:40px;height:35px;position:relative;margin:10px auto 0;transform:rotate(0);transition:.5s ease-in-out;cursor:pointer;display:block}:host span{display:block;position:absolute;height:4px;width:100%;border-radius:9px;opacity:1;left:0;transform:rotate(0);transition:.25s ease-in-out}:host span:nth-child(1){top:0}:host span:nth-child(2),:host span:nth-child(3){top:12px}:host span:nth-child(4){top:24px}:host.open span:nth-child(1){top:12px;width:0%;left:50%}:host.open span:nth-child(2){transform:rotate(45deg)}:host.open span:nth-child(3){transform:rotate(-45deg)}:host.open span:nth-child(4){top:18px;width:0;left:50%}\n"] }); }
2197
+ }
2198
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BurgerComponent, decorators: [{
2199
+ type: Component,
2200
+ args: [{ selector: 'ui-burger', template: " <span></span>\r\n <span></span>\r\n <span></span>\r\n <span></span>\r\n", styles: [":host{width:40px;height:35px;position:relative;margin:10px auto 0;transform:rotate(0);transition:.5s ease-in-out;cursor:pointer;display:block}:host span{display:block;position:absolute;height:4px;width:100%;border-radius:9px;opacity:1;left:0;transform:rotate(0);transition:.25s ease-in-out}:host span:nth-child(1){top:0}:host span:nth-child(2),:host span:nth-child(3){top:12px}:host span:nth-child(4){top:24px}:host.open span:nth-child(1){top:12px;width:0%;left:50%}:host.open span:nth-child(2){transform:rotate(45deg)}:host.open span:nth-child(3){transform:rotate(-45deg)}:host.open span:nth-child(4){top:18px;width:0;left:50%}\n"] }]
2201
+ }], ctorParameters: function () { return []; }, propDecorators: { open: [{
2202
+ type: HostBinding,
2203
+ args: ['class.open']
2204
+ }, {
2205
+ type: Input
2206
+ }] } });
2207
+
2208
+ class AutocompleteComponent extends UiBaseComponent {
2209
+ constructor(controlContainer,
2210
+ // @Optional() @Self() public ngControl: NgControl,
2211
+ cdr) {
2212
+ super();
2213
+ this.controlContainer = controlContainer;
2214
+ this.cdr = cdr;
2215
+ this.SHOWN_USERS_DELTA = 10;
2216
+ this.multiple = true;
2217
+ this.allowNew = false;
2218
+ this.displayAttribute = 'name';
2219
+ this.idAttribute = 'id';
2220
+ this.filteredOptions = [];
2221
+ this.filteredMaxItemsShown = this.SHOWN_USERS_DELTA;
2222
+ // skipBlur = false;
2223
+ // typingStarted = false;
2224
+ this.messageShown = false;
2225
+ this.alreadyAdded = false;
2226
+ this.optionsVisible = false;
2227
+ this.inputFocused = false;
2228
+ this.inputControl = new UntypedFormControl('');
2229
+ this.checkboxSelection = new Set();
2230
+ this.optionDisabled = () => false;
2231
+ this.optionFormatter = (o) => o[this.displayAttribute];
2232
+ }
2233
+ buildSearchableOptions() {
2234
+ return this.options.map(o => ({
2235
+ ...o,
2236
+ unselectable: this.optionDisabled(o),
2237
+ searchString: `${this.optionFormatter(o)}`.toLowerCase()
2238
+ }));
2239
+ }
2240
+ filterOptions(text) {
2241
+ this.filteredMaxItemsShown = this.SHOWN_USERS_DELTA;
2242
+ return this.searchableOptions.filter(u => u.searchString.includes(text));
2243
+ }
2244
+ ngOnInit() {
2245
+ // console.log('ngoninit');
2246
+ super.ngOnInit();
2247
+ // if (this.formControlName && this.controlContainer.control) {
2248
+ // this.control = this.controlContainer.control.get(this.formControlName) as FormControl;
2249
+ // }
2250
+ //
2251
+ // this.user = this.control.value;
2252
+ // this.value = this.control.value;
2253
+ this.searchableOptions = this.buildSearchableOptions();
2254
+ // if (this.control.disabled) {
2255
+ // this.inputControl.disable();
2256
+ // }
2257
+ // this.control.statusChanges.subscribe(v => {
2258
+ // if (v === 'DISABLED') {
2259
+ // this.inputControl.disable();
2260
+ // }
2261
+ // if (v === 'VALID') {
2262
+ // this.inputControl.enable();
2263
+ // }
2264
+ // });
2265
+ this.inputControl.valueChanges.pipe(debounceTime(200)).subscribe(v => {
2266
+ const lcv = v.toLowerCase();
2267
+ this.filteredOptions = this.filterOptions(lcv);
2268
+ if (this.filteredOptions.length > 0) {
2269
+ this.focusedOption = this.filteredOptions[0];
2270
+ }
2271
+ else {
2272
+ this.focusedOption = undefined;
2273
+ }
2274
+ if (v === '') {
2275
+ this.focusedOption = undefined;
2276
+ this.selectedOption = undefined;
2277
+ }
2278
+ // if (v !== '') {
2279
+ // if (this.newUsername === v) {
2280
+ // this.selectedUser = {id: null, fullName: v};
2281
+ // this.initialUser = this.selectedUser;
2282
+ // } else {
2283
+ // if (this.filteredGroupsAndUsers.length > 0) {
2284
+ // this.focusedGroup = this.filteredGroupsAndUsers[0];
2285
+ // this.focusedUser = this.focusedGroup.filteredUsers[0];
2286
+ // } else {
2287
+ // this.focusedGroup = null;
2288
+ // this.focusedUser = null;
2289
+ // }
2290
+ // if ((this.focusedUser && !this.focusedUser.unselectable) || this.focusedUser === this.initialUser) {
2291
+ // this.selectedUser = this.focusedUser;
2292
+ // } else {
2293
+ // this.selectedUser = null;
2294
+ // }
2295
+ // }
2296
+ // } else {
2297
+ // this.selectedUser = null;
2298
+ // this.focusedUser = null;
2299
+ // this.focusedGroup = null;
2300
+ // }
2301
+ // this.onChange(v);
2302
+ });
2303
+ // if (this.user !== null) {
2304
+ // let selectedUser = null;
2305
+ // this.groupsAndUsers.find(g => g.users.find(u => {
2306
+ // if (u.id === this.user.id) {
2307
+ // selectedUser = u;
2308
+ // return true;
2309
+ // } else {
2310
+ // return false;
2311
+ // }
2312
+ // }));
2313
+ //
2314
+ // if (selectedUser) {
2315
+ // this.inputControl.setValue(selectedUser.fullName);
2316
+ // this.selectedUser = selectedUser;
2317
+ // } else {
2318
+ // this.newUsername = this.user.fullName;
2319
+ // this.inputControl.setValue(this.user.fullName);
2320
+ // this.selectedUser = { id: null, fullName: this.newUsername };
2321
+ // }
2322
+ // } else {
2323
+ // this.selectedUser = null;
2324
+ // this.inputControl.setValue('');
2325
+ // }
2326
+ // this.initialUser = this.selectedUser;
2327
+ // }
2328
+ }
2329
+ inputFocusChanged(focused) {
2330
+ if (focused) {
2331
+ this.optionsVisible = true;
2332
+ }
2333
+ }
2334
+ // setTimeout(() => {
2335
+ // if (!focused && this.skipBlur) {
2336
+ // this.skipBlur = false;
2337
+ // return;
2338
+ // }
2339
+ // if (!this.typingStarted && focused) {
2340
+ // this.inputControl.setValue(this.inputControl.value);
2341
+ // this.typingStarted = true;
2342
+ // }
2343
+ // if (!this.messageShown) {
2344
+ // this.inputFocused = focused;
2345
+ // if (!focused) {
2346
+ // this.emitSelection('focus lost');
2347
+ // }
2348
+ // }
2349
+ // }, 250);
2350
+ // }
2351
+ get hasCheckboxSelected() {
2352
+ return this.checkboxSelection.size > 0;
2353
+ }
2354
+ optionChecked(u) {
2355
+ return this.checkboxSelection.has(u[this.idAttribute]);
2356
+ }
2357
+ select(u) {
2358
+ if (this.hasCheckboxSelected || u.unselectable) {
2359
+ return;
2360
+ }
2361
+ if (!u.unselectable) {
2362
+ this.selectedOption = u;
2363
+ this.initialOption = u;
2364
+ this.toggleDropdown();
2365
+ }
2366
+ }
2367
+ toggleOptionCheckboxed(u) {
2368
+ if (!u.unselectable) {
2369
+ this.checkboxSelection.has(u[this.idAttribute]) ?
2370
+ this.checkboxSelection.delete(u[this.idAttribute]) : this.checkboxSelection.add(u[this.idAttribute]);
2371
+ }
2372
+ this.input?.focus();
2373
+ }
2374
+ // get optionsVisible(): boolean {
2375
+ // return this.inputFocused && this.typingStarted;
2376
+ // }
2377
+ keyPressed(keyEvent) {
2378
+ this.lastEmittedId = -1;
2379
+ this.optionsVisible = true;
2380
+ // this.typingStarted = keyEvent.key !== 'Tab' && keyEvent.key !== 'Escape';
2381
+ if (keyEvent.key === 'Escape') {
2382
+ keyEvent.stopPropagation();
2383
+ keyEvent.preventDefault();
2384
+ this.optionsVisible = false;
2385
+ return;
2386
+ }
2387
+ if (keyEvent.key === 'Enter' && this.hasCheckboxSelected) {
2388
+ if (this.focusedOption && !this.focusedOption.unselectable) {
2389
+ this.toggleOptionCheckboxed(this.focusedOption);
2390
+ }
2391
+ keyEvent.stopPropagation();
2392
+ keyEvent.preventDefault();
2393
+ return;
2394
+ }
2395
+ // if (keyEvent.key === 'Enter' && this.filteredGroupsAndUsers.length === 0 && this.focusedUser === null && !this.alreadyAdded) {
2396
+ // this.newUser();
2397
+ // keyEvent.stopPropagation();
2398
+ // keyEvent.preventDefault();
2399
+ // return;
2400
+ // }
2401
+ if (keyEvent.key === 'Enter') {
2402
+ this.selectedOption = this.focusedOption;
2403
+ keyEvent.stopPropagation();
2404
+ keyEvent.preventDefault();
2405
+ this.toggleDropdown();
2406
+ return;
2407
+ }
2408
+ if ((keyEvent.key === 'ArrowDown' || keyEvent.key === 'ArrowUp') && !this.focusedOption) {
2409
+ if (this.filteredOptions.length > 0) {
2410
+ this.focusedOption = this.filteredOptions[0];
2411
+ // if (!this.focusedUser.unselectable || this.focusedUser === this.initialUser) {
2412
+ // this.selectedUser = this.focusedUser;
2413
+ // }
2414
+ this.selectedOption = this.focusedOption;
2415
+ return;
2416
+ }
2417
+ }
2418
+ if (keyEvent.key === 'ArrowDown' && this.focusedOption) {
2419
+ const idx = this.filteredOptions.indexOf(this.focusedOption);
2420
+ if (idx === this.filteredMaxItemsShown - 1) {
2421
+ this.filteredMaxItemsShown += this.SHOWN_USERS_DELTA;
2422
+ }
2423
+ if (idx < this.filteredOptions.length - 1) {
2424
+ this.focusedOption = this.filteredOptions[idx + 1];
2425
+ this.selectedOption = this.focusedOption;
2426
+ }
2427
+ }
2428
+ if (keyEvent.key === 'ArrowUp' && this.focusedOption) {
2429
+ const idx = this.filteredOptions.indexOf(this.focusedOption);
2430
+ if (idx > 0) {
2431
+ this.focusedOption = this.filteredOptions[idx - 1];
2432
+ this.selectedOption = this.focusedOption;
2433
+ }
2434
+ }
2435
+ this.cdr.detectChanges();
2436
+ }
2437
+ toggleDropdown() {
2438
+ this.optionsVisible = false;
2439
+ this.emitSelection('toggle');
2440
+ }
2441
+ emitSelection(src) {
2442
+ this.initialOption = this.selectedOption;
2443
+ if (this.selectedOption) {
2444
+ const checkId = this.selectedOption.id === null ? 0 : this.selectedOption.id;
2445
+ if (this.lastEmittedId !== checkId) {
2446
+ this.lastEmittedId = checkId;
2447
+ this.onChange(this.options.find(o => o[this.idAttribute] === this.selectedOption[this.idAttribute]));
2448
+ this.inputControl.setValue(this.selectedOption[this.displayAttribute]);
2449
+ }
2450
+ }
2451
+ else {
2452
+ // this.control.setValue(null);
2453
+ this.onChange(null);
2454
+ this.inputControl.setValue('', { emitEvent: false });
2455
+ }
2456
+ // if (this.selectedOption) {
2457
+ // const checkId = this.selectedUser.id === null ? 0 : this.selectedUser.id;
2458
+ // if (this.lastEmittedId !== checkId) {
2459
+ // this.inputControl.setValue(this.selectedUser.fullName, {emitEvent: false});
2460
+ // if (this.selectedUser.id) {
2461
+ // this.groupsAndUsers.find(g => g.users.find(u => {
2462
+ // if (u.id === this.selectedUser.id) {
2463
+ // this.control.setValue(u);
2464
+ // return true;
2465
+ // } else {
2466
+ // return false;
2467
+ // }
2468
+ // }));
2469
+ // } else {
2470
+ // this.control.setValue(this.selectedUser);
2471
+ // }
2472
+ // this.lastEmittedId = checkId;
2473
+ // }
2474
+ // } else {
2475
+ // if (this.lastEmittedId !== null || this.lastEmittedId === -1/* || this.selectedUser?.unselectable*/) {
2476
+ // this.control?.setValue(null);
2477
+ // this.inputControl.setValue('', {emitEvent: false});
2478
+ // this.lastEmittedId = null;
2479
+ // }
2480
+ // }
2481
+ // this.typingStarted = false;
2482
+ }
2483
+ cancelCheckboxSelection() {
2484
+ this.checkboxSelection.clear();
2485
+ // this.skipBlur = true;
2486
+ // this.input?.focus();
2487
+ }
2488
+ useCheckboxSelection() {
2489
+ // this.newUsername = '';
2490
+ // const users = [];
2491
+ // this.groupsAndUsers.forEach(g => g.users.forEach(u => {
2492
+ // if (!users.includes(u) && this.checkboxSelection.has(u.id)) {
2493
+ // users.push(u);
2494
+ // }
2495
+ // }));
2496
+ const outputOptions = this.options.filter(o => this.checkboxSelection.has(o[this.idAttribute]) && !this.optionDisabled(o));
2497
+ if (outputOptions.length > 0) {
2498
+ this.selectedOption = outputOptions[0];
2499
+ this.inputControl.setValue(this.selectedOption[this.displayAttribute], { emitEvent: false });
2500
+ this.onChange(outputOptions);
2501
+ this.toggleDropdown();
2502
+ // this.control?.setValue(outputOptions);
2503
+ // this.typingStarted = false;
2504
+ // this.skipBlur = true;
2505
+ }
2506
+ this.checkboxSelection.clear();
2507
+ }
2508
+ newOption() {
2509
+ }
2510
+ loadMore(visible) {
2511
+ if (visible) {
2512
+ this.filteredMaxItemsShown += this.SHOWN_USERS_DELTA;
2513
+ }
2514
+ }
2515
+ focus() {
2516
+ this.input?.focus();
2517
+ }
2518
+ registerOnChange(fn) {
2519
+ this.onChange = fn;
2520
+ }
2521
+ registerOnTouched(fn) {
2522
+ }
2523
+ setDisabledState(isDisabled) {
2524
+ isDisabled ? this.inputControl.disable() : this.inputControl.enable();
2525
+ }
2526
+ writeValue(obj) {
2527
+ if (obj) {
2528
+ if (obj.id) {
2529
+ this.filteredOptions = this.searchableOptions.filter(so => so.id === obj.id);
2530
+ }
2531
+ else {
2532
+ this.filteredOptions = this.filterOptions(obj[this.displayAttribute].toLowerCase());
2533
+ }
2534
+ if (this.filteredOptions.length === 1) {
2535
+ this.selectedOption = this.filteredOptions[0];
2536
+ this.focusedOption = this.filteredOptions[0];
2537
+ }
2538
+ this.inputControl.setValue(obj[this.displayAttribute]);
2539
+ }
2540
+ else {
2541
+ this.filteredOptions = this.filterOptions('');
2542
+ }
2543
+ }
2544
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: AutocompleteComponent, deps: [{ token: i1.ControlContainer, host: true, optional: true, skipSelf: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
2545
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: AutocompleteComponent, selector: "ui-autocomplete", inputs: { options: "options", multiple: "multiple", allowNew: "allowNew", displayAttribute: "displayAttribute", idAttribute: "idAttribute", optionDisabled: "optionDisabled", optionFormatter: "optionFormatter" }, providers: [{
2546
+ provide: NG_VALUE_ACCESSOR,
2547
+ multi: true,
2548
+ useExisting: AutocompleteComponent
2549
+ }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "optionsTrigger", first: true, predicate: ["trigger"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"wrapper\" #wrapper>\r\n <div *ngIf=\"optionsVisible\" (click)=\"toggleDropdown()\" class=\"overlay\"></div>\r\n <ui-input [formControl]=\"inputControl\" #input #trigger=\"cdkOverlayOrigin\" cdkOverlayOrigin (focusChanged)=\"inputFocusChanged($event)\" (keyPressed)=\"keyPressed($event)\" [placeholder]=\"placeholder\" [useInputMessages]=\"'never'\">\r\n <div slot=\"prefix\"><ng-content select=\"[slot=acprefix]\"></ng-content></div>\r\n </ui-input>\r\n\r\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]=\"trigger\" [cdkConnectedOverlayOpen]=\"optionsVisible\">\r\n <div class=\"options-box\" style=\"display: flex; flex-direction: column\" [ngStyle]=\"{width: wrapper.offsetWidth + 'px'}\">\r\n <div class=\"options\" #options>\r\n\r\n <ng-container *ngFor=\"let option of filteredOptions; index as i\">\r\n <div *ngIf=\"i < filteredMaxItemsShown\" class=\"option-container\" [ngClass]=\"{selected: focusedOption === option}\">\r\n <mat-checkbox [checked]=\"optionChecked(option) || option.unselectable\" [disabled]=\"option.unselectable\" (change)=\"toggleOptionCheckboxed(option)\">\r\n <div class=\"option-container-inner\" (click)=\"select(option)\">\r\n <div class=\"option-option\" uiForceVisibility [visibilityWithin]=\"options\" [visibilityPadding]=\"4\" *ngIf=\"focusedOption === option\" [ngClass]=\"{unselectable: option.unselectable}\">\r\n {{optionFormatter(option)}}\r\n </div>\r\n <div class=\"option-option\" *ngIf=\"focusedOption !== option\" [ngClass]=\"{unselectable: option.unselectable}\">\r\n {{optionFormatter(option)}}\r\n </div>\r\n <mat-icon *ngIf=\"!hasCheckboxSelected && !option.unselectable\">north_west</mat-icon>\r\n </div>\r\n </mat-checkbox>\r\n </div>\r\n </ng-container>\r\n\r\n <div *ngIf=\"filteredOptions.length >= filteredMaxItemsShown\" class=\"option-container\" uiForceVisibility [visibilityWithin]=\"options\" [visibilityEmitChange]=\"true\" (visibilityChanged)=\"loadMore($event)\">\r\n &nbsp;\r\n </div>\r\n\r\n\r\n <div *ngIf=\"filteredOptions.length === 0 && !focusedOption\" class=\"new-user\">\r\n <ng-container *ngIf=\"alreadyAdded\">\r\n <div style=\"text-align: center\">U\u017Eivatel {{inputControl.value}} u\u017E je mezi dlu\u017En\u00EDky</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!alreadyAdded\">\r\n <div style=\"text-align: center; padding: 1em 0\">U\u017Eivatele <strong>{{inputControl.value}}</strong> nezn\u00E1me</div>\r\n <ui-button *ngIf=\"allowNew\" style=\"margin-top: 6px;\" [size]=\"'small'\" [label]=\"'P\u0159idat jej?'\" (click)=\"newOption()\"></ui-button>\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"filteredOptions.length === 0 && focusedOption\" class=\"new-user\">\r\n <div style=\"text-align: center\">Nezn\u00E1m\u00FD u\u017Eivatel {{inputControl.value}}</div>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"hasCheckboxSelected && filteredOptions.length > 0\" class=\"checkbox-buttons\">\r\n <ui-button [size]=\"'small'\" [kind]=\"'basic'\" [label]=\"'Zru\u0161it v\u00FDb\u011Br'\" (click)=\"cancelCheckboxSelection()\"></ui-button>\r\n <ui-button [size]=\"'small'\" [label]=\"'Pou\u017E\u00EDt v\u00FDb\u011Br (' + checkboxSelection.size + ')'\" (click)=\"useCheckboxSelection()\"></ui-button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</div>\r\n\r\n", styles: [":host .wrapper{position:relative;outline:none;display:flex}:host .overlay{position:fixed;inset:0}.options-box{max-height:248px;min-width:310px;box-shadow:0 2px 4px -1px #07254833,0 4px 5px #07254824,0 1px 10px #0725481f}.options-box .checkbox-buttons{display:flex;padding:8px 4px 4px;justify-content:space-between}.options-box .options{padding:4px;overflow:auto;scroll-behavior:smooth;display:flex;flex-direction:column}.options-box .options .option-container{padding:0 0 0 12px;display:flex;align-items:center}.options-box .options .option-container:hover{cursor:pointer}.options-box .options .option-container mat-checkbox{width:100%}.options-box .options .option-container mat-checkbox ::ng-deep .mdc-form-field{width:100%}.options-box .options .option-container mat-checkbox ::ng-deep .mdc-form-field label{display:flex;width:100%}.options-box .options .option-container-inner{flex:1 1 100%;display:flex;align-items:center}.options-box .options .option-container-inner .option-option{flex:1 1 100%;padding:10px 0 10px 8px}.options-box .options .option-container-inner mat-icon{display:none;font-size:20px;height:20px;margin-right:8px}.options-box .options .option-container-inner:hover mat-icon{display:block}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$3.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i5.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i5.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: ButtonComponent, selector: "ui-button", inputs: ["type", "matIconPrefix", "label", "disabled", "busy", "kind", "color", "size", "formInvalid"] }, { kind: "component", type: InputComponent, selector: "ui-input", inputs: ["prefixIcon", "suffixIcon", "type", "clearButton", "activeIcons", "forceHasPrefix", "forceHasSuffix", "textAlign"], outputs: ["focusChanged", "keyPressed"] }, { kind: "directive", type: ForceVisibilityDirective, selector: "[uiForceVisibility]", inputs: ["visibilityWithin", "visibilityPadding", "visibilityOnRequestOnly", "visibilityEmitChange", "visibilityFromTop", "visibilityCheckEnabled"], outputs: ["visibilityChanged"], exportAs: ["ForceVisibilityDirective"] }] }); }
2550
+ }
2551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: AutocompleteComponent, decorators: [{
2552
+ type: Component,
2553
+ args: [{ selector: 'ui-autocomplete', providers: [{
2554
+ provide: NG_VALUE_ACCESSOR,
2555
+ multi: true,
2556
+ useExisting: AutocompleteComponent
2557
+ }], template: "<div class=\"wrapper\" #wrapper>\r\n <div *ngIf=\"optionsVisible\" (click)=\"toggleDropdown()\" class=\"overlay\"></div>\r\n <ui-input [formControl]=\"inputControl\" #input #trigger=\"cdkOverlayOrigin\" cdkOverlayOrigin (focusChanged)=\"inputFocusChanged($event)\" (keyPressed)=\"keyPressed($event)\" [placeholder]=\"placeholder\" [useInputMessages]=\"'never'\">\r\n <div slot=\"prefix\"><ng-content select=\"[slot=acprefix]\"></ng-content></div>\r\n </ui-input>\r\n\r\n <ng-template cdkConnectedOverlay [cdkConnectedOverlayOrigin]=\"trigger\" [cdkConnectedOverlayOpen]=\"optionsVisible\">\r\n <div class=\"options-box\" style=\"display: flex; flex-direction: column\" [ngStyle]=\"{width: wrapper.offsetWidth + 'px'}\">\r\n <div class=\"options\" #options>\r\n\r\n <ng-container *ngFor=\"let option of filteredOptions; index as i\">\r\n <div *ngIf=\"i < filteredMaxItemsShown\" class=\"option-container\" [ngClass]=\"{selected: focusedOption === option}\">\r\n <mat-checkbox [checked]=\"optionChecked(option) || option.unselectable\" [disabled]=\"option.unselectable\" (change)=\"toggleOptionCheckboxed(option)\">\r\n <div class=\"option-container-inner\" (click)=\"select(option)\">\r\n <div class=\"option-option\" uiForceVisibility [visibilityWithin]=\"options\" [visibilityPadding]=\"4\" *ngIf=\"focusedOption === option\" [ngClass]=\"{unselectable: option.unselectable}\">\r\n {{optionFormatter(option)}}\r\n </div>\r\n <div class=\"option-option\" *ngIf=\"focusedOption !== option\" [ngClass]=\"{unselectable: option.unselectable}\">\r\n {{optionFormatter(option)}}\r\n </div>\r\n <mat-icon *ngIf=\"!hasCheckboxSelected && !option.unselectable\">north_west</mat-icon>\r\n </div>\r\n </mat-checkbox>\r\n </div>\r\n </ng-container>\r\n\r\n <div *ngIf=\"filteredOptions.length >= filteredMaxItemsShown\" class=\"option-container\" uiForceVisibility [visibilityWithin]=\"options\" [visibilityEmitChange]=\"true\" (visibilityChanged)=\"loadMore($event)\">\r\n &nbsp;\r\n </div>\r\n\r\n\r\n <div *ngIf=\"filteredOptions.length === 0 && !focusedOption\" class=\"new-user\">\r\n <ng-container *ngIf=\"alreadyAdded\">\r\n <div style=\"text-align: center\">U\u017Eivatel {{inputControl.value}} u\u017E je mezi dlu\u017En\u00EDky</div>\r\n </ng-container>\r\n <ng-container *ngIf=\"!alreadyAdded\">\r\n <div style=\"text-align: center; padding: 1em 0\">U\u017Eivatele <strong>{{inputControl.value}}</strong> nezn\u00E1me</div>\r\n <ui-button *ngIf=\"allowNew\" style=\"margin-top: 6px;\" [size]=\"'small'\" [label]=\"'P\u0159idat jej?'\" (click)=\"newOption()\"></ui-button>\r\n </ng-container>\r\n </div>\r\n <div *ngIf=\"filteredOptions.length === 0 && focusedOption\" class=\"new-user\">\r\n <div style=\"text-align: center\">Nezn\u00E1m\u00FD u\u017Eivatel {{inputControl.value}}</div>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"hasCheckboxSelected && filteredOptions.length > 0\" class=\"checkbox-buttons\">\r\n <ui-button [size]=\"'small'\" [kind]=\"'basic'\" [label]=\"'Zru\u0161it v\u00FDb\u011Br'\" (click)=\"cancelCheckboxSelection()\"></ui-button>\r\n <ui-button [size]=\"'small'\" [label]=\"'Pou\u017E\u00EDt v\u00FDb\u011Br (' + checkboxSelection.size + ')'\" (click)=\"useCheckboxSelection()\"></ui-button>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</div>\r\n\r\n", styles: [":host .wrapper{position:relative;outline:none;display:flex}:host .overlay{position:fixed;inset:0}.options-box{max-height:248px;min-width:310px;box-shadow:0 2px 4px -1px #07254833,0 4px 5px #07254824,0 1px 10px #0725481f}.options-box .checkbox-buttons{display:flex;padding:8px 4px 4px;justify-content:space-between}.options-box .options{padding:4px;overflow:auto;scroll-behavior:smooth;display:flex;flex-direction:column}.options-box .options .option-container{padding:0 0 0 12px;display:flex;align-items:center}.options-box .options .option-container:hover{cursor:pointer}.options-box .options .option-container mat-checkbox{width:100%}.options-box .options .option-container mat-checkbox ::ng-deep .mdc-form-field{width:100%}.options-box .options .option-container mat-checkbox ::ng-deep .mdc-form-field label{display:flex;width:100%}.options-box .options .option-container-inner{flex:1 1 100%;display:flex;align-items:center}.options-box .options .option-container-inner .option-option{flex:1 1 100%;padding:10px 0 10px 8px}.options-box .options .option-container-inner mat-icon{display:none;font-size:20px;height:20px;margin-right:8px}.options-box .options .option-container-inner:hover mat-icon{display:block}\n"] }]
2558
+ }], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
2559
+ type: Optional
2560
+ }, {
2561
+ type: Host
2562
+ }, {
2563
+ type: SkipSelf
2564
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { options: [{
2565
+ type: Input
2566
+ }], multiple: [{
2567
+ type: Input
2568
+ }], allowNew: [{
2569
+ type: Input
2570
+ }], displayAttribute: [{
2571
+ type: Input
2572
+ }], idAttribute: [{
2573
+ type: Input
2574
+ }], input: [{
2575
+ type: ViewChild,
2576
+ args: ['input']
2577
+ }], optionsTrigger: [{
2578
+ type: ViewChild,
2579
+ args: ['trigger']
2580
+ }], optionDisabled: [{
2581
+ type: Input
2582
+ }], optionFormatter: [{
2583
+ type: Input
2584
+ }] } });
2585
+
2586
+ class ActionButtonComponent extends ButtonComponent {
2587
+ constructor() {
2588
+ super(...arguments);
2589
+ this.withPrimary = false;
2590
+ this.overlayAlignment = 'left';
2591
+ this.hasBackdrop = false;
2592
+ this.autoClose = true;
2593
+ this.primaryClick = new EventEmitter();
2594
+ this.overlayToggled = new EventEmitter();
2595
+ this.deferredRender = false;
2596
+ this.iconHover = false;
2597
+ this.rightPositions = [
2598
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },
2599
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },
2600
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },
2601
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' }
2602
+ ];
2603
+ this.leftPositions = [
2604
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
2605
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },
2606
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },
2607
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' }
2608
+ ];
2609
+ this.openOverlay = false;
2610
+ }
2611
+ get class() {
2612
+ return super.class + (this.withPrimary ? ' with-primary' : '');
2613
+ }
2614
+ onKeydownHandler(evt) {
2615
+ if (this.openOverlay) {
2616
+ this.toggleOverlay(false);
2617
+ }
2618
+ }
2619
+ // constructor() {
2620
+ // super();
2621
+ // }
2622
+ get positions() {
2623
+ switch (this.overlayAlignment) {
2624
+ case 'left': return this.leftPositions;
2625
+ default: return this.rightPositions;
2626
+ }
2627
+ }
2628
+ ngOnInit() {
2629
+ setTimeout(() => {
2630
+ this.deferredRender = true;
2631
+ });
2632
+ }
2633
+ toggleOverlay(status) {
2634
+ if (status || this.autoClose) {
2635
+ this.openOverlay = status;
2636
+ this.overlayToggled.emit(status);
2637
+ }
2638
+ }
2639
+ closeOverlay() {
2640
+ this.openOverlay = false;
2641
+ }
2642
+ togglePrimaryOverlay(status, $event) {
2643
+ this.toggleOverlay(status);
2644
+ $event.stopPropagation();
2645
+ $event.preventDefault();
2646
+ }
2647
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ActionButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2648
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: ActionButtonComponent, selector: "ui-action-button", inputs: { withPrimary: "withPrimary", overlayAlignment: "overlayAlignment", hasBackdrop: "hasBackdrop", triggerTpl: "triggerTpl", autoClose: "autoClose" }, outputs: { primaryClick: "primaryClick", overlayToggled: "overlayToggled" }, host: { listeners: { "document:keydown.escape": "onKeydownHandler($event)" }, properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "trigger1", first: true, predicate: ["trigger1"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"triggerTpl\">\r\n <div style=\"display: flex;\" (click)=\"toggleOverlay(true)\" cdkOverlayOrigin #trigger1=\"cdkOverlayOrigin\">\r\n <ng-template [ngTemplateOutlet]=\"triggerTpl\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"!triggerTpl && withPrimary\">\r\n <button matRipple [type]=\"type\" [disabled]=\"isDisabled || busy\" [ngClass]=\"{busy: busy, 'icon-hover': iconHover}\" [class]=\"class\" (click)=\"primaryClick.emit()\">\r\n <div class=\"hover-container\"></div>\r\n {{label}}\r\n <div class=\"mat-icon-container\" (mouseenter)=\"iconHover = true\" (mouseleave)=\"iconHover = false\" cdkOverlayOrigin #trigger1=\"cdkOverlayOrigin\" (click)=\"togglePrimaryOverlay(true, $event)\">\r\n \u25BC\r\n </div>\r\n <mat-progress-bar *ngIf=\"busy\" mode=\"indeterminate\" [color]=\"color\"></mat-progress-bar>\r\n </button>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"!triggerTpl && !withPrimary\">\r\n <button matRipple [type]=\"type\" [disabled]=\"isDisabled || busy\" [ngClass]=\"{busy: busy}\" [class]=\"class\" cdkOverlayOrigin #trigger1=\"cdkOverlayOrigin\" (click)=\"toggleOverlay(true)\">\r\n {{label}}\r\n <div class=\"mat-icon-container\">\r\n \u25BC\r\n </div>\r\n <mat-progress-bar *ngIf=\"busy\" mode=\"indeterminate\" [color]=\"color\"></mat-progress-bar>\r\n </button>\r\n</ng-container>\r\n\r\n<ng-template *ngIf=\"deferredRender\" cdkConnectedOverlay [cdkConnectedOverlayPositions]=\"positions\" [cdkConnectedOverlayOrigin]=\"trigger1\" [cdkConnectedOverlayOpen]=\"openOverlay\" [cdkConnectedOverlayHasBackdrop]=\"hasBackdrop\" [cdkConnectedOverlayDisableClose]=\"!autoClose\" (overlayOutsideClick)=\"toggleOverlay(false)\">\r\n <ng-content></ng-content>\r\n</ng-template>\r\n", styles: [":host{display:flex;align-items:center}:host button{font-size:1em;width:100%;cursor:pointer;outline:none;position:relative;display:flex;align-items:center;justify-content:center;border:1px solid transparent;transition:all .15s ease-in-out}:host button mat-progress-bar{position:absolute;bottom:1px;height:2px;border-bottom-left-radius:10px;border-bottom-right-radius:10px}:host button mat-icon{margin-right:4px;height:16px;width:16px;font-size:16px}:host.small button mat-icon{width:14px;height:14px;font-size:14px;margin-right:2px}\n", ":host .mat-icon-container{margin-left:.25em}:host button{font-size:1em}:host.small.with-primary button{padding-right:2.9em!important}:host.small.with-primary button .mat-icon-container{position:absolute;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;border-left:1px solid transparent;padding-right:.6em;padding-left:.6em}:host.small.with-primary button .hover-container{position:absolute;inset:0 2.2em 0 0}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "directive", type: i5.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i5.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: i4.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }] }); }
2649
+ }
2650
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ActionButtonComponent, decorators: [{
2651
+ type: Component,
2652
+ args: [{ selector: 'ui-action-button', template: "<ng-container *ngIf=\"triggerTpl\">\r\n <div style=\"display: flex;\" (click)=\"toggleOverlay(true)\" cdkOverlayOrigin #trigger1=\"cdkOverlayOrigin\">\r\n <ng-template [ngTemplateOutlet]=\"triggerTpl\"></ng-template>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"!triggerTpl && withPrimary\">\r\n <button matRipple [type]=\"type\" [disabled]=\"isDisabled || busy\" [ngClass]=\"{busy: busy, 'icon-hover': iconHover}\" [class]=\"class\" (click)=\"primaryClick.emit()\">\r\n <div class=\"hover-container\"></div>\r\n {{label}}\r\n <div class=\"mat-icon-container\" (mouseenter)=\"iconHover = true\" (mouseleave)=\"iconHover = false\" cdkOverlayOrigin #trigger1=\"cdkOverlayOrigin\" (click)=\"togglePrimaryOverlay(true, $event)\">\r\n \u25BC\r\n </div>\r\n <mat-progress-bar *ngIf=\"busy\" mode=\"indeterminate\" [color]=\"color\"></mat-progress-bar>\r\n </button>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"!triggerTpl && !withPrimary\">\r\n <button matRipple [type]=\"type\" [disabled]=\"isDisabled || busy\" [ngClass]=\"{busy: busy}\" [class]=\"class\" cdkOverlayOrigin #trigger1=\"cdkOverlayOrigin\" (click)=\"toggleOverlay(true)\">\r\n {{label}}\r\n <div class=\"mat-icon-container\">\r\n \u25BC\r\n </div>\r\n <mat-progress-bar *ngIf=\"busy\" mode=\"indeterminate\" [color]=\"color\"></mat-progress-bar>\r\n </button>\r\n</ng-container>\r\n\r\n<ng-template *ngIf=\"deferredRender\" cdkConnectedOverlay [cdkConnectedOverlayPositions]=\"positions\" [cdkConnectedOverlayOrigin]=\"trigger1\" [cdkConnectedOverlayOpen]=\"openOverlay\" [cdkConnectedOverlayHasBackdrop]=\"hasBackdrop\" [cdkConnectedOverlayDisableClose]=\"!autoClose\" (overlayOutsideClick)=\"toggleOverlay(false)\">\r\n <ng-content></ng-content>\r\n</ng-template>\r\n", styles: [":host{display:flex;align-items:center}:host button{font-size:1em;width:100%;cursor:pointer;outline:none;position:relative;display:flex;align-items:center;justify-content:center;border:1px solid transparent;transition:all .15s ease-in-out}:host button mat-progress-bar{position:absolute;bottom:1px;height:2px;border-bottom-left-radius:10px;border-bottom-right-radius:10px}:host button mat-icon{margin-right:4px;height:16px;width:16px;font-size:16px}:host.small button mat-icon{width:14px;height:14px;font-size:14px;margin-right:2px}\n", ":host .mat-icon-container{margin-left:.25em}:host button{font-size:1em}:host.small.with-primary button{padding-right:2.9em!important}:host.small.with-primary button .mat-icon-container{position:absolute;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;border-left:1px solid transparent;padding-right:.6em;padding-left:.6em}:host.small.with-primary button .hover-container{position:absolute;inset:0 2.2em 0 0}\n"] }]
2653
+ }], propDecorators: { withPrimary: [{
2654
+ type: Input
2655
+ }], overlayAlignment: [{
2656
+ type: Input
2657
+ }], hasBackdrop: [{
2658
+ type: Input
2659
+ }], triggerTpl: [{
2660
+ type: Input
2661
+ }], autoClose: [{
2662
+ type: Input
2663
+ }], primaryClick: [{
2664
+ type: Output
2665
+ }], overlayToggled: [{
2666
+ type: Output
2667
+ }], trigger1: [{
2668
+ type: ViewChild,
2669
+ args: ['trigger1', { static: false }]
2670
+ }], class: [{
2671
+ type: HostBinding,
2672
+ args: ['class']
2673
+ }], onKeydownHandler: [{
2674
+ type: HostListener,
2675
+ args: ['document:keydown.escape', ['$event']]
2676
+ }] } });
2677
+
2678
+ class RadioComponent {
2679
+ constructor() {
2680
+ this.color = 'primary';
2681
+ }
2682
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: RadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2683
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: RadioComponent, selector: "ui-radio", inputs: { value: "value", label: "label", color: "color" }, ngImport: i0, template: "<mat-radio-button [value]=\"value\" [color]=\"color\">\r\n {{label}}\r\n</mat-radio-button>\r\n", styles: [""], dependencies: [{ kind: "component", type: i3$6.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }] }); }
2684
+ }
2685
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: RadioComponent, decorators: [{
2686
+ type: Component,
2687
+ args: [{ selector: 'ui-radio', template: "<mat-radio-button [value]=\"value\" [color]=\"color\">\r\n {{label}}\r\n</mat-radio-button>\r\n" }]
2688
+ }], propDecorators: { value: [{
2689
+ type: Input
2690
+ }], label: [{
2691
+ type: Input
2692
+ }], color: [{
2693
+ type: Input
2694
+ }] } });
2695
+
2696
+ // export interface CheckboxGroupOption {
2697
+ // value: any,
2698
+ // label: string,
2699
+ // hint?: string
2700
+ // }
2701
+ class CheckboxGroupComponent extends UiSimpleComponent {
2702
+ constructor(control) {
2703
+ super(control);
2704
+ this.control = control;
2705
+ this.displayAttribute = 'label';
2706
+ this.hintAttribute = 'hint';
2707
+ this.optionEnabled = (option) => true;
2708
+ }
2709
+ // ngOnInit(): void {
2710
+ // super.ngOnInit();
2711
+ // }
2712
+ ngOnChanges(changes) {
2713
+ super.ngOnChanges(changes);
2714
+ if (changes.options) {
2715
+ this.cbxs = [];
2716
+ this.valueMode = Array.isArray(this.control.value) ? 'array' : 'object';
2717
+ Object.keys(changes.options.currentValue).forEach(k => {
2718
+ const v = changes.options.currentValue[k];
2719
+ const ct = new UntypedFormControl(this.valueMode === 'array' ? this.control.value.includes(v) : this.control.value[k] === true);
2720
+ if (!this.optionEnabled(v)) {
2721
+ ct.disable();
2722
+ }
2723
+ ct.valueChanges.subscribe(() => {
2724
+ const value = this.valueMode === 'array' ? [] : {};
2725
+ let hasChecked = false;
2726
+ this.cbxs.forEach((cbx) => {
2727
+ const checked = cbx.control.value;
2728
+ hasChecked = hasChecked || checked;
2729
+ if (this.valueMode === 'array') {
2730
+ if (checked) {
2731
+ value.push(cbx.value.value);
2732
+ }
2733
+ }
2734
+ else {
2735
+ value[cbx.key] = checked;
2736
+ }
2737
+ });
2738
+ this.componentFormControl.markAsTouched();
2739
+ this.componentFormControl.setValue(value);
2740
+ if (this.componentFormControl.hasValidator(Validators.required) && !hasChecked) {
2741
+ this.componentFormControl.setErrors({ cbGroupRequired: true });
2742
+ }
2743
+ else {
2744
+ this.componentFormControl.setErrors(null);
2745
+ }
2746
+ });
2747
+ this.cbxs.push({
2748
+ control: ct,
2749
+ value: this.valueAttribute ? v[this.valueAttribute] : v,
2750
+ label: this.displayAttribute ? v[this.displayAttribute] : v,
2751
+ hint: this.hintAttribute ? v[this.hintAttribute] : undefined,
2752
+ key: this.valueMode === 'object' ? k : undefined
2753
+ });
2754
+ });
2755
+ }
2756
+ }
2757
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: CheckboxGroupComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
2758
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: CheckboxGroupComponent, selector: "ui-checkbox-group", inputs: { valueAttribute: "valueAttribute", displayAttribute: "displayAttribute", hintAttribute: "hintAttribute", options: "options", optionEnabled: "optionEnabled" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<ui-checkbox *ngFor=\"let cbx of cbxs\" [formControl]=\"cbx.control\" [label]=\"cbx.label\" [hint]=\"cbx.hint\"></ui-checkbox>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host ui-checkbox{margin-top:.2em;margin-bottom:.2em}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: CheckboxComponent, selector: "ui-checkbox", inputs: ["color", "useInputMessages"] }, { kind: "component", type: UiSimpleLayoutComponent, selector: "ui-simple-layout", inputs: ["ctx"] }] }); }
2759
+ }
2760
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: CheckboxGroupComponent, decorators: [{
2761
+ type: Component,
2762
+ args: [{ selector: 'ui-checkbox-group', template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<ui-checkbox *ngFor=\"let cbx of cbxs\" [formControl]=\"cbx.control\" [label]=\"cbx.label\" [hint]=\"cbx.hint\"></ui-checkbox>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host ui-checkbox{margin-top:.2em;margin-bottom:.2em}\n"] }]
2763
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2764
+ type: Optional
2765
+ }, {
2766
+ type: Self
2767
+ }] }]; }, propDecorators: { valueAttribute: [{
2768
+ type: Input
2769
+ }], displayAttribute: [{
2770
+ type: Input
2771
+ }], hintAttribute: [{
2772
+ type: Input
2773
+ }], options: [{
2774
+ type: Input
2775
+ }], optionEnabled: [{
2776
+ type: Input
2777
+ }] } });
2778
+
2779
+ class RadioGroupComponent extends UiSimpleComponent {
2780
+ constructor(control) {
2781
+ super(control);
2782
+ this.control = control;
2783
+ this.id = Math.round(Math.random() * 999999);
2784
+ this.displayAttribute = 'name';
2785
+ this.groupName = 'radio-' + this.id;
2786
+ this.optionEnabled = (option) => true;
2787
+ }
2788
+ // ngOnInit(): void {
2789
+ // super.ngOnInit();
2790
+ // }
2791
+ ngOnChanges(changes) {
2792
+ super.ngOnChanges(changes);
2793
+ if (changes.options) {
2794
+ this.cbxs = [];
2795
+ changes.options.currentValue.forEach(cv => {
2796
+ this.cbxs.push({
2797
+ value: this.valueAttribute ? cv[this.valueAttribute] : cv,
2798
+ label: cv[this.displayAttribute]
2799
+ });
2800
+ });
2801
+ }
2802
+ }
2803
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: RadioGroupComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
2804
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: RadioGroupComponent, selector: "ui-radio-group", inputs: { options: "options", displayAttribute: "displayAttribute", valueAttribute: "valueAttribute", groupName: "groupName", optionEnabled: "optionEnabled" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n <mat-radio-group [formControl]=\"componentFormControl\" [name]=\"groupName\" [class]=\"size\">\r\n\r\n <mat-radio-button *ngFor=\"let cbx of cbxs\" [value]=\"cbx.value\" >{{cbx.label}}</mat-radio-button>\r\n\r\n </mat-radio-group>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host mat-radio-group{display:flex;flex-direction:column}:host mat-radio-button{margin-top:.2em;margin-bottom:.2em}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3$6.MatRadioGroup, selector: "mat-radio-group", exportAs: ["matRadioGroup"] }, { kind: "component", type: i3$6.MatRadioButton, selector: "mat-radio-button", inputs: ["disableRipple", "tabIndex"], exportAs: ["matRadioButton"] }, { kind: "component", type: UiSimpleLayoutComponent, selector: "ui-simple-layout", inputs: ["ctx"] }] }); }
2805
+ }
2806
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: RadioGroupComponent, decorators: [{
2807
+ type: Component,
2808
+ args: [{ selector: 'ui-radio-group', template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n <mat-radio-group [formControl]=\"componentFormControl\" [name]=\"groupName\" [class]=\"size\">\r\n\r\n <mat-radio-button *ngFor=\"let cbx of cbxs\" [value]=\"cbx.value\" >{{cbx.label}}</mat-radio-button>\r\n\r\n </mat-radio-group>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host mat-radio-group{display:flex;flex-direction:column}:host mat-radio-button{margin-top:.2em;margin-bottom:.2em}\n"] }]
2809
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2810
+ type: Optional
2811
+ }, {
2812
+ type: Self
2813
+ }] }]; }, propDecorators: { options: [{
2814
+ type: Input
2815
+ }], displayAttribute: [{
2816
+ type: Input
2817
+ }], valueAttribute: [{
2818
+ type: Input
2819
+ }], groupName: [{
2820
+ type: Input
2821
+ }], optionEnabled: [{
2822
+ type: Input
2823
+ }] } });
2824
+
2825
+ class EditorComponent extends UiSimpleComponent {
2826
+ clickout(event) {
2827
+ const cr = this.el.nativeElement.getBoundingClientRect();
2828
+ const outside = event.x < cr.x || event.x > cr.x + cr.width || event.y < cr.y || event.y > cr.y + cr.height;
2829
+ this.focused = !outside;
2830
+ if (!this.focused) {
2831
+ this.componentFormControl.markAsTouched();
2832
+ }
2833
+ }
2834
+ constructor(ngControl /*, private _ngZone: NgZone, private cdr: ChangeDetectorRef*/, el) {
2835
+ super(ngControl);
2836
+ this.ngControl = ngControl;
2837
+ this.el = el;
2838
+ this.rows = 5;
2839
+ this.autoResize = false;
2840
+ this.focused = false;
2841
+ this.editorId = `editorJs${Math.round(Math.random() * 10000000)}`;
2842
+ }
2843
+ focus() {
2844
+ this.focused = true;
2845
+ this.editor.focus();
2846
+ }
2847
+ setDisabledState(isDisabled) {
2848
+ }
2849
+ ngAfterViewInit() {
2850
+ this.editor = new EditorJS({
2851
+ holder: this.editorId,
2852
+ inlineToolbar: ['bold', 'italic'],
2853
+ tools: {
2854
+ header: {
2855
+ class: Header,
2856
+ inlineToolbar: true,
2857
+ config: {
2858
+ levels: [1, 2],
2859
+ defaultLevel: 1
2860
+ }
2861
+ },
2862
+ list: {
2863
+ class: List,
2864
+ inlineToolbar: true,
2865
+ config: {
2866
+ defaultStyle: 'unordered'
2867
+ },
2868
+ },
2869
+ },
2870
+ i18n: {
2871
+ messages: {
2872
+ ui: {
2873
+ "inlineToolbar": {
2874
+ "converter": {
2875
+ "Convert to": "Odstavec změnit na"
2876
+ }
2877
+ }
2878
+ },
2879
+ toolNames: {
2880
+ "Heading": "Nadpis",
2881
+ "List": "Seznam"
2882
+ }
2883
+ }
2884
+ },
2885
+ minHeight: 90,
2886
+ placeholder: 'Něco napiš...',
2887
+ onChange: () => { this.focused = true; this.editor.save().then((r) => this.onChange(r)); },
2888
+ onReady: () => {
2889
+ const editorElement = document.getElementById(this.editorId); // your "holder" ID
2890
+ editorElement.addEventListener('focusin', () => {
2891
+ this.focused = true;
2892
+ });
2893
+ },
2894
+ data: this.data
2895
+ });
2896
+ }
2897
+ inputLength() {
2898
+ let len = 0;
2899
+ if (this.componentFormControl && this.componentFormControl.value && this.componentFormControl.value.blocks) {
2900
+ this.componentFormControl.value.blocks.forEach(b => {
2901
+ if (b.type === 'paragraph' || b.type === 'header') {
2902
+ len += b.data.text.replace(/<\/?[^>]+(>|$)/g, '').replace(/&nbsp;/, '').length;
2903
+ }
2904
+ if (b.type === 'list') {
2905
+ b.data.items.forEach(i => {
2906
+ len += i.replace(/<\/?[^>]+(>|$)/g, '').replace(/&nbsp;/, '').length;
2907
+ });
2908
+ }
2909
+ });
2910
+ }
2911
+ return len;
2912
+ }
2913
+ writeValue(obj) {
2914
+ this.data = obj;
2915
+ }
2916
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: EditorComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
2917
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: EditorComponent, selector: "ui-editor", inputs: { rows: "rows", autoResize: "autoResize" }, host: { listeners: { "document:click": "clickout($event)" } }, usesInheritance: true, ngImport: i0, template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<div class=\"editor-wrapper\" [ngClass]=\"{focus: focused}\">\r\n <ng-container *ngIf=\"componentFormControl\">\r\n\r\n <p [id]=editorId></p>\r\n\r\n </ng-container>\r\n</div>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n", ".editor-wrapper{max-height:140px;min-height:140px;overflow-y:auto;overflow-x:hidden}.editor-wrapper.focus{max-height:unset}.editor-wrapper ::ng-deep .codex-editor__redactor{margin-right:0}.editor-wrapper ::ng-deep .ce-toolbar__actions{background-color:#fff;margin:0 4px;border-radius:6px;padding:3px;right:0}.editor-wrapper ::ng-deep .ce-toolbar__actions .ce-popover-item__icon{margin-right:0}.editor-wrapper ::ng-deep .ce-toolbar__actions .ce-popover--opened{width:unset;min-width:unset}.editor-wrapper ::ng-deep .ce-toolbar__actions .ce-popover--opened .ce-popover__items{display:flex}.editor-wrapper ::ng-deep .ce-popover--opened{margin-right:12px}.editor-wrapper ::ng-deep .cdx-search-field,.editor-wrapper ::ng-deep .ce-popover-item__title{display:none}.editor-wrapper ::ng-deep .ce-popover--open-top{top:calc(-1 * (var(--offset-from-target) + 48px))!important}.editor-wrapper ::ng-deep .ce-conversion-toolbar__tools{display:flex}.editor-wrapper ::ng-deep .ce-conversion-toolbar{width:210px}.editor-wrapper ::ng-deep h1.ce-header{font-size:1.3em;line-height:1.2em;margin:0 0 .4em;padding:0;letter-spacing:0;font-weight:700}.editor-wrapper ::ng-deep h2.ce-header{font-size:1.15em;line-height:1.1em;margin:0 0 .4em;padding:0;letter-spacing:0;font-weight:700}.editor-wrapper ::ng-deep .ce-paragraph{line-height:1.5em;font-size:1em;padding:0;margin:0 0 .5em}.editor-wrapper ::ng-deep .cdx-list{padding:0 0 0 2em;margin:0 0 .5em}.editor-wrapper ::ng-deep .cdx-list li{padding:0}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: UiSimpleLayoutComponent, selector: "ui-simple-layout", inputs: ["ctx"] }] }); }
2918
+ }
2919
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: EditorComponent, decorators: [{
2920
+ type: Component,
2921
+ args: [{ selector: 'ui-editor', template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<div class=\"editor-wrapper\" [ngClass]=\"{focus: focused}\">\r\n <ng-container *ngIf=\"componentFormControl\">\r\n\r\n <p [id]=editorId></p>\r\n\r\n </ng-container>\r\n</div>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n", ".editor-wrapper{max-height:140px;min-height:140px;overflow-y:auto;overflow-x:hidden}.editor-wrapper.focus{max-height:unset}.editor-wrapper ::ng-deep .codex-editor__redactor{margin-right:0}.editor-wrapper ::ng-deep .ce-toolbar__actions{background-color:#fff;margin:0 4px;border-radius:6px;padding:3px;right:0}.editor-wrapper ::ng-deep .ce-toolbar__actions .ce-popover-item__icon{margin-right:0}.editor-wrapper ::ng-deep .ce-toolbar__actions .ce-popover--opened{width:unset;min-width:unset}.editor-wrapper ::ng-deep .ce-toolbar__actions .ce-popover--opened .ce-popover__items{display:flex}.editor-wrapper ::ng-deep .ce-popover--opened{margin-right:12px}.editor-wrapper ::ng-deep .cdx-search-field,.editor-wrapper ::ng-deep .ce-popover-item__title{display:none}.editor-wrapper ::ng-deep .ce-popover--open-top{top:calc(-1 * (var(--offset-from-target) + 48px))!important}.editor-wrapper ::ng-deep .ce-conversion-toolbar__tools{display:flex}.editor-wrapper ::ng-deep .ce-conversion-toolbar{width:210px}.editor-wrapper ::ng-deep h1.ce-header{font-size:1.3em;line-height:1.2em;margin:0 0 .4em;padding:0;letter-spacing:0;font-weight:700}.editor-wrapper ::ng-deep h2.ce-header{font-size:1.15em;line-height:1.1em;margin:0 0 .4em;padding:0;letter-spacing:0;font-weight:700}.editor-wrapper ::ng-deep .ce-paragraph{line-height:1.5em;font-size:1em;padding:0;margin:0 0 .5em}.editor-wrapper ::ng-deep .cdx-list{padding:0 0 0 2em;margin:0 0 .5em}.editor-wrapper ::ng-deep .cdx-list li{padding:0}\n"] }]
2922
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2923
+ type: Optional
2924
+ }, {
2925
+ type: Self
2926
+ }] }, { type: i0.ElementRef }]; }, propDecorators: { rows: [{
2927
+ type: Input
2928
+ }], autoResize: [{
2929
+ type: Input
2930
+ }], clickout: [{
2931
+ type: HostListener,
2932
+ args: ['document:click', ['$event']]
2933
+ }] } });
2934
+
2935
+ class InputAutocompleteComponent extends UiSimpleComponent {
2936
+ get textAlignClass() {
2937
+ return `text-align-${this.textAlign}`;
2938
+ }
2939
+ get hasPrefix() {
2940
+ return (this.prefixIcon && this.prefixIcon.icon !== '') || this.prefix?.nativeElement?.innerText !== '' || this.forceHasPrefix;
2941
+ }
2942
+ get hasSuffix() {
2943
+ return (this.suffixIcon && this.suffixIcon.icon !== '') || this.suffix?.nativeElement?.innerText !== '' || this.forceHasSuffix;
2944
+ }
2945
+ // control;
2946
+ // onTouched = () => {};
2947
+ // onChange = (value) => {};
2948
+ // get showInvalid(): boolean {
2949
+ // return true;
2950
+ // // return this.control.touched && !!this.control.errors;
2951
+ // }
2952
+ // get validationMessage(): string {
2953
+ // // console.log(this.control?.errors);
2954
+ // let e: any = {code: 'Neznámá chyba'};
2955
+ // const errors = this.control?.errors || {};
2956
+ // Object.keys(errors).find(a => {
2957
+ // e = {code: a, data: errors[a]};
2958
+ // return true;
2959
+ // });
2960
+ // switch (e.code) {
2961
+ // case 'required':
2962
+ // return this.translateService.instant('ui.controls.validation.required');
2963
+ // case 'email':
2964
+ // return this.translateService.instant('ui.controls.validation.email');
2965
+ // case 'matDatepickerParse':
2966
+ // return this.translateService.instant('ui.controls.validation.matDatepickerParse');
2967
+ // case 'maxlength':
2968
+ // return this.translateService.instant('ui.controls.validation.maxlength', e.data);
2969
+ // case 'minlength':
2970
+ // return this.translateService.instant('ui.controls.validation.minlength', e.data);
2971
+ // case 'positive':
2972
+ // return this.translateService.instant(isNaN(Number(e.data)) ? 'ui.controls.validation.invalidNumber' : 'ui.controls.validation.positive');
2973
+ // case 'custom':
2974
+ // return this.translateService.instant(e.data);
2975
+ // default:
2976
+ // return this.translateService.instant(e.code);
2977
+ // }
2978
+ // }
2979
+ get maxLenRequired() {
2980
+ return true;
2981
+ // return this.control.value && (this.control.value.length > (this.validators?.maxLength || 0));
2982
+ }
2983
+ constructor(controlContainer) {
2984
+ super(null, controlContainer);
2985
+ this.controlContainer = controlContainer;
2986
+ this.type = 'text';
2987
+ this.clearButton = false;
2988
+ this.activeIcons = true;
2989
+ this.forceHasPrefix = false;
2990
+ this.forceHasSuffix = false;
2991
+ this.options = [];
2992
+ this.textAlign = 'left';
2993
+ this.focusChanged = new EventEmitter();
2994
+ this.keyPressed = new EventEmitter();
2995
+ this.filteredOptions = [];
2996
+ // control = new FormControl();
2997
+ this.required = false;
2998
+ this.hasFocus = false;
2999
+ // this.componentFormControl = new FormControl();
3000
+ // super();
3001
+ // super(undefined, /*ngControl*/ translateService);
3002
+ // super(control);
3003
+ // console.log(control);
3004
+ // if (control) {
3005
+ // control.valueAccessor = this;
3006
+ // }
3007
+ // if (ngControl != null) {
3008
+ // // Setting the value accessor directly (instead of using
3009
+ // // the providers) to avoid running into a circular import.
3010
+ // ngControl.valueAccessor = this;
3011
+ // }
3012
+ }
3013
+ get showClearButton() {
3014
+ return this.clearButton && this.componentFormControl?.value !== '';
3015
+ }
3016
+ ngOnInit() {
3017
+ super.ngOnInit();
3018
+ this.filteredOptions = this.options;
3019
+ this.componentFormControl?.valueChanges.subscribe((v) => {
3020
+ const vl = v.toLowerCase();
3021
+ this.filteredOptions = this.options.filter(o => vl === '' || o.toLowerCase().includes(vl));
3022
+ });
3023
+ // console.log('probiha vubec oninit?');
3024
+ // if (this.ngControl) {
3025
+ // console.log('from ngControl....??');
3026
+ // if (this.formControl) {
3027
+ // this.componentFormControl = this.formControl;
3028
+ // } else {
3029
+ // this.componentFormControl = this.ngControl.control as UntypedFormControl;
3030
+ // }
3031
+ // setTimeout(() => {
3032
+ // this.applyValidators();
3033
+ // });
3034
+ // } else {
3035
+ // const control = this.formControlName ?
3036
+ // (this.controlContainer as FormGroupDirective).control.get(this.formControlName) : this.formControl;
3037
+ // this.componentFormControl.setValidators(control.validator);
3038
+ // this.componentFormControl.valueChanges.subscribe(v => console.log('onitin sub', v));
3039
+ // control._componentFormControl = this.componentFormControl;
3040
+ // if (control._markAsTouched === undefined) {
3041
+ // // control._componentFormControl = this.componentFormControl;
3042
+ // console.log('overriding markAsTouched for', this.formControlName);
3043
+ // control._markAsTouched = control.markAsTouched;
3044
+ // control.markAsTouched = ({onlySelf}: { onlySelf?: boolean } = {}): void => {
3045
+ // console.log('marking as touched', this.componentFormControl.value, control.value, this.xxx.value, control._componentFormControl.value);
3046
+ // control._markAsTouched({onlySelf});
3047
+ // setTimeout(() => control._componentFormControl.markAsTouched(), 1000);
3048
+ // }
3049
+ // }
3050
+ // }
3051
+ }
3052
+ clearValue() {
3053
+ this.componentFormControl?.setValue('');
3054
+ this.input?.nativeElement.focus();
3055
+ }
3056
+ focus() {
3057
+ this.input?.nativeElement.focus();
3058
+ }
3059
+ onFocus(focus) {
3060
+ setTimeout(() => {
3061
+ this.hasFocus = focus;
3062
+ this.focusChanged.emit(focus);
3063
+ });
3064
+ }
3065
+ onKeypressed($event) {
3066
+ this.keyPressed.emit($event);
3067
+ }
3068
+ // registerOnChange(onChange: any): void {
3069
+ // this.onChange = onChange;
3070
+ // }
3071
+ //
3072
+ // registerOnTouched(onTouched: any): void {
3073
+ // this.onTouched = onTouched;
3074
+ // }
3075
+ // registerOnValidatorChange(fn: () => void): void {
3076
+ // }
3077
+ // setDisabledState(isDisabled: boolean): void {
3078
+ // // isDisabled ? this.control.disable() : this.control.enable();
3079
+ // }
3080
+ // validate(control: AbstractControl): ValidationErrors | null {
3081
+ // // this.control = control;
3082
+ // // console.log(control, control.value, control.errors);
3083
+ // if (this.value === 'error') {
3084
+ // return { customError: 'muj error'}
3085
+ // } else {
3086
+ // return null;
3087
+ // }
3088
+ // // console.log('custom validate');
3089
+ // // return null;
3090
+ // }
3091
+ //
3092
+ // writeValue(obj: any): void {
3093
+ // console.log('writevalue: ', obj);
3094
+ // this.componentFormControl.setValue(obj);
3095
+ // // this.value = obj;
3096
+ // // this.control.setValue(obj);
3097
+ // }
3098
+ //
3099
+ // registerOnChange(fn: any): void {
3100
+ // }
3101
+ //
3102
+ // registerOnTouched(fn: any): void {
3103
+ // }
3104
+ //
3105
+ // setDisabledState(isDisabled: boolean): void {
3106
+ // }
3107
+ // modelChange($event: any) {
3108
+ // console.log($event);
3109
+ // this.onTouched();
3110
+ // this.onChange($event)
3111
+ // }
3112
+ // validate(control: AbstractControl): ValidationErrors | null {
3113
+ // console.log(this.label, 'validate');
3114
+ // return this.componentFormControl.errors;
3115
+ // // return undefined;
3116
+ // }
3117
+ validate(control) {
3118
+ if (this.parentFormControl) {
3119
+ return this.parentFormControl._componentFormControl.errors;
3120
+ }
3121
+ // console.log('validate', this.componentFormControl.errors);
3122
+ // // this.componentFormControl.setErrors( { custom: 'xxx' });
3123
+ // this.componentFormControl.setErrors( this.componentFormControl.errors);
3124
+ // console.log('validate 2', this.componentFormControl.errors);
3125
+ // return this.componentFormControl.errors;
3126
+ // console.log(this.componentFormControl.errors, control.errors, this.parentFormControl.errors, this);
3127
+ // return this.componentFormControl.errors;
3128
+ }
3129
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: InputAutocompleteComponent, deps: [{ token: i1.ControlContainer, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); }
3130
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: InputAutocompleteComponent, selector: "ui-input-autocomplete", inputs: { prefixIcon: "prefixIcon", suffixIcon: "suffixIcon", type: "type", clearButton: "clearButton", activeIcons: "activeIcons", forceHasPrefix: "forceHasPrefix", forceHasSuffix: "forceHasSuffix", options: "options", textAlign: "textAlign" }, outputs: { focusChanged: "focusChanged", keyPressed: "keyPressed" }, host: { properties: { "class": "this.textAlignClass" } }, providers: [
3131
+ {
3132
+ provide: NG_VALUE_ACCESSOR,
3133
+ multi: true,
3134
+ useExisting: InputAutocompleteComponent
3135
+ },
3136
+ {
3137
+ provide: NG_VALIDATORS,
3138
+ multi: true,
3139
+ useExisting: InputAutocompleteComponent
3140
+ }
3141
+ ], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "prefix", first: true, predicate: ["prefix"], descendants: true, static: true }, { propertyName: "suffix", first: true, predicate: ["suffix"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<div class=\"control-container\" [ngClass]=\"{'has-suffix': hasSuffix, 'has-prefix': hasPrefix, 'has-clear-icon': showClearButton, 'active-icons': activeIcons, 'has-focus': hasFocus}\">\r\n <input #input matInput [type]=\"type\" [formControl]=\"componentFormControl\" [placeholder]=\"placeholder\" (keydown)=\"onKeypressed($event)\" (focus)=\"onFocus(true)\" (blur)=\"onFocus(false)\" [matAutocomplete]=\"auto\"/>\r\n\r\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of filteredOptions\" [value]=\"option\">{{option}}</mat-option>\r\n </mat-autocomplete>\r\n <div #prefix><ng-content select=\"[slot=prefix]\"></ng-content></div>\r\n <div #suffix><ng-content select=\"[slot=suffix]\"></ng-content></div>\r\n <mat-icon *ngIf=\"prefixIcon\" class=\"prefix-icon\" [matTooltip]=\"prefixIcon.tooltip\">{{ prefixIcon.icon }}</mat-icon>\r\n <mat-icon *ngIf=\"suffixIcon\" class=\"suffix-icon\" [matTooltip]=\"suffixIcon.tooltip\">{{ suffixIcon.icon }}</mat-icon>\r\n <ui-action-icon [size]=\"'small'\" [color]=\"'warn'\" *ngIf=\"showClearButton\" (click)=\"clearValue()\" [matIcon]=\"'clear'\" class=\"clear-icon\"></ui-action-icon>\r\n</div>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n", ":host.text-align-left ::ng-deep input{text-align:left}:host.text-align-right ::ng-deep input{text-align:right}:host.text-align-center ::ng-deep input{text-align:center}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "directive", type: i3$4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatAutocomplete, selector: "mat-autocomplete", inputs: ["disableRipple", "hideSingleSelectionIndicator"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i7.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", exportAs: ["matAutocompleteTrigger"] }, { kind: "component", type: UiSimpleLayoutComponent, selector: "ui-simple-layout", inputs: ["ctx"] }, { kind: "component", type: ActionIconComponent, selector: "ui-action-icon", inputs: ["size", "color", "disabled", "busy", "matIcon"] }] }); }
3142
+ }
3143
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: InputAutocompleteComponent, decorators: [{
3144
+ type: Component,
3145
+ args: [{ selector: 'ui-input-autocomplete', providers: [
3146
+ {
3147
+ provide: NG_VALUE_ACCESSOR,
3148
+ multi: true,
3149
+ useExisting: InputAutocompleteComponent
3150
+ },
3151
+ {
3152
+ provide: NG_VALIDATORS,
3153
+ multi: true,
3154
+ useExisting: InputAutocompleteComponent
3155
+ }
3156
+ ], template: "<ui-simple-layout [ctx]=\"this\">\r\n\r\n<div class=\"control-container\" [ngClass]=\"{'has-suffix': hasSuffix, 'has-prefix': hasPrefix, 'has-clear-icon': showClearButton, 'active-icons': activeIcons, 'has-focus': hasFocus}\">\r\n <input #input matInput [type]=\"type\" [formControl]=\"componentFormControl\" [placeholder]=\"placeholder\" (keydown)=\"onKeypressed($event)\" (focus)=\"onFocus(true)\" (blur)=\"onFocus(false)\" [matAutocomplete]=\"auto\"/>\r\n\r\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\r\n <mat-option *ngFor=\"let option of filteredOptions\" [value]=\"option\">{{option}}</mat-option>\r\n </mat-autocomplete>\r\n <div #prefix><ng-content select=\"[slot=prefix]\"></ng-content></div>\r\n <div #suffix><ng-content select=\"[slot=suffix]\"></ng-content></div>\r\n <mat-icon *ngIf=\"prefixIcon\" class=\"prefix-icon\" [matTooltip]=\"prefixIcon.tooltip\">{{ prefixIcon.icon }}</mat-icon>\r\n <mat-icon *ngIf=\"suffixIcon\" class=\"suffix-icon\" [matTooltip]=\"suffixIcon.tooltip\">{{ suffixIcon.icon }}</mat-icon>\r\n <ui-action-icon [size]=\"'small'\" [color]=\"'warn'\" *ngIf=\"showClearButton\" (click)=\"clearValue()\" [matIcon]=\"'clear'\" class=\"clear-icon\"></ui-action-icon>\r\n</div>\r\n\r\n</ui-simple-layout>\r\n", styles: [":host{display:flex;flex-direction:column;width:100%}:host .control-container{width:100%;position:relative}:host .control-container.has-prefix ::ng-deep input,:host .control-container.has-prefix ::ng-deep textarea,:host .control-container.has-prefix ::ng-deep .mat-mdc-select-trigger{padding-left:1.8em}:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep input,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep textarea,:host .control-container.has-suffix:not(.has-clear-icon) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep input,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep textarea,:host .control-container.has-clear-icon:not(.has-suffix) ::ng-deep .mat-mdc-select-trigger{padding-right:1.8em}:host .control-container.has-suffix.has-clear-icon ::ng-deep input,:host .control-container.has-suffix.has-clear-icon ::ng-deep textarea,:host .control-container.has-suffix.has-clear-icon ::ng-deep .mat-mdc-select-trigger{padding-right:3.6em}:host .control-container.has-suffix.has-clear-icon ::ng-deep .clear-icon{right:1.4em!important}:host ::ng-deep [slot=suffix],:host ::ng-deep .clear-icon,:host ::ng-deep .suffix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);right:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=suffix]:not(.disabled),:host ::ng-deep .clear-icon:not(.disabled),:host ::ng-deep .suffix-icon:not(.disabled){cursor:pointer}:host ::ng-deep [slot=prefix],:host ::ng-deep .prefix-icon{position:absolute;user-select:none;transition:color .25s;top:calc(50% - .5em);left:.2em;width:1em;height:1em;font-size:1.5em}:host ::ng-deep [slot=prefix]:not(.disabled),:host ::ng-deep .prefix-icon:not(.disabled){cursor:pointer}:host ::ng-deep input,:host ::ng-deep textarea,:host ::ng-deep .mat-mdc-select-trigger,:host ::ng-deep .editor-wrapper{resize:none;width:100%;line-height:1.2em;font-size:1em;outline:none;border-style:solid;transition:border-color 333ms}:host ::ng-deep textarea.autoresize{box-sizing:content-box;width:calc(100% - 1.4em)}:host ::ng-deep ::ng-deep .mat-select-trigger,:host ::ng-deep ::ng-deep .mat-mdc-select-trigger{height:100%}:host ::ng-deep ::ng-deep .mat-select-value,:host ::ng-deep ::ng-deep .mat-mdc-select-value{vertical-align:middle}::ng-deep ui-input{display:block}\n", ":host.text-align-left ::ng-deep input{text-align:left}:host.text-align-right ::ng-deep input{text-align:right}:host.text-align-center ::ng-deep input{text-align:center}\n"] }]
3157
+ }], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
3158
+ type: Optional
3159
+ }, {
3160
+ type: Host
3161
+ }, {
3162
+ type: SkipSelf
3163
+ }] }]; }, propDecorators: { prefixIcon: [{
3164
+ type: Input
3165
+ }], suffixIcon: [{
3166
+ type: Input
3167
+ }], type: [{
3168
+ type: Input
3169
+ }], clearButton: [{
3170
+ type: Input
3171
+ }], activeIcons: [{
3172
+ type: Input
3173
+ }], forceHasPrefix: [{
3174
+ type: Input
3175
+ }], forceHasSuffix: [{
3176
+ type: Input
3177
+ }], options: [{
3178
+ type: Input
3179
+ }], textAlignClass: [{
3180
+ type: HostBinding,
3181
+ args: ['class']
3182
+ }], textAlign: [{
3183
+ type: Input
3184
+ }], input: [{
3185
+ type: ViewChild,
3186
+ args: ['input']
3187
+ }], prefix: [{
3188
+ type: ViewChild,
3189
+ args: ['prefix', { static: true }]
3190
+ }], suffix: [{
3191
+ type: ViewChild,
3192
+ args: ['suffix', { static: true }]
3193
+ }], focusChanged: [{
3194
+ type: Output
3195
+ }], keyPressed: [{
3196
+ type: Output
3197
+ }] } });
3198
+
3199
+ class UiModule {
3200
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3201
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.11", ngImport: i0, type: UiModule, declarations: [ButtonComponent,
3202
+ InputComponent,
3203
+ InputAutocompleteComponent,
3204
+ SelectComponent,
3205
+ FileComponent,
3206
+ UiFileUploaderComponent,
3207
+ ExpanderComponent,
3208
+ ForceVisibilityDirective,
3209
+ MessageBoxModalComponent,
3210
+ DialogComponent,
3211
+ CurrencyComponent,
3212
+ CheckboxComponent,
3213
+ AvatarComponent,
3214
+ SubmitButtonComponent,
3215
+ TextAreaComponent,
3216
+ DateComponent,
3217
+ TableComponent,
3218
+ BurgerComponent,
3219
+ AutocompleteComponent,
3220
+ ActionButtonComponent,
3221
+ UiBaseLayoutComponent,
3222
+ UiSimpleLayoutComponent,
3223
+ ValidationMessageComponent,
3224
+ RadioComponent,
3225
+ CheckboxGroupComponent,
3226
+ RadioGroupComponent,
3227
+ ActionIconComponent,
3228
+ EditorComponent], imports: [CommonModule,
3229
+ MatButtonModule,
3230
+ MatIconModule,
3231
+ MatDialogModule,
3232
+ MatCheckboxModule,
3233
+ MatDatepickerModule,
3234
+ MatMomentDateModule,
3235
+ DragDropModule,
3236
+ ReactiveFormsModule,
3237
+ FormsModule,
3238
+ MatTooltipModule,
3239
+ MatProgressBarModule,
3240
+ MatTableModule,
3241
+ MatSortModule,
3242
+ MatSelectModule,
3243
+ NgxUploaderModule,
3244
+ MatProgressSpinnerModule,
3245
+ MatMenuModule,
3246
+ ImageCropperModule,
3247
+ RouterModule,
3248
+ OverlayModule,
3249
+ MatRippleModule,
3250
+ MatInputModule,
3251
+ MatRadioModule,
3252
+ MatSnackBarModule,
3253
+ MatAutocompleteModule], exports: [ActionButtonComponent,
3254
+ ActionIconComponent,
3255
+ AutocompleteComponent,
3256
+ AvatarComponent,
3257
+ BurgerComponent,
3258
+ ButtonComponent,
3259
+ CheckboxComponent,
3260
+ CheckboxGroupComponent,
3261
+ CurrencyComponent,
3262
+ DateComponent,
3263
+ DialogComponent,
3264
+ ExpanderComponent,
3265
+ FileComponent,
3266
+ ForceVisibilityDirective,
3267
+ InputComponent,
3268
+ InputAutocompleteComponent,
3269
+ MessageBoxModalComponent,
3270
+ RadioComponent,
3271
+ RadioGroupComponent,
3272
+ SelectComponent,
3273
+ SubmitButtonComponent,
3274
+ TableComponent,
3275
+ TextAreaComponent,
3276
+ UiFileUploaderComponent,
3277
+ EditorComponent] }); }
3278
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiModule, providers: [
3279
+ UiFileService,
3280
+ { provide: UI_TRANSLATESERVICE, useClass: UiTranslateService },
3281
+ { provide: MAT_DATE_LOCALE, useValue: 'cs-CZ' },
3282
+ { provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: false } },
3283
+ { provide: MAT_RADIO_DEFAULT_OPTIONS, useValue: { color: 'primary' } },
3284
+ { provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useValue: { color: 'primary' } }
3285
+ ], imports: [CommonModule,
3286
+ MatButtonModule,
3287
+ MatIconModule,
3288
+ MatDialogModule,
3289
+ MatCheckboxModule,
3290
+ MatDatepickerModule,
3291
+ MatMomentDateModule,
3292
+ DragDropModule,
3293
+ ReactiveFormsModule,
3294
+ FormsModule,
3295
+ MatTooltipModule,
3296
+ MatProgressBarModule,
3297
+ MatTableModule,
3298
+ MatSortModule,
3299
+ MatSelectModule,
3300
+ NgxUploaderModule,
3301
+ MatProgressSpinnerModule,
3302
+ MatMenuModule,
3303
+ ImageCropperModule,
3304
+ RouterModule,
3305
+ OverlayModule,
3306
+ MatRippleModule,
3307
+ MatInputModule,
3308
+ MatRadioModule,
3309
+ MatSnackBarModule,
3310
+ MatAutocompleteModule] }); }
3311
+ }
3312
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiModule, decorators: [{
3313
+ type: NgModule,
3314
+ args: [{
3315
+ declarations: [
3316
+ ButtonComponent,
3317
+ InputComponent,
3318
+ InputAutocompleteComponent,
3319
+ SelectComponent,
3320
+ FileComponent,
3321
+ UiFileUploaderComponent,
3322
+ ExpanderComponent,
3323
+ ForceVisibilityDirective,
3324
+ MessageBoxModalComponent,
3325
+ DialogComponent,
3326
+ CurrencyComponent,
3327
+ CheckboxComponent,
3328
+ AvatarComponent,
3329
+ SubmitButtonComponent,
3330
+ TextAreaComponent,
3331
+ DateComponent,
3332
+ TableComponent,
3333
+ BurgerComponent,
3334
+ AutocompleteComponent,
3335
+ ActionButtonComponent,
3336
+ UiBaseLayoutComponent,
3337
+ UiSimpleLayoutComponent,
3338
+ ValidationMessageComponent,
3339
+ RadioComponent,
3340
+ CheckboxGroupComponent,
3341
+ RadioGroupComponent,
3342
+ ActionIconComponent,
3343
+ EditorComponent
3344
+ ],
3345
+ exports: [
3346
+ ActionButtonComponent,
3347
+ ActionIconComponent,
3348
+ AutocompleteComponent,
3349
+ AvatarComponent,
3350
+ BurgerComponent,
3351
+ ButtonComponent,
3352
+ CheckboxComponent,
3353
+ CheckboxGroupComponent,
3354
+ CurrencyComponent,
3355
+ DateComponent,
3356
+ DialogComponent,
3357
+ ExpanderComponent,
3358
+ FileComponent,
3359
+ ForceVisibilityDirective,
3360
+ InputComponent,
3361
+ InputAutocompleteComponent,
3362
+ MessageBoxModalComponent,
3363
+ RadioComponent,
3364
+ RadioGroupComponent,
3365
+ SelectComponent,
3366
+ SubmitButtonComponent,
3367
+ TableComponent,
3368
+ TextAreaComponent,
3369
+ UiFileUploaderComponent,
3370
+ EditorComponent
3371
+ ],
3372
+ imports: [
3373
+ CommonModule,
3374
+ MatButtonModule,
3375
+ MatIconModule,
3376
+ MatDialogModule,
3377
+ MatCheckboxModule,
3378
+ MatDatepickerModule,
3379
+ MatMomentDateModule,
3380
+ DragDropModule,
3381
+ ReactiveFormsModule,
3382
+ FormsModule,
3383
+ MatTooltipModule,
3384
+ MatProgressBarModule,
3385
+ MatTableModule,
3386
+ MatSortModule,
3387
+ MatSelectModule,
3388
+ NgxUploaderModule,
3389
+ MatProgressSpinnerModule,
3390
+ MatMenuModule,
3391
+ ImageCropperModule,
3392
+ RouterModule,
3393
+ OverlayModule,
3394
+ MatRippleModule,
3395
+ MatInputModule,
3396
+ MatRadioModule,
3397
+ MatSnackBarModule,
3398
+ MatAutocompleteModule
3399
+ ],
3400
+ providers: [
3401
+ UiFileService,
3402
+ { provide: UI_TRANSLATESERVICE, useClass: UiTranslateService },
3403
+ { provide: MAT_DATE_LOCALE, useValue: 'cs-CZ' },
3404
+ { provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: false } },
3405
+ { provide: MAT_RADIO_DEFAULT_OPTIONS, useValue: { color: 'primary' } },
3406
+ { provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useValue: { color: 'primary' } }
3407
+ ]
3408
+ }]
3409
+ }] });
3410
+
3411
+ class ToastService {
3412
+ constructor(snackService) {
3413
+ this.snackService = snackService;
3414
+ }
3415
+ open(message, options = { duration: 2500, type: 'info' }) {
3416
+ this.snackService.open(message, null, {
3417
+ duration: options.duration || 2500,
3418
+ panelClass: [options.type || 'message']
3419
+ });
3420
+ }
3421
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ToastService, deps: [{ token: i1$3.MatSnackBar }], target: i0.ɵɵFactoryTarget.Injectable }); }
3422
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ToastService, providedIn: 'root' }); }
3423
+ }
3424
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ToastService, decorators: [{
3425
+ type: Injectable,
3426
+ args: [{
3427
+ providedIn: 'root'
3428
+ }]
3429
+ }], ctorParameters: function () { return [{ type: i1$3.MatSnackBar }]; } });
3430
+
3431
+ /*
3432
+ * Public API Surface of ui
3433
+ */
3434
+ // export * from './lib/ui.service';
3435
+ // export * from './lib/ui.component';
3436
+
3437
+ /**
3438
+ * Generated bundle index. Do not edit.
3439
+ */
3440
+
3441
+ export { ActionButtonComponent, ActionIconComponent, AutocompleteComponent, AvatarComponent, BurgerComponent, ButtonComponent, CheckboxComponent, CheckboxGroupComponent, CurrencyComponent, DateComponent, DialogComponent, EditorComponent, ExpanderComponent, FileComponent, ForceVisibilityDirective, InputAutocompleteComponent, InputComponent, MessageBoxModalComponent, MessageBoxService, RadioComponent, RadioGroupComponent, SelectComponent, SubmitButtonComponent, TableComponent, TextAreaComponent, ToastService, UI_FILESERVICE, UI_TRANSLATESERVICE, UiFileService, UiFileUploaderComponent, UiModule, UiTranslateService };
3442
+ //# sourceMappingURL=rlucan-ui.mjs.map