@ptsecurity/mosaic 17.3.0 → 17.5.0

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 (161) hide show
  1. package/autocomplete/autocomplete-trigger.directive.d.ts +1 -0
  2. package/button/button.scss +14 -4
  3. package/checkbox/checkbox.d.ts +6 -6
  4. package/core/animation/animation.d.ts +2 -1
  5. package/core/common-behaviors/checkbox.d.ts +1 -0
  6. package/core/common-behaviors/index.d.ts +1 -0
  7. package/core/forms/index.d.ts +1 -0
  8. package/core/forms/validators.d.ts +22 -0
  9. package/core/locales/en-US.d.ts +17 -0
  10. package/core/locales/es-LA.d.ts +17 -0
  11. package/core/locales/fa-IR.d.ts +17 -0
  12. package/core/locales/index.d.ts +7 -0
  13. package/core/locales/locale-service.d.ts +175 -0
  14. package/core/locales/pt-BR.d.ts +17 -0
  15. package/core/locales/ru-RU.d.ts +17 -0
  16. package/core/locales/tk-TM.d.ts +64 -0
  17. package/core/locales/zh-CN.d.ts +17 -0
  18. package/core/pop-up/constants.d.ts +9 -0
  19. package/core/pop-up/pop-up-trigger.d.ts +28 -10
  20. package/core/pop-up/pop-up.d.ts +3 -3
  21. package/core/styles/theming/_theming.scss +1 -0
  22. package/datepicker/calendar-header.component.d.ts +11 -5
  23. package/datepicker/datepicker-input.directive.d.ts +10 -0
  24. package/dropdown/dropdown-trigger.directive.d.ts +1 -1
  25. package/ellipsis-center/ellipsis-center.directive.d.ts +3 -7
  26. package/esm2022/autocomplete/autocomplete-trigger.directive.mjs +13 -5
  27. package/esm2022/button/button.component.mjs +2 -2
  28. package/esm2022/checkbox/checkbox.mjs +5 -5
  29. package/esm2022/code-block/actionbar.component.mjs +1 -1
  30. package/esm2022/core/animation/animation.mjs +2 -1
  31. package/esm2022/core/common-behaviors/checkbox.mjs +2 -0
  32. package/esm2022/core/common-behaviors/index.mjs +2 -1
  33. package/esm2022/core/forms/index.mjs +2 -1
  34. package/esm2022/core/forms/validators.mjs +33 -0
  35. package/esm2022/core/locales/en-US.mjs +19 -2
  36. package/esm2022/core/locales/es-LA.mjs +19 -2
  37. package/esm2022/core/locales/fa-IR.mjs +19 -2
  38. package/esm2022/core/locales/index.mjs +8 -1
  39. package/esm2022/core/locales/locale-service.mjs +39 -3
  40. package/esm2022/core/locales/pt-BR.mjs +19 -2
  41. package/esm2022/core/locales/ru-RU.mjs +19 -2
  42. package/esm2022/core/locales/tk-TM.mjs +63 -0
  43. package/esm2022/core/locales/zh-CN.mjs +19 -2
  44. package/esm2022/core/pop-up/constants.mjs +6 -1
  45. package/esm2022/core/pop-up/pop-up-trigger.mjs +72 -23
  46. package/esm2022/core/pop-up/pop-up.mjs +7 -6
  47. package/esm2022/core/version.mjs +2 -2
  48. package/esm2022/datepicker/calendar-header.component.mjs +40 -10
  49. package/esm2022/datepicker/datepicker-input.directive.mjs +103 -23
  50. package/esm2022/dropdown/dropdown-trigger.directive.mjs +2 -2
  51. package/esm2022/ellipsis-center/ellipsis-center.directive.mjs +12 -23
  52. package/esm2022/file-upload/file-upload.mjs +39 -2
  53. package/esm2022/file-upload/file-upload.module.mjs +8 -1
  54. package/esm2022/file-upload/multiple-file-upload.component.mjs +159 -46
  55. package/esm2022/file-upload/single-file-upload.component.mjs +141 -41
  56. package/esm2022/form-field/form-field.mjs +6 -6
  57. package/esm2022/form-field/validate.directive.mjs +5 -2
  58. package/esm2022/input/input-number.mjs +31 -59
  59. package/esm2022/input/input-password.mjs +15 -26
  60. package/esm2022/input/input.mjs +3 -3
  61. package/esm2022/loader-overlay/loader-overlay.component.mjs +10 -8
  62. package/esm2022/modal/modal.component.mjs +3 -3
  63. package/esm2022/modal/modal.directive.mjs +38 -7
  64. package/esm2022/navbar/navbar-item.component.mjs +16 -30
  65. package/esm2022/popover/popover-confirm.component.mjs +11 -20
  66. package/esm2022/popover/popover.component.mjs +52 -29
  67. package/esm2022/progress-spinner/progress-spinner.component.mjs +2 -2
  68. package/esm2022/select/select-option.directive.mjs +7 -18
  69. package/esm2022/select/select.component.mjs +9 -6
  70. package/esm2022/sidebar/sidebar.component.mjs +10 -6
  71. package/esm2022/tabs/tab-group.component.mjs +1 -1
  72. package/esm2022/tabs/tab-header.component.mjs +2 -2
  73. package/esm2022/tabs/tab.component.mjs +3 -4
  74. package/esm2022/textarea/textarea.component.mjs +8 -4
  75. package/esm2022/timezone/timezone-option.directive.mjs +7 -18
  76. package/esm2022/title/title.directive.mjs +7 -18
  77. package/esm2022/toggle/toggle.component.mjs +103 -18
  78. package/esm2022/tooltip/tooltip.component.mjs +72 -45
  79. package/esm2022/tree-select/tree-select.component.mjs +9 -7
  80. package/fesm2022/ptsecurity-mosaic-autocomplete.mjs +12 -4
  81. package/fesm2022/ptsecurity-mosaic-autocomplete.mjs.map +1 -1
  82. package/fesm2022/ptsecurity-mosaic-button.mjs +2 -2
  83. package/fesm2022/ptsecurity-mosaic-button.mjs.map +1 -1
  84. package/fesm2022/ptsecurity-mosaic-checkbox.mjs +4 -4
  85. package/fesm2022/ptsecurity-mosaic-checkbox.mjs.map +1 -1
  86. package/fesm2022/ptsecurity-mosaic-code-block.mjs +1 -1
  87. package/fesm2022/ptsecurity-mosaic-code-block.mjs.map +1 -1
  88. package/fesm2022/ptsecurity-mosaic-core.mjs +325 -37
  89. package/fesm2022/ptsecurity-mosaic-core.mjs.map +1 -1
  90. package/fesm2022/ptsecurity-mosaic-datepicker.mjs +141 -31
  91. package/fesm2022/ptsecurity-mosaic-datepicker.mjs.map +1 -1
  92. package/fesm2022/ptsecurity-mosaic-dropdown.mjs +1 -1
  93. package/fesm2022/ptsecurity-mosaic-dropdown.mjs.map +1 -1
  94. package/fesm2022/ptsecurity-mosaic-ellipsis-center.mjs +11 -19
  95. package/fesm2022/ptsecurity-mosaic-ellipsis-center.mjs.map +1 -1
  96. package/fesm2022/ptsecurity-mosaic-file-upload.mjs +330 -80
  97. package/fesm2022/ptsecurity-mosaic-file-upload.mjs.map +1 -1
  98. package/fesm2022/ptsecurity-mosaic-form-field.mjs +9 -6
  99. package/fesm2022/ptsecurity-mosaic-form-field.mjs.map +1 -1
  100. package/fesm2022/ptsecurity-mosaic-input.mjs +39 -75
  101. package/fesm2022/ptsecurity-mosaic-input.mjs.map +1 -1
  102. package/fesm2022/ptsecurity-mosaic-loader-overlay.mjs +10 -8
  103. package/fesm2022/ptsecurity-mosaic-loader-overlay.mjs.map +1 -1
  104. package/fesm2022/ptsecurity-mosaic-modal.mjs +32 -7
  105. package/fesm2022/ptsecurity-mosaic-modal.mjs.map +1 -1
  106. package/fesm2022/ptsecurity-mosaic-navbar.mjs +14 -26
  107. package/fesm2022/ptsecurity-mosaic-navbar.mjs.map +1 -1
  108. package/fesm2022/ptsecurity-mosaic-popover.mjs +58 -40
  109. package/fesm2022/ptsecurity-mosaic-popover.mjs.map +1 -1
  110. package/fesm2022/ptsecurity-mosaic-progress-spinner.mjs +2 -2
  111. package/fesm2022/ptsecurity-mosaic-progress-spinner.mjs.map +1 -1
  112. package/fesm2022/ptsecurity-mosaic-select.mjs +25 -28
  113. package/fesm2022/ptsecurity-mosaic-select.mjs.map +1 -1
  114. package/fesm2022/ptsecurity-mosaic-sidebar.mjs +8 -4
  115. package/fesm2022/ptsecurity-mosaic-sidebar.mjs.map +1 -1
  116. package/fesm2022/ptsecurity-mosaic-tabs.mjs +5 -6
  117. package/fesm2022/ptsecurity-mosaic-tabs.mjs.map +1 -1
  118. package/fesm2022/ptsecurity-mosaic-textarea.mjs +7 -3
  119. package/fesm2022/ptsecurity-mosaic-textarea.mjs.map +1 -1
  120. package/fesm2022/ptsecurity-mosaic-timezone.mjs +10 -17
  121. package/fesm2022/ptsecurity-mosaic-timezone.mjs.map +1 -1
  122. package/fesm2022/ptsecurity-mosaic-title.mjs +6 -14
  123. package/fesm2022/ptsecurity-mosaic-title.mjs.map +1 -1
  124. package/fesm2022/ptsecurity-mosaic-toggle.mjs +102 -17
  125. package/fesm2022/ptsecurity-mosaic-toggle.mjs.map +1 -1
  126. package/fesm2022/ptsecurity-mosaic-tooltip.mjs +71 -42
  127. package/fesm2022/ptsecurity-mosaic-tooltip.mjs.map +1 -1
  128. package/fesm2022/ptsecurity-mosaic-tree-select.mjs +8 -6
  129. package/fesm2022/ptsecurity-mosaic-tree-select.mjs.map +1 -1
  130. package/file-upload/_file-upload-theme.scss +23 -13
  131. package/file-upload/file-upload.d.ts +31 -3
  132. package/file-upload/file-upload.module.d.ts +11 -10
  133. package/file-upload/file-upload.scss +8 -1
  134. package/file-upload/multiple-file-upload.component.d.ts +62 -10
  135. package/file-upload/multiple-file-upload.component.scss +0 -8
  136. package/file-upload/single-file-upload.component.d.ts +55 -11
  137. package/file-upload/single-file-upload.component.scss +0 -8
  138. package/form-field/form-field.d.ts +1 -1
  139. package/form-field/validate.directive.d.ts +5 -2
  140. package/input/input-number.d.ts +10 -11
  141. package/input/input-password.d.ts +3 -6
  142. package/input/input.d.ts +1 -1
  143. package/loader-overlay/loader-overlay.component.d.ts +4 -3
  144. package/modal/modal.directive.d.ts +4 -1
  145. package/navbar/navbar-item.component.d.ts +5 -7
  146. package/package.json +24 -27
  147. package/popover/popover-confirm.component.d.ts +3 -6
  148. package/popover/popover.component.d.ts +14 -7
  149. package/prebuilt-themes/dark-theme.css +1 -1
  150. package/prebuilt-themes/default-theme.css +1 -1
  151. package/progress-spinner/progress-spinner.scss +1 -0
  152. package/select/select-option.directive.d.ts +3 -6
  153. package/sidebar/sidebar.component.d.ts +3 -2
  154. package/tabs/tab-header.scss +2 -2
  155. package/textarea/textarea.component.d.ts +1 -0
  156. package/timezone/timezone-option.directive.d.ts +3 -6
  157. package/title/title.directive.d.ts +3 -6
  158. package/toggle/_toggle-theme.scss +7 -1
  159. package/toggle/toggle.component.d.ts +23 -6
  160. package/toggle/toggle.scss +23 -0
  161. package/tooltip/tooltip.component.d.ts +25 -13
@@ -1,28 +1,64 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, EventEmitter, Directive, Output, TemplateRef, Component, ChangeDetectionStrategy, Optional, Inject, Input, ContentChild, ViewChild, NgModule } from '@angular/core';
2
+ import { InjectionToken, inject, Renderer2, ChangeDetectorRef, DestroyRef, ElementRef, EventEmitter, Directive, Output, TemplateRef, Component, ChangeDetectionStrategy, ViewEncapsulation, Optional, Inject, Input, ContentChild, ViewChild, ContentChildren, NgModule } from '@angular/core';
3
+ import { NgControl, NgForm, FormGroupDirective, FormsModule, ReactiveFormsModule } from '@angular/forms';
4
+ import * as i8 from '@ptsecurity/mosaic/core';
5
+ import { MC_LOCALE_SERVICE, ErrorStateMatcher, ruRULocaleData, McDataSizeModule } from '@ptsecurity/mosaic/core';
6
+ import { Subject, BehaviorSubject } from 'rxjs';
3
7
  import * as i1 from '@angular/common';
4
8
  import { CommonModule } from '@angular/common';
5
9
  import * as i4$1 from '@ptsecurity/mosaic/button';
6
10
  import { McButtonModule } from '@ptsecurity/mosaic/button';
7
- import * as i9 from '@ptsecurity/mosaic/core';
8
- import { McDataSizeModule } from '@ptsecurity/mosaic/core';
9
- import * as i6 from '@ptsecurity/mosaic/ellipsis-center';
11
+ import * as i5 from '@ptsecurity/mosaic/ellipsis-center';
10
12
  import { McEllipsisCenterModule } from '@ptsecurity/mosaic/ellipsis-center';
11
- import * as i5 from '@ptsecurity/mosaic/form-field';
12
- import { McFormFieldModule } from '@ptsecurity/mosaic/form-field';
13
+ import { McHint, McFormFieldModule } from '@ptsecurity/mosaic/form-field';
13
14
  import * as i3 from '@ptsecurity/mosaic/icon';
14
15
  import { McIconModule } from '@ptsecurity/mosaic/icon';
15
- import * as i7 from '@ptsecurity/mosaic/link';
16
+ import * as i6 from '@ptsecurity/mosaic/link';
16
17
  import { McLinkModule } from '@ptsecurity/mosaic/link';
17
18
  import * as i4 from '@ptsecurity/mosaic/list';
18
19
  import { McListModule } from '@ptsecurity/mosaic/list';
19
20
  import * as i2 from '@ptsecurity/mosaic/progress-spinner';
20
21
  import { McProgressSpinnerModule } from '@ptsecurity/mosaic/progress-spinner';
21
22
  import { McToolTipModule } from '@ptsecurity/mosaic/tooltip';
22
- import { BehaviorSubject } from 'rxjs';
23
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
24
+ import { distinctUntilChanged } from 'rxjs/operators';
23
25
 
24
26
  /* Object for labels customization inside file upload component */
25
27
  const MC_FILE_UPLOAD_CONFIGURATION = new InjectionToken('McFileUploadConfiguration');
28
+ /** @docs-private */
29
+ class McFileUploadBase {
30
+ constructor() {
31
+ /** Whether the component is in an error state. */
32
+ this.errorState = false;
33
+ /**
34
+ * Emits whenever the component state changes and should cause the parent
35
+ * form-field to update. Implemented as part of `McFormFieldControl`.
36
+ * @docs-private
37
+ */
38
+ this.stateChanges = new Subject();
39
+ this.renderer = inject(Renderer2);
40
+ this.cdr = inject(ChangeDetectorRef);
41
+ this.localeService = inject(MC_LOCALE_SERVICE, { optional: true });
42
+ this.destroyRef = inject(DestroyRef);
43
+ this.ngControl = inject(NgControl, { optional: true, self: true });
44
+ this.parentForm = inject(NgForm, { optional: true });
45
+ this.parentFormGroup = inject(FormGroupDirective, { optional: true });
46
+ this.defaultErrorStateMatcher = inject(ErrorStateMatcher);
47
+ this.elementRef = inject(ElementRef);
48
+ }
49
+ /** implemented as part of base class. Decided not use mixinErrorState, not to over */
50
+ updateErrorState() {
51
+ const oldState = this.errorState;
52
+ const parent = this.parentFormGroup || this.parentForm;
53
+ const matcher = this.errorStateMatcher || this.defaultErrorStateMatcher;
54
+ const control = this.ngControl ? this.ngControl.control : null;
55
+ const newState = matcher.isErrorState(control, parent);
56
+ if (newState !== oldState) {
57
+ this.errorState = newState;
58
+ this.stateChanges.next();
59
+ }
60
+ }
61
+ }
26
62
 
27
63
  const isFolderCanBeDragged = () => 'webkitGetAsEntry' in DataTransferItem.prototype;
28
64
  const entryIsDirectory = (entry) => !!entry && entry.isDirectory;
@@ -103,67 +139,155 @@ const unwrapDirectory = async (item) => {
103
139
  };
104
140
 
105
141
  let nextMultipleFileUploadUniqueId = 0;
106
- const MC_MULTIPLE_FILE_UPLOAD_DEFAULT_CONFIGURATION = {
107
- captionText: 'Перетащите сюда или',
108
- captionTextWhenSelected: 'Перетащите еще или',
109
- captionTextForCompactSize: 'Перетащите файлы или',
110
- browseLink: 'выберите',
111
- title: 'Загрузите файлы',
112
- gridHeaders: {
113
- file: 'Файл',
114
- size: 'Размер'
142
+ const MC_MULTIPLE_FILE_UPLOAD_DEFAULT_CONFIGURATION = ruRULocaleData['ru-RU'].fileUpload.multiple;
143
+ class McMultipleFileUploadComponent extends McFileUploadBase {
144
+ get files() {
145
+ return this._files;
146
+ }
147
+ set files(currentFileList) {
148
+ this._files = currentFileList;
149
+ this.cvaOnChange(this._files);
150
+ this.cdr.markForCheck();
115
151
  }
116
- };
117
- class McMultipleFileUploadComponent {
118
152
  get acceptedFiles() {
119
153
  return this.accept && this.accept.length > 0 ? this.accept.map((ext) => `.${ext}`).join(',') : '*/*';
120
154
  }
155
+ /**
156
+ * @deprecated use `FormControl.errors`
157
+ */
121
158
  get hasErrors() {
122
159
  return this.errors && !!this.errors.length;
123
160
  }
124
- constructor(renderer, config) {
125
- this.renderer = renderer;
126
- this.config = config;
161
+ get hasHint() {
162
+ return this.hint.length > 0;
163
+ }
164
+ /**
165
+ * Indicates an invalid state based on file errors or `errorState`,
166
+ * applying a CSS class in HTML for visual feedback.
167
+ */
168
+ get invalid() {
169
+ return this.errorState;
170
+ }
171
+ constructor(configuration) {
172
+ super();
173
+ this.configuration = configuration;
127
174
  this.errors = [];
128
- this.files = [];
129
175
  this.size = 'default';
176
+ /**
177
+ * custom ID for the file input element.
178
+ */
130
179
  this.inputId = `mc-multiple-file-upload-${nextMultipleFileUploadUniqueId++}`;
180
+ this._files = [];
131
181
  this.fileQueueChanged = new EventEmitter();
132
- this.config = config || MC_MULTIPLE_FILE_UPLOAD_DEFAULT_CONFIGURATION;
133
- this.columnDefs = [
134
- { header: this.config.gridHeaders.file, cssClass: 'file' },
135
- { header: this.config.gridHeaders.size, cssClass: 'size' },
136
- { header: '', cssClass: 'action' }
137
- ];
182
+ /**
183
+ * Emits an event containing a chunk of files added to the file list.
184
+ */
185
+ this.filesAdded = new EventEmitter();
186
+ /**
187
+ * Emits an event containing a file and file's index when removed from the file list.
188
+ */
189
+ this.fileRemoved = new EventEmitter();
190
+ /** cvaOnChange function registered via registerOnChange (ControlValueAccessor). @docs-private */
191
+ // tslint:disable-next-line:no-empty
192
+ this.cvaOnChange = (_) => { };
193
+ /** onTouch function registered via registerOnTouch (ControlValueAccessor). @docs-private */
194
+ // tslint:disable-next-line:no-empty
195
+ this.onTouched = () => { };
196
+ this.updateLocaleParams = () => {
197
+ this.config = this.configuration || this.localeService?.getParams('fileUpload').multiple;
198
+ this.columnDefs = [
199
+ { header: this.config.gridHeaders.file, cssClass: 'file' },
200
+ { header: this.config.gridHeaders.size, cssClass: 'size' },
201
+ { header: '', cssClass: 'action' }
202
+ ];
203
+ this.makeCaptionText();
204
+ this.cdr.markForCheck();
205
+ };
206
+ this.localeService?.changes.pipe(takeUntilDestroyed()).subscribe(this.updateLocaleParams);
207
+ if (!this.localeService) {
208
+ this.initDefaultParams();
209
+ }
210
+ if (this.ngControl) {
211
+ // Note: we provide the value accessor through here, instead of
212
+ // the `providers` to avoid running into a circular import.
213
+ this.ngControl.valueAccessor = this;
214
+ }
215
+ }
216
+ ngAfterViewInit() {
217
+ // FormControl specific errors update
218
+ this.ngControl?.statusChanges
219
+ ?.pipe(takeUntilDestroyed(this.destroyRef))
220
+ .subscribe(() => {
221
+ this.errors = Object.values(this.ngControl?.errors || {});
222
+ this.cdr.markForCheck();
223
+ });
224
+ this.stateChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.cdr.markForCheck());
225
+ }
226
+ ngDoCheck() {
227
+ if (this.ngControl) {
228
+ // We need to re-evaluate this on every change detection cycle, because there are some
229
+ // error triggers that we can't subscribe to (e.g. parent form submissions). This means
230
+ // that whatever logic is in here has to be super lean or we risk destroying the performance.
231
+ this.updateErrorState();
232
+ }
233
+ }
234
+ /** Implemented as part of ControlValueAccessor. @docs-private */
235
+ writeValue(files) {
236
+ this.files = files instanceof FileList || !files ? this.mapToFileItem(files) : files;
237
+ this.fileQueueChanged.emit(this.files);
238
+ }
239
+ /** Implemented as part of ControlValueAccessor. @docs-private */
240
+ registerOnChange(fn) { this.cvaOnChange = fn; }
241
+ /** Implemented as part of ControlValueAccessor. @docs-private */
242
+ registerOnTouched(fn) { this.onTouched = fn; }
243
+ /**
244
+ * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
245
+ * @param isDisabled Whether the control should be disabled.
246
+ * @docs-private
247
+ */
248
+ setDisabledState(isDisabled) {
249
+ this.disabled = isDisabled;
250
+ this.cdr.markForCheck();
138
251
  }
139
252
  onFileSelectedViaClick({ target }) {
140
253
  if (this.disabled) {
141
254
  return;
142
255
  }
143
- this.files = [
144
- ...this.files,
145
- ...this.mapToFileItem(target.files)
146
- ];
256
+ const filesToAdd = this.mapToFileItem(target.files);
147
257
  /* even if the user selects the same file,
148
258
  the onchange event will be triggered every time user clicks on the control.*/
149
259
  this.renderer.setProperty(this.input.nativeElement, 'value', null);
150
- this.onFileListChange();
260
+ this.files = [
261
+ ...this.files,
262
+ ...filesToAdd
263
+ ];
264
+ this.filesAdded.emit(filesToAdd);
265
+ this.fileQueueChanged.emit(this.files);
266
+ this.onTouched();
151
267
  }
152
268
  onFileDropped(files) {
153
269
  if (this.disabled) {
154
270
  return;
155
271
  }
156
- this.files = [...this.files, ...this.mapToFileItem(files)];
157
- this.onFileListChange();
272
+ const filesToAdd = this.mapToFileItem(files);
273
+ this.files = [
274
+ ...this.files,
275
+ ...filesToAdd
276
+ ];
277
+ this.filesAdded.emit(filesToAdd);
278
+ this.fileQueueChanged.emit(this.files);
279
+ this.onTouched();
158
280
  }
159
281
  deleteFile(index, event) {
160
282
  if (this.disabled) {
161
283
  return;
162
284
  }
163
285
  event?.stopPropagation();
164
- this.files.splice(index, 1);
286
+ const removedFile = this.files.splice(index, 1)[0];
165
287
  this.files = [...this.files];
166
- this.onFileListChange();
288
+ this.fileRemoved.emit([removedFile, index]);
289
+ this.fileQueueChanged.emit(this.files);
290
+ this.onTouched();
167
291
  }
168
292
  onFileListChange() {
169
293
  this.fileQueueChanged.emit(this.files);
@@ -198,15 +322,29 @@ class McMultipleFileUploadComponent {
198
322
  const fileExt = file.name.split('.').pop() || '';
199
323
  return this.acceptedFiles !== '*/*' && this.acceptedFiles.length > 0 ? this.acceptedFiles.includes(fileExt) : true;
200
324
  }
201
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: McMultipleFileUploadComponent, deps: [{ token: i0.Renderer2 }, { token: MC_FILE_UPLOAD_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
202
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: McMultipleFileUploadComponent, selector: "mc-multiple-file-upload", inputs: { accept: "accept", disabled: "disabled", errors: "errors", files: "files", size: "size", inputId: "inputId", customValidation: "customValidation" }, outputs: { fileQueueChanged: "fileQueueChanged" }, host: { classAttribute: "mc-multiple-file-upload" }, queries: [{ propertyName: "customFileIcon", first: true, predicate: ["mcFileIcon"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.selected]=\"files && files.length\"\n [ngClass]=\"size\"\n (filesDropped)=\"onFileDropped($event)\"\n>\n <ng-container *ngIf=\"!files.length; else fileOutput\">\n <div class=\"dropzone\">\n <ng-container *ngIf=\"size === 'default' else compactCaption\">\n <i mc-icon=\"mc-upload-to-cloud_64\"></i>\n <div class=\"dropzone__text\">\n <span class=\"multiple__header\">{{ config.title }}</span>\n <div>\n <span class=\"multiple__caption\">\n {{ config.captionText }}\n <label mc-link pseudo [tabIndex]=\"-1\" [for]=\"inputId\" [disabled]=\"disabled\">\n {{ config.browseLink }}\n <ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container>\n </label>\n </span>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</div>\n\n<div class=\"mc-file-upload__info-section\">\n <mc-hint class=\"mc-file-upload__hint\">\n <ng-content select=\"[hint]\"></ng-content>\n </mc-hint>\n\n <ng-container *ngIf=\"hasErrors\">\n <mc-hint class=\"mc-file-upload__hint mc-error\"\n *ngFor=\"let error of errors\">\n {{ error }}\n </mc-hint>\n </ng-container>\n</div>\n\n<ng-template #fileOutput>\n <div class=\"file-upload__dropzone\">\n <div class=\"mc-file-upload__grid\">\n <div class=\"mc-file-multiple-uploaded__header\">\n <div class=\"mc-file-multiple-uploaded__header-inner\">\n <div [class]=\"'mc-file-upload__' + column.cssClass\" *ngFor=\"let column of columnDefs\">\n {{ column.header }}\n </div>\n </div>\n </div>\n\n <mc-list-selection [autoSelect]=\"false\" [disabled]=\"disabled\">\n <mc-list-option\n class=\"multiple__uploaded-item\"\n [value]=\"file.file.name\"\n (keydown.delete)=\"deleteFile(index)\"\n (keydown.backspace)=\"deleteFile(index)\"\n *ngFor=\"let file of files; let index = index;\">\n <div class=\"mc-file-upload__row\" [class.error]=\"file.hasError\">\n <div class=\"mc-file-upload__file\">\n <ng-container *ngIf=\"{ loading: file.loading | async, progress: file.progress | async } as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\"\n [ngTemplateOutlet]=\"$any(customFileIcon)\"\n [ngTemplateOutletContext]=\"{ $implicit: file }\"\n >\n </ng-container>\n\n <mc-progress-spinner\n class=\"pt-nat-file-upload-name-cell__icon\"\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <span class=\"file-item__text\" [mcEllipsisCenter]=\"file.file.name\" [minVisibleLength]=\"10\"></span>\n </div>\n <div class=\"mc-file-upload__size\">\n {{ file.file.size | mcDataSize }}\n </div>\n <div class=\"mc-file-upload__action\">\n <i mc-icon=\"mc-close-circle_16\" (click)=\"deleteFile(index, $event)\"></i>\n </div>\n </div>\n </mc-list-option>\n </mc-list-selection>\n </div>\n\n <div class=\"btn-upload\">\n <div class=\"dropzone\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ config.captionTextWhenSelected }}\n <label mc-link pseudo [tabIndex]=\"-1\" [for]=\"inputId\" [disabled]=\"disabled\">\n {{ config.browseLink }}\n <ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container>\n </label>\n </span>\n </div>\n </div>\n </div>\n</ng-template>\n\n<ng-template #compactCaption>\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ config.captionText }}\n <label mc-link pseudo [tabIndex]=\"-1\" [for]=\"inputId\" [disabled]=\"disabled\">\n {{ config.browseLink }}\n <ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container>\n </label>\n </span>\n</ng-template>\n\n<ng-template #inputTemplate>\n <input #input\n type=\"file\"\n class=\"cdk-visually-hidden\"\n multiple\n [id]=\"inputId\"\n [accept]=\"acceptedFiles\"\n [disabled]=\"disabled\"\n (change)=\"onFileSelectedViaClick($event)\">\n</ng-template>\n", styles: [".mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mc-file-upload{border-radius:var(--mc-file-upload-size-multiple-border-radius, 4px);border-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-style:var(--mc-file-upload-size-multiple-border-style, dashed)}.mc-file-upload .mc-list-option{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px);height:36px}.mc-file-upload .mc-list-option .mc-icon{margin-right:0}.mc-file-upload .mc-file-upload__grid{min-height:142px}.mc-file-upload .mc-file-multiple-uploaded__header-inner,.mc-file-upload .mc-file-upload__row{display:flex;align-items:center}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__file{width:65%;max-width:65%}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__size{width:var(--mc-size-7xl, 64px);min-width:var(--mc-size-7xl, 64px);text-align:left;flex-grow:1}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__action{padding-left:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px);padding-right:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px)}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__file{display:flex;align-items:center}.mc-file-upload .mc-file-upload__row .mc-file-upload__file .file-item__text{margin-left:0;width:90%}.mc-file-upload .mc-file-multiple-uploaded__header{border-bottom-width:1px;border-bottom-style:solid}.mc-file-upload .mc-file-multiple-uploaded__header-inner{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px);border:2px solid transparent;border-bottom:unset;box-sizing:border-box;height:var(--mc-size-3xl, 32px)}.mc-file-upload .btn-upload .dropzone{margin:0;border-top-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-top-style:var(--mc-file-upload-size-multiple-border-style, dashed);padding:3px var(--mc-size-m, 12px) var(--mc-size-xxs, 4px) var(--mc-size-m, 12px)}.mc-file-upload.compact:not(.selected){height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:var(--mc-size-m, 12px)}.mc-file-upload.compact .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload.default{min-height:176px;justify-content:center}.mc-file-upload.default .dropzone .dropzone__text{margin-left:var(--mc-size-l, 16px)}.mc-file-upload.default .btn-upload .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload .file-upload__dropzone{width:100%;height:100%}.mc-hint{display:block}.mc-file-upload__hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.McProgressSpinner, selector: "mc-progress-spinner", inputs: ["color", "id", "value", "mode", "size"] }, { kind: "component", type: i3.McIcon, selector: "[mc-icon]", inputs: ["color"] }, { kind: "directive", type: i3.McIconCSSStyler, selector: "[mc-icon]" }, { kind: "component", type: i4.McListSelection, selector: "mc-list-selection", inputs: ["disabled", "autoSelect", "noUnselectLast", "horizontal", "tabIndex", "compareWith"], outputs: ["onSelectAll", "onCopy", "selectionChange"], exportAs: ["mcListSelection"] }, { kind: "component", type: i4.McListOption, selector: "mc-list-option", inputs: ["checkboxPosition", "value", "disabled", "showCheckbox", "selected"], exportAs: ["mcListOption"] }, { kind: "directive", type: i5.McHint, selector: "mc-hint", inputs: ["color", "id"] }, { kind: "directive", type: i6.McEllipsisCenterDirective, selector: "[mcEllipsisCenter]", inputs: ["mcEllipsisCenter", "minVisibleLength"] }, { kind: "directive", type: i7.McLink, selector: "[mc-link]", inputs: ["tabIndex", "disabled", "pseudo", "noUnderline", "caption", "useVisited", "print"], exportAs: ["mcLink"] }, { kind: "directive", type: McFileDropDirective, selector: "[mcFileDrop]", outputs: ["filesDropped"], exportAs: ["mcFileDrop"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i9.McDataSizePipe, name: "mcDataSize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
325
+ initDefaultParams() {
326
+ this.config = MC_MULTIPLE_FILE_UPLOAD_DEFAULT_CONFIGURATION;
327
+ this.columnDefs = [
328
+ { header: this.config.gridHeaders.file, cssClass: 'file' },
329
+ { header: this.config.gridHeaders.size, cssClass: 'size' },
330
+ { header: '', cssClass: 'action' }
331
+ ];
332
+ this.makeCaptionText();
333
+ }
334
+ makeCaptionText() {
335
+ this.separatedCaptionText = this.config.captionText.split('{{ browseLink }}');
336
+ this.separatedCaptionTextWhenSelected = this.config.captionTextWhenSelected.split('{{ browseLink }}');
337
+ this.separatedCaptionTextForCompactSize = this.config.captionTextForCompactSize.split('{{ browseLink }}');
338
+ }
339
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: McMultipleFileUploadComponent, deps: [{ token: MC_FILE_UPLOAD_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
340
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: McMultipleFileUploadComponent, selector: "mc-multiple-file-upload", inputs: { accept: "accept", disabled: "disabled", errors: "errors", size: "size", inputId: "inputId", customValidation: "customValidation", errorStateMatcher: "errorStateMatcher", files: "files" }, outputs: { fileQueueChanged: "fileQueueChanged", filesAdded: "filesAdded", fileRemoved: "fileRemoved" }, host: { classAttribute: "mc-multiple-file-upload" }, queries: [{ propertyName: "customFileIcon", first: true, predicate: ["mcFileIcon"], descendants: true, read: TemplateRef }, { propertyName: "hint", predicate: McHint }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.mc-error]=\"errorState\"\n [class.selected]=\"files && files.length\"\n [ngClass]=\"size\"\n (filesDropped)=\"onFileDropped($event)\"\n>\n <ng-container *ngIf=\"!files.length; else fileOutput\">\n <div class=\"dropzone\">\n <ng-container *ngIf=\"size === 'default' else compactCaption\">\n <i mc-icon=\"mc-upload-to-cloud_64\"></i>\n <div class=\"dropzone__text\">\n <span class=\"multiple__header\">{{ config.title }}</span>\n <div>\n <span class=\"multiple__caption\">\n {{ separatedCaptionText[0] }}<label mc-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">{{ config.browseLink }}<ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container></label>{{ separatedCaptionText[1] }}\n </span>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</div>\n\n<ng-container *ngIf=\"hasHint\">\n <div class=\"mc-file-upload__hint\">\n <ng-content select=\"mc-hint,[hint]\" />\n </div>\n</ng-container>\n\n<ng-template #fileOutput>\n <div class=\"file-upload__dropzone\">\n <div class=\"mc-file-upload__grid\">\n <div class=\"mc-file-multiple-uploaded__header\">\n <div class=\"mc-file-multiple-uploaded__header-inner\">\n <div [class]=\"'mc-file-upload__' + column.cssClass\" *ngFor=\"let column of columnDefs\">\n {{ column.header }}\n </div>\n </div>\n </div>\n\n <mc-list-selection [autoSelect]=\"false\" [disabled]=\"disabled\">\n <mc-list-option\n class=\"multiple__uploaded-item\"\n [value]=\"file.file.name\"\n (keydown.delete)=\"deleteFile(index)\"\n (keydown.backspace)=\"deleteFile(index)\"\n *ngFor=\"let file of files; let index = index;\">\n <div class=\"mc-file-upload__row\" [class.error]=\"file.hasError\">\n <div class=\"mc-file-upload__file\">\n <ng-container *ngIf=\"{ loading: file.loading | async, progress: file.progress | async } as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\"\n [ngTemplateOutlet]=\"$any(customFileIcon)\"\n [ngTemplateOutletContext]=\"{ $implicit: file }\"\n >\n </ng-container>\n\n <mc-progress-spinner\n class=\"pt-nat-file-upload-name-cell__icon\"\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <span class=\"file-item__text\" [mcEllipsisCenter]=\"file.file.name\" [minVisibleLength]=\"10\"></span>\n </div>\n <div class=\"mc-file-upload__size\">\n {{ file.file.size | mcDataSize }}\n </div>\n <div class=\"mc-file-upload__action\">\n <i mc-icon=\"mc-close-circle_16\" (click)=\"deleteFile(index, $event)\"></i>\n </div>\n </div>\n </mc-list-option>\n </mc-list-selection>\n </div>\n\n <div class=\"btn-upload\">\n <div class=\"dropzone\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ separatedCaptionTextWhenSelected[0] }}<label mc-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">{{ config.browseLink }}<ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container></label>{{ separatedCaptionTextWhenSelected[1] }}\n </span>\n </div>\n </div>\n </div>\n</ng-template>\n\n<ng-template #compactCaption>\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ separatedCaptionTextForCompactSize[0] }}<label mc-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">{{ config.browseLink }}<ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container></label>{{ separatedCaptionTextForCompactSize[1] }}\n </span>\n</ng-template>\n\n<ng-template #inputTemplate>\n <input #input\n type=\"file\"\n class=\"cdk-visually-hidden\"\n multiple\n [id]=\"inputId\"\n [accept]=\"acceptedFiles\"\n [disabled]=\"disabled\"\n (change)=\"onFileSelectedViaClick($event)\">\n</ng-template>\n", styles: [".mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}.mc-file-upload__hint>.mc-hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mc-file-upload{border-radius:var(--mc-file-upload-size-multiple-border-radius, 4px);border-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-style:var(--mc-file-upload-size-multiple-border-style, dashed)}.mc-file-upload .mc-list-option{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px);height:36px}.mc-file-upload .mc-list-option .mc-icon{margin-right:0}.mc-file-upload .mc-file-upload__grid{min-height:142px}.mc-file-upload .mc-file-multiple-uploaded__header-inner,.mc-file-upload .mc-file-upload__row{display:flex;align-items:center}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__file{width:65%;max-width:65%}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__size{width:var(--mc-size-7xl, 64px);min-width:var(--mc-size-7xl, 64px);text-align:left;flex-grow:1}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__action{padding-left:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px);padding-right:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px)}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__file{display:flex;align-items:center}.mc-file-upload .mc-file-upload__row .mc-file-upload__file .file-item__text{margin-left:0;width:90%}.mc-file-upload .mc-file-multiple-uploaded__header{border-bottom-width:1px;border-bottom-style:solid}.mc-file-upload .mc-file-multiple-uploaded__header-inner{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px);border:2px solid transparent;border-bottom:unset;box-sizing:border-box;height:var(--mc-size-3xl, 32px)}.mc-file-upload .btn-upload .dropzone{margin:0;border-top-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-top-style:var(--mc-file-upload-size-multiple-border-style, dashed);padding:3px var(--mc-size-m, 12px) var(--mc-size-xxs, 4px) var(--mc-size-m, 12px)}.mc-file-upload.compact:not(.selected){height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:var(--mc-size-m, 12px)}.mc-file-upload.compact .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload.default{min-height:176px;justify-content:center}.mc-file-upload.default .dropzone .dropzone__text{margin-left:var(--mc-size-l, 16px)}.mc-file-upload.default .btn-upload .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload .file-upload__dropzone{width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.McProgressSpinner, selector: "mc-progress-spinner", inputs: ["color", "id", "value", "mode", "size"] }, { kind: "component", type: i3.McIcon, selector: "[mc-icon]", inputs: ["color"] }, { kind: "directive", type: i3.McIconCSSStyler, selector: "[mc-icon]" }, { kind: "component", type: i4.McListSelection, selector: "mc-list-selection", inputs: ["disabled", "autoSelect", "noUnselectLast", "horizontal", "tabIndex", "compareWith"], outputs: ["onSelectAll", "onCopy", "selectionChange"], exportAs: ["mcListSelection"] }, { kind: "component", type: i4.McListOption, selector: "mc-list-option", inputs: ["checkboxPosition", "value", "disabled", "showCheckbox", "selected"], exportAs: ["mcListOption"] }, { kind: "directive", type: i5.McEllipsisCenterDirective, selector: "[mcEllipsisCenter]", inputs: ["mcEllipsisCenter", "minVisibleLength"] }, { kind: "directive", type: i6.McLink, selector: "[mc-link]", inputs: ["tabIndex", "disabled", "pseudo", "noUnderline", "caption", "useVisited", "print"], exportAs: ["mcLink"] }, { kind: "directive", type: McFileDropDirective, selector: "[mcFileDrop]", outputs: ["filesDropped"], exportAs: ["mcFileDrop"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.McDataSizePipe, name: "mcDataSize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
203
341
  }
204
342
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: McMultipleFileUploadComponent, decorators: [{
205
343
  type: Component,
206
- args: [{ selector: 'mc-multiple-file-upload', changeDetection: ChangeDetectionStrategy.OnPush, host: {
344
+ args: [{ selector: 'mc-multiple-file-upload', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
207
345
  class: 'mc-multiple-file-upload'
208
- }, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.selected]=\"files && files.length\"\n [ngClass]=\"size\"\n (filesDropped)=\"onFileDropped($event)\"\n>\n <ng-container *ngIf=\"!files.length; else fileOutput\">\n <div class=\"dropzone\">\n <ng-container *ngIf=\"size === 'default' else compactCaption\">\n <i mc-icon=\"mc-upload-to-cloud_64\"></i>\n <div class=\"dropzone__text\">\n <span class=\"multiple__header\">{{ config.title }}</span>\n <div>\n <span class=\"multiple__caption\">\n {{ config.captionText }}\n <label mc-link pseudo [tabIndex]=\"-1\" [for]=\"inputId\" [disabled]=\"disabled\">\n {{ config.browseLink }}\n <ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container>\n </label>\n </span>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</div>\n\n<div class=\"mc-file-upload__info-section\">\n <mc-hint class=\"mc-file-upload__hint\">\n <ng-content select=\"[hint]\"></ng-content>\n </mc-hint>\n\n <ng-container *ngIf=\"hasErrors\">\n <mc-hint class=\"mc-file-upload__hint mc-error\"\n *ngFor=\"let error of errors\">\n {{ error }}\n </mc-hint>\n </ng-container>\n</div>\n\n<ng-template #fileOutput>\n <div class=\"file-upload__dropzone\">\n <div class=\"mc-file-upload__grid\">\n <div class=\"mc-file-multiple-uploaded__header\">\n <div class=\"mc-file-multiple-uploaded__header-inner\">\n <div [class]=\"'mc-file-upload__' + column.cssClass\" *ngFor=\"let column of columnDefs\">\n {{ column.header }}\n </div>\n </div>\n </div>\n\n <mc-list-selection [autoSelect]=\"false\" [disabled]=\"disabled\">\n <mc-list-option\n class=\"multiple__uploaded-item\"\n [value]=\"file.file.name\"\n (keydown.delete)=\"deleteFile(index)\"\n (keydown.backspace)=\"deleteFile(index)\"\n *ngFor=\"let file of files; let index = index;\">\n <div class=\"mc-file-upload__row\" [class.error]=\"file.hasError\">\n <div class=\"mc-file-upload__file\">\n <ng-container *ngIf=\"{ loading: file.loading | async, progress: file.progress | async } as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\"\n [ngTemplateOutlet]=\"$any(customFileIcon)\"\n [ngTemplateOutletContext]=\"{ $implicit: file }\"\n >\n </ng-container>\n\n <mc-progress-spinner\n class=\"pt-nat-file-upload-name-cell__icon\"\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <span class=\"file-item__text\" [mcEllipsisCenter]=\"file.file.name\" [minVisibleLength]=\"10\"></span>\n </div>\n <div class=\"mc-file-upload__size\">\n {{ file.file.size | mcDataSize }}\n </div>\n <div class=\"mc-file-upload__action\">\n <i mc-icon=\"mc-close-circle_16\" (click)=\"deleteFile(index, $event)\"></i>\n </div>\n </div>\n </mc-list-option>\n </mc-list-selection>\n </div>\n\n <div class=\"btn-upload\">\n <div class=\"dropzone\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ config.captionTextWhenSelected }}\n <label mc-link pseudo [tabIndex]=\"-1\" [for]=\"inputId\" [disabled]=\"disabled\">\n {{ config.browseLink }}\n <ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container>\n </label>\n </span>\n </div>\n </div>\n </div>\n</ng-template>\n\n<ng-template #compactCaption>\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ config.captionText }}\n <label mc-link pseudo [tabIndex]=\"-1\" [for]=\"inputId\" [disabled]=\"disabled\">\n {{ config.browseLink }}\n <ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container>\n </label>\n </span>\n</ng-template>\n\n<ng-template #inputTemplate>\n <input #input\n type=\"file\"\n class=\"cdk-visually-hidden\"\n multiple\n [id]=\"inputId\"\n [accept]=\"acceptedFiles\"\n [disabled]=\"disabled\"\n (change)=\"onFileSelectedViaClick($event)\">\n</ng-template>\n", styles: [".mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mc-file-upload{border-radius:var(--mc-file-upload-size-multiple-border-radius, 4px);border-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-style:var(--mc-file-upload-size-multiple-border-style, dashed)}.mc-file-upload .mc-list-option{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px);height:36px}.mc-file-upload .mc-list-option .mc-icon{margin-right:0}.mc-file-upload .mc-file-upload__grid{min-height:142px}.mc-file-upload .mc-file-multiple-uploaded__header-inner,.mc-file-upload .mc-file-upload__row{display:flex;align-items:center}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__file{width:65%;max-width:65%}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__size{width:var(--mc-size-7xl, 64px);min-width:var(--mc-size-7xl, 64px);text-align:left;flex-grow:1}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__action{padding-left:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px);padding-right:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px)}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__file{display:flex;align-items:center}.mc-file-upload .mc-file-upload__row .mc-file-upload__file .file-item__text{margin-left:0;width:90%}.mc-file-upload .mc-file-multiple-uploaded__header{border-bottom-width:1px;border-bottom-style:solid}.mc-file-upload .mc-file-multiple-uploaded__header-inner{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px);border:2px solid transparent;border-bottom:unset;box-sizing:border-box;height:var(--mc-size-3xl, 32px)}.mc-file-upload .btn-upload .dropzone{margin:0;border-top-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-top-style:var(--mc-file-upload-size-multiple-border-style, dashed);padding:3px var(--mc-size-m, 12px) var(--mc-size-xxs, 4px) var(--mc-size-m, 12px)}.mc-file-upload.compact:not(.selected){height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:var(--mc-size-m, 12px)}.mc-file-upload.compact .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload.default{min-height:176px;justify-content:center}.mc-file-upload.default .dropzone .dropzone__text{margin-left:var(--mc-size-l, 16px)}.mc-file-upload.default .btn-upload .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload .file-upload__dropzone{width:100%;height:100%}.mc-hint{display:block}.mc-file-upload__hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n"] }]
209
- }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: undefined, decorators: [{
346
+ }, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.mc-error]=\"errorState\"\n [class.selected]=\"files && files.length\"\n [ngClass]=\"size\"\n (filesDropped)=\"onFileDropped($event)\"\n>\n <ng-container *ngIf=\"!files.length; else fileOutput\">\n <div class=\"dropzone\">\n <ng-container *ngIf=\"size === 'default' else compactCaption\">\n <i mc-icon=\"mc-upload-to-cloud_64\"></i>\n <div class=\"dropzone__text\">\n <span class=\"multiple__header\">{{ config.title }}</span>\n <div>\n <span class=\"multiple__caption\">\n {{ separatedCaptionText[0] }}<label mc-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">{{ config.browseLink }}<ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container></label>{{ separatedCaptionText[1] }}\n </span>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n</div>\n\n<ng-container *ngIf=\"hasHint\">\n <div class=\"mc-file-upload__hint\">\n <ng-content select=\"mc-hint,[hint]\" />\n </div>\n</ng-container>\n\n<ng-template #fileOutput>\n <div class=\"file-upload__dropzone\">\n <div class=\"mc-file-upload__grid\">\n <div class=\"mc-file-multiple-uploaded__header\">\n <div class=\"mc-file-multiple-uploaded__header-inner\">\n <div [class]=\"'mc-file-upload__' + column.cssClass\" *ngFor=\"let column of columnDefs\">\n {{ column.header }}\n </div>\n </div>\n </div>\n\n <mc-list-selection [autoSelect]=\"false\" [disabled]=\"disabled\">\n <mc-list-option\n class=\"multiple__uploaded-item\"\n [value]=\"file.file.name\"\n (keydown.delete)=\"deleteFile(index)\"\n (keydown.backspace)=\"deleteFile(index)\"\n *ngFor=\"let file of files; let index = index;\">\n <div class=\"mc-file-upload__row\" [class.error]=\"file.hasError\">\n <div class=\"mc-file-upload__file\">\n <ng-container *ngIf=\"{ loading: file.loading | async, progress: file.progress | async } as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\"\n [ngTemplateOutlet]=\"$any(customFileIcon)\"\n [ngTemplateOutletContext]=\"{ $implicit: file }\"\n >\n </ng-container>\n\n <mc-progress-spinner\n class=\"pt-nat-file-upload-name-cell__icon\"\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <span class=\"file-item__text\" [mcEllipsisCenter]=\"file.file.name\" [minVisibleLength]=\"10\"></span>\n </div>\n <div class=\"mc-file-upload__size\">\n {{ file.file.size | mcDataSize }}\n </div>\n <div class=\"mc-file-upload__action\">\n <i mc-icon=\"mc-close-circle_16\" (click)=\"deleteFile(index, $event)\"></i>\n </div>\n </div>\n </mc-list-option>\n </mc-list-selection>\n </div>\n\n <div class=\"btn-upload\">\n <div class=\"dropzone\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ separatedCaptionTextWhenSelected[0] }}<label mc-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">{{ config.browseLink }}<ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container></label>{{ separatedCaptionTextWhenSelected[1] }}\n </span>\n </div>\n </div>\n </div>\n</ng-template>\n\n<ng-template #compactCaption>\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ separatedCaptionTextForCompactSize[0] }}<label mc-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">{{ config.browseLink }}<ng-container *ngTemplateOutlet=\"inputTemplate\"></ng-container></label>{{ separatedCaptionTextForCompactSize[1] }}\n </span>\n</ng-template>\n\n<ng-template #inputTemplate>\n <input #input\n type=\"file\"\n class=\"cdk-visually-hidden\"\n multiple\n [id]=\"inputId\"\n [accept]=\"acceptedFiles\"\n [disabled]=\"disabled\"\n (change)=\"onFileSelectedViaClick($event)\">\n</ng-template>\n", styles: [".mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}.mc-file-upload__hint>.mc-hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mc-file-upload{border-radius:var(--mc-file-upload-size-multiple-border-radius, 4px);border-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-style:var(--mc-file-upload-size-multiple-border-style, dashed)}.mc-file-upload .mc-list-option{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px);height:36px}.mc-file-upload .mc-list-option .mc-icon{margin-right:0}.mc-file-upload .mc-file-upload__grid{min-height:142px}.mc-file-upload .mc-file-multiple-uploaded__header-inner,.mc-file-upload .mc-file-upload__row{display:flex;align-items:center}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__file{width:65%;max-width:65%}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__size{width:var(--mc-size-7xl, 64px);min-width:var(--mc-size-7xl, 64px);text-align:left;flex-grow:1}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__action{padding-left:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px);padding-right:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px)}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__file{display:flex;align-items:center}.mc-file-upload .mc-file-upload__row .mc-file-upload__file .file-item__text{margin-left:0;width:90%}.mc-file-upload .mc-file-multiple-uploaded__header{border-bottom-width:1px;border-bottom-style:solid}.mc-file-upload .mc-file-multiple-uploaded__header-inner{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px);border:2px solid transparent;border-bottom:unset;box-sizing:border-box;height:var(--mc-size-3xl, 32px)}.mc-file-upload .btn-upload .dropzone{margin:0;border-top-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-top-style:var(--mc-file-upload-size-multiple-border-style, dashed);padding:3px var(--mc-size-m, 12px) var(--mc-size-xxs, 4px) var(--mc-size-m, 12px)}.mc-file-upload.compact:not(.selected){height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:var(--mc-size-m, 12px)}.mc-file-upload.compact .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload.default{min-height:176px;justify-content:center}.mc-file-upload.default .dropzone .dropzone__text{margin-left:var(--mc-size-l, 16px)}.mc-file-upload.default .btn-upload .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload .file-upload__dropzone{width:100%;height:100%}\n"] }]
347
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
210
348
  type: Optional
211
349
  }, {
212
350
  type: Inject,
@@ -217,74 +355,167 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
217
355
  type: Input
218
356
  }], errors: [{
219
357
  type: Input
220
- }], files: [{
221
- type: Input
222
358
  }], size: [{
223
359
  type: Input
224
360
  }], inputId: [{
225
361
  type: Input
226
362
  }], customValidation: [{
227
363
  type: Input
364
+ }], errorStateMatcher: [{
365
+ type: Input
366
+ }], files: [{
367
+ type: Input
228
368
  }], fileQueueChanged: [{
229
369
  type: Output
370
+ }], filesAdded: [{
371
+ type: Output
372
+ }], fileRemoved: [{
373
+ type: Output
230
374
  }], customFileIcon: [{
231
375
  type: ContentChild,
232
376
  args: ['mcFileIcon', { static: false, read: TemplateRef }]
233
377
  }], input: [{
234
378
  type: ViewChild,
235
379
  args: ['input']
380
+ }], hint: [{
381
+ type: ContentChildren,
382
+ args: [McHint]
236
383
  }] } });
237
384
 
238
385
  let nextSingleFileUploadUniqueId = 0;
239
- const MC_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION = {
240
- captionText: 'Перетащите файл или',
241
- browseLink: 'выберите'
242
- };
243
- class McSingleFileUploadComponent {
386
+ const MC_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION = ruRULocaleData['ru-RU'].fileUpload.single;
387
+ class McSingleFileUploadComponent extends McFileUploadBase {
388
+ get file() {
389
+ return this._file;
390
+ }
391
+ set file(currentFile) {
392
+ this._file = currentFile;
393
+ this.cvaOnChange(this._file);
394
+ this.cdr.markForCheck();
395
+ }
244
396
  get acceptedFiles() {
245
397
  return this.accept && this.accept.length > 0 ? this.accept.map((ext) => `.${ext}`).join(',') : '*/*';
246
398
  }
247
- constructor(renderer, config) {
248
- this.renderer = renderer;
249
- this.config = config;
399
+ get hasHint() {
400
+ return this.hint.length > 0;
401
+ }
402
+ /**
403
+ * Indicates an invalid state based on `errorState`,
404
+ * applying a CSS class in HTML for visual feedback.
405
+ */
406
+ get invalid() {
407
+ return !!this.file?.hasError || this.errorState;
408
+ }
409
+ constructor(configuration) {
410
+ super();
411
+ this.configuration = configuration;
412
+ this._file = null;
250
413
  this.disabled = false;
414
+ /**
415
+ * @deprecated use `FormControl.errors`
416
+ */
251
417
  this.errors = [];
252
- this.files = [];
253
418
  this.inputId = `mc-single-file-upload-${nextSingleFileUploadUniqueId++}`;
254
419
  this.fileQueueChanged = new EventEmitter();
255
- this.config = config || MC_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION;
420
+ /** cvaOnChange function registered via registerOnChange (ControlValueAccessor).
421
+ * @docs-private
422
+ */
423
+ // tslint:disable-next-line:no-empty
424
+ this.cvaOnChange = (_) => { };
425
+ /** onTouch function registered via registerOnTouch (ControlValueAccessor).
426
+ * @docs-private
427
+ */
428
+ // tslint:disable-next-line:no-empty
429
+ this.onTouched = () => { };
430
+ this.updateLocaleParams = () => {
431
+ this.config = this.configuration || this.localeService?.getParams('fileUpload').multiple;
432
+ this.makeCaptionText();
433
+ this.cdr.markForCheck();
434
+ };
435
+ this.localeService?.changes.pipe(takeUntilDestroyed())
436
+ .subscribe(this.updateLocaleParams);
437
+ if (!this.localeService) {
438
+ this.initDefaultParams();
439
+ }
440
+ if (this.ngControl) {
441
+ // Note: we provide the value accessor through here, instead of
442
+ // the `providers` to avoid running into a circular import.
443
+ this.ngControl.valueAccessor = this;
444
+ }
445
+ }
446
+ ngAfterViewInit() {
447
+ // FormControl specific errors update
448
+ this.ngControl?.statusChanges?.pipe(distinctUntilChanged(), takeUntilDestroyed(this.destroyRef))
449
+ .subscribe((status) => {
450
+ if (this._file) {
451
+ this._file.hasError = status === 'INVALID';
452
+ }
453
+ this.errors = Object.values(this.ngControl?.errors || {});
454
+ this.cdr.markForCheck();
455
+ });
456
+ this.stateChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.cdr.markForCheck());
457
+ }
458
+ ngDoCheck() {
459
+ if (this.ngControl) {
460
+ // We need to re-evaluate this on every change detection cycle, because there are some
461
+ // error triggers that we can't subscribe to (e.g. parent form submissions). This means
462
+ // that whatever logic is in here has to be super lean or we risk destroying the performance.
463
+ this.updateErrorState();
464
+ }
465
+ }
466
+ /** Implemented as part of ControlValueAccessor. @docs-private */
467
+ writeValue(file) {
468
+ this.file = file instanceof File ? this.mapToFileItem(file) : file;
469
+ this.fileQueueChanged.emit(this._file);
470
+ }
471
+ /** Implemented as part of ControlValueAccessor. @docs-private */
472
+ registerOnChange(fn) { this.cvaOnChange = fn; }
473
+ /** Implemented as part of ControlValueAccessor. @docs-private */
474
+ registerOnTouched(fn) { this.onTouched = fn; }
475
+ /**
476
+ * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
477
+ * @param isDisabled Whether the control should be disabled.
478
+ * @docs-private
479
+ */
480
+ setDisabledState(isDisabled) {
481
+ this.disabled = isDisabled;
482
+ this.cdr.markForCheck();
256
483
  }
257
484
  onFileSelectedViaClick({ target }) {
258
485
  if (this.disabled) {
259
486
  return;
260
487
  }
261
- const files = target.files;
262
- if (files?.length) {
263
- this.files = [this.mapToFileItem(files[0])];
264
- this.fileQueueChanged.emit(this.files[0]);
265
- }
266
488
  /* even if the user selects the same file,
267
489
  the onchange event will be triggered every time user clicks on the control.*/
268
490
  this.renderer.setProperty(this.input.nativeElement, 'value', null);
491
+ const files = target.files;
492
+ if (files?.length) {
493
+ this.file = this.mapToFileItem(files[0]);
494
+ this.fileQueueChanged.emit(this._file);
495
+ }
496
+ this.onTouched();
269
497
  }
270
498
  deleteItem(event) {
271
499
  if (this.disabled) {
272
500
  return;
273
501
  }
274
502
  event?.stopPropagation();
275
- this.files = [];
503
+ this.file = null;
504
+ this.fileQueueChanged.emit(this.file);
276
505
  this.errors = [];
277
- this.fileQueueChanged.emit(null);
506
+ // mark as touched after file drop even if file wasn't correct
507
+ this.onTouched();
278
508
  }
279
509
  onFileDropped(files) {
280
510
  if (this.disabled) {
281
511
  return;
282
512
  }
283
- if (this.isCorrectExtension(files[0])) {
284
- this.files = Array.from(files)
285
- .map((file) => this.mapToFileItem(file));
286
- this.fileQueueChanged.emit(this.files[0]);
513
+ if (files?.length && this.isCorrectExtension(files[0])) {
514
+ this.file = this.mapToFileItem(files[0]);
515
+ this.fileQueueChanged.emit(this.file);
287
516
  }
517
+ // mark as touched after file drop even if file wasn't correct
518
+ this.onTouched();
288
519
  }
289
520
  mapToFileItem(file) {
290
521
  this.validateFile(file);
@@ -295,47 +526,60 @@ class McSingleFileUploadComponent {
295
526
  };
296
527
  }
297
528
  validateFile(file) {
298
- if (this.customValidation && this.customValidation.length) {
299
- this.errors = this.customValidation.reduce((errors, validatorFn) => {
300
- errors.push(validatorFn(file));
301
- return errors;
302
- }, []).filter(Boolean);
529
+ if (!this.customValidation?.length) {
530
+ return;
303
531
  }
532
+ this.errors = this.customValidation.reduce((errors, validatorFn) => {
533
+ errors.push(validatorFn(file));
534
+ return errors;
535
+ }, []).filter(Boolean);
304
536
  }
305
537
  isCorrectExtension(file) {
306
538
  const fileExt = file.name.split('.').pop() || '';
307
539
  return this.acceptedFiles !== '*/*' && this.acceptedFiles.length > 0 ? this.acceptedFiles.includes(fileExt) : true;
308
540
  }
309
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: McSingleFileUploadComponent, deps: [{ token: i0.Renderer2 }, { token: MC_FILE_UPLOAD_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
310
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: McSingleFileUploadComponent, selector: "mc-single-file-upload", inputs: { accept: "accept", disabled: "disabled", errors: "errors", files: "files", inputId: "inputId", customValidation: "customValidation" }, outputs: { fileQueueChanged: "fileQueueChanged" }, host: { classAttribute: "mc-single-file-upload" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.mc-error]=\"errors && errors.length\"\n (filesDropped)=\"onFileDropped($event)\">\n <div class=\"dropzone\" *ngIf=\"!files.length; else fileOutput\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text\">\n {{ config.captionText }}\n <label mc-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">\n {{ config.browseLink }}\n <input #input type=\"file\" class=\"cdk-visually-hidden\" [id]=\"inputId\" [accept]=\"acceptedFiles\" [disabled]=\"disabled\" (change)=\"onFileSelectedViaClick($event)\">\n </label>\n </span>\n </div>\n</div>\n\n<mc-hint class=\"mc-file-upload__hint\">\n <ng-content select=\"[hint]\"></ng-content>\n</mc-hint>\n<ng-container *ngIf=\"errors && errors.length\">\n <mc-hint class=\"mc-file-upload__hint mc-error\" *ngFor=\"let error of errors\">{{ error }}</mc-hint>\n</ng-container>\n\n\n<ng-template #fileOutput>\n <div class=\"file-item\" *ngIf=\"files && files.length\">\n <div class=\"file-item__text-wrapper\">\n <ng-container *ngIf=\"{ loading: files[0].loading | async, progress: files[0].progress | async} as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\">\n <ng-content select=\"[mc-icon]\"></ng-content>\n </ng-container>\n\n <mc-progress-spinner\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <div class=\"file-item__text\" [mcEllipsisCenter]=\"files[0].file.name\" [minVisibleLength]=\"10\"></div>\n </div>\n <button mc-button\n class=\"mc-button_transparent\"\n [disabled]=\"disabled\"\n (keydown.delete)=\"deleteItem()\"\n (keydown.backspace)=\"deleteItem()\"\n (click)=\"deleteItem($event)\">\n <i mc-icon=\"mc-close-circle_16\"></i>\n </button>\n </div>\n</ng-template>\n", styles: [".mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mc-file-upload{height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:var(--mc-size-m, 12px);border-radius:var(--mc-file-upload-size-single-border-radius, 4px);border-width:var(--mc-file-upload-size-single-border-width, 1px);border-style:var(--mc-file-upload-size-single-border-style, dashed)}.mc-file-upload .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload .file-item{width:100%}.mc-file-upload .file-item .file-item__text-wrapper{display:flex;align-items:center;width:100%}.mc-file-upload .file-item .file-item__text-wrapper .file-item__text{margin-left:var(--mc-size-s, 8px);width:120px;flex-grow:1}.mc-hint{display:block}.mc-file-upload__hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.McProgressSpinner, selector: "mc-progress-spinner", inputs: ["color", "id", "value", "mode", "size"] }, { kind: "component", type: i3.McIcon, selector: "[mc-icon]", inputs: ["color"] }, { kind: "directive", type: i3.McIconCSSStyler, selector: "[mc-icon]" }, { kind: "component", type: i4$1.McButton, selector: "[mc-button]", inputs: ["color", "tabIndex", "disabled"] }, { kind: "directive", type: i4$1.McButtonCssStyler, selector: "[mc-button]" }, { kind: "directive", type: i5.McHint, selector: "mc-hint", inputs: ["color", "id"] }, { kind: "directive", type: i6.McEllipsisCenterDirective, selector: "[mcEllipsisCenter]", inputs: ["mcEllipsisCenter", "minVisibleLength"] }, { kind: "directive", type: i7.McLink, selector: "[mc-link]", inputs: ["tabIndex", "disabled", "pseudo", "noUnderline", "caption", "useVisited", "print"], exportAs: ["mcLink"] }, { kind: "directive", type: McFileDropDirective, selector: "[mcFileDrop]", outputs: ["filesDropped"], exportAs: ["mcFileDrop"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
541
+ initDefaultParams() {
542
+ this.config = MC_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION;
543
+ this.makeCaptionText();
544
+ }
545
+ makeCaptionText() {
546
+ this.separatedCaptionText = this.config.captionText.split('{{ browseLink }}');
547
+ }
548
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: McSingleFileUploadComponent, deps: [{ token: MC_FILE_UPLOAD_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
549
+ /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: McSingleFileUploadComponent, selector: "mc-single-file-upload", inputs: { file: "file", accept: "accept", disabled: "disabled", errors: "errors", inputId: "inputId", customValidation: "customValidation", errorStateMatcher: "errorStateMatcher" }, outputs: { fileQueueChanged: "fileQueueChanged" }, host: { classAttribute: "mc-single-file-upload" }, queries: [{ propertyName: "hint", predicate: McHint }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.mc-error]=\"invalid\"\n (filesDropped)=\"onFileDropped($event)\">\n <div class=\"dropzone\" *ngIf=\"!file; else fileOutput\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text\">\n {{ separatedCaptionText[0] }}<label mc-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">{{ config.browseLink }}<input #input type=\"file\" class=\"cdk-visually-hidden\" [id]=\"inputId\" [accept]=\"acceptedFiles\" [disabled]=\"disabled\" (change)=\"onFileSelectedViaClick($event)\"></label>{{ separatedCaptionText[1] }}\n </span>\n </div>\n</div>\n\n<ng-container *ngIf=\"hasHint\">\n <div class=\"mc-file-upload__hint\">\n <ng-content select=\"mc-hint,[hint]\" />\n </div>\n</ng-container>\n\n<ng-template #fileOutput>\n <div class=\"file-item\" *ngIf=\"file\">\n <div class=\"file-item__text-wrapper\">\n <ng-container *ngIf=\"{ loading: file.loading | async, progress: file.progress | async} as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\">\n <ng-content select=\"[mc-icon]\"></ng-content>\n </ng-container>\n\n <mc-progress-spinner\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <div class=\"file-item__text\" [mcEllipsisCenter]=\"file.file.name\" [minVisibleLength]=\"10\"></div>\n </div>\n <button mc-button\n class=\"mc-button_transparent\"\n [disabled]=\"disabled\"\n (keydown.delete)=\"deleteItem()\"\n (keydown.backspace)=\"deleteItem()\"\n (click)=\"deleteItem($event)\">\n <i mc-icon=\"mc-close-circle_16\"></i>\n </button>\n </div>\n</ng-template>\n", styles: [".mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}.mc-file-upload__hint>.mc-hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mc-file-upload{height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:var(--mc-size-m, 12px);border-radius:var(--mc-file-upload-size-single-border-radius, 4px);border-width:var(--mc-file-upload-size-single-border-width, 1px);border-style:var(--mc-file-upload-size-single-border-style, dashed)}.mc-file-upload .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload .file-item{width:100%}.mc-file-upload .file-item .file-item__text-wrapper{display:flex;align-items:center;width:100%}.mc-file-upload .file-item .file-item__text-wrapper .file-item__text{margin-left:var(--mc-size-s, 8px);width:120px;flex-grow:1}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.McProgressSpinner, selector: "mc-progress-spinner", inputs: ["color", "id", "value", "mode", "size"] }, { kind: "component", type: i3.McIcon, selector: "[mc-icon]", inputs: ["color"] }, { kind: "directive", type: i3.McIconCSSStyler, selector: "[mc-icon]" }, { kind: "component", type: i4$1.McButton, selector: "[mc-button]", inputs: ["color", "tabIndex", "disabled"] }, { kind: "directive", type: i4$1.McButtonCssStyler, selector: "[mc-button]" }, { kind: "directive", type: i5.McEllipsisCenterDirective, selector: "[mcEllipsisCenter]", inputs: ["mcEllipsisCenter", "minVisibleLength"] }, { kind: "directive", type: i6.McLink, selector: "[mc-link]", inputs: ["tabIndex", "disabled", "pseudo", "noUnderline", "caption", "useVisited", "print"], exportAs: ["mcLink"] }, { kind: "directive", type: McFileDropDirective, selector: "[mcFileDrop]", outputs: ["filesDropped"], exportAs: ["mcFileDrop"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
311
550
  }
312
551
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: McSingleFileUploadComponent, decorators: [{
313
552
  type: Component,
314
- args: [{ selector: 'mc-single-file-upload', changeDetection: ChangeDetectionStrategy.OnPush, host: {
553
+ args: [{ selector: 'mc-single-file-upload', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
315
554
  class: 'mc-single-file-upload'
316
- }, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.mc-error]=\"errors && errors.length\"\n (filesDropped)=\"onFileDropped($event)\">\n <div class=\"dropzone\" *ngIf=\"!files.length; else fileOutput\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text\">\n {{ config.captionText }}\n <label mc-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">\n {{ config.browseLink }}\n <input #input type=\"file\" class=\"cdk-visually-hidden\" [id]=\"inputId\" [accept]=\"acceptedFiles\" [disabled]=\"disabled\" (change)=\"onFileSelectedViaClick($event)\">\n </label>\n </span>\n </div>\n</div>\n\n<mc-hint class=\"mc-file-upload__hint\">\n <ng-content select=\"[hint]\"></ng-content>\n</mc-hint>\n<ng-container *ngIf=\"errors && errors.length\">\n <mc-hint class=\"mc-file-upload__hint mc-error\" *ngFor=\"let error of errors\">{{ error }}</mc-hint>\n</ng-container>\n\n\n<ng-template #fileOutput>\n <div class=\"file-item\" *ngIf=\"files && files.length\">\n <div class=\"file-item__text-wrapper\">\n <ng-container *ngIf=\"{ loading: files[0].loading | async, progress: files[0].progress | async} as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\">\n <ng-content select=\"[mc-icon]\"></ng-content>\n </ng-container>\n\n <mc-progress-spinner\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <div class=\"file-item__text\" [mcEllipsisCenter]=\"files[0].file.name\" [minVisibleLength]=\"10\"></div>\n </div>\n <button mc-button\n class=\"mc-button_transparent\"\n [disabled]=\"disabled\"\n (keydown.delete)=\"deleteItem()\"\n (keydown.backspace)=\"deleteItem()\"\n (click)=\"deleteItem($event)\">\n <i mc-icon=\"mc-close-circle_16\"></i>\n </button>\n </div>\n</ng-template>\n", styles: [".mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mc-file-upload{height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:var(--mc-size-m, 12px);border-radius:var(--mc-file-upload-size-single-border-radius, 4px);border-width:var(--mc-file-upload-size-single-border-width, 1px);border-style:var(--mc-file-upload-size-single-border-style, dashed)}.mc-file-upload .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload .file-item{width:100%}.mc-file-upload .file-item .file-item__text-wrapper{display:flex;align-items:center;width:100%}.mc-file-upload .file-item .file-item__text-wrapper .file-item__text{margin-left:var(--mc-size-s, 8px);width:120px;flex-grow:1}.mc-hint{display:block}.mc-file-upload__hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n"] }]
317
- }], ctorParameters: () => [{ type: i0.Renderer2 }, { type: undefined, decorators: [{
555
+ }, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.mc-error]=\"invalid\"\n (filesDropped)=\"onFileDropped($event)\">\n <div class=\"dropzone\" *ngIf=\"!file; else fileOutput\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text\">\n {{ separatedCaptionText[0] }}<label mc-link pseudo [disabled]=\"disabled\" [tabIndex]=\"-1\" [for]=\"inputId\">{{ config.browseLink }}<input #input type=\"file\" class=\"cdk-visually-hidden\" [id]=\"inputId\" [accept]=\"acceptedFiles\" [disabled]=\"disabled\" (change)=\"onFileSelectedViaClick($event)\"></label>{{ separatedCaptionText[1] }}\n </span>\n </div>\n</div>\n\n<ng-container *ngIf=\"hasHint\">\n <div class=\"mc-file-upload__hint\">\n <ng-content select=\"mc-hint,[hint]\" />\n </div>\n</ng-container>\n\n<ng-template #fileOutput>\n <div class=\"file-item\" *ngIf=\"file\">\n <div class=\"file-item__text-wrapper\">\n <ng-container *ngIf=\"{ loading: file.loading | async, progress: file.progress | async} as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\">\n <ng-content select=\"[mc-icon]\"></ng-content>\n </ng-container>\n\n <mc-progress-spinner\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <div class=\"file-item__text\" [mcEllipsisCenter]=\"file.file.name\" [minVisibleLength]=\"10\"></div>\n </div>\n <button mc-button\n class=\"mc-button_transparent\"\n [disabled]=\"disabled\"\n (keydown.delete)=\"deleteItem()\"\n (keydown.backspace)=\"deleteItem()\"\n (click)=\"deleteItem($event)\">\n <i mc-icon=\"mc-close-circle_16\"></i>\n </button>\n </div>\n</ng-template>\n", styles: [".mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}.mc-file-upload__hint>.mc-hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mc-file-upload{height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:var(--mc-size-m, 12px);border-radius:var(--mc-file-upload-size-single-border-radius, 4px);border-width:var(--mc-file-upload-size-single-border-width, 1px);border-style:var(--mc-file-upload-size-single-border-style, dashed)}.mc-file-upload .dropzone .dropzone__text{margin-left:var(--mc-size-xs, 6px)}.mc-file-upload .file-item{width:100%}.mc-file-upload .file-item .file-item__text-wrapper{display:flex;align-items:center;width:100%}.mc-file-upload .file-item .file-item__text-wrapper .file-item__text{margin-left:var(--mc-size-s, 8px);width:120px;flex-grow:1}\n"] }]
556
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
318
557
  type: Optional
319
558
  }, {
320
559
  type: Inject,
321
560
  args: [MC_FILE_UPLOAD_CONFIGURATION]
322
- }] }], propDecorators: { accept: [{
561
+ }] }], propDecorators: { file: [{
562
+ type: Input
563
+ }], accept: [{
323
564
  type: Input
324
565
  }], disabled: [{
325
566
  type: Input
326
567
  }], errors: [{
327
568
  type: Input
328
- }], files: [{
329
- type: Input
330
569
  }], inputId: [{
331
570
  type: Input
332
571
  }], customValidation: [{
333
572
  type: Input
573
+ }], errorStateMatcher: [{
574
+ type: Input
334
575
  }], fileQueueChanged: [{
335
576
  type: Output
336
577
  }], input: [{
337
578
  type: ViewChild,
338
579
  args: ['input']
580
+ }], hint: [{
581
+ type: ContentChildren,
582
+ args: [McHint]
339
583
  }] } });
340
584
 
341
585
  class McFileUploadModule {
@@ -343,6 +587,8 @@ class McFileUploadModule {
343
587
  /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.0", ngImport: i0, type: McFileUploadModule, declarations: [McFileDropDirective,
344
588
  McSingleFileUploadComponent,
345
589
  McMultipleFileUploadComponent], imports: [CommonModule,
590
+ FormsModule,
591
+ ReactiveFormsModule,
346
592
  McToolTipModule,
347
593
  McProgressSpinnerModule,
348
594
  McIconModule,
@@ -355,6 +601,8 @@ class McFileUploadModule {
355
601
  McMultipleFileUploadComponent,
356
602
  McFileDropDirective] }); }
357
603
  /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: McFileUploadModule, imports: [CommonModule,
604
+ FormsModule,
605
+ ReactiveFormsModule,
358
606
  McToolTipModule,
359
607
  McProgressSpinnerModule,
360
608
  McIconModule,
@@ -370,6 +618,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
370
618
  args: [{
371
619
  imports: [
372
620
  CommonModule,
621
+ FormsModule,
622
+ ReactiveFormsModule,
373
623
  McToolTipModule,
374
624
  McProgressSpinnerModule,
375
625
  McIconModule,
@@ -397,5 +647,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
397
647
  * Generated bundle index. Do not edit.
398
648
  */
399
649
 
400
- export { MC_FILE_UPLOAD_CONFIGURATION, MC_MULTIPLE_FILE_UPLOAD_DEFAULT_CONFIGURATION, MC_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION, McFileDropDirective, McFileUploadModule, McMultipleFileUploadComponent, McSingleFileUploadComponent };
650
+ export { MC_FILE_UPLOAD_CONFIGURATION, MC_MULTIPLE_FILE_UPLOAD_DEFAULT_CONFIGURATION, MC_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION, McFileDropDirective, McFileUploadBase, McFileUploadModule, McMultipleFileUploadComponent, McSingleFileUploadComponent };
401
651
  //# sourceMappingURL=ptsecurity-mosaic-file-upload.mjs.map