@rlucan/ui 14.2.5 → 16.2.2

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 (104) hide show
  1. package/README.md +24 -24
  2. package/esm2022/lib/action-button/action-button.component.mjs +99 -0
  3. package/esm2022/lib/action-icon/action-icon.component.mjs +37 -0
  4. package/esm2022/lib/autocomplete/autocomplete.component.mjs +391 -0
  5. package/esm2022/lib/avatar/avatar.component.mjs +34 -0
  6. package/esm2022/lib/button/button.component.mjs +57 -0
  7. package/esm2022/lib/checkbox/checkbox.component.mjs +39 -0
  8. package/{esm2020 → esm2022}/lib/checkbox-group/checkbox-group.component.mjs +6 -6
  9. package/esm2022/lib/currency/currency.component.mjs +151 -0
  10. package/esm2022/lib/date/date.component.mjs +68 -0
  11. package/{esm2020 → esm2022}/lib/dialog/dialog.component.mjs +5 -5
  12. package/esm2022/lib/directives/force-visibility/force-visibility.directive.mjs +104 -0
  13. package/esm2022/lib/editor/editor.component.mjs +119 -0
  14. package/{esm2020 → esm2022}/lib/elements/burger/burger.component.mjs +4 -4
  15. package/{esm2020 → esm2022}/lib/elements/expander/expander.component.mjs +4 -4
  16. package/{esm2020 → esm2022}/lib/elements/validation-message/validation-message.component.mjs +4 -4
  17. package/esm2022/lib/file/file.component.mjs +145 -0
  18. package/esm2022/lib/file-uploader/ui-file-uploader.component.mjs +405 -0
  19. package/esm2022/lib/input/input.component.mjs +265 -0
  20. package/esm2022/lib/input-autocomplete/input-autocomplete.component.mjs +277 -0
  21. package/esm2022/lib/layouts/base/ui-base-layout.component.mjs +22 -0
  22. package/esm2022/lib/layouts/base/ui-base.component.mjs +74 -0
  23. package/esm2022/lib/layouts/simple/ui-simple-layout.component.mjs +18 -0
  24. package/esm2022/lib/layouts/simple/ui-simple.component.mjs +166 -0
  25. package/{esm2020 → esm2022}/lib/radio/radio.component.mjs +4 -4
  26. package/esm2022/lib/radio-group/radio-group.component.mjs +53 -0
  27. package/esm2022/lib/select/select.component.mjs +126 -0
  28. package/{esm2020 → esm2022}/lib/services/message-box.service.mjs +10 -10
  29. package/{esm2020 → esm2022}/lib/services/toast.service.mjs +4 -4
  30. package/{esm2020 → esm2022}/lib/services/ui-file.service.mjs +4 -4
  31. package/{esm2020 → esm2022}/lib/services/ui-translate.service.mjs +4 -4
  32. package/{esm2020 → esm2022}/lib/submit-button/submit-button.component.mjs +4 -4
  33. package/esm2022/lib/table/table.component.mjs +97 -0
  34. package/esm2022/lib/text-area/text-area.component.mjs +46 -0
  35. package/esm2022/lib/ui.module.mjs +269 -0
  36. package/esm2022/public-api.mjs +35 -0
  37. package/fesm2022/rlucan-ui.mjs +3453 -0
  38. package/fesm2022/rlucan-ui.mjs.map +1 -0
  39. package/lib/action-button/action-button.component.d.ts +3 -7
  40. package/lib/action-icon/action-icon.component.d.ts +1 -1
  41. package/lib/autocomplete/autocomplete.component.d.ts +2 -2
  42. package/lib/avatar/avatar.component.d.ts +1 -1
  43. package/lib/button/button.component.d.ts +1 -1
  44. package/lib/checkbox/checkbox.component.d.ts +2 -2
  45. package/lib/checkbox-group/checkbox-group.component.d.ts +2 -2
  46. package/lib/currency/currency.component.d.ts +3 -2
  47. package/lib/date/date.component.d.ts +1 -1
  48. package/lib/dialog/dialog.component.d.ts +1 -1
  49. package/lib/directives/force-visibility/force-visibility.directive.d.ts +5 -3
  50. package/lib/editor/editor.component.d.ts +24 -0
  51. package/lib/elements/burger/burger.component.d.ts +1 -1
  52. package/lib/elements/expander/expander.component.d.ts +1 -1
  53. package/lib/elements/validation-message/validation-message.component.d.ts +1 -1
  54. package/lib/file/file.component.d.ts +1 -1
  55. package/lib/file-uploader/ui-file-uploader.component.d.ts +2 -2
  56. package/lib/input/input.component.d.ts +5 -4
  57. package/lib/input-autocomplete/input-autocomplete.component.d.ts +44 -0
  58. package/lib/{base → layouts/base}/ui-base-layout.component.d.ts +1 -1
  59. package/lib/{base → layouts/base}/ui-base.component.d.ts +1 -1
  60. package/lib/{simple → layouts/simple}/ui-simple-layout.component.d.ts +2 -1
  61. package/lib/{simple → layouts/simple}/ui-simple.component.d.ts +2 -1
  62. package/lib/radio/radio.component.d.ts +1 -1
  63. package/lib/radio-group/radio-group.component.d.ts +2 -2
  64. package/lib/select/select.component.d.ts +8 -4
  65. package/lib/services/toast.service.d.ts +1 -1
  66. package/lib/services/ui-file.service.d.ts +1 -1
  67. package/lib/submit-button/submit-button.component.d.ts +1 -1
  68. package/lib/table/table.component.d.ts +1 -1
  69. package/lib/text-area/text-area.component.d.ts +2 -2
  70. package/lib/ui.model.d.ts +2 -2
  71. package/lib/ui.module.d.ts +52 -49
  72. package/package.json +22 -24
  73. package/public-api.d.ts +2 -0
  74. package/scss/ui-defaults.scss +1 -1
  75. package/src/js/editorjs.mjs +9634 -0
  76. package/ui.scss +41 -14
  77. package/esm2020/lib/action-button/action-button.component.mjs +0 -99
  78. package/esm2020/lib/action-icon/action-icon.component.mjs +0 -37
  79. package/esm2020/lib/autocomplete/autocomplete.component.mjs +0 -391
  80. package/esm2020/lib/avatar/avatar.component.mjs +0 -34
  81. package/esm2020/lib/base/ui-base-layout.component.mjs +0 -22
  82. package/esm2020/lib/base/ui-base.component.mjs +0 -74
  83. package/esm2020/lib/button/button.component.mjs +0 -57
  84. package/esm2020/lib/checkbox/checkbox.component.mjs +0 -39
  85. package/esm2020/lib/currency/currency.component.mjs +0 -148
  86. package/esm2020/lib/date/date.component.mjs +0 -68
  87. package/esm2020/lib/directives/force-visibility/force-visibility.directive.mjs +0 -96
  88. package/esm2020/lib/file/file.component.mjs +0 -145
  89. package/esm2020/lib/file-uploader/ui-file-uploader.component.mjs +0 -394
  90. package/esm2020/lib/input/input.component.mjs +0 -258
  91. package/esm2020/lib/radio-group/radio-group.component.mjs +0 -53
  92. package/esm2020/lib/select/select.component.mjs +0 -91
  93. package/esm2020/lib/simple/ui-simple-layout.component.mjs +0 -15
  94. package/esm2020/lib/simple/ui-simple.component.mjs +0 -154
  95. package/esm2020/lib/table/table.component.mjs +0 -97
  96. package/esm2020/lib/text-area/text-area.component.mjs +0 -46
  97. package/esm2020/lib/ui.module.mjs +0 -255
  98. package/esm2020/public-api.mjs +0 -33
  99. package/fesm2015/rlucan-ui.mjs +0 -3017
  100. package/fesm2015/rlucan-ui.mjs.map +0 -1
  101. package/fesm2020/rlucan-ui.mjs +0 -2982
  102. package/fesm2020/rlucan-ui.mjs.map +0 -1
  103. /package/{esm2020 → esm2022}/lib/ui.model.mjs +0 -0
  104. /package/{esm2020 → esm2022}/rlucan-ui.mjs +0 -0
@@ -0,0 +1,3453 @@
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;-webkit-user-select:none;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;-webkit-user-select:none;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;-webkit-user-select:none;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;-webkit-user-select:none;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 && this.componentFormControl.value) {
762
+ this.componentFormControl.setValue(this.mapValues(this.componentFormControl.value), { emitEvent: false });
763
+ }
764
+ }
765
+ ngOnChanges(changes) {
766
+ super.ngOnChanges(changes);
767
+ if (changes.options && this.componentFormControl && this.trackBy) {
768
+ this.componentFormControl.setValue(this.mapValues(this.componentFormControl.value), { emitEvent: false });
769
+ }
770
+ }
771
+ mapValues(src) {
772
+ if (src && this.trackBy && this.options) {
773
+ if (this.multiple) {
774
+ return this.options.filter(o => src.find(v => v[this.trackBy] === o[this.trackBy]));
775
+ }
776
+ else {
777
+ return this.options.find(o => o[this.trackBy] === src[this.trackBy]);
778
+ }
779
+ }
780
+ else {
781
+ return src;
782
+ }
783
+ }
784
+ selectOption(o, select) {
785
+ select.selectionChange.emit(this.optionToValue(o));
786
+ select.close();
787
+ }
788
+ selectAll() {
789
+ this.componentFormControl.setValue(this.options.map(o => this.optionToValue(o)));
790
+ }
791
+ clearAll() {
792
+ this.componentFormControl.setValue([]);
793
+ }
794
+ setDisabledState(isDisabled) {
795
+ }
796
+ writeValue(obj) {
797
+ if (!this.ngControl) {
798
+ if (obj && obj.error) {
799
+ console.log('setting error', obj, obj.error);
800
+ this.componentFormControl.setErrors(obj.error === 'clear' ? null : { custom: obj.error }, { emitEvent: false });
801
+ }
802
+ else {
803
+ this.componentFormControl.setValue(this.mapValues(obj));
804
+ }
805
+ }
806
+ }
807
+ 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 }); }
808
+ 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, usesOnChanges: 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\" [innerHTML]=\"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;-webkit-user-select:none;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;-webkit-user-select:none;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"] }] }); }
809
+ }
810
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: SelectComponent, decorators: [{
811
+ type: Component,
812
+ 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\" [innerHTML]=\"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;-webkit-user-select:none;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;-webkit-user-select:none;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"] }]
813
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
814
+ type: Optional
815
+ }, {
816
+ type: Self
817
+ }] }, { type: undefined, decorators: [{
818
+ type: Inject,
819
+ args: [UI_TRANSLATESERVICE]
820
+ }] }]; }, propDecorators: { multiple: [{
821
+ type: Input
822
+ }], triggerFormatter: [{
823
+ type: Input
824
+ }], valueAttribute: [{
825
+ type: Input
826
+ }], resetText: [{
827
+ type: Input
828
+ }], displayAttribute: [{
829
+ type: Input
830
+ }], options: [{
831
+ type: Input
832
+ }], optionFormatter: [{
833
+ type: Input
834
+ }], optionTemplateRef: [{
835
+ type: Input
836
+ }], triggerTemplateRef: [{
837
+ type: Input
838
+ }], panelClass: [{
839
+ type: Input
840
+ }], allowEmptySelection: [{
841
+ type: Input
842
+ }], trackBy: [{
843
+ type: Input
844
+ }], select: [{
845
+ type: ViewChild,
846
+ args: ['select']
847
+ }] } });
848
+
849
+ const UI_FILESERVICE = new InjectionToken('IUiFileService');
850
+ // export const FileServiceConfigService = new InjectionToken<FileServiceConfig>('FileServiceConfig');
851
+ class UiFileService {
852
+ constructor(fileServiceConfig) {
853
+ this.fileServiceConfig = fileServiceConfig;
854
+ this.uploadInput = new EventEmitter();
855
+ this.uploadSubscription = new Subject();
856
+ this.filesToRemove = [];
857
+ this.controls = new Set();
858
+ this.uploadSubscription.subscribe((v) => {
859
+ switch (v.action) {
860
+ case 'register':
861
+ this.controls.add(v.data);
862
+ return;
863
+ case 'destroy':
864
+ this.controls.delete(v.data);
865
+ return;
866
+ case 'uploadStarted':
867
+ let cnt = 0;
868
+ this.controls.forEach(c => cnt += c.hasFilesToUpload ? 1 : 0);
869
+ if (cnt === 0) {
870
+ this.uploadSubscription.next({ action: 'uploadSuccess' });
871
+ }
872
+ break;
873
+ case 'uploadControlFailed':
874
+ case 'uploadControlSuccess':
875
+ let cnt2 = 0;
876
+ this.controls.forEach(c => cnt2 += c.hasFilesToUpload ? 1 : 0);
877
+ if (cnt2 === 0) {
878
+ this.uploadSubscription.next({ action: v.action === 'uploadControlFailed' ? 'uploadFailed' : 'uploadSuccess' });
879
+ }
880
+ break;
881
+ }
882
+ });
883
+ }
884
+ upload() {
885
+ const promises = [];
886
+ this.controls.forEach(c => promises.push(c.beforeSave()));
887
+ return new Promise((res, rej) => {
888
+ this.uploadSubscription.subscribe((v) => {
889
+ if (v.action === 'uploadSuccess' || v.action === 'uploadFailed') {
890
+ res(v.action);
891
+ }
892
+ });
893
+ this.uploadSubscription.next({ action: 'uploadStarted' });
894
+ Promise.all(promises).then((r) => {
895
+ const event = {
896
+ type: 'uploadAll',
897
+ url: this.fileServiceConfig.uploadUrl,
898
+ method: 'POST',
899
+ headers: this.fileServiceConfig.getAuthHeader()
900
+ };
901
+ this.uploadInput.emit(event);
902
+ });
903
+ });
904
+ }
905
+ 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 }); }
906
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiFileService }); }
907
+ }
908
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiFileService, decorators: [{
909
+ type: Injectable
910
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
911
+ type: Optional
912
+ }, {
913
+ type: Inject,
914
+ args: [UI_FILESERVICE]
915
+ }] }]; } });
916
+
917
+ class FileComponent {
918
+ get fitImageFileSize() {
919
+ if (!this.fileServiceConfig.imageSizes[this.fileSize]) {
920
+ console.error('Missing filesize for ' + this.fileSize);
921
+ }
922
+ return this.fileServiceConfig.imageSizes[this.fileSize][0] < 0 || this.fileServiceConfig.imageSizes[this.fileSize][1] < 0;
923
+ }
924
+ get width() {
925
+ if (this.fitImageFileSize) {
926
+ if (this.nativeFileSizeRatio === -1) {
927
+ return '100%';
928
+ }
929
+ else {
930
+ return this.nativeFileWidth + 'px';
931
+ }
932
+ }
933
+ else {
934
+ return this.fileServiceConfig.imageSizes[this.fileSize] ? this.fileServiceConfig.imageSizes[this.fileSize][0] + 'px' : undefined;
935
+ }
936
+ }
937
+ get maxWidth() {
938
+ if (this.fileServiceConfig.imageSizes[this.fileSize][0] < 0) {
939
+ return this.width;
940
+ }
941
+ return this.fileServiceConfig.imageSizes[this.fileSize] ? this.fileServiceConfig.imageSizes[this.fileSize][0] + 'px' : undefined;
942
+ }
943
+ get height() {
944
+ if (this.fitImageFileSize) {
945
+ if (this.nativeFileSizeRatio === -1) {
946
+ return '100%';
947
+ }
948
+ else {
949
+ return this.nativeFileHeight + 'px';
950
+ }
951
+ }
952
+ else {
953
+ return this.fileServiceConfig.imageSizes[this.fileSize] ? this.fileServiceConfig.imageSizes[this.fileSize][1] + 'px' : undefined;
954
+ }
955
+ }
956
+ get maxHeight() {
957
+ if (this.fileServiceConfig.imageSizes[this.fileSize][1] < 0) {
958
+ return this.height;
959
+ }
960
+ return this.fileServiceConfig.imageSizes[this.fileSize] ? this.fileServiceConfig.imageSizes[this.fileSize][1] + 'px' : undefined;
961
+ }
962
+ get isVideo() {
963
+ return this.mime.startsWith('video/');
964
+ }
965
+ get mime() {
966
+ if (this.srcUrlMimeType) {
967
+ return this.srcUrlMimeType;
968
+ }
969
+ else {
970
+ if (this.srcData.nativeFile) {
971
+ return this.srcData.nativeFile.type;
972
+ }
973
+ return this.fileServiceConfig.getMimeType(this.srcData);
974
+ }
975
+ }
976
+ get useRetinaSrc() {
977
+ return this.fileServiceConfig.useRetinaSrc;
978
+ }
979
+ constructor(fileServiceConfig, domSanitizer, fileService) {
980
+ this.fileServiceConfig = fileServiceConfig;
981
+ this.domSanitizer = domSanitizer;
982
+ this.fileService = fileService;
983
+ this.fileSize = 'default';
984
+ this.visible = false;
985
+ this.nativeFileSizeRatio = -1;
986
+ }
987
+ ngOnInit() {
988
+ }
989
+ ngOnChanges(changes) {
990
+ if (changes.srcData) {
991
+ this.nativeFileSizeRatio = -1;
992
+ if (changes.srcData.currentValue.nativeFile) {
993
+ this.src = this.domSanitizer.bypassSecurityTrustUrl(URL.createObjectURL(changes.srcData.currentValue.nativeFile));
994
+ const img = new Image();
995
+ img.onload = () => {
996
+ if (this.fitImageFileSize) {
997
+ this.nativeFileSizeRatio = Math.max(img.width / this.fileServiceConfig.imageSizes[this.fileSize][0], img.height / this.fileServiceConfig.imageSizes[this.fileSize][1], 1);
998
+ }
999
+ else {
1000
+ this.nativeFileSizeRatio = 1;
1001
+ }
1002
+ this.nativeFileWidth = img.width / this.nativeFileSizeRatio;
1003
+ this.nativeFileHeight = img.height / this.nativeFileSizeRatio;
1004
+ URL.revokeObjectURL(img.src);
1005
+ };
1006
+ img.src = URL.createObjectURL(changes.srcData.currentValue.nativeFile);
1007
+ }
1008
+ else {
1009
+ this.src = this.fileServiceConfig.getMediaSrc(this.fileSize, changes.srcData.currentValue, this.srcOptions);
1010
+ }
1011
+ }
1012
+ if (changes.srcUrl) {
1013
+ this.src = changes.srcUrl.currentValue?.src;
1014
+ if (this.src) {
1015
+ this.srcUrlMimeType = changes.srcUrl.currentValue?.mimeType || 'image/png';
1016
+ }
1017
+ else {
1018
+ this.srcUrlMimeType = undefined;
1019
+ }
1020
+ }
1021
+ }
1022
+ 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 }); }
1023
+ 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"] }] }); }
1024
+ }
1025
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: FileComponent, decorators: [{
1026
+ type: Component,
1027
+ 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"] }]
1028
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1029
+ type: Optional
1030
+ }, {
1031
+ type: Inject,
1032
+ args: [UI_FILESERVICE]
1033
+ }] }, { type: i1$1.DomSanitizer }, { type: UiFileService }]; }, propDecorators: { fileSize: [{
1034
+ type: Input
1035
+ }], srcOptions: [{
1036
+ type: Input
1037
+ }], srcData: [{
1038
+ type: Input
1039
+ }], srcUrl: [{
1040
+ type: Input
1041
+ }], width: [{
1042
+ type: HostBinding,
1043
+ args: ['style.width']
1044
+ }], maxWidth: [{
1045
+ type: HostBinding,
1046
+ args: ['style.maxWidth']
1047
+ }], height: [{
1048
+ type: HostBinding,
1049
+ args: ['style.height']
1050
+ }], maxHeight: [{
1051
+ type: HostBinding,
1052
+ args: ['style.maxHeight']
1053
+ }] } });
1054
+
1055
+ class UiFileUploaderComponent extends UiSimpleComponent {
1056
+ get menuTemplate() {
1057
+ return this.templates?.menuTemplate;
1058
+ }
1059
+ get addFileTemplate() {
1060
+ return this.templates?.addFileTemplate;
1061
+ }
1062
+ get fileTemplate() {
1063
+ return this.templates?.fileTemplate;
1064
+ }
1065
+ constructor(fileServiceConfig, translateService, controlContainer, fileService) {
1066
+ super(null, controlContainer);
1067
+ this.fileServiceConfig = fileServiceConfig;
1068
+ this.translateService = translateService;
1069
+ this.controlContainer = controlContainer;
1070
+ this.fileService = fileService;
1071
+ this.maxFiles = 1;
1072
+ this.multiple = true;
1073
+ this.crop = false;
1074
+ this.cropRounded = false;
1075
+ this.fileSize = 'default';
1076
+ this.customFileMenu = false;
1077
+ this.newFilePosition = 'last';
1078
+ this.templates = {};
1079
+ this.previewPosition = 'bottom';
1080
+ this.imageCropped = new EventEmitter();
1081
+ this.fileEvent = new EventEmitter();
1082
+ this.uploadOptions = {
1083
+ concurrency: this.fileServiceConfig.concurrentUploads
1084
+ };
1085
+ this.uploading = false;
1086
+ this.showCropper = false;
1087
+ this.showCropPreview = {};
1088
+ this.cropPreviewTimeouts = {};
1089
+ this.cropSourceImages = {};
1090
+ this.cropperImageLoaded = {};
1091
+ this.imagesDone = {};
1092
+ this.transform = {};
1093
+ this.canvasRotation = {};
1094
+ this.refreshAddInput = false;
1095
+ this.patchingValues = false;
1096
+ this.inputArray = false;
1097
+ this.dragging = false;
1098
+ this.uploaderId = Math.round(Math.random() * 1000000);
1099
+ this.croppedImages = {};
1100
+ this.fileService.uploadSubscription.next({ action: 'register', data: this });
1101
+ this.fileService.uploadSubscription.subscribe((v) => {
1102
+ switch (v.action) {
1103
+ case 'uploadStarted':
1104
+ this.uploading = true;
1105
+ break;
1106
+ case 'uploadFailed':
1107
+ case 'uploadSuccess':
1108
+ setTimeout(() => {
1109
+ this.uploading = false;
1110
+ });
1111
+ this.patchValues();
1112
+ }
1113
+ });
1114
+ }
1115
+ get uploadInput() {
1116
+ return this.fileService.uploadInput;
1117
+ }
1118
+ get editable() {
1119
+ return this.componentFormControl.enabled;
1120
+ }
1121
+ get ngAddStyle() {
1122
+ return {
1123
+ width: Math.abs(this.fileServiceConfig.imageSizes[this.fileSize][0]) + 'px',
1124
+ height: Math.abs(this.fileServiceConfig.imageSizes[this.fileSize][1]) + 'px',
1125
+ };
1126
+ }
1127
+ get aspectRatio() {
1128
+ return this.fileServiceConfig.imageSizes[this.fileSize][0] / this.fileServiceConfig.imageSizes[this.fileSize][1];
1129
+ }
1130
+ get addFileImgSrc() {
1131
+ return this.fileServiceConfig.addFileImgSrc;
1132
+ }
1133
+ cropDone(f) {
1134
+ return !f.$newFile || this.imagesDone[f.$newFile.id];
1135
+ }
1136
+ // ngOnInit(): void {
1137
+ // super.ngOnInit();
1138
+ // }
1139
+ ngOnDestroy() {
1140
+ this.fileService.uploadSubscription.next({ action: 'destroy', data: this });
1141
+ }
1142
+ remove(f) {
1143
+ if (f.$newFile) {
1144
+ this.uploadInput.emit({ type: 'remove', id: f.$newFile.id });
1145
+ }
1146
+ this.files.splice(this.files.indexOf(f), 1);
1147
+ this.prepareResponse();
1148
+ // this.onChange(this.inputArray ? this.files : (this.files.length > 0 ? this.files[0] : null));
1149
+ this.fileEvent.emit({ message: 'fileRemoved', data: f });
1150
+ // this.patchValues();
1151
+ }
1152
+ patchValues() {
1153
+ this.patchingValues = true;
1154
+ // if (this.inputArray) {
1155
+ // this.componentFormControl.setValue(this.files.map(f => f.custom));
1156
+ // } else {
1157
+ // this.componentFormControl.setValue(this.files.length === 0 ? null : this.files[0].custom);
1158
+ // }
1159
+ this.patchingValues = false;
1160
+ }
1161
+ get hasFilesToUpload() {
1162
+ return !!this.files.find(f => f.$newFile && f.$newFile.progress.status !== 2);
1163
+ }
1164
+ canImagePreview(type) {
1165
+ return type.startsWith('image/') || type.startsWith('video/');
1166
+ }
1167
+ onUploadOutput($event, skipCustomValidation = false) {
1168
+ // console.log($event);
1169
+ switch ($event.type) {
1170
+ case 'start':
1171
+ break;
1172
+ case 'dragOver':
1173
+ this.dragging = true;
1174
+ break;
1175
+ case 'dragOut':
1176
+ case 'drop':
1177
+ this.dragging = false;
1178
+ break;
1179
+ case 'addedToQueue':
1180
+ if (this.crop && !$event.file.type.startsWith('image/')) {
1181
+ this.uploadInput.emit({ type: 'remove', id: $event.file.id });
1182
+ this.fileEvent.emit({ message: 'cropInvalidFileType', data: $event.file });
1183
+ return;
1184
+ }
1185
+ if (!skipCustomValidation && this.fileServiceConfig.fileValidation) {
1186
+ this.fileServiceConfig.fileValidation(this.fileSize, $event.file).then(valid => {
1187
+ if (valid) {
1188
+ this.onUploadOutput($event, true);
1189
+ }
1190
+ else {
1191
+ this.uploadInput.emit({ type: 'remove', id: $event.file.id });
1192
+ // this.fileEvent.emit({ message: 'cropInvalidFileType', data: $event.file });
1193
+ }
1194
+ });
1195
+ }
1196
+ else {
1197
+ let f;
1198
+ if (this.changeFileIndex !== undefined) {
1199
+ f = this.files[this.changeFileIndex];
1200
+ if (f.$newFile) {
1201
+ this.uploadInput.emit({ type: 'remove', id: f.$newFile.id });
1202
+ }
1203
+ f.$newFile = $event.file;
1204
+ f.custom = $event.file;
1205
+ this.changeFileIndex = undefined;
1206
+ }
1207
+ else {
1208
+ f = { custom: $event.file, $newFile: $event.file };
1209
+ if (this.newFilePosition === 'last') {
1210
+ this.files.push(f);
1211
+ }
1212
+ else {
1213
+ this.files.unshift(f);
1214
+ }
1215
+ }
1216
+ if (this.canImagePreview($event.file.type)) {
1217
+ if (this.crop) {
1218
+ this.canvasRotation[$event.file.id] = 0;
1219
+ this.cropSourceImages[$event.file.id] = $event.file.nativeFile;
1220
+ this.cropperImageLoaded[$event.file.id] = false;
1221
+ }
1222
+ }
1223
+ this.prepareResponse();
1224
+ this.fileEvent.emit({ message: 'fileAdded', data: f });
1225
+ }
1226
+ break;
1227
+ case 'done':
1228
+ const df = this.files.find(f => f.$newFile === $event.file);
1229
+ if (df) {
1230
+ if (df.$newFile.responseStatus === 200) {
1231
+ this.files[this.files.indexOf(df)].custom = df.$newFile.response;
1232
+ df.$newFile = null;
1233
+ }
1234
+ else {
1235
+ // console.log('error on upload', df.$event);
1236
+ }
1237
+ }
1238
+ if (!this.hasFilesToUpload) {
1239
+ this.prepareResponse(false);
1240
+ this.fileService.uploadSubscription.next({
1241
+ action: this.files.find(f => !!f.$newFile) ? 'uploadControlFailed' : 'uploadControlSuccess'
1242
+ });
1243
+ }
1244
+ break;
1245
+ }
1246
+ }
1247
+ prepareResponse(doemit = true) {
1248
+ if (this.inputArray) {
1249
+ if (!this.responseFiles) {
1250
+ this.responseFiles = [];
1251
+ }
1252
+ this.responseFiles.length = 0;
1253
+ this.files.forEach(f => this.responseFiles.push({ ...f.custom, $newFile: f.$newFile }));
1254
+ }
1255
+ else {
1256
+ if (this.files.length === 0) {
1257
+ this.responseFiles = null;
1258
+ }
1259
+ else {
1260
+ if (!this.responseFiles) {
1261
+ this.responseFiles = {};
1262
+ }
1263
+ Object.keys(this.files[0].custom).forEach(k => {
1264
+ this.responseFiles[k] = this.files[0].custom[k];
1265
+ });
1266
+ this.responseFiles.$newFile = this.files[0].$newFile;
1267
+ }
1268
+ }
1269
+ if (doemit) {
1270
+ this.onChange(this.responseFiles);
1271
+ }
1272
+ // console.log('emit', this.files[1], { ...this.files[1].custom, $newFile: this.files[1].$newFile });
1273
+ // this.onChange(this.inputArray ?
1274
+ // this.files.map(f => ({ ...f.custom, $newFile: f.$newFile})) :
1275
+ // (this.files.length > 0 ? { ...this.files[0].custom, $newFile: this.files[0].$newFile } : null));
1276
+ // this.onChange(this.inputArray ?
1277
+ // this.files :
1278
+ // (this.files.length > 0 ? this.files[0] : null));
1279
+ }
1280
+ beforeSave() {
1281
+ return new Promise((res, rej) => {
1282
+ this.files.forEach(f => {
1283
+ if (f.$newFile && f.$newFile.progress.status === 2) {
1284
+ f.$newFile.progress.status = 0;
1285
+ }
1286
+ if (this.crop && f.$newFile && !this.imagesDone[f.$newFile.id]) {
1287
+ this.cropperDone(f.$newFile.id);
1288
+ }
1289
+ });
1290
+ setTimeout(() => {
1291
+ res('done');
1292
+ }, 250);
1293
+ });
1294
+ }
1295
+ fileChangeEvent(event, f) {
1296
+ this.changeFileIndex = this.files.indexOf(f);
1297
+ }
1298
+ startCropPreview(id) {
1299
+ clearTimeout(this.cropPreviewTimeouts[id]);
1300
+ this.showCropPreview[id] = !!this.cropSourceImages[id];
1301
+ }
1302
+ stopCropPreview(id) {
1303
+ this.cropPreviewTimeouts[id] = setTimeout(() => {
1304
+ this.showCropPreview[id] = false;
1305
+ }, 250);
1306
+ }
1307
+ zoomCroppedImage(dir, id) {
1308
+ let scale = this.transform[id].scale;
1309
+ scale += dir;
1310
+ if (scale < 0.1) {
1311
+ scale = 0.1;
1312
+ }
1313
+ this.transform[id] = {
1314
+ ...this.transform[id],
1315
+ scale
1316
+ };
1317
+ }
1318
+ rotateCroppedImage(dir, id) {
1319
+ this.canvasRotation[id] += dir;
1320
+ const flippedH = this.transform[id].flipH;
1321
+ const flippedV = this.transform[id].flipV;
1322
+ this.transform[id] = {
1323
+ ...this.transform[id],
1324
+ flipH: flippedV,
1325
+ flipV: flippedH
1326
+ };
1327
+ }
1328
+ onImageCropped(event, id) {
1329
+ this.croppedImages[id] = event;
1330
+ this.imageCropped.emit(event);
1331
+ }
1332
+ imageLoaded(id) {
1333
+ this.showCropper = true;
1334
+ setTimeout(() => {
1335
+ this.transform[id] = {
1336
+ scale: 1
1337
+ };
1338
+ });
1339
+ }
1340
+ cropperReady(sourceImageDimensions, id) {
1341
+ this.cropperImageLoaded[id] = true;
1342
+ }
1343
+ loadImageFailed() {
1344
+ }
1345
+ toggleMenuVisibility(f) {
1346
+ this.fileMenuOpened = f;
1347
+ }
1348
+ menuClick() {
1349
+ this.fileMenuOpened = undefined;
1350
+ }
1351
+ writeValue(obj) {
1352
+ this.inputArray = obj instanceof Array;
1353
+ if (this.inputArray) {
1354
+ this.files = obj.map(f => ({ custom: f, $newFile: null }));
1355
+ }
1356
+ else {
1357
+ this.files = obj ? [{ custom: obj, $newFile: null }] : [];
1358
+ }
1359
+ this.cropSourceImages = {};
1360
+ }
1361
+ cropperDone(id) {
1362
+ const f = this.files.find(fx => fx.$newFile && fx.$newFile.id === id);
1363
+ if (f) {
1364
+ // const url = this.croppedImages[id];
1365
+ // console.log(url);
1366
+ // fetch(url)
1367
+ // .then(res => res.blob())
1368
+ // .then(blob => {
1369
+ // f.$newFile.nativeFile = new File([ blob ], 'crop.png', {
1370
+ // type: 'image/png'
1371
+ // });
1372
+ // f.$newFile.name = 'crop.png';
1373
+ // f.$newFile.size = f.$newFile.nativeFile.size;
1374
+ // f.$newFile.type = f.$newFile.nativeFile.type;
1375
+ // this.imagesDone[id] = true;
1376
+ // console.log(f);
1377
+ // })
1378
+ const croppedImage = this.croppedImages[id];
1379
+ f.$newFile.nativeFile = new File([croppedImage.blob], 'crop.png', {
1380
+ type: 'image/png'
1381
+ });
1382
+ f.$newFile.name = 'crop.png';
1383
+ f.$newFile.size = f.$newFile.nativeFile.size;
1384
+ f.$newFile.type = f.$newFile.nativeFile.type;
1385
+ this.imagesDone[id] = true;
1386
+ console.log(f);
1387
+ }
1388
+ }
1389
+ 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 }); }
1390
+ 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: [{
1391
+ provide: NG_VALUE_ACCESSOR,
1392
+ multi: true,
1393
+ useExisting: UiFileUploaderComponent,
1394
+ }], 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;-webkit-user-select:none;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"] }] }); }
1395
+ }
1396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiFileUploaderComponent, decorators: [{
1397
+ type: Component,
1398
+ args: [{ selector: 'ui-file-uploader', providers: [{
1399
+ provide: NG_VALUE_ACCESSOR,
1400
+ multi: true,
1401
+ useExisting: UiFileUploaderComponent,
1402
+ }], 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;-webkit-user-select:none;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"] }]
1403
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
1404
+ type: Optional
1405
+ }, {
1406
+ type: Inject,
1407
+ args: [UI_FILESERVICE]
1408
+ }] }, { type: undefined, decorators: [{
1409
+ type: Inject,
1410
+ args: [UI_TRANSLATESERVICE]
1411
+ }] }, { type: i1.ControlContainer, decorators: [{
1412
+ type: Optional
1413
+ }, {
1414
+ type: Host
1415
+ }, {
1416
+ type: SkipSelf
1417
+ }] }, { type: UiFileService }]; }, propDecorators: { maxFiles: [{
1418
+ type: Input
1419
+ }], multiple: [{
1420
+ type: Input
1421
+ }], crop: [{
1422
+ type: Input
1423
+ }], cropRounded: [{
1424
+ type: Input
1425
+ }], cropMaxWidth: [{
1426
+ type: Input
1427
+ }], fileSize: [{
1428
+ type: Input
1429
+ }], customFileMenu: [{
1430
+ type: Input
1431
+ }], addHint: [{
1432
+ type: Input
1433
+ }], newFilePosition: [{
1434
+ type: Input
1435
+ }], templates: [{
1436
+ type: Input
1437
+ }], previewPosition: [{
1438
+ type: Input
1439
+ }], imageCropped: [{
1440
+ type: Output
1441
+ }], fileEvent: [{
1442
+ type: Output
1443
+ }] } });
1444
+
1445
+ class ExpanderComponent {
1446
+ constructor() {
1447
+ this.expanded = false;
1448
+ this.direction = 'right-down';
1449
+ }
1450
+ ngOnInit() {
1451
+ }
1452
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ExpanderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1453
+ 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"] }] }); }
1454
+ }
1455
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ExpanderComponent, decorators: [{
1456
+ type: Component,
1457
+ 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"] }]
1458
+ }], ctorParameters: function () { return []; }, propDecorators: { expanded: [{
1459
+ type: HostBinding,
1460
+ args: ['class.expanded']
1461
+ }, {
1462
+ type: Input
1463
+ }], direction: [{
1464
+ type: HostBinding,
1465
+ args: ['class']
1466
+ }, {
1467
+ type: Input
1468
+ }] } });
1469
+
1470
+ class ForceVisibilityDirective {
1471
+ static { this.disabled = false; }
1472
+ constructor(el) {
1473
+ this.el = el;
1474
+ this.visibilityPadding = 15;
1475
+ this.visibilityOnRequestOnly = false;
1476
+ this.visibilityEmitChange = false;
1477
+ this.visibilityFromTop = 0;
1478
+ this.visibilityCheckEnabled = true;
1479
+ this.visibilityChanged = new EventEmitter();
1480
+ }
1481
+ static disableFor(timeoutMs) {
1482
+ this.disabled = true;
1483
+ setTimeout(() => this.disabled = false, timeoutMs);
1484
+ }
1485
+ ngOnInit() {
1486
+ if (!this.visibilityOnRequestOnly && !this.visibilityEmitChange) {
1487
+ setTimeout(() => {
1488
+ this.forceVisibility();
1489
+ }, 125);
1490
+ }
1491
+ if (this.visibilityEmitChange) {
1492
+ if (!this.visibilityWithin) {
1493
+ throw Error('traceVisibilityChanged requires visibilityWithin');
1494
+ }
1495
+ else {
1496
+ this.visible = this.isVisible();
1497
+ this.visibilityWithin.onscroll = () => {
1498
+ const v = this.isVisible();
1499
+ if (v !== this.visible) {
1500
+ this.visible = v;
1501
+ this.visibilityChanged.emit(v);
1502
+ }
1503
+ };
1504
+ }
1505
+ }
1506
+ }
1507
+ ngOnChanges(changes) {
1508
+ if (changes.visibilityCheckEnabled && changes.visibilityCheckEnabled.currentValue !== changes.visibilityCheckEnabled.previousValue) {
1509
+ this.forceVisibility();
1510
+ }
1511
+ }
1512
+ isVisible() {
1513
+ const rect = this.el.nativeElement.getBoundingClientRect();
1514
+ const rectIn = this.visibilityWithin.getBoundingClientRect();
1515
+ return rect.top + +this.visibilityPadding - rectIn.bottom < 0;
1516
+ }
1517
+ forceVisibility() {
1518
+ if (ForceVisibilityDirective.disabled || !this.visibilityCheckEnabled) {
1519
+ return;
1520
+ }
1521
+ const rect = this.el.nativeElement.getBoundingClientRect();
1522
+ const padding = +this.visibilityPadding;
1523
+ if (this.visibilityWithin) {
1524
+ const rectIn = this.visibilityWithin.getBoundingClientRect();
1525
+ let diff = rect.top + rect.height + padding - rectIn.bottom;
1526
+ if (diff > 0) {
1527
+ this.visibilityWithin.scrollBy(0, diff);
1528
+ }
1529
+ else {
1530
+ diff = rect.top - rectIn.top - padding;
1531
+ if (diff < 0) {
1532
+ this.visibilityWithin.scrollBy(0, diff);
1533
+ }
1534
+ }
1535
+ }
1536
+ else {
1537
+ if (this.visibilityFromTop !== 0) {
1538
+ document.getElementsByTagName('app-root')[0].scrollTo(0, rect.top - +this.visibilityFromTop);
1539
+ }
1540
+ else {
1541
+ if (rect.bottom > window.innerHeight) {
1542
+ document.getElementsByTagName('app-root')[0].scrollBy(0, rect.bottom - window.innerHeight + 15);
1543
+ }
1544
+ }
1545
+ }
1546
+ }
1547
+ 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 }); }
1548
+ 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 }); }
1549
+ }
1550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ForceVisibilityDirective, decorators: [{
1551
+ type: Directive,
1552
+ args: [{
1553
+ selector: '[uiForceVisibility]',
1554
+ exportAs: 'ForceVisibilityDirective'
1555
+ }]
1556
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { visibilityWithin: [{
1557
+ type: Input
1558
+ }], visibilityPadding: [{
1559
+ type: Input
1560
+ }], visibilityOnRequestOnly: [{
1561
+ type: Input
1562
+ }], visibilityEmitChange: [{
1563
+ type: Input
1564
+ }], visibilityFromTop: [{
1565
+ type: Input
1566
+ }], visibilityCheckEnabled: [{
1567
+ type: Input
1568
+ }], visibilityChanged: [{
1569
+ type: Output
1570
+ }] } });
1571
+
1572
+ class DialogComponent {
1573
+ constructor(dialogRef) {
1574
+ this.dialogRef = dialogRef;
1575
+ this.title = '';
1576
+ this.draggable = false; // true;
1577
+ this.hideCloseButton = false;
1578
+ }
1579
+ clickClose() {
1580
+ if (!this.close) {
1581
+ this.dialogRef.close();
1582
+ }
1583
+ else {
1584
+ this.close();
1585
+ }
1586
+ }
1587
+ 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 }); }
1588
+ 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"] }] }); }
1589
+ }
1590
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: DialogComponent, decorators: [{
1591
+ type: Component,
1592
+ 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"] }]
1593
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }]; }, propDecorators: { title: [{
1594
+ type: Input
1595
+ }], draggable: [{
1596
+ type: Input
1597
+ }], hideCloseButton: [{
1598
+ type: Input
1599
+ }], close: [{
1600
+ type: Input
1601
+ }] } });
1602
+
1603
+ class MessageBoxModalComponent {
1604
+ constructor(dialogRef, sanitizer, data) {
1605
+ this.dialogRef = dialogRef;
1606
+ this.sanitizer = sanitizer;
1607
+ this.data = data;
1608
+ this.buttons = [];
1609
+ this.hideCloseButton = false;
1610
+ this.processing = null;
1611
+ if (data.message) {
1612
+ this.message = this.sanitizer.bypassSecurityTrustHtml(data.message);
1613
+ }
1614
+ if (this.data.options.template) {
1615
+ this.template = this.data.options.template;
1616
+ }
1617
+ if (this.data.options.errorMessage) {
1618
+ this.errorMessage = this.sanitizer.bypassSecurityTrustHtml(data.options.errorMessage);
1619
+ }
1620
+ if (this.data.options.errorDetail) {
1621
+ this.errorDetail = this.sanitizer.bypassSecurityTrustHtml(data.options.errorDetail);
1622
+ }
1623
+ if (this.data.options.hideCloseButton !== undefined) {
1624
+ this.hideCloseButton = this.data.options.hideCloseButton;
1625
+ }
1626
+ this.buttons = data.options.buttons ? data.options.buttons : [{ id: 'close', text: 'Close' }];
1627
+ this.title = data.options.title;
1628
+ }
1629
+ close(result) {
1630
+ this.dialogRef.close(result);
1631
+ }
1632
+ buttonClick(b) {
1633
+ if (b.process) {
1634
+ this.processing = b;
1635
+ b.process().then(r => {
1636
+ this.close(r);
1637
+ }).catch(e => {
1638
+ this.processing = null;
1639
+ });
1640
+ }
1641
+ else {
1642
+ this.close(b.id);
1643
+ }
1644
+ }
1645
+ 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 }); }
1646
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.11", type: MessageBoxModalComponent, selector: "ui-message-box-modal", ngImport: i0, template: `
1647
+ <ui-dialog [title]="title" [hideCloseButton]="hideCloseButton">
1648
+ <div mat-dialog-content *ngIf="message" style="padding: 7px 16px 12px 16px;">
1649
+ <div [innerHTML]="message" style="line-height: 24px;"></div>
1650
+ <pre *ngIf="errorMessage" [innerHTML]="errorMessage"></pre>
1651
+ <pre *ngIf="errorDetail" [innerHTML]="errorDetail"></pre>
1652
+ </div>
1653
+
1654
+ <div mat-dialog-content *ngIf="template" style="padding: 7px 16px 12px 16px;">
1655
+ <ng-template [ngTemplateOutlet]="template"></ng-template>
1656
+ </div>
1657
+
1658
+ <div mat-dialog-actions>
1659
+ <div class="buttons">
1660
+ <ui-button *ngFor="let b of buttons" [color]="b.color || 'primary'" [tabIndex]="-1"
1661
+ [kind]="b.kind || 'stroked'" [busy]="processing === b" [disabled]="!!processing || (b.disabled && b.disabled())" (click)="buttonClick(b)" [label]="b.text"></ui-button>
1662
+ </div>
1663
+ </div>
1664
+ </ui-dialog>
1665
+ `, 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"] }] }); }
1666
+ }
1667
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MessageBoxModalComponent, decorators: [{
1668
+ type: Component,
1669
+ args: [{
1670
+ selector: 'ui-message-box-modal',
1671
+ template: `
1672
+ <ui-dialog [title]="title" [hideCloseButton]="hideCloseButton">
1673
+ <div mat-dialog-content *ngIf="message" style="padding: 7px 16px 12px 16px;">
1674
+ <div [innerHTML]="message" style="line-height: 24px;"></div>
1675
+ <pre *ngIf="errorMessage" [innerHTML]="errorMessage"></pre>
1676
+ <pre *ngIf="errorDetail" [innerHTML]="errorDetail"></pre>
1677
+ </div>
1678
+
1679
+ <div mat-dialog-content *ngIf="template" style="padding: 7px 16px 12px 16px;">
1680
+ <ng-template [ngTemplateOutlet]="template"></ng-template>
1681
+ </div>
1682
+
1683
+ <div mat-dialog-actions>
1684
+ <div class="buttons">
1685
+ <ui-button *ngFor="let b of buttons" [color]="b.color || 'primary'" [tabIndex]="-1"
1686
+ [kind]="b.kind || 'stroked'" [busy]="processing === b" [disabled]="!!processing || (b.disabled && b.disabled())" (click)="buttonClick(b)" [label]="b.text"></ui-button>
1687
+ </div>
1688
+ </div>
1689
+ </ui-dialog>
1690
+ `
1691
+ }]
1692
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: i1$1.DomSanitizer }, { type: undefined, decorators: [{
1693
+ type: Inject,
1694
+ args: [MAT_DIALOG_DATA]
1695
+ }] }]; } });
1696
+ class MessageBoxService {
1697
+ constructor(dialog, translateService) {
1698
+ this.dialog = dialog;
1699
+ this.translateService = translateService;
1700
+ }
1701
+ confirm(message, options = {}) {
1702
+ const config = new MatDialogConfig();
1703
+ config.disableClose = false;
1704
+ config.minWidth = '340px';
1705
+ config.maxWidth = options.maxWidth || '600px';
1706
+ config.width = '40vw';
1707
+ config.data = { message, options };
1708
+ return this.dialog.open(MessageBoxModalComponent, config).afterClosed();
1709
+ }
1710
+ open(options = {}) {
1711
+ const config = new MatDialogConfig();
1712
+ config.disableClose = true;
1713
+ config.minWidth = '340px';
1714
+ config.maxWidth = options.maxWidth || '600px';
1715
+ config.width = '40vw';
1716
+ config.data = { message: options.message, options };
1717
+ return this.dialog.open(MessageBoxModalComponent, config).afterClosed();
1718
+ }
1719
+ confirmDelete(title, message) {
1720
+ const options = {
1721
+ title,
1722
+ buttons: [
1723
+ { id: 'cancel', text: this.translateService.instant('ui.messagebox.button.cancel') },
1724
+ { id: 'delete', text: this.translateService.instant('ui.messagebox.button.delete'), color: 'warn', kind: 'flat' }
1725
+ ]
1726
+ };
1727
+ // @ts-ignore
1728
+ return this.confirm(message, options);
1729
+ }
1730
+ 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 }); }
1731
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MessageBoxService, providedIn: 'root' }); }
1732
+ }
1733
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: MessageBoxService, decorators: [{
1734
+ type: Injectable,
1735
+ args: [{
1736
+ providedIn: 'root'
1737
+ }]
1738
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialog }, { type: undefined, decorators: [{
1739
+ type: Inject,
1740
+ args: [UI_TRANSLATESERVICE]
1741
+ }] }]; } });
1742
+
1743
+ class CurrencyComponent extends UiBaseComponent {
1744
+ // @HostBinding('class')
1745
+ // get sizeClass(): string {
1746
+ // return this.size;
1747
+ // }
1748
+ constructor(controlContainer) {
1749
+ super();
1750
+ this.controlContainer = controlContainer;
1751
+ this.currencies = [];
1752
+ this.currencyDisabled = false;
1753
+ this.panelClass = 'ui-currency';
1754
+ this.amountHidden = false;
1755
+ this.formGroup = new UntypedFormGroup({
1756
+ amount: new UntypedFormControl(),
1757
+ currency: new UntypedFormControl()
1758
+ });
1759
+ this.hasFocus = false;
1760
+ this.onChange = (value) => { };
1761
+ }
1762
+ ngOnInit() {
1763
+ super.ngOnInit();
1764
+ this.formGroup.valueChanges.subscribe(v => this.onChange(v));
1765
+ // this.formGroup = new FormGroup({
1766
+ // amount: new FormControl(this.control?.value.amount),
1767
+ // currency: new FormControl(this.currencies.find(c => c.code === this.control?.value.currency.code))
1768
+ // });
1769
+ // this.formGroup.valueChanges.subscribe(v => {
1770
+ // this.onChange(this.formGroup?.getRawValue());
1771
+ // });
1772
+ if (this.currencyDisabled) {
1773
+ this.formGroup.get('currency')?.disable();
1774
+ }
1775
+ // this.ngControl.control.statusChanges.subscribe(s => {
1776
+ // if (s === 'INVALID') {
1777
+ // // this.formGroup?.get('amount')?.setErrors(this.control?.errors || null);
1778
+ // this.formGroup?.get('currency')?.markAsTouched();
1779
+ // // this.formGroup?.get('currency')?.setErrors(this.control?.errors || null);
1780
+ // }
1781
+ // if (s === 'DISABLED') {
1782
+ // this.formGroup?.disable({emitEvent: false});
1783
+ // }
1784
+ // if (s === 'VALID') {
1785
+ // this.formGroup?.enable({emitEvent: false});
1786
+ // if (this.currencyDisabled) {
1787
+ // this.formGroup?.get('currency')?.disable({emitEvent: false});
1788
+ // }
1789
+ // }
1790
+ // });
1791
+ this.parentFormControl = this.controlContainer.control.get(this.formControlName);
1792
+ }
1793
+ // bindValidators(validators) {
1794
+ // console.log('binding validators', validators);
1795
+ // if (this.formGroup) {
1796
+ // this.formGroup.get('amount').setValidators(validators);
1797
+ // this.formGroup.get('currency').markAsTouched();
1798
+ // this.formGroup.get('currency').setErrors(validators);
1799
+ // }
1800
+ // }
1801
+ get isInvalid() {
1802
+ return this.parentFormControl.invalid;
1803
+ }
1804
+ get validationErrors() {
1805
+ return this.parentFormControl.errors;
1806
+ }
1807
+ focusChanged(hasFocus) {
1808
+ this.hasFocus = hasFocus;
1809
+ }
1810
+ registerOnChange(fn) {
1811
+ this.onChange = fn;
1812
+ }
1813
+ registerOnTouched(fn) {
1814
+ }
1815
+ registerOnValidatorChange(fn) {
1816
+ }
1817
+ setDisabledState(isDisabled) {
1818
+ if (isDisabled) {
1819
+ this.formGroup.get('amount').disable();
1820
+ if (!this.currencyDisabled) {
1821
+ this.formGroup.get('currency').disable();
1822
+ }
1823
+ }
1824
+ else {
1825
+ this.formGroup.get('amount').enable();
1826
+ if (!this.currencyDisabled) {
1827
+ this.formGroup.get('currency').enable();
1828
+ }
1829
+ }
1830
+ }
1831
+ validate(control) {
1832
+ return undefined;
1833
+ }
1834
+ writeValue(obj) {
1835
+ this.formGroup.setValue(obj);
1836
+ }
1837
+ 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 }); }
1838
+ 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: [{
1839
+ provide: NG_VALUE_ACCESSOR,
1840
+ multi: true,
1841
+ useExisting: CurrencyComponent
1842
+ }, {
1843
+ provide: NG_VALIDATORS,
1844
+ multi: true,
1845
+ useExisting: CurrencyComponent
1846
+ }
1847
+ ], 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"] }] }); }
1848
+ }
1849
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: CurrencyComponent, decorators: [{
1850
+ type: Component,
1851
+ args: [{ selector: 'ui-currency', providers: [{
1852
+ provide: NG_VALUE_ACCESSOR,
1853
+ multi: true,
1854
+ useExisting: CurrencyComponent
1855
+ }, {
1856
+ provide: NG_VALIDATORS,
1857
+ multi: true,
1858
+ useExisting: CurrencyComponent
1859
+ }
1860
+ ], 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"] }]
1861
+ }], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
1862
+ type: Optional
1863
+ }, {
1864
+ type: Host
1865
+ }, {
1866
+ type: SkipSelf
1867
+ }] }]; }, propDecorators: { currencies: [{
1868
+ type: Input
1869
+ }], currencyDisabled: [{
1870
+ type: Input
1871
+ }], formControlName: [{
1872
+ type: Input
1873
+ }], panelClass: [{
1874
+ type: Input
1875
+ }], amountHidden: [{
1876
+ type: HostBinding,
1877
+ args: ['class.amount-hidden']
1878
+ }, {
1879
+ type: Input
1880
+ }], hasFocus: [{
1881
+ type: HostBinding,
1882
+ args: ['class.focus']
1883
+ }] } });
1884
+
1885
+ class CheckboxComponent extends UiSimpleComponent {
1886
+ constructor(ngControl) {
1887
+ super(ngControl);
1888
+ this.ngControl = ngControl;
1889
+ this.color = 'primary';
1890
+ this.useInputMessages = 'never';
1891
+ }
1892
+ ngOnInit() {
1893
+ super.ngOnInit();
1894
+ if (this.label) {
1895
+ this.text = this.label;
1896
+ this.label = undefined;
1897
+ }
1898
+ }
1899
+ setDisabledState(isDisabled) {
1900
+ }
1901
+ 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 }); }
1902
+ 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"] }] }); }
1903
+ }
1904
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: CheckboxComponent, decorators: [{
1905
+ type: Component,
1906
+ 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"] }]
1907
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
1908
+ type: Optional
1909
+ }, {
1910
+ type: Self
1911
+ }] }]; }, propDecorators: { color: [{
1912
+ type: Input
1913
+ }], useInputMessages: [{
1914
+ type: Input
1915
+ }] } });
1916
+
1917
+ class AvatarComponent {
1918
+ get contrast() {
1919
+ const hexCode = this.user.shortColour.substring(1, 7);
1920
+ const hexR = parseInt(hexCode.substring(0, 2), 16);
1921
+ const hexG = parseInt(hexCode.substring(2, 4), 16);
1922
+ const hexB = parseInt(hexCode.substring(4, 6), 16);
1923
+ const contrastRatio = hexR * 0.299 + hexG * 0.587 + hexB * 0.114;
1924
+ return contrastRatio >= 200 ? 'black' : 'white';
1925
+ }
1926
+ constructor() {
1927
+ this.user = {};
1928
+ this.size = 'normal';
1929
+ }
1930
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: AvatarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1931
+ 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"] }] }); }
1932
+ }
1933
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: AvatarComponent, decorators: [{
1934
+ type: Component,
1935
+ 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"] }]
1936
+ }], ctorParameters: function () { return []; }, propDecorators: { user: [{
1937
+ type: Input
1938
+ }], srcOptions: [{
1939
+ type: Input
1940
+ }], size: [{
1941
+ type: HostBinding,
1942
+ args: ['class']
1943
+ }, {
1944
+ type: Input
1945
+ }] } });
1946
+
1947
+ class SubmitButtonComponent {
1948
+ constructor(dialogRef, controlContainer) {
1949
+ this.dialogRef = dialogRef;
1950
+ this.controlContainer = controlContainer;
1951
+ this.busy = false;
1952
+ this.disabled = false;
1953
+ this.formGroups = [];
1954
+ this.label = 'Save';
1955
+ this.prependCloseButton = true;
1956
+ }
1957
+ ngOnInit() {
1958
+ if (this.formInvalid === undefined) {
1959
+ if (this.formGroups === undefined && this.controlContainer && this.controlContainer.control instanceof UntypedFormGroup) {
1960
+ this.formGroups = this.controlContainer.control;
1961
+ }
1962
+ if (!Array.isArray(this.formGroups)) {
1963
+ this.formGroups = [this.formGroups];
1964
+ }
1965
+ }
1966
+ }
1967
+ get formsValid() {
1968
+ if (this.formInvalid !== undefined) {
1969
+ return !this.formInvalid;
1970
+ }
1971
+ else {
1972
+ return !this.formGroups.find(f => f.invalid);
1973
+ }
1974
+ }
1975
+ doSubmit() {
1976
+ this.formGroups.forEach(f => f.markAllAsTouched());
1977
+ if (this.formsValid && this.submit) {
1978
+ this.submit();
1979
+ }
1980
+ }
1981
+ 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 }); }
1982
+ 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"] }] }); }
1983
+ }
1984
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: SubmitButtonComponent, decorators: [{
1985
+ type: Component,
1986
+ 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"] }]
1987
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialogRef }, { type: i1.ControlContainer, decorators: [{
1988
+ type: Optional
1989
+ }, {
1990
+ type: Host
1991
+ }, {
1992
+ type: SkipSelf
1993
+ }] }]; }, propDecorators: { busy: [{
1994
+ type: Input
1995
+ }], disabled: [{
1996
+ type: Input
1997
+ }], formGroups: [{
1998
+ type: Input
1999
+ }], label: [{
2000
+ type: Input
2001
+ }], submit: [{
2002
+ type: Input
2003
+ }], formInvalid: [{
2004
+ type: Input
2005
+ }], prependCloseButton: [{
2006
+ type: HostBinding,
2007
+ args: ['class.with-close']
2008
+ }, {
2009
+ type: Input
2010
+ }] } });
2011
+
2012
+ class TextAreaComponent extends UiSimpleComponent {
2013
+ constructor(ngControl /*, private _ngZone: NgZone, private cdr: ChangeDetectorRef*/) {
2014
+ super(ngControl);
2015
+ this.ngControl = ngControl;
2016
+ this.rows = 5;
2017
+ this.autoResize = false;
2018
+ this.lastClientHeight = -1;
2019
+ this.focusChanged = new EventEmitter();
2020
+ }
2021
+ focus() {
2022
+ this.textarea.nativeElement.focus();
2023
+ }
2024
+ setDisabledState(isDisabled) {
2025
+ }
2026
+ onFocus(focus) {
2027
+ this.focusChanged.emit(focus);
2028
+ }
2029
+ 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 }); }
2030
+ 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;-webkit-user-select:none;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;-webkit-user-select:none;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"] }] }); }
2031
+ }
2032
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: TextAreaComponent, decorators: [{
2033
+ type: Component,
2034
+ 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;-webkit-user-select:none;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;-webkit-user-select:none;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"] }]
2035
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2036
+ type: Optional
2037
+ }, {
2038
+ type: Self
2039
+ }] }]; }, propDecorators: { rows: [{
2040
+ type: Input
2041
+ }], autoResize: [{
2042
+ type: Input
2043
+ }], textarea: [{
2044
+ type: ViewChild,
2045
+ args: ['textarea']
2046
+ }], focusChanged: [{
2047
+ type: Output
2048
+ }] } });
2049
+
2050
+ class DateComponent extends UiSimpleComponent {
2051
+ constructor(ngControl) {
2052
+ super(ngControl);
2053
+ this.ngControl = ngControl;
2054
+ // @Input() placeholder: string | undefined;
2055
+ // @Input() control;
2056
+ // // @Input() controlName;
2057
+ // @Input() label;
2058
+ // @Input() type;
2059
+ // @Input() floatLabel;
2060
+ this.doKeyup = new EventEmitter();
2061
+ this.hasFocus = false;
2062
+ this.controlTypeName = 'date';
2063
+ this.opening = false;
2064
+ }
2065
+ open() {
2066
+ this.hasFocus = true;
2067
+ // this.opening = true;
2068
+ // this.picker.open();
2069
+ // setTimeout(() => {
2070
+ // this.input.nativeElement.focus();
2071
+ // this.opening = false;
2072
+ // }); // , 150);
2073
+ }
2074
+ close() {
2075
+ this.hasFocus = false;
2076
+ // if (!this.opening) {
2077
+ // this.picker.close();h
2078
+ // }
2079
+ }
2080
+ keyup() {
2081
+ this.doKeyup.emit();
2082
+ // this.onChange(this.control.value);
2083
+ }
2084
+ writeValue(obj) { }
2085
+ registerOnChange(fn) {
2086
+ this.onChange = fn;
2087
+ }
2088
+ registerOnTouched(fn) { }
2089
+ setDisabledState(isDisabled) { }
2090
+ 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 }); }
2091
+ 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;-webkit-user-select:none;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;-webkit-user-select:none;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"] }] }); }
2092
+ }
2093
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: DateComponent, decorators: [{
2094
+ type: Component,
2095
+ 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;-webkit-user-select:none;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;-webkit-user-select:none;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"] }]
2096
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2097
+ type: Optional
2098
+ }, {
2099
+ type: Self
2100
+ }] }]; }, propDecorators: { doKeyup: [{
2101
+ type: Output
2102
+ }], picker: [{
2103
+ type: ViewChild,
2104
+ args: ['picker']
2105
+ }], input: [{
2106
+ type: ViewChild,
2107
+ args: ['input']
2108
+ }] } });
2109
+
2110
+ class TableComponent {
2111
+ get columnList() {
2112
+ return this.columns.map(c => c.name);
2113
+ }
2114
+ constructor(/*private persistService: PersistService, */ domSanitizer) {
2115
+ this.domSanitizer = domSanitizer;
2116
+ this.columns = [];
2117
+ this.rowTemplates = {};
2118
+ this.headerTemplates = {};
2119
+ this.stateStoreKey = '';
2120
+ }
2121
+ ngOnInit() {
2122
+ this.options = { ...{ sticky: false }, ...this.options };
2123
+ if (this.dataSource) {
2124
+ // if (this.stateStoreKey !== '') {
2125
+ // const storeKey = this.stateStoreKey + '.sort';
2126
+ // const ms = this.persistService.get(storeKey, { active: '', direction: ''});
2127
+ // this.matSort.active = ms.active;
2128
+ // this.matSort.direction = ms.direction;
2129
+ // this.matSort.sortChange.subscribe(sc => {
2130
+ // this.persistService.set(storeKey, sc.direction === '' ? { active: '', direction: ''} : sc);
2131
+ // });
2132
+ // }
2133
+ if (this.columns.find(c => c.sortable !== undefined)) {
2134
+ this.dataSource.sortData = (rows, sort) => {
2135
+ if (sort.direction) {
2136
+ const sortColumn = this.columns.find(c => c.name === sort.active);
2137
+ if (sortColumn) {
2138
+ const res = sort.direction === 'asc' ? 1 : -1;
2139
+ return rows.sort((r1, r2) => {
2140
+ if (sortColumn.sortable === true) {
2141
+ return r1[sortColumn.name] < r2[sortColumn.name] ? -res : res;
2142
+ }
2143
+ if (typeof sortColumn.sortable === 'function') {
2144
+ return sortColumn.sortable(r1, sort.direction) < sortColumn.sortable(r2, sort.direction) ? -res : res;
2145
+ }
2146
+ return 0;
2147
+ });
2148
+ }
2149
+ }
2150
+ return rows;
2151
+ };
2152
+ }
2153
+ }
2154
+ }
2155
+ ngAfterViewInit() {
2156
+ this.dataSource.sort = this.matSort;
2157
+ }
2158
+ display(row, col) {
2159
+ if (col.formatter) {
2160
+ return this.domSanitizer.bypassSecurityTrustHtml(col.formatter(row));
2161
+ }
2162
+ else {
2163
+ return row[col.name];
2164
+ }
2165
+ }
2166
+ rowClicked(row) {
2167
+ if (this.rowAction) {
2168
+ this.rowAction(row);
2169
+ }
2170
+ }
2171
+ 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 }); }
2172
+ 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\">\r\n\r\n <ng-container *ngFor=\"let c of columns\" [matColumnDef]=\"c.name\">\r\n\r\n <ng-container *ngIf=\"c.sortable\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>{{c.label}}</th>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!c.sortable\">\r\n <ng-container *ngIf=\"!headerTemplates[c.name]\">\r\n <th mat-header-cell *matHeaderCellDef>{{c.label}}</th>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"headerTemplates[c.name]\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <ng-template [ngTemplateOutlet]=\"headerTemplates[c.name]\"></ng-template>\r\n </th>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <td mat-cell *matCellDef=\"let element\" [colSpan]=\"c.colSpan ? c.colSpan(element) : 1\" [class]=\"c.cellClass ? c.cellClass(element) : ''\">\r\n <ng-container *ngIf=\"!c.colSpan || c.colSpan(element) > 0\">\r\n <ng-container *ngIf=\"rowTemplates[c.name]\">\r\n <ng-template [ngTemplateOutlet]=\"rowTemplates[c.name]\" [ngTemplateOutletContext]=\"{row:element}\" ></ng-template>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!rowTemplates[c.name]\">\r\n <span [innerHTML]=\"display(element, c)\"></span>\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"columnList; sticky: options?.sticky\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: columnList;\" (click)=\"rowClicked(row)\"></tr>\r\n</table>\r\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"] }] }); }
2173
+ }
2174
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: TableComponent, decorators: [{
2175
+ type: Component,
2176
+ args: [{ selector: 'ui-table', template: "<table mat-table matSort [dataSource]=\"dataSource\" style=\"width: 100%\" [matSortActive]=\"matSortActive\" [matSortDirection]=\"matSortDirection\">\r\n\r\n <ng-container *ngFor=\"let c of columns\" [matColumnDef]=\"c.name\">\r\n\r\n <ng-container *ngIf=\"c.sortable\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header>{{c.label}}</th>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!c.sortable\">\r\n <ng-container *ngIf=\"!headerTemplates[c.name]\">\r\n <th mat-header-cell *matHeaderCellDef>{{c.label}}</th>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"headerTemplates[c.name]\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <ng-template [ngTemplateOutlet]=\"headerTemplates[c.name]\"></ng-template>\r\n </th>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <td mat-cell *matCellDef=\"let element\" [colSpan]=\"c.colSpan ? c.colSpan(element) : 1\" [class]=\"c.cellClass ? c.cellClass(element) : ''\">\r\n <ng-container *ngIf=\"!c.colSpan || c.colSpan(element) > 0\">\r\n <ng-container *ngIf=\"rowTemplates[c.name]\">\r\n <ng-template [ngTemplateOutlet]=\"rowTemplates[c.name]\" [ngTemplateOutletContext]=\"{row:element}\" ></ng-template>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"!rowTemplates[c.name]\">\r\n <span [innerHTML]=\"display(element, c)\"></span>\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n\r\n <tr mat-header-row *matHeaderRowDef=\"columnList; sticky: options?.sticky\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: columnList;\" (click)=\"rowClicked(row)\"></tr>\r\n</table>\r\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"] }]
2177
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; }, propDecorators: { columns: [{
2178
+ type: Input
2179
+ }], dataSource: [{
2180
+ type: Input
2181
+ }], options: [{
2182
+ type: Input
2183
+ }], rowTemplates: [{
2184
+ type: Input
2185
+ }], headerTemplates: [{
2186
+ type: Input
2187
+ }], stateStoreKey: [{
2188
+ type: Input
2189
+ }], rowAction: [{
2190
+ type: Input
2191
+ }], matSortActive: [{
2192
+ type: Input
2193
+ }], matSortDirection: [{
2194
+ type: Input
2195
+ }], matSort: [{
2196
+ type: ViewChild,
2197
+ args: [MatSort]
2198
+ }] } });
2199
+
2200
+ class BurgerComponent {
2201
+ constructor() {
2202
+ this.open = false;
2203
+ }
2204
+ ngOnInit() {
2205
+ }
2206
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BurgerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2207
+ 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"] }); }
2208
+ }
2209
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: BurgerComponent, decorators: [{
2210
+ type: Component,
2211
+ 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"] }]
2212
+ }], ctorParameters: function () { return []; }, propDecorators: { open: [{
2213
+ type: HostBinding,
2214
+ args: ['class.open']
2215
+ }, {
2216
+ type: Input
2217
+ }] } });
2218
+
2219
+ class AutocompleteComponent extends UiBaseComponent {
2220
+ constructor(controlContainer,
2221
+ // @Optional() @Self() public ngControl: NgControl,
2222
+ cdr) {
2223
+ super();
2224
+ this.controlContainer = controlContainer;
2225
+ this.cdr = cdr;
2226
+ this.SHOWN_USERS_DELTA = 10;
2227
+ this.multiple = true;
2228
+ this.allowNew = false;
2229
+ this.displayAttribute = 'name';
2230
+ this.idAttribute = 'id';
2231
+ this.filteredOptions = [];
2232
+ this.filteredMaxItemsShown = this.SHOWN_USERS_DELTA;
2233
+ // skipBlur = false;
2234
+ // typingStarted = false;
2235
+ this.messageShown = false;
2236
+ this.alreadyAdded = false;
2237
+ this.optionsVisible = false;
2238
+ this.inputFocused = false;
2239
+ this.inputControl = new UntypedFormControl('');
2240
+ this.checkboxSelection = new Set();
2241
+ this.optionDisabled = () => false;
2242
+ this.optionFormatter = (o) => o[this.displayAttribute];
2243
+ }
2244
+ buildSearchableOptions() {
2245
+ return this.options.map(o => ({
2246
+ ...o,
2247
+ unselectable: this.optionDisabled(o),
2248
+ searchString: `${this.optionFormatter(o)}`.toLowerCase()
2249
+ }));
2250
+ }
2251
+ filterOptions(text) {
2252
+ this.filteredMaxItemsShown = this.SHOWN_USERS_DELTA;
2253
+ return this.searchableOptions.filter(u => u.searchString.includes(text));
2254
+ }
2255
+ ngOnInit() {
2256
+ // console.log('ngoninit');
2257
+ super.ngOnInit();
2258
+ // if (this.formControlName && this.controlContainer.control) {
2259
+ // this.control = this.controlContainer.control.get(this.formControlName) as FormControl;
2260
+ // }
2261
+ //
2262
+ // this.user = this.control.value;
2263
+ // this.value = this.control.value;
2264
+ this.searchableOptions = this.buildSearchableOptions();
2265
+ // if (this.control.disabled) {
2266
+ // this.inputControl.disable();
2267
+ // }
2268
+ // this.control.statusChanges.subscribe(v => {
2269
+ // if (v === 'DISABLED') {
2270
+ // this.inputControl.disable();
2271
+ // }
2272
+ // if (v === 'VALID') {
2273
+ // this.inputControl.enable();
2274
+ // }
2275
+ // });
2276
+ this.inputControl.valueChanges.pipe(debounceTime(200)).subscribe(v => {
2277
+ const lcv = v.toLowerCase();
2278
+ this.filteredOptions = this.filterOptions(lcv);
2279
+ if (this.filteredOptions.length > 0) {
2280
+ this.focusedOption = this.filteredOptions[0];
2281
+ }
2282
+ else {
2283
+ this.focusedOption = undefined;
2284
+ }
2285
+ if (v === '') {
2286
+ this.focusedOption = undefined;
2287
+ this.selectedOption = undefined;
2288
+ }
2289
+ // if (v !== '') {
2290
+ // if (this.newUsername === v) {
2291
+ // this.selectedUser = {id: null, fullName: v};
2292
+ // this.initialUser = this.selectedUser;
2293
+ // } else {
2294
+ // if (this.filteredGroupsAndUsers.length > 0) {
2295
+ // this.focusedGroup = this.filteredGroupsAndUsers[0];
2296
+ // this.focusedUser = this.focusedGroup.filteredUsers[0];
2297
+ // } else {
2298
+ // this.focusedGroup = null;
2299
+ // this.focusedUser = null;
2300
+ // }
2301
+ // if ((this.focusedUser && !this.focusedUser.unselectable) || this.focusedUser === this.initialUser) {
2302
+ // this.selectedUser = this.focusedUser;
2303
+ // } else {
2304
+ // this.selectedUser = null;
2305
+ // }
2306
+ // }
2307
+ // } else {
2308
+ // this.selectedUser = null;
2309
+ // this.focusedUser = null;
2310
+ // this.focusedGroup = null;
2311
+ // }
2312
+ // this.onChange(v);
2313
+ });
2314
+ // if (this.user !== null) {
2315
+ // let selectedUser = null;
2316
+ // this.groupsAndUsers.find(g => g.users.find(u => {
2317
+ // if (u.id === this.user.id) {
2318
+ // selectedUser = u;
2319
+ // return true;
2320
+ // } else {
2321
+ // return false;
2322
+ // }
2323
+ // }));
2324
+ //
2325
+ // if (selectedUser) {
2326
+ // this.inputControl.setValue(selectedUser.fullName);
2327
+ // this.selectedUser = selectedUser;
2328
+ // } else {
2329
+ // this.newUsername = this.user.fullName;
2330
+ // this.inputControl.setValue(this.user.fullName);
2331
+ // this.selectedUser = { id: null, fullName: this.newUsername };
2332
+ // }
2333
+ // } else {
2334
+ // this.selectedUser = null;
2335
+ // this.inputControl.setValue('');
2336
+ // }
2337
+ // this.initialUser = this.selectedUser;
2338
+ // }
2339
+ }
2340
+ inputFocusChanged(focused) {
2341
+ if (focused) {
2342
+ this.optionsVisible = true;
2343
+ }
2344
+ }
2345
+ // setTimeout(() => {
2346
+ // if (!focused && this.skipBlur) {
2347
+ // this.skipBlur = false;
2348
+ // return;
2349
+ // }
2350
+ // if (!this.typingStarted && focused) {
2351
+ // this.inputControl.setValue(this.inputControl.value);
2352
+ // this.typingStarted = true;
2353
+ // }
2354
+ // if (!this.messageShown) {
2355
+ // this.inputFocused = focused;
2356
+ // if (!focused) {
2357
+ // this.emitSelection('focus lost');
2358
+ // }
2359
+ // }
2360
+ // }, 250);
2361
+ // }
2362
+ get hasCheckboxSelected() {
2363
+ return this.checkboxSelection.size > 0;
2364
+ }
2365
+ optionChecked(u) {
2366
+ return this.checkboxSelection.has(u[this.idAttribute]);
2367
+ }
2368
+ select(u) {
2369
+ if (this.hasCheckboxSelected || u.unselectable) {
2370
+ return;
2371
+ }
2372
+ if (!u.unselectable) {
2373
+ this.selectedOption = u;
2374
+ this.initialOption = u;
2375
+ this.toggleDropdown();
2376
+ }
2377
+ }
2378
+ toggleOptionCheckboxed(u) {
2379
+ if (!u.unselectable) {
2380
+ this.checkboxSelection.has(u[this.idAttribute]) ?
2381
+ this.checkboxSelection.delete(u[this.idAttribute]) : this.checkboxSelection.add(u[this.idAttribute]);
2382
+ }
2383
+ this.input?.focus();
2384
+ }
2385
+ // get optionsVisible(): boolean {
2386
+ // return this.inputFocused && this.typingStarted;
2387
+ // }
2388
+ keyPressed(keyEvent) {
2389
+ this.lastEmittedId = -1;
2390
+ this.optionsVisible = true;
2391
+ // this.typingStarted = keyEvent.key !== 'Tab' && keyEvent.key !== 'Escape';
2392
+ if (keyEvent.key === 'Escape') {
2393
+ keyEvent.stopPropagation();
2394
+ keyEvent.preventDefault();
2395
+ this.optionsVisible = false;
2396
+ return;
2397
+ }
2398
+ if (keyEvent.key === 'Enter' && this.hasCheckboxSelected) {
2399
+ if (this.focusedOption && !this.focusedOption.unselectable) {
2400
+ this.toggleOptionCheckboxed(this.focusedOption);
2401
+ }
2402
+ keyEvent.stopPropagation();
2403
+ keyEvent.preventDefault();
2404
+ return;
2405
+ }
2406
+ // if (keyEvent.key === 'Enter' && this.filteredGroupsAndUsers.length === 0 && this.focusedUser === null && !this.alreadyAdded) {
2407
+ // this.newUser();
2408
+ // keyEvent.stopPropagation();
2409
+ // keyEvent.preventDefault();
2410
+ // return;
2411
+ // }
2412
+ if (keyEvent.key === 'Enter') {
2413
+ this.selectedOption = this.focusedOption;
2414
+ keyEvent.stopPropagation();
2415
+ keyEvent.preventDefault();
2416
+ this.toggleDropdown();
2417
+ return;
2418
+ }
2419
+ if ((keyEvent.key === 'ArrowDown' || keyEvent.key === 'ArrowUp') && !this.focusedOption) {
2420
+ if (this.filteredOptions.length > 0) {
2421
+ this.focusedOption = this.filteredOptions[0];
2422
+ // if (!this.focusedUser.unselectable || this.focusedUser === this.initialUser) {
2423
+ // this.selectedUser = this.focusedUser;
2424
+ // }
2425
+ this.selectedOption = this.focusedOption;
2426
+ return;
2427
+ }
2428
+ }
2429
+ if (keyEvent.key === 'ArrowDown' && this.focusedOption) {
2430
+ const idx = this.filteredOptions.indexOf(this.focusedOption);
2431
+ if (idx === this.filteredMaxItemsShown - 1) {
2432
+ this.filteredMaxItemsShown += this.SHOWN_USERS_DELTA;
2433
+ }
2434
+ if (idx < this.filteredOptions.length - 1) {
2435
+ this.focusedOption = this.filteredOptions[idx + 1];
2436
+ this.selectedOption = this.focusedOption;
2437
+ }
2438
+ }
2439
+ if (keyEvent.key === 'ArrowUp' && this.focusedOption) {
2440
+ const idx = this.filteredOptions.indexOf(this.focusedOption);
2441
+ if (idx > 0) {
2442
+ this.focusedOption = this.filteredOptions[idx - 1];
2443
+ this.selectedOption = this.focusedOption;
2444
+ }
2445
+ }
2446
+ this.cdr.detectChanges();
2447
+ }
2448
+ toggleDropdown() {
2449
+ this.optionsVisible = false;
2450
+ this.emitSelection('toggle');
2451
+ }
2452
+ emitSelection(src) {
2453
+ this.initialOption = this.selectedOption;
2454
+ if (this.selectedOption) {
2455
+ const checkId = this.selectedOption.id === null ? 0 : this.selectedOption.id;
2456
+ if (this.lastEmittedId !== checkId) {
2457
+ this.lastEmittedId = checkId;
2458
+ this.onChange(this.options.find(o => o[this.idAttribute] === this.selectedOption[this.idAttribute]));
2459
+ this.inputControl.setValue(this.selectedOption[this.displayAttribute]);
2460
+ }
2461
+ }
2462
+ else {
2463
+ // this.control.setValue(null);
2464
+ this.onChange(null);
2465
+ this.inputControl.setValue('', { emitEvent: false });
2466
+ }
2467
+ // if (this.selectedOption) {
2468
+ // const checkId = this.selectedUser.id === null ? 0 : this.selectedUser.id;
2469
+ // if (this.lastEmittedId !== checkId) {
2470
+ // this.inputControl.setValue(this.selectedUser.fullName, {emitEvent: false});
2471
+ // if (this.selectedUser.id) {
2472
+ // this.groupsAndUsers.find(g => g.users.find(u => {
2473
+ // if (u.id === this.selectedUser.id) {
2474
+ // this.control.setValue(u);
2475
+ // return true;
2476
+ // } else {
2477
+ // return false;
2478
+ // }
2479
+ // }));
2480
+ // } else {
2481
+ // this.control.setValue(this.selectedUser);
2482
+ // }
2483
+ // this.lastEmittedId = checkId;
2484
+ // }
2485
+ // } else {
2486
+ // if (this.lastEmittedId !== null || this.lastEmittedId === -1/* || this.selectedUser?.unselectable*/) {
2487
+ // this.control?.setValue(null);
2488
+ // this.inputControl.setValue('', {emitEvent: false});
2489
+ // this.lastEmittedId = null;
2490
+ // }
2491
+ // }
2492
+ // this.typingStarted = false;
2493
+ }
2494
+ cancelCheckboxSelection() {
2495
+ this.checkboxSelection.clear();
2496
+ // this.skipBlur = true;
2497
+ // this.input?.focus();
2498
+ }
2499
+ useCheckboxSelection() {
2500
+ // this.newUsername = '';
2501
+ // const users = [];
2502
+ // this.groupsAndUsers.forEach(g => g.users.forEach(u => {
2503
+ // if (!users.includes(u) && this.checkboxSelection.has(u.id)) {
2504
+ // users.push(u);
2505
+ // }
2506
+ // }));
2507
+ const outputOptions = this.options.filter(o => this.checkboxSelection.has(o[this.idAttribute]) && !this.optionDisabled(o));
2508
+ if (outputOptions.length > 0) {
2509
+ this.selectedOption = outputOptions[0];
2510
+ this.inputControl.setValue(this.selectedOption[this.displayAttribute], { emitEvent: false });
2511
+ this.onChange(outputOptions);
2512
+ this.toggleDropdown();
2513
+ // this.control?.setValue(outputOptions);
2514
+ // this.typingStarted = false;
2515
+ // this.skipBlur = true;
2516
+ }
2517
+ this.checkboxSelection.clear();
2518
+ }
2519
+ newOption() {
2520
+ }
2521
+ loadMore(visible) {
2522
+ if (visible) {
2523
+ this.filteredMaxItemsShown += this.SHOWN_USERS_DELTA;
2524
+ }
2525
+ }
2526
+ focus() {
2527
+ this.input?.focus();
2528
+ }
2529
+ registerOnChange(fn) {
2530
+ this.onChange = fn;
2531
+ }
2532
+ registerOnTouched(fn) {
2533
+ }
2534
+ setDisabledState(isDisabled) {
2535
+ isDisabled ? this.inputControl.disable() : this.inputControl.enable();
2536
+ }
2537
+ writeValue(obj) {
2538
+ if (obj) {
2539
+ if (obj.id) {
2540
+ this.filteredOptions = this.searchableOptions.filter(so => so.id === obj.id);
2541
+ }
2542
+ else {
2543
+ this.filteredOptions = this.filterOptions(obj[this.displayAttribute].toLowerCase());
2544
+ }
2545
+ if (this.filteredOptions.length === 1) {
2546
+ this.selectedOption = this.filteredOptions[0];
2547
+ this.focusedOption = this.filteredOptions[0];
2548
+ }
2549
+ this.inputControl.setValue(obj[this.displayAttribute]);
2550
+ }
2551
+ else {
2552
+ this.filteredOptions = this.filterOptions('');
2553
+ }
2554
+ }
2555
+ 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 }); }
2556
+ 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: [{
2557
+ provide: NG_VALUE_ACCESSOR,
2558
+ multi: true,
2559
+ useExisting: AutocompleteComponent
2560
+ }], 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"] }] }); }
2561
+ }
2562
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: AutocompleteComponent, decorators: [{
2563
+ type: Component,
2564
+ args: [{ selector: 'ui-autocomplete', providers: [{
2565
+ provide: NG_VALUE_ACCESSOR,
2566
+ multi: true,
2567
+ useExisting: AutocompleteComponent
2568
+ }], 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"] }]
2569
+ }], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
2570
+ type: Optional
2571
+ }, {
2572
+ type: Host
2573
+ }, {
2574
+ type: SkipSelf
2575
+ }] }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { options: [{
2576
+ type: Input
2577
+ }], multiple: [{
2578
+ type: Input
2579
+ }], allowNew: [{
2580
+ type: Input
2581
+ }], displayAttribute: [{
2582
+ type: Input
2583
+ }], idAttribute: [{
2584
+ type: Input
2585
+ }], input: [{
2586
+ type: ViewChild,
2587
+ args: ['input']
2588
+ }], optionsTrigger: [{
2589
+ type: ViewChild,
2590
+ args: ['trigger']
2591
+ }], optionDisabled: [{
2592
+ type: Input
2593
+ }], optionFormatter: [{
2594
+ type: Input
2595
+ }] } });
2596
+
2597
+ class ActionButtonComponent extends ButtonComponent {
2598
+ constructor() {
2599
+ super(...arguments);
2600
+ this.withPrimary = false;
2601
+ this.overlayAlignment = 'left';
2602
+ this.hasBackdrop = false;
2603
+ this.autoClose = true;
2604
+ this.primaryClick = new EventEmitter();
2605
+ this.overlayToggled = new EventEmitter();
2606
+ this.deferredRender = false;
2607
+ this.iconHover = false;
2608
+ this.rightPositions = [
2609
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },
2610
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },
2611
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },
2612
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' }
2613
+ ];
2614
+ this.leftPositions = [
2615
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
2616
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },
2617
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' },
2618
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' }
2619
+ ];
2620
+ this.openOverlay = false;
2621
+ }
2622
+ get class() {
2623
+ return super.class + (this.withPrimary ? ' with-primary' : '');
2624
+ }
2625
+ onKeydownHandler(evt) {
2626
+ if (this.openOverlay) {
2627
+ this.toggleOverlay(false);
2628
+ }
2629
+ }
2630
+ // constructor() {
2631
+ // super();
2632
+ // }
2633
+ get positions() {
2634
+ switch (this.overlayAlignment) {
2635
+ case 'left': return this.leftPositions;
2636
+ default: return this.rightPositions;
2637
+ }
2638
+ }
2639
+ ngOnInit() {
2640
+ setTimeout(() => {
2641
+ this.deferredRender = true;
2642
+ });
2643
+ }
2644
+ toggleOverlay(status) {
2645
+ if (status || this.autoClose) {
2646
+ this.openOverlay = status;
2647
+ this.overlayToggled.emit(status);
2648
+ }
2649
+ }
2650
+ closeOverlay() {
2651
+ this.openOverlay = false;
2652
+ }
2653
+ togglePrimaryOverlay(status, $event) {
2654
+ this.toggleOverlay(status);
2655
+ $event.stopPropagation();
2656
+ $event.preventDefault();
2657
+ }
2658
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ActionButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2659
+ 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"] }] }); }
2660
+ }
2661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ActionButtonComponent, decorators: [{
2662
+ type: Component,
2663
+ 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"] }]
2664
+ }], propDecorators: { withPrimary: [{
2665
+ type: Input
2666
+ }], overlayAlignment: [{
2667
+ type: Input
2668
+ }], hasBackdrop: [{
2669
+ type: Input
2670
+ }], triggerTpl: [{
2671
+ type: Input
2672
+ }], autoClose: [{
2673
+ type: Input
2674
+ }], primaryClick: [{
2675
+ type: Output
2676
+ }], overlayToggled: [{
2677
+ type: Output
2678
+ }], trigger1: [{
2679
+ type: ViewChild,
2680
+ args: ['trigger1', { static: false }]
2681
+ }], class: [{
2682
+ type: HostBinding,
2683
+ args: ['class']
2684
+ }], onKeydownHandler: [{
2685
+ type: HostListener,
2686
+ args: ['document:keydown.escape', ['$event']]
2687
+ }] } });
2688
+
2689
+ class RadioComponent {
2690
+ constructor() {
2691
+ this.color = 'primary';
2692
+ }
2693
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: RadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2694
+ 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"] }] }); }
2695
+ }
2696
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: RadioComponent, decorators: [{
2697
+ type: Component,
2698
+ args: [{ selector: 'ui-radio', template: "<mat-radio-button [value]=\"value\" [color]=\"color\">\r\n {{label}}\r\n</mat-radio-button>\r\n" }]
2699
+ }], propDecorators: { value: [{
2700
+ type: Input
2701
+ }], label: [{
2702
+ type: Input
2703
+ }], color: [{
2704
+ type: Input
2705
+ }] } });
2706
+
2707
+ // export interface CheckboxGroupOption {
2708
+ // value: any,
2709
+ // label: string,
2710
+ // hint?: string
2711
+ // }
2712
+ class CheckboxGroupComponent extends UiSimpleComponent {
2713
+ constructor(control) {
2714
+ super(control);
2715
+ this.control = control;
2716
+ this.displayAttribute = 'label';
2717
+ this.hintAttribute = 'hint';
2718
+ this.optionEnabled = (option) => true;
2719
+ }
2720
+ // ngOnInit(): void {
2721
+ // super.ngOnInit();
2722
+ // }
2723
+ ngOnChanges(changes) {
2724
+ super.ngOnChanges(changes);
2725
+ if (changes.options) {
2726
+ this.cbxs = [];
2727
+ this.valueMode = Array.isArray(this.control.value) ? 'array' : 'object';
2728
+ Object.keys(changes.options.currentValue).forEach(k => {
2729
+ const v = changes.options.currentValue[k];
2730
+ const ct = new UntypedFormControl(this.valueMode === 'array' ? this.control.value.includes(v) : this.control.value[k] === true);
2731
+ if (!this.optionEnabled(v)) {
2732
+ ct.disable();
2733
+ }
2734
+ ct.valueChanges.subscribe(() => {
2735
+ const value = this.valueMode === 'array' ? [] : {};
2736
+ let hasChecked = false;
2737
+ this.cbxs.forEach((cbx) => {
2738
+ const checked = cbx.control.value;
2739
+ hasChecked = hasChecked || checked;
2740
+ if (this.valueMode === 'array') {
2741
+ if (checked) {
2742
+ value.push(cbx.value.value);
2743
+ }
2744
+ }
2745
+ else {
2746
+ value[cbx.key] = checked;
2747
+ }
2748
+ });
2749
+ this.componentFormControl.markAsTouched();
2750
+ this.componentFormControl.setValue(value);
2751
+ if (this.componentFormControl.hasValidator(Validators.required) && !hasChecked) {
2752
+ this.componentFormControl.setErrors({ cbGroupRequired: true });
2753
+ }
2754
+ else {
2755
+ this.componentFormControl.setErrors(null);
2756
+ }
2757
+ });
2758
+ this.cbxs.push({
2759
+ control: ct,
2760
+ value: this.valueAttribute ? v[this.valueAttribute] : v,
2761
+ label: this.displayAttribute ? v[this.displayAttribute] : v,
2762
+ hint: this.hintAttribute ? v[this.hintAttribute] : undefined,
2763
+ key: this.valueMode === 'object' ? k : undefined
2764
+ });
2765
+ });
2766
+ }
2767
+ }
2768
+ 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 }); }
2769
+ 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"] }] }); }
2770
+ }
2771
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: CheckboxGroupComponent, decorators: [{
2772
+ type: Component,
2773
+ 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"] }]
2774
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2775
+ type: Optional
2776
+ }, {
2777
+ type: Self
2778
+ }] }]; }, propDecorators: { valueAttribute: [{
2779
+ type: Input
2780
+ }], displayAttribute: [{
2781
+ type: Input
2782
+ }], hintAttribute: [{
2783
+ type: Input
2784
+ }], options: [{
2785
+ type: Input
2786
+ }], optionEnabled: [{
2787
+ type: Input
2788
+ }] } });
2789
+
2790
+ class RadioGroupComponent extends UiSimpleComponent {
2791
+ constructor(control) {
2792
+ super(control);
2793
+ this.control = control;
2794
+ this.id = Math.round(Math.random() * 999999);
2795
+ this.displayAttribute = 'name';
2796
+ this.groupName = 'radio-' + this.id;
2797
+ this.optionEnabled = (option) => true;
2798
+ }
2799
+ // ngOnInit(): void {
2800
+ // super.ngOnInit();
2801
+ // }
2802
+ ngOnChanges(changes) {
2803
+ super.ngOnChanges(changes);
2804
+ if (changes.options) {
2805
+ this.cbxs = [];
2806
+ changes.options.currentValue.forEach(cv => {
2807
+ this.cbxs.push({
2808
+ value: this.valueAttribute ? cv[this.valueAttribute] : cv,
2809
+ label: cv[this.displayAttribute]
2810
+ });
2811
+ });
2812
+ }
2813
+ }
2814
+ 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 }); }
2815
+ 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"] }] }); }
2816
+ }
2817
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: RadioGroupComponent, decorators: [{
2818
+ type: Component,
2819
+ 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"] }]
2820
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2821
+ type: Optional
2822
+ }, {
2823
+ type: Self
2824
+ }] }]; }, propDecorators: { options: [{
2825
+ type: Input
2826
+ }], displayAttribute: [{
2827
+ type: Input
2828
+ }], valueAttribute: [{
2829
+ type: Input
2830
+ }], groupName: [{
2831
+ type: Input
2832
+ }], optionEnabled: [{
2833
+ type: Input
2834
+ }] } });
2835
+
2836
+ class EditorComponent extends UiSimpleComponent {
2837
+ clickout(event) {
2838
+ const cr = this.el.nativeElement.getBoundingClientRect();
2839
+ const outside = event.x < cr.x || event.x > cr.x + cr.width || event.y < cr.y || event.y > cr.y + cr.height;
2840
+ this.focused = !outside;
2841
+ if (!this.focused) {
2842
+ this.componentFormControl.markAsTouched();
2843
+ }
2844
+ }
2845
+ constructor(ngControl /*, private _ngZone: NgZone, private cdr: ChangeDetectorRef*/, el) {
2846
+ super(ngControl);
2847
+ this.ngControl = ngControl;
2848
+ this.el = el;
2849
+ this.rows = 5;
2850
+ this.autoResize = false;
2851
+ this.focused = false;
2852
+ this.editorId = `editorJs${Math.round(Math.random() * 10000000)}`;
2853
+ }
2854
+ focus() {
2855
+ this.focused = true;
2856
+ this.editor.focus();
2857
+ }
2858
+ setDisabledState(isDisabled) {
2859
+ }
2860
+ ngAfterViewInit() {
2861
+ this.editor = new EditorJS({
2862
+ holder: this.editorId,
2863
+ inlineToolbar: ['bold', 'italic'],
2864
+ tools: {
2865
+ header: {
2866
+ class: Header,
2867
+ inlineToolbar: true,
2868
+ config: {
2869
+ levels: [1, 2],
2870
+ defaultLevel: 1
2871
+ }
2872
+ },
2873
+ list: {
2874
+ class: List,
2875
+ inlineToolbar: true,
2876
+ config: {
2877
+ defaultStyle: 'unordered'
2878
+ },
2879
+ },
2880
+ },
2881
+ i18n: {
2882
+ messages: {
2883
+ ui: {
2884
+ "inlineToolbar": {
2885
+ "converter": {
2886
+ "Convert to": "Odstavec změnit na"
2887
+ }
2888
+ }
2889
+ },
2890
+ toolNames: {
2891
+ "Heading": "Nadpis",
2892
+ "List": "Seznam"
2893
+ }
2894
+ }
2895
+ },
2896
+ minHeight: 90,
2897
+ placeholder: 'Něco napiš...',
2898
+ onChange: () => { this.focused = true; this.editor.save().then((r) => this.onChange(r)); },
2899
+ onReady: () => {
2900
+ const editorElement = document.getElementById(this.editorId); // your "holder" ID
2901
+ editorElement.addEventListener('focusin', () => {
2902
+ this.focused = true;
2903
+ });
2904
+ },
2905
+ data: this.data
2906
+ });
2907
+ }
2908
+ inputLength() {
2909
+ let len = 0;
2910
+ if (this.componentFormControl && this.componentFormControl.value && this.componentFormControl.value.blocks) {
2911
+ this.componentFormControl.value.blocks.forEach(b => {
2912
+ if (b.type === 'paragraph' || b.type === 'header') {
2913
+ len += b.data.text.replace(/<\/?[^>]+(>|$)/g, '').replace(/&nbsp;/, '').length;
2914
+ }
2915
+ if (b.type === 'list') {
2916
+ b.data.items.forEach(i => {
2917
+ len += i.replace(/<\/?[^>]+(>|$)/g, '').replace(/&nbsp;/, '').length;
2918
+ });
2919
+ }
2920
+ });
2921
+ }
2922
+ return len;
2923
+ }
2924
+ writeValue(obj) {
2925
+ this.data = obj;
2926
+ }
2927
+ 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 }); }
2928
+ 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;-webkit-user-select:none;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;-webkit-user-select:none;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"] }] }); }
2929
+ }
2930
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: EditorComponent, decorators: [{
2931
+ type: Component,
2932
+ 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;-webkit-user-select:none;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;-webkit-user-select:none;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"] }]
2933
+ }], ctorParameters: function () { return [{ type: i1.NgControl, decorators: [{
2934
+ type: Optional
2935
+ }, {
2936
+ type: Self
2937
+ }] }, { type: i0.ElementRef }]; }, propDecorators: { rows: [{
2938
+ type: Input
2939
+ }], autoResize: [{
2940
+ type: Input
2941
+ }], clickout: [{
2942
+ type: HostListener,
2943
+ args: ['document:click', ['$event']]
2944
+ }] } });
2945
+
2946
+ class InputAutocompleteComponent extends UiSimpleComponent {
2947
+ get textAlignClass() {
2948
+ return `text-align-${this.textAlign}`;
2949
+ }
2950
+ get hasPrefix() {
2951
+ return (this.prefixIcon && this.prefixIcon.icon !== '') || this.prefix?.nativeElement?.innerText !== '' || this.forceHasPrefix;
2952
+ }
2953
+ get hasSuffix() {
2954
+ return (this.suffixIcon && this.suffixIcon.icon !== '') || this.suffix?.nativeElement?.innerText !== '' || this.forceHasSuffix;
2955
+ }
2956
+ // control;
2957
+ // onTouched = () => {};
2958
+ // onChange = (value) => {};
2959
+ // get showInvalid(): boolean {
2960
+ // return true;
2961
+ // // return this.control.touched && !!this.control.errors;
2962
+ // }
2963
+ // get validationMessage(): string {
2964
+ // // console.log(this.control?.errors);
2965
+ // let e: any = {code: 'Neznámá chyba'};
2966
+ // const errors = this.control?.errors || {};
2967
+ // Object.keys(errors).find(a => {
2968
+ // e = {code: a, data: errors[a]};
2969
+ // return true;
2970
+ // });
2971
+ // switch (e.code) {
2972
+ // case 'required':
2973
+ // return this.translateService.instant('ui.controls.validation.required');
2974
+ // case 'email':
2975
+ // return this.translateService.instant('ui.controls.validation.email');
2976
+ // case 'matDatepickerParse':
2977
+ // return this.translateService.instant('ui.controls.validation.matDatepickerParse');
2978
+ // case 'maxlength':
2979
+ // return this.translateService.instant('ui.controls.validation.maxlength', e.data);
2980
+ // case 'minlength':
2981
+ // return this.translateService.instant('ui.controls.validation.minlength', e.data);
2982
+ // case 'positive':
2983
+ // return this.translateService.instant(isNaN(Number(e.data)) ? 'ui.controls.validation.invalidNumber' : 'ui.controls.validation.positive');
2984
+ // case 'custom':
2985
+ // return this.translateService.instant(e.data);
2986
+ // default:
2987
+ // return this.translateService.instant(e.code);
2988
+ // }
2989
+ // }
2990
+ get maxLenRequired() {
2991
+ return true;
2992
+ // return this.control.value && (this.control.value.length > (this.validators?.maxLength || 0));
2993
+ }
2994
+ constructor(controlContainer) {
2995
+ super(null, controlContainer);
2996
+ this.controlContainer = controlContainer;
2997
+ this.type = 'text';
2998
+ this.clearButton = false;
2999
+ this.activeIcons = true;
3000
+ this.forceHasPrefix = false;
3001
+ this.forceHasSuffix = false;
3002
+ this.options = [];
3003
+ this.textAlign = 'left';
3004
+ this.focusChanged = new EventEmitter();
3005
+ this.keyPressed = new EventEmitter();
3006
+ this.filteredOptions = [];
3007
+ // control = new FormControl();
3008
+ this.required = false;
3009
+ this.hasFocus = false;
3010
+ // this.componentFormControl = new FormControl();
3011
+ // super();
3012
+ // super(undefined, /*ngControl*/ translateService);
3013
+ // super(control);
3014
+ // console.log(control);
3015
+ // if (control) {
3016
+ // control.valueAccessor = this;
3017
+ // }
3018
+ // if (ngControl != null) {
3019
+ // // Setting the value accessor directly (instead of using
3020
+ // // the providers) to avoid running into a circular import.
3021
+ // ngControl.valueAccessor = this;
3022
+ // }
3023
+ }
3024
+ get showClearButton() {
3025
+ return this.clearButton && this.componentFormControl?.value !== '';
3026
+ }
3027
+ ngOnInit() {
3028
+ super.ngOnInit();
3029
+ this.filteredOptions = this.options;
3030
+ this.componentFormControl?.valueChanges.subscribe((v) => {
3031
+ const vl = v.toLowerCase();
3032
+ this.filteredOptions = this.options.filter(o => vl === '' || o.toLowerCase().includes(vl));
3033
+ });
3034
+ // console.log('probiha vubec oninit?');
3035
+ // if (this.ngControl) {
3036
+ // console.log('from ngControl....??');
3037
+ // if (this.formControl) {
3038
+ // this.componentFormControl = this.formControl;
3039
+ // } else {
3040
+ // this.componentFormControl = this.ngControl.control as UntypedFormControl;
3041
+ // }
3042
+ // setTimeout(() => {
3043
+ // this.applyValidators();
3044
+ // });
3045
+ // } else {
3046
+ // const control = this.formControlName ?
3047
+ // (this.controlContainer as FormGroupDirective).control.get(this.formControlName) : this.formControl;
3048
+ // this.componentFormControl.setValidators(control.validator);
3049
+ // this.componentFormControl.valueChanges.subscribe(v => console.log('onitin sub', v));
3050
+ // control._componentFormControl = this.componentFormControl;
3051
+ // if (control._markAsTouched === undefined) {
3052
+ // // control._componentFormControl = this.componentFormControl;
3053
+ // console.log('overriding markAsTouched for', this.formControlName);
3054
+ // control._markAsTouched = control.markAsTouched;
3055
+ // control.markAsTouched = ({onlySelf}: { onlySelf?: boolean } = {}): void => {
3056
+ // console.log('marking as touched', this.componentFormControl.value, control.value, this.xxx.value, control._componentFormControl.value);
3057
+ // control._markAsTouched({onlySelf});
3058
+ // setTimeout(() => control._componentFormControl.markAsTouched(), 1000);
3059
+ // }
3060
+ // }
3061
+ // }
3062
+ }
3063
+ clearValue() {
3064
+ this.componentFormControl?.setValue('');
3065
+ this.input?.nativeElement.focus();
3066
+ }
3067
+ focus() {
3068
+ this.input?.nativeElement.focus();
3069
+ }
3070
+ onFocus(focus) {
3071
+ setTimeout(() => {
3072
+ this.hasFocus = focus;
3073
+ this.focusChanged.emit(focus);
3074
+ });
3075
+ }
3076
+ onKeypressed($event) {
3077
+ this.keyPressed.emit($event);
3078
+ }
3079
+ // registerOnChange(onChange: any): void {
3080
+ // this.onChange = onChange;
3081
+ // }
3082
+ //
3083
+ // registerOnTouched(onTouched: any): void {
3084
+ // this.onTouched = onTouched;
3085
+ // }
3086
+ // registerOnValidatorChange(fn: () => void): void {
3087
+ // }
3088
+ // setDisabledState(isDisabled: boolean): void {
3089
+ // // isDisabled ? this.control.disable() : this.control.enable();
3090
+ // }
3091
+ // validate(control: AbstractControl): ValidationErrors | null {
3092
+ // // this.control = control;
3093
+ // // console.log(control, control.value, control.errors);
3094
+ // if (this.value === 'error') {
3095
+ // return { customError: 'muj error'}
3096
+ // } else {
3097
+ // return null;
3098
+ // }
3099
+ // // console.log('custom validate');
3100
+ // // return null;
3101
+ // }
3102
+ //
3103
+ // writeValue(obj: any): void {
3104
+ // console.log('writevalue: ', obj);
3105
+ // this.componentFormControl.setValue(obj);
3106
+ // // this.value = obj;
3107
+ // // this.control.setValue(obj);
3108
+ // }
3109
+ //
3110
+ // registerOnChange(fn: any): void {
3111
+ // }
3112
+ //
3113
+ // registerOnTouched(fn: any): void {
3114
+ // }
3115
+ //
3116
+ // setDisabledState(isDisabled: boolean): void {
3117
+ // }
3118
+ // modelChange($event: any) {
3119
+ // console.log($event);
3120
+ // this.onTouched();
3121
+ // this.onChange($event)
3122
+ // }
3123
+ // validate(control: AbstractControl): ValidationErrors | null {
3124
+ // console.log(this.label, 'validate');
3125
+ // return this.componentFormControl.errors;
3126
+ // // return undefined;
3127
+ // }
3128
+ validate(control) {
3129
+ if (this.parentFormControl) {
3130
+ return this.parentFormControl._componentFormControl.errors;
3131
+ }
3132
+ // console.log('validate', this.componentFormControl.errors);
3133
+ // // this.componentFormControl.setErrors( { custom: 'xxx' });
3134
+ // this.componentFormControl.setErrors( this.componentFormControl.errors);
3135
+ // console.log('validate 2', this.componentFormControl.errors);
3136
+ // return this.componentFormControl.errors;
3137
+ // console.log(this.componentFormControl.errors, control.errors, this.parentFormControl.errors, this);
3138
+ // return this.componentFormControl.errors;
3139
+ }
3140
+ 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 }); }
3141
+ 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: [
3142
+ {
3143
+ provide: NG_VALUE_ACCESSOR,
3144
+ multi: true,
3145
+ useExisting: InputAutocompleteComponent
3146
+ },
3147
+ {
3148
+ provide: NG_VALIDATORS,
3149
+ multi: true,
3150
+ useExisting: InputAutocompleteComponent
3151
+ }
3152
+ ], 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;-webkit-user-select:none;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;-webkit-user-select:none;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"] }] }); }
3153
+ }
3154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: InputAutocompleteComponent, decorators: [{
3155
+ type: Component,
3156
+ args: [{ selector: 'ui-input-autocomplete', providers: [
3157
+ {
3158
+ provide: NG_VALUE_ACCESSOR,
3159
+ multi: true,
3160
+ useExisting: InputAutocompleteComponent
3161
+ },
3162
+ {
3163
+ provide: NG_VALIDATORS,
3164
+ multi: true,
3165
+ useExisting: InputAutocompleteComponent
3166
+ }
3167
+ ], 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;-webkit-user-select:none;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;-webkit-user-select:none;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"] }]
3168
+ }], ctorParameters: function () { return [{ type: i1.ControlContainer, decorators: [{
3169
+ type: Optional
3170
+ }, {
3171
+ type: Host
3172
+ }, {
3173
+ type: SkipSelf
3174
+ }] }]; }, propDecorators: { prefixIcon: [{
3175
+ type: Input
3176
+ }], suffixIcon: [{
3177
+ type: Input
3178
+ }], type: [{
3179
+ type: Input
3180
+ }], clearButton: [{
3181
+ type: Input
3182
+ }], activeIcons: [{
3183
+ type: Input
3184
+ }], forceHasPrefix: [{
3185
+ type: Input
3186
+ }], forceHasSuffix: [{
3187
+ type: Input
3188
+ }], options: [{
3189
+ type: Input
3190
+ }], textAlignClass: [{
3191
+ type: HostBinding,
3192
+ args: ['class']
3193
+ }], textAlign: [{
3194
+ type: Input
3195
+ }], input: [{
3196
+ type: ViewChild,
3197
+ args: ['input']
3198
+ }], prefix: [{
3199
+ type: ViewChild,
3200
+ args: ['prefix', { static: true }]
3201
+ }], suffix: [{
3202
+ type: ViewChild,
3203
+ args: ['suffix', { static: true }]
3204
+ }], focusChanged: [{
3205
+ type: Output
3206
+ }], keyPressed: [{
3207
+ type: Output
3208
+ }] } });
3209
+
3210
+ class UiModule {
3211
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3212
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.11", ngImport: i0, type: UiModule, declarations: [ButtonComponent,
3213
+ InputComponent,
3214
+ InputAutocompleteComponent,
3215
+ SelectComponent,
3216
+ FileComponent,
3217
+ UiFileUploaderComponent,
3218
+ ExpanderComponent,
3219
+ ForceVisibilityDirective,
3220
+ MessageBoxModalComponent,
3221
+ DialogComponent,
3222
+ CurrencyComponent,
3223
+ CheckboxComponent,
3224
+ AvatarComponent,
3225
+ SubmitButtonComponent,
3226
+ TextAreaComponent,
3227
+ DateComponent,
3228
+ TableComponent,
3229
+ BurgerComponent,
3230
+ AutocompleteComponent,
3231
+ ActionButtonComponent,
3232
+ UiBaseLayoutComponent,
3233
+ UiSimpleLayoutComponent,
3234
+ ValidationMessageComponent,
3235
+ RadioComponent,
3236
+ CheckboxGroupComponent,
3237
+ RadioGroupComponent,
3238
+ ActionIconComponent,
3239
+ EditorComponent], imports: [CommonModule,
3240
+ MatButtonModule,
3241
+ MatIconModule,
3242
+ MatDialogModule,
3243
+ MatCheckboxModule,
3244
+ MatDatepickerModule,
3245
+ MatMomentDateModule,
3246
+ DragDropModule,
3247
+ ReactiveFormsModule,
3248
+ FormsModule,
3249
+ MatTooltipModule,
3250
+ MatProgressBarModule,
3251
+ MatTableModule,
3252
+ MatSortModule,
3253
+ MatSelectModule,
3254
+ NgxUploaderModule,
3255
+ MatProgressSpinnerModule,
3256
+ MatMenuModule,
3257
+ ImageCropperModule,
3258
+ RouterModule,
3259
+ OverlayModule,
3260
+ MatRippleModule,
3261
+ MatInputModule,
3262
+ MatRadioModule,
3263
+ MatSnackBarModule,
3264
+ MatAutocompleteModule], exports: [ActionButtonComponent,
3265
+ ActionIconComponent,
3266
+ AutocompleteComponent,
3267
+ AvatarComponent,
3268
+ BurgerComponent,
3269
+ ButtonComponent,
3270
+ CheckboxComponent,
3271
+ CheckboxGroupComponent,
3272
+ CurrencyComponent,
3273
+ DateComponent,
3274
+ DialogComponent,
3275
+ ExpanderComponent,
3276
+ FileComponent,
3277
+ ForceVisibilityDirective,
3278
+ InputComponent,
3279
+ InputAutocompleteComponent,
3280
+ MessageBoxModalComponent,
3281
+ RadioComponent,
3282
+ RadioGroupComponent,
3283
+ SelectComponent,
3284
+ SubmitButtonComponent,
3285
+ TableComponent,
3286
+ TextAreaComponent,
3287
+ UiFileUploaderComponent,
3288
+ EditorComponent] }); }
3289
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiModule, providers: [
3290
+ UiFileService,
3291
+ { provide: UI_TRANSLATESERVICE, useClass: UiTranslateService },
3292
+ { provide: MAT_DATE_LOCALE, useValue: 'cs-CZ' },
3293
+ { provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: false } },
3294
+ { provide: MAT_RADIO_DEFAULT_OPTIONS, useValue: { color: 'primary' } },
3295
+ { provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useValue: { color: 'primary' } }
3296
+ ], imports: [CommonModule,
3297
+ MatButtonModule,
3298
+ MatIconModule,
3299
+ MatDialogModule,
3300
+ MatCheckboxModule,
3301
+ MatDatepickerModule,
3302
+ MatMomentDateModule,
3303
+ DragDropModule,
3304
+ ReactiveFormsModule,
3305
+ FormsModule,
3306
+ MatTooltipModule,
3307
+ MatProgressBarModule,
3308
+ MatTableModule,
3309
+ MatSortModule,
3310
+ MatSelectModule,
3311
+ NgxUploaderModule,
3312
+ MatProgressSpinnerModule,
3313
+ MatMenuModule,
3314
+ ImageCropperModule,
3315
+ RouterModule,
3316
+ OverlayModule,
3317
+ MatRippleModule,
3318
+ MatInputModule,
3319
+ MatRadioModule,
3320
+ MatSnackBarModule,
3321
+ MatAutocompleteModule] }); }
3322
+ }
3323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: UiModule, decorators: [{
3324
+ type: NgModule,
3325
+ args: [{
3326
+ declarations: [
3327
+ ButtonComponent,
3328
+ InputComponent,
3329
+ InputAutocompleteComponent,
3330
+ SelectComponent,
3331
+ FileComponent,
3332
+ UiFileUploaderComponent,
3333
+ ExpanderComponent,
3334
+ ForceVisibilityDirective,
3335
+ MessageBoxModalComponent,
3336
+ DialogComponent,
3337
+ CurrencyComponent,
3338
+ CheckboxComponent,
3339
+ AvatarComponent,
3340
+ SubmitButtonComponent,
3341
+ TextAreaComponent,
3342
+ DateComponent,
3343
+ TableComponent,
3344
+ BurgerComponent,
3345
+ AutocompleteComponent,
3346
+ ActionButtonComponent,
3347
+ UiBaseLayoutComponent,
3348
+ UiSimpleLayoutComponent,
3349
+ ValidationMessageComponent,
3350
+ RadioComponent,
3351
+ CheckboxGroupComponent,
3352
+ RadioGroupComponent,
3353
+ ActionIconComponent,
3354
+ EditorComponent
3355
+ ],
3356
+ exports: [
3357
+ ActionButtonComponent,
3358
+ ActionIconComponent,
3359
+ AutocompleteComponent,
3360
+ AvatarComponent,
3361
+ BurgerComponent,
3362
+ ButtonComponent,
3363
+ CheckboxComponent,
3364
+ CheckboxGroupComponent,
3365
+ CurrencyComponent,
3366
+ DateComponent,
3367
+ DialogComponent,
3368
+ ExpanderComponent,
3369
+ FileComponent,
3370
+ ForceVisibilityDirective,
3371
+ InputComponent,
3372
+ InputAutocompleteComponent,
3373
+ MessageBoxModalComponent,
3374
+ RadioComponent,
3375
+ RadioGroupComponent,
3376
+ SelectComponent,
3377
+ SubmitButtonComponent,
3378
+ TableComponent,
3379
+ TextAreaComponent,
3380
+ UiFileUploaderComponent,
3381
+ EditorComponent
3382
+ ],
3383
+ imports: [
3384
+ CommonModule,
3385
+ MatButtonModule,
3386
+ MatIconModule,
3387
+ MatDialogModule,
3388
+ MatCheckboxModule,
3389
+ MatDatepickerModule,
3390
+ MatMomentDateModule,
3391
+ DragDropModule,
3392
+ ReactiveFormsModule,
3393
+ FormsModule,
3394
+ MatTooltipModule,
3395
+ MatProgressBarModule,
3396
+ MatTableModule,
3397
+ MatSortModule,
3398
+ MatSelectModule,
3399
+ NgxUploaderModule,
3400
+ MatProgressSpinnerModule,
3401
+ MatMenuModule,
3402
+ ImageCropperModule,
3403
+ RouterModule,
3404
+ OverlayModule,
3405
+ MatRippleModule,
3406
+ MatInputModule,
3407
+ MatRadioModule,
3408
+ MatSnackBarModule,
3409
+ MatAutocompleteModule
3410
+ ],
3411
+ providers: [
3412
+ UiFileService,
3413
+ { provide: UI_TRANSLATESERVICE, useClass: UiTranslateService },
3414
+ { provide: MAT_DATE_LOCALE, useValue: 'cs-CZ' },
3415
+ { provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: { useUtc: false } },
3416
+ { provide: MAT_RADIO_DEFAULT_OPTIONS, useValue: { color: 'primary' } },
3417
+ { provide: MAT_CHECKBOX_DEFAULT_OPTIONS, useValue: { color: 'primary' } }
3418
+ ]
3419
+ }]
3420
+ }] });
3421
+
3422
+ class ToastService {
3423
+ constructor(snackService) {
3424
+ this.snackService = snackService;
3425
+ }
3426
+ open(message, options = { duration: 2500, type: 'info' }) {
3427
+ this.snackService.open(message, null, {
3428
+ duration: options.duration || 2500,
3429
+ panelClass: [options.type || 'message']
3430
+ });
3431
+ }
3432
+ 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 }); }
3433
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ToastService, providedIn: 'root' }); }
3434
+ }
3435
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.11", ngImport: i0, type: ToastService, decorators: [{
3436
+ type: Injectable,
3437
+ args: [{
3438
+ providedIn: 'root'
3439
+ }]
3440
+ }], ctorParameters: function () { return [{ type: i1$3.MatSnackBar }]; } });
3441
+
3442
+ /*
3443
+ * Public API Surface of ui
3444
+ */
3445
+ // export * from './lib/ui.service';
3446
+ // export * from './lib/ui.component';
3447
+
3448
+ /**
3449
+ * Generated bundle index. Do not edit.
3450
+ */
3451
+
3452
+ 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 };
3453
+ //# sourceMappingURL=rlucan-ui.mjs.map