@ngx-mce/file-input 21.1.1 → 21.2.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,110 +1,110 @@
1
- # Angular Material File Input
2
- ## For Angular Material 21.x
3
-
4
- [![License](https://img.shields.io/npm/l/angular-material-components.svg)](https://www.npmjs.com/package/@ngx-mce/file-input)
5
- [![npm version](https://badge.fury.io/js/%40angular-material-components%2Ffile-input.svg)](https://www.npmjs.com/package/@ngx-mce/file-input)
6
- [![Github All Releases](https://img.shields.io/npm/dt/@ngx-mce/file-input.svg)]()
7
-
8
- ## Description
9
-
10
- This is a File Input component for Angular Material projects.
11
-
12
- <a href="https://buymeacoffee.com/fbf.prog64" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
13
-
14
- # Version control
15
-
16
- Choose the version corresponding to your Angular version:
17
-
18
- | Angular | @ngx-mce/datetime-picker |
19
- | -------- | -------------------------|
20
- | 21 | 21.x |
21
- | 15 -- 20 | Please use [GNURub's version](https://github.com/GNURub/angular-material-components) |
22
- | 7 -- 14 | Please use [h2qutc's version](https://github.com/h2qutc/angular-material-components) |
23
-
24
- # File Input in action
25
-
26
- See demo:
27
-
28
- * Over [StackBlitz](https://stackblitz.com/edit/demo-ngx-mat-file-input).
29
- * In the [documentation](https://fbf-prog64.github.io/angular-material-components/).
30
-
31
- ![File Input in action](demo_file_input.png)
32
-
33
- # How to use
34
-
35
- ## Install
36
-
37
- ```
38
- npm install --save @ngx-mce/file-input
39
- ```
40
-
41
- ## Configure
42
-
43
- ```
44
- import { NgxMatFileInputModule } from '@ngx-mce/file-input';
45
-
46
- @NgModule({
47
- ...
48
- imports: [
49
- ...
50
- NgxMatFileInputModule
51
- ]
52
- ...
53
- })
54
- export class AppModule { }
55
- ```
56
-
57
- Check more details [here](src/app/demo-fileinput/demo-fileinput.module.ts).
58
-
59
- ## Using the component
60
-
61
- ```
62
- <mat-form-field>
63
- <ngx-mat-file-input [formControl]="fileControl" [multiple]="multiple" [accept]="accept" [color]="color">
64
- </ngx-mat-file-input>
65
- </mat-form-field>
66
- ```
67
-
68
- ℹ️ You can provide a custom icon by using the directive **_ngxMatFileInputIcon_**.
69
-
70
- ```
71
- <mat-form-field>
72
- <ngx-mat-file-input [formControl]="fileControl" [multiple]="multiple" [accept]="accept"
73
- [color]="color">
74
- <mat-icon ngxMatFileInputIcon>folder</mat-icon>
75
- </ngx-mat-file-input>
76
- </mat-form-field>
77
- ```
78
-
79
- ℹ️ This compoment accepts all properties of a regular **MatFormField**, such as appearance variants, hints...
80
-
81
- ```
82
- <mat-form-field appearance="outline">
83
- <ngx-mat-file-input [formControl]="file3Control">
84
- </ngx-mat-file-input>
85
- <mat-hint>Hint</mat-hint>
86
- </mat-form-field>
87
- ```
88
-
89
- ### List of @Input
90
-
91
- | @Input | Type | Default value | Description |
92
- | ------------ | ------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
93
- | **disabled** | boolean | null | If true, the file input is readonly. |
94
- | **multiple** | boolean | false | If true, the file input allows the user to select more than one file. |
95
- | **accept** | string | null | Limiting accepted file types (For example: accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — Accept PNG or JPEG files.) |
96
- | **color** | ThemePalette | null | Theme color palette for the component. |
97
-
98
- ## Theming
99
-
100
- - @see @angular/material
101
- [Using a pre-built theme](https://material.angular.io/guide/theming#using-a-pre-built-theme)
102
- - Add the Material Design icon font to your index.html
103
-
104
- ```
105
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=block" rel="stylesheet">
106
- ```
107
-
108
- ## License
109
-
110
- MIT
1
+ # Angular Material File Input
2
+ ## For Angular Material 21.x
3
+
4
+ [![License](https://img.shields.io/npm/l/angular-material-components.svg)](https://www.npmjs.com/package/@ngx-mce/file-input)
5
+ [![npm version](https://badge.fury.io/js/%40angular-material-components%2Ffile-input.svg)](https://www.npmjs.com/package/@ngx-mce/file-input)
6
+ [![Github All Releases](https://img.shields.io/npm/dt/@ngx-mce/file-input.svg)]()
7
+
8
+ ## Description
9
+
10
+ This is a File Input component for Angular Material projects.
11
+
12
+ <a href="https://buymeacoffee.com/fbf.prog64" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
13
+
14
+ # Version control
15
+
16
+ Choose the version corresponding to your Angular version:
17
+
18
+ | Angular | @ngx-mce/datetime-picker |
19
+ | -------- | -------------------------|
20
+ | 21 | 21.x |
21
+ | 15 -- 20 | Please use [GNURub's version](https://github.com/GNURub/angular-material-components) |
22
+ | 7 -- 14 | Please use [h2qutc's version](https://github.com/h2qutc/angular-material-components) |
23
+
24
+ # File Input in action
25
+
26
+ See demo:
27
+
28
+ * Over [StackBlitz](https://stackblitz.com/edit/demo-ngx-mat-file-input).
29
+ * In the [documentation](https://fbf-prog64.github.io/angular-material-components/).
30
+
31
+ ![File Input in action](demo_file_input.png)
32
+
33
+ # How to use
34
+
35
+ ## Install
36
+
37
+ ```
38
+ npm install --save @ngx-mce/file-input
39
+ ```
40
+
41
+ ## Configure
42
+
43
+ ```
44
+ import { NgxMatFileInputModule } from '@ngx-mce/file-input';
45
+
46
+ @NgModule({
47
+ ...
48
+ imports: [
49
+ ...
50
+ NgxMatFileInputModule
51
+ ]
52
+ ...
53
+ })
54
+ export class AppModule { }
55
+ ```
56
+
57
+ Check more details [here](src/app/demo-fileinput/demo-fileinput.module.ts).
58
+
59
+ ## Using the component
60
+
61
+ ```
62
+ <mat-form-field>
63
+ <ngx-mat-file-input [formControl]="fileControl" [multiple]="multiple" [accept]="accept" [color]="color">
64
+ </ngx-mat-file-input>
65
+ </mat-form-field>
66
+ ```
67
+
68
+ ℹ️ You can provide a custom icon by using the directive **_ngxMatFileInputIcon_**.
69
+
70
+ ```
71
+ <mat-form-field>
72
+ <ngx-mat-file-input [formControl]="fileControl" [multiple]="multiple" [accept]="accept"
73
+ [color]="color">
74
+ <mat-icon ngxMatFileInputIcon>folder</mat-icon>
75
+ </ngx-mat-file-input>
76
+ </mat-form-field>
77
+ ```
78
+
79
+ ℹ️ This compoment accepts all properties of a regular **MatFormField**, such as appearance variants, hints...
80
+
81
+ ```
82
+ <mat-form-field appearance="outline">
83
+ <ngx-mat-file-input [formControl]="file3Control">
84
+ </ngx-mat-file-input>
85
+ <mat-hint>Hint</mat-hint>
86
+ </mat-form-field>
87
+ ```
88
+
89
+ ### List of @Input
90
+
91
+ | @Input | Type | Default value | Description |
92
+ | ------------ | ------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
93
+ | **disabled** | boolean | null | If true, the file input is readonly. |
94
+ | **multiple** | boolean | false | If true, the file input allows the user to select more than one file. |
95
+ | **accept** | string | null | Limiting accepted file types (For example: accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — Accept PNG or JPEG files.) |
96
+ | **color** | ThemePalette | null | Theme color palette for the component. |
97
+
98
+ ## Theming
99
+
100
+ - @see @angular/material
101
+ [Using a pre-built theme](https://material.angular.io/guide/theming#using-a-pre-built-theme)
102
+ - Add the Material Design icon font to your index.html
103
+
104
+ ```
105
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons&display=block" rel="stylesheet">
106
+ ```
107
+
108
+ ## License
109
+
110
+ MIT
@@ -13,6 +13,11 @@ import * as i3 from '@angular/material/core';
13
13
 
14
14
  let nextUniqueId = 0;
15
15
  class NgxMatInputMixinBase {
16
+ _defaultErrorStateMatcher;
17
+ _parentForm;
18
+ _parentFormGroup;
19
+ ngControl;
20
+ stateChanges = new Subject();
16
21
  constructor(_defaultErrorStateMatcher, _parentForm, _parentFormGroup,
17
22
  /** @docs-private */
18
23
  ngControl) {
@@ -20,20 +25,39 @@ class NgxMatInputMixinBase {
20
25
  this._parentForm = _parentForm;
21
26
  this._parentFormGroup = _parentFormGroup;
22
27
  this.ngControl = ngControl;
23
- this.stateChanges = new Subject();
24
28
  }
25
29
  }
26
30
  class NgxMatFileInputIcon {
27
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgxMatFileInputIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
28
- /** @nocollapse */ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: NgxMatFileInputIcon, isStandalone: true, selector: "[ngxMatFileInputIcon]", ngImport: i0 }); }
31
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NgxMatFileInputIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
32
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: NgxMatFileInputIcon, isStandalone: true, selector: "[ngxMatFileInputIcon]", ngImport: i0 });
29
33
  }
30
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgxMatFileInputIcon, decorators: [{
34
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NgxMatFileInputIcon, decorators: [{
31
35
  type: Directive,
32
36
  args: [{
33
37
  selector: '[ngxMatFileInputIcon]',
34
38
  }]
35
39
  }] });
36
40
  class NgxMatFileInputComponent extends NgxMatInputMixinBase {
41
+ _elementRef;
42
+ _platform;
43
+ _cd;
44
+ ngControl;
45
+ _inputFileRef = viewChild('inputFile', ...(ngDevMode ? [{ debugName: "_inputFileRef" }] : []));
46
+ _inputValueRef = viewChild('inputValue', ...(ngDevMode ? [{ debugName: "_inputValueRef" }] : []));
47
+ color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
48
+ fileNames = "";
49
+ _uid = `ngx-mat-fileinput-${nextUniqueId++}`;
50
+ _previousNativeValue;
51
+ _ariaDescribedby = "";
52
+ stateChanges = new Subject();
53
+ focused = false;
54
+ errorState = false;
55
+ controlType = 'ngx-mat-file-input';
56
+ autofilled = false;
57
+ /** Function when touched */
58
+ _onTouched = () => { };
59
+ /** Function when changed */
60
+ _onChange = () => { };
37
61
  get disabled() {
38
62
  if (this.ngControl && this.ngControl.disabled !== null) {
39
63
  return this.ngControl.disabled;
@@ -47,36 +71,45 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
47
71
  this.stateChanges.next();
48
72
  }
49
73
  }
74
+ _disabled = false;
50
75
  get id() {
51
76
  return this._id;
52
77
  }
53
78
  set id(value) {
54
79
  this._id = value || this._uid;
55
80
  }
81
+ _id = "";
56
82
  get multiple() {
57
83
  return this._multiple;
58
84
  }
59
85
  set multiple(value) {
60
86
  this._multiple = coerceBooleanProperty(value);
61
87
  }
88
+ _multiple = false;
89
+ placeholder = 'Choose a file';
90
+ separator = input(',', ...(ngDevMode ? [{ debugName: "separator" }] : []));
62
91
  get required() {
63
92
  return this._required;
64
93
  }
65
94
  set required(value) {
66
95
  this._required = coerceBooleanProperty(value);
67
96
  }
97
+ _required = false;
98
+ errorStateMatcher = null;
68
99
  get value() {
69
100
  return this._value;
70
101
  }
71
102
  set value(value) {
72
103
  this._value = value;
73
104
  }
105
+ _value = null;
74
106
  get readonly() {
75
107
  return this._readonly;
76
108
  }
77
109
  set readonly(value) {
78
110
  this._readonly = coerceBooleanProperty(value);
79
111
  }
112
+ _readonly = true;
80
113
  /**
81
114
  * Limiting accepted file types
82
115
  * Example: accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — Accept PNG or JPEG files.
@@ -87,31 +120,13 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
87
120
  set accept(value) {
88
121
  this._accept = value;
89
122
  }
123
+ _accept = "";
90
124
  constructor(_elementRef, _platform, _cd, ngControl, _parentForm, _parentFormGroup, _defaultErrorStateMatcher) {
91
125
  super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);
92
126
  this._elementRef = _elementRef;
93
127
  this._platform = _platform;
94
128
  this._cd = _cd;
95
129
  this.ngControl = ngControl;
96
- this._inputFileRef = viewChild('inputFile', ...(ngDevMode ? [{ debugName: "_inputFileRef" }] : []));
97
- this._inputValueRef = viewChild('inputValue', ...(ngDevMode ? [{ debugName: "_inputValueRef" }] : []));
98
- this.color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : []));
99
- this.fileNames = null;
100
- this._uid = `ngx-mat-fileinput-${nextUniqueId++}`;
101
- this.stateChanges = new Subject();
102
- this.focused = false;
103
- this.controlType = 'ngx-mat-file-input';
104
- this.autofilled = false;
105
- /** Function when touched */
106
- this._onTouched = () => { };
107
- /** Function when changed */
108
- this._onChange = () => { };
109
- this._disabled = false;
110
- this._multiple = false;
111
- this.placeholder = 'Choose a file';
112
- this.separator = input(',', ...(ngDevMode ? [{ debugName: "separator" }] : []));
113
- this._required = false;
114
- this._readonly = true;
115
130
  this.id = this.id;
116
131
  if (this.ngControl) {
117
132
  this.ngControl.valueAccessor = this;
@@ -151,7 +166,7 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
151
166
  }
152
167
  /** Focuses the input. */
153
168
  focus(options) {
154
- this._inputValueRef().nativeElement.focus(options);
169
+ this._inputValueRef()?.nativeElement.focus(options);
155
170
  }
156
171
  _focusChanged(isFocused) {
157
172
  if (isFocused !== this.focused && (!this.readonly || !isFocused)) {
@@ -166,11 +181,11 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
166
181
  this.stateChanges.next();
167
182
  }
168
183
  _isBadInput() {
169
- let validity = this._inputValueRef().nativeElement.validity;
184
+ let validity = (this._inputValueRef()?.nativeElement).validity;
170
185
  return validity && validity.badInput;
171
186
  }
172
187
  get empty() {
173
- return !this._inputValueRef().nativeElement.value && !this._isBadInput() && !this.autofilled;
188
+ return !this._inputValueRef()?.nativeElement.value && !this._isBadInput() && !this.autofilled;
174
189
  }
175
190
  get shouldLabelFloat() {
176
191
  return this.focused || !this.empty;
@@ -179,7 +194,7 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
179
194
  this._ariaDescribedby = ids.join(' ');
180
195
  }
181
196
  openFilePicker(event) {
182
- this._inputFileRef().nativeElement.click();
197
+ this._inputFileRef()?.nativeElement.click();
183
198
  if (event) {
184
199
  event.preventDefault();
185
200
  event.stopPropagation();
@@ -190,7 +205,9 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
190
205
  if (filelist.length > 0) {
191
206
  const files = new Array();
192
207
  for (let i = 0; i < filelist.length; i++) {
193
- files.push(filelist.item(i));
208
+ const f = filelist.item(i);
209
+ if (f)
210
+ files.push(f);
194
211
  }
195
212
  this._updateInputValue(files);
196
213
  this._resetInputFile();
@@ -214,24 +231,24 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
214
231
  }
215
232
  this._inputValueRef().nativeElement.value = text;
216
233
  }
217
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgxMatFileInputComponent, deps: [{ token: i0.ElementRef }, { token: i1.Platform }, { token: i0.ChangeDetectorRef }, { token: i2.NgControl, optional: true, self: true }, { token: i2.NgForm, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: i3.ErrorStateMatcher }], target: i0.ɵɵFactoryTarget.Component }); }
218
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.3", type: NgxMatFileInputComponent, isStandalone: true, selector: "ngx-mat-file-input", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: false, isRequired: false, transformFunction: null } }, host: { classAttribute: "ngx-mat-file-input" }, providers: [
234
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NgxMatFileInputComponent, deps: [{ token: i0.ElementRef }, { token: i1.Platform }, { token: i0.ChangeDetectorRef }, { token: i2.NgControl, optional: true, self: true }, { token: i2.NgForm, optional: true }, { token: i2.FormGroupDirective, optional: true }, { token: i3.ErrorStateMatcher }], target: i0.ɵɵFactoryTarget.Component });
235
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.1.5", type: NgxMatFileInputComponent, isStandalone: true, selector: "ngx-mat-file-input", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, errorStateMatcher: { classPropertyName: "errorStateMatcher", publicName: "errorStateMatcher", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: false, isRequired: false, transformFunction: null } }, host: { classAttribute: "ngx-mat-file-input" }, providers: [
219
236
  {
220
237
  provide: MatFormFieldControl,
221
- useExisting: forwardRef((() => NgxMatFileInputComponent)),
238
+ useExisting: forwardRef(() => NgxMatFileInputComponent),
222
239
  },
223
- ], viewQueries: [{ propertyName: "_inputFileRef", first: true, predicate: ["inputFile"], descendants: true, isSignal: true }, { propertyName: "_inputValueRef", first: true, predicate: ["inputValue"], descendants: true, isSignal: true }], exportAs: ["ngx-mat-file-input"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<input\r\n #inputValue\r\n autocomplete=\"off\"\r\n class=\"mat-mdc-input-element mat-mdc-form-field-input-control mdc-text-field__input\"\r\n [attr.id]=\"id\"\r\n [attr.placeholder]=\"placeholder\"\r\n [disabled]=\"disabled\"\r\n [required]=\"required\"\r\n [attr.readonly]=\"readonly || null\"\r\n [attr.aria-describedby]=\"_ariaDescribedby || null\"\r\n [attr.aria-invalid]=\"errorState\"\r\n [attr.aria-required]=\"required.toString()\"\r\n/>\r\n<div class=\"mat-mdc-form-field-suffix\">\r\n <button\r\n matSuffix\r\n mat-icon-button\r\n [color]=\"color()\"\r\n class=\"button-browse\"\r\n (click)=\"openFilePicker($event)\"\r\n type=\"button\"\r\n [disabled]=\"disabled\"\r\n >\r\n <ng-content select=\"[ngxMatFileInputIcon]\">\r\n <mat-icon class=\"ngx-mat-file-input--default-icon\">attach_file</mat-icon>\r\n </ng-content>\r\n </button>\r\n</div>\r\n<input\r\n type=\"file\"\r\n #inputFile\r\n (change)=\"handleFiles($event.target.files)\"\r\n class=\"input-file\"\r\n [multiple]=\"multiple\"\r\n [accept]=\"accept\"\r\n/>\r\n", styles: [".mat-mdc-form-field-appearance-outline .mat-form-field-prefix .ngx-mat-file-input--default-icon,.mat-mdc-form-field-appearance-outline .mat-form-field-suffix .ngx-mat-file-input--default-icon{width:1em}.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-prefix .ngx-mat-file-input--default-icon,.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-suffix .ngx-mat-file-input--default-icon{display:block;width:1.5em;height:1.5em}.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-prefix .mat-icon-button .ngx-mat-file-input--default-icon,.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-suffix .mat-icon-button .ngx-mat-file-input--default-icon{margin:auto}.ngx-mat-file-input{display:flex;line-height:18px;align-items:center}.ngx-mat-file-input .input-file{display:block;visibility:hidden;width:0;height:0}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], encapsulation: i0.ViewEncapsulation.None }); }
240
+ ], viewQueries: [{ propertyName: "_inputFileRef", first: true, predicate: ["inputFile"], descendants: true, isSignal: true }, { propertyName: "_inputValueRef", first: true, predicate: ["inputValue"], descendants: true, isSignal: true }], exportAs: ["ngx-mat-file-input"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<input\n #inputValue\n autocomplete=\"off\"\n class=\"mat-mdc-input-element mat-mdc-form-field-input-control mdc-text-field__input\"\n [attr.id]=\"id\"\n [attr.placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [attr.readonly]=\"readonly || null\"\n [attr.aria-describedby]=\"_ariaDescribedby || null\"\n [attr.aria-invalid]=\"errorState\"\n [attr.aria-required]=\"required.toString()\"\n/>\n<div class=\"mat-mdc-form-field-suffix\">\n <button\n matSuffix\n mat-icon-button\n [color]=\"color()\"\n class=\"button-browse\"\n (click)=\"openFilePicker($event)\"\n type=\"button\"\n [disabled]=\"disabled\"\n >\n <ng-content select=\"[ngxMatFileInputIcon]\">\n <mat-icon class=\"ngx-mat-file-input--default-icon\">attach_file</mat-icon>\n </ng-content>\n </button>\n</div>\n<input\n type=\"file\"\n #inputFile\n (change)=\"handleFiles($event.target.files!)\"\n class=\"input-file\"\n [multiple]=\"multiple\"\n [accept]=\"accept\"\n/>\n", styles: [".mat-mdc-form-field-appearance-outline .mat-form-field-prefix .ngx-mat-file-input--default-icon,.mat-mdc-form-field-appearance-outline .mat-form-field-suffix .ngx-mat-file-input--default-icon{width:1em}.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-prefix .ngx-mat-file-input--default-icon,.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-suffix .ngx-mat-file-input--default-icon{display:block;width:1.5em;height:1.5em}.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-prefix .mat-icon-button .ngx-mat-file-input--default-icon,.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-suffix .mat-icon-button .ngx-mat-file-input--default-icon{margin:auto}.ngx-mat-file-input{display:flex;line-height:18px;align-items:center}.ngx-mat-file-input .input-file{display:block;visibility:hidden;width:0;height:0}\n"], dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i4.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], encapsulation: i0.ViewEncapsulation.None });
224
241
  }
225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: NgxMatFileInputComponent, decorators: [{
242
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: NgxMatFileInputComponent, decorators: [{
226
243
  type: Component,
227
244
  args: [{ selector: 'ngx-mat-file-input', encapsulation: ViewEncapsulation.None, host: {
228
245
  class: 'ngx-mat-file-input',
229
246
  }, providers: [
230
247
  {
231
248
  provide: MatFormFieldControl,
232
- useExisting: forwardRef((() => NgxMatFileInputComponent)),
249
+ useExisting: forwardRef(() => NgxMatFileInputComponent),
233
250
  },
234
- ], exportAs: 'ngx-mat-file-input', imports: [MatIconModule, MatButtonModule], template: "<input\r\n #inputValue\r\n autocomplete=\"off\"\r\n class=\"mat-mdc-input-element mat-mdc-form-field-input-control mdc-text-field__input\"\r\n [attr.id]=\"id\"\r\n [attr.placeholder]=\"placeholder\"\r\n [disabled]=\"disabled\"\r\n [required]=\"required\"\r\n [attr.readonly]=\"readonly || null\"\r\n [attr.aria-describedby]=\"_ariaDescribedby || null\"\r\n [attr.aria-invalid]=\"errorState\"\r\n [attr.aria-required]=\"required.toString()\"\r\n/>\r\n<div class=\"mat-mdc-form-field-suffix\">\r\n <button\r\n matSuffix\r\n mat-icon-button\r\n [color]=\"color()\"\r\n class=\"button-browse\"\r\n (click)=\"openFilePicker($event)\"\r\n type=\"button\"\r\n [disabled]=\"disabled\"\r\n >\r\n <ng-content select=\"[ngxMatFileInputIcon]\">\r\n <mat-icon class=\"ngx-mat-file-input--default-icon\">attach_file</mat-icon>\r\n </ng-content>\r\n </button>\r\n</div>\r\n<input\r\n type=\"file\"\r\n #inputFile\r\n (change)=\"handleFiles($event.target.files)\"\r\n class=\"input-file\"\r\n [multiple]=\"multiple\"\r\n [accept]=\"accept\"\r\n/>\r\n", styles: [".mat-mdc-form-field-appearance-outline .mat-form-field-prefix .ngx-mat-file-input--default-icon,.mat-mdc-form-field-appearance-outline .mat-form-field-suffix .ngx-mat-file-input--default-icon{width:1em}.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-prefix .ngx-mat-file-input--default-icon,.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-suffix .ngx-mat-file-input--default-icon{display:block;width:1.5em;height:1.5em}.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-prefix .mat-icon-button .ngx-mat-file-input--default-icon,.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-suffix .mat-icon-button .ngx-mat-file-input--default-icon{margin:auto}.ngx-mat-file-input{display:flex;line-height:18px;align-items:center}.ngx-mat-file-input .input-file{display:block;visibility:hidden;width:0;height:0}\n"] }]
251
+ ], exportAs: 'ngx-mat-file-input', imports: [MatIconModule, MatButtonModule], template: "<input\n #inputValue\n autocomplete=\"off\"\n class=\"mat-mdc-input-element mat-mdc-form-field-input-control mdc-text-field__input\"\n [attr.id]=\"id\"\n [attr.placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [attr.readonly]=\"readonly || null\"\n [attr.aria-describedby]=\"_ariaDescribedby || null\"\n [attr.aria-invalid]=\"errorState\"\n [attr.aria-required]=\"required.toString()\"\n/>\n<div class=\"mat-mdc-form-field-suffix\">\n <button\n matSuffix\n mat-icon-button\n [color]=\"color()\"\n class=\"button-browse\"\n (click)=\"openFilePicker($event)\"\n type=\"button\"\n [disabled]=\"disabled\"\n >\n <ng-content select=\"[ngxMatFileInputIcon]\">\n <mat-icon class=\"ngx-mat-file-input--default-icon\">attach_file</mat-icon>\n </ng-content>\n </button>\n</div>\n<input\n type=\"file\"\n #inputFile\n (change)=\"handleFiles($event.target.files!)\"\n class=\"input-file\"\n [multiple]=\"multiple\"\n [accept]=\"accept\"\n/>\n", styles: [".mat-mdc-form-field-appearance-outline .mat-form-field-prefix .ngx-mat-file-input--default-icon,.mat-mdc-form-field-appearance-outline .mat-form-field-suffix .ngx-mat-file-input--default-icon{width:1em}.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-prefix .ngx-mat-file-input--default-icon,.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-suffix .ngx-mat-file-input--default-icon{display:block;width:1.5em;height:1.5em}.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-prefix .mat-icon-button .ngx-mat-file-input--default-icon,.mat-mdc-form-field:not(.mat-form-field-appearance-outline) .mat-form-field-suffix .mat-icon-button .ngx-mat-file-input--default-icon{margin:auto}.ngx-mat-file-input{display:flex;line-height:18px;align-items:center}.ngx-mat-file-input .input-file{display:block;visibility:hidden;width:0;height:0}\n"] }]
235
252
  }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.Platform }, { type: i0.ChangeDetectorRef }, { type: i2.NgControl, decorators: [{
236
253
  type: Optional
237
254
  }, {
@@ -270,6 +287,7 @@ function calculFileSize(number) {
270
287
  else if (number >= 1048576) {
271
288
  return (number / 1048576).toFixed(1) + 'MB';
272
289
  }
290
+ return `${number}`;
273
291
  }
274
292
 
275
293
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-mce-file-input.mjs","sources":["../../../../projects/file-input/src/lib/file-input.component.ts","../../../../projects/file-input/src/lib/file-input.component.html","../../../../projects/file-input/src/lib/file-input-helper.ts","../../../../projects/file-input/src/lib/validators/max-size.validator.ts","../../../../projects/file-input/src/lib/validators/accept.validator.ts","../../../../projects/file-input/src/public-api.ts","../../../../projects/file-input/src/ngx-mce-file-input.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Platform } from '@angular/cdk/platform';\n\nimport {\n ChangeDetectorRef,\n Component,\n Directive,\n DoCheck,\n ElementRef,\n forwardRef,\n Input,\n input,\n OnDestroy,\n Optional,\n Self,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { ErrorStateMatcher, ThemePalette } from '@angular/material/core';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { Subject } from 'rxjs';\nimport { FileOrArrayFile } from './file-input-type';\n\nlet nextUniqueId = 0;\n\nclass NgxMatInputMixinBase {\n readonly stateChanges = new Subject<void>();\n\n constructor(\n public _defaultErrorStateMatcher: ErrorStateMatcher,\n public _parentForm: NgForm,\n public _parentFormGroup: FormGroupDirective,\n /** @docs-private */\n public ngControl: NgControl,\n ) {}\n}\n\n@Directive({\n selector: '[ngxMatFileInputIcon]',\n})\nexport class NgxMatFileInputIcon {}\n\n@Component({\n selector: 'ngx-mat-file-input',\n templateUrl: 'file-input.component.html',\n styleUrls: ['file-input.component.scss'],\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'ngx-mat-file-input',\n },\n providers: [\n {\n provide: MatFormFieldControl,\n useExisting: forwardRef(() => NgxMatFileInputComponent),\n },\n ],\n exportAs: 'ngx-mat-file-input',\n imports: [MatIconModule, MatButtonModule],\n})\nexport class NgxMatFileInputComponent\n extends NgxMatInputMixinBase\n implements MatFormFieldControl<FileOrArrayFile>, OnDestroy, DoCheck, ControlValueAccessor\n{\n private _inputFileRef = viewChild<ElementRef>('inputFile');\n private _inputValueRef = viewChild<ElementRef>('inputValue');\n\n readonly color = input<ThemePalette>('primary');\n\n public fileNames: string = null;\n\n protected _uid = `ngx-mat-fileinput-${nextUniqueId++}`;\n protected _previousNativeValue: any;\n _ariaDescribedby: string;\n\n readonly stateChanges: Subject<void> = new Subject<void>();\n focused: boolean = false;\n errorState: boolean;\n controlType: string = 'ngx-mat-file-input';\n autofilled: boolean = false;\n\n /** Function when touched */\n _onTouched = () => {};\n\n /** Function when changed */\n _onChange: (value: FileOrArrayFile) => void = () => {};\n\n @Input()\n get disabled(): boolean {\n if (this.ngControl && this.ngControl.disabled !== null) {\n return this.ngControl.disabled;\n }\n return this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n if (this.focused) {\n this.focused = false;\n this.stateChanges.next();\n }\n }\n protected _disabled = false;\n\n @Input()\n get id(): string {\n return this._id;\n }\n set id(value: string) {\n this._id = value || this._uid;\n }\n protected _id: string;\n\n @Input()\n get multiple(): boolean {\n return this._multiple;\n }\n set multiple(value: boolean) {\n this._multiple = coerceBooleanProperty(value);\n }\n protected _multiple = false;\n\n @Input()\n placeholder = 'Choose a file';\n separator = input<string>(',');\n\n @Input()\n get required(): boolean {\n return this._required;\n }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n }\n protected _required = false;\n\n @Input() errorStateMatcher: ErrorStateMatcher;\n\n @Input()\n get value(): FileOrArrayFile {\n return this._value;\n }\n set value(value: FileOrArrayFile) {\n this._value = value;\n }\n protected _value: FileOrArrayFile;\n\n @Input()\n get readonly(): boolean {\n return this._readonly;\n }\n set readonly(value: boolean) {\n this._readonly = coerceBooleanProperty(value);\n }\n private _readonly = true;\n\n /**\n * Limiting accepted file types\n * Example: accept=\"image/png, image/jpeg\" or accept=\".png, .jpg, .jpeg\" — Accept PNG or JPEG files.\n */\n @Input()\n get accept(): string {\n return this._accept;\n }\n set accept(value: string) {\n this._accept = value;\n }\n private _accept: string;\n\n constructor(\n protected _elementRef: ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>,\n protected _platform: Platform,\n private _cd: ChangeDetectorRef,\n @Optional() @Self() public ngControl: NgControl,\n @Optional() _parentForm: NgForm,\n @Optional() _parentFormGroup: FormGroupDirective,\n _defaultErrorStateMatcher: ErrorStateMatcher,\n ) {\n super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);\n\n this.id = this.id;\n\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n ngOnChanges() {\n this.stateChanges.next();\n }\n\n ngOnDestroy() {\n this.stateChanges.complete();\n }\n\n ngDoCheck() {\n if (this.ngControl) {\n this.updateErrorState();\n }\n }\n\n updateErrorState() {\n const control = this.ngControl ? this.ngControl.control : null;\n\n this.errorState = (this.errorStateMatcher ?? this._defaultErrorStateMatcher).isErrorState(\n control,\n this._parentForm,\n );\n }\n\n // Implemented as part of ControlValueAccessor.\n writeValue(value: FileOrArrayFile): void {\n this._updateInputValue(value);\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnChange(fn: (value: any) => void): void {\n this._onChange = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.stateChanges.next();\n }\n\n /** Focuses the input. */\n focus(options?: FocusOptions): void {\n this._inputValueRef().nativeElement.focus(options);\n }\n\n _focusChanged(isFocused: boolean) {\n if (isFocused !== this.focused && (!this.readonly || !isFocused)) {\n this.focused = isFocused;\n this.stateChanges.next();\n }\n }\n\n /** Mark the field as touched */\n _markAsTouched() {\n this._onTouched();\n this._cd.markForCheck();\n this.stateChanges.next();\n }\n\n protected _isBadInput() {\n let validity = (this._inputValueRef().nativeElement as HTMLInputElement).validity;\n return validity && validity.badInput;\n }\n\n get empty(): boolean {\n return !this._inputValueRef().nativeElement.value && !this._isBadInput() && !this.autofilled;\n }\n\n get shouldLabelFloat(): boolean {\n return this.focused || !this.empty;\n }\n\n setDescribedByIds(ids: string[]) {\n this._ariaDescribedby = ids.join(' ');\n }\n\n openFilePicker(event?: MouseEvent) {\n this._inputFileRef().nativeElement.click();\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n this._markAsTouched();\n }\n\n handleFiles(filelist: FileList) {\n if (filelist.length > 0) {\n const files: Array<File> = new Array();\n for (let i = 0; i < filelist.length; i++) {\n files.push(filelist.item(i));\n }\n this._updateInputValue(files);\n this._resetInputFile();\n this._onChange(this.multiple ? files : files[0]);\n }\n }\n\n /** Handles a click on the control's container. */\n onContainerClick(event: MouseEvent) {}\n\n private _resetInputFile() {\n this._inputFileRef().nativeElement.value = '';\n }\n\n private _updateInputValue(files: FileOrArrayFile) {\n let text = null;\n if (files) {\n if (Array.isArray(files)) {\n text = this._multiple ? files.map((x) => x.name).join(this.separator()) : files[0].name;\n } else {\n text = files.name != null ? files.name : null;\n }\n }\n\n this._inputValueRef().nativeElement.value = text;\n }\n}\n","<input\r\n #inputValue\r\n autocomplete=\"off\"\r\n class=\"mat-mdc-input-element mat-mdc-form-field-input-control mdc-text-field__input\"\r\n [attr.id]=\"id\"\r\n [attr.placeholder]=\"placeholder\"\r\n [disabled]=\"disabled\"\r\n [required]=\"required\"\r\n [attr.readonly]=\"readonly || null\"\r\n [attr.aria-describedby]=\"_ariaDescribedby || null\"\r\n [attr.aria-invalid]=\"errorState\"\r\n [attr.aria-required]=\"required.toString()\"\r\n/>\r\n<div class=\"mat-mdc-form-field-suffix\">\r\n <button\r\n matSuffix\r\n mat-icon-button\r\n [color]=\"color()\"\r\n class=\"button-browse\"\r\n (click)=\"openFilePicker($event)\"\r\n type=\"button\"\r\n [disabled]=\"disabled\"\r\n >\r\n <ng-content select=\"[ngxMatFileInputIcon]\">\r\n <mat-icon class=\"ngx-mat-file-input--default-icon\">attach_file</mat-icon>\r\n </ng-content>\r\n </button>\r\n</div>\r\n<input\r\n type=\"file\"\r\n #inputFile\r\n (change)=\"handleFiles($event.target.files)\"\r\n class=\"input-file\"\r\n [multiple]=\"multiple\"\r\n [accept]=\"accept\"\r\n/>\r\n","export function calculFileSize(number: number): string {\n if (number < 1024) {\n return number + 'bytes';\n } else if (number >= 1024 && number < 1048576) {\n return (number / 1024).toFixed(1) + 'KB';\n } else if (number >= 1048576) {\n return (number / 1048576).toFixed(1) + 'MB';\n }\n}\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\n/**\n * Validator for size of file\n * @param max Max of size of file (in bytes)\n */\nexport function MaxSizeValidator(max: number): ValidatorFn {\n return (ctrl: AbstractControl): ValidationErrors | null => {\n max = Number(max);\n if (isNaN(max)) {\n throw 'MaxSizeValidator: max of size of file is invalid';\n }\n if (!ctrl.value) return null;\n let files: File[] = ctrl.value;\n if (!Array.isArray(ctrl.value)) {\n files = [ctrl.value];\n }\n if (!files.length) return null;\n const add = (a: any, b: any): number => a + b;\n const sumSize = files.map((x) => x.size).reduce(add);\n if (sumSize > max) {\n return {\n maxSize: true,\n };\n }\n return null;\n };\n}\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\n/**\n * Validator for input file accept\n * @param accept Allowable type of file\n */\nexport function AcceptValidator(accept: string): ValidatorFn {\n return (ctrl: AbstractControl): ValidationErrors | null => {\n if (!accept) {\n throw 'AcceptValidator: allowable type of file can not be empty';\n }\n\n if (ctrl.value == null) return null;\n\n if (!accept.includes(ctrl.value.type)) {\n return {\n accept: true,\n };\n }\n\n return null;\n };\n}\n","/*\n * Public API Surface of file-input\n */\n\nexport * from './lib/file-input.component';\n\nexport * from './lib/file-input-type';\nexport * from './lib/file-input-helper';\nexport * from './lib/validators';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AA0BA,IAAI,YAAY,GAAG,CAAC;AAEpB,MAAM,oBAAoB,CAAA;AAGxB,IAAA,WAAA,CACS,yBAA4C,EAC5C,WAAmB,EACnB,gBAAoC;;IAEpC,SAAoB,EAAA;QAJpB,IAAA,CAAA,yBAAyB,GAAzB,yBAAyB;QACzB,IAAA,CAAA,WAAW,GAAX,WAAW;QACX,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAEhB,IAAA,CAAA,SAAS,GAAT,SAAS;AAPT,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;IAQxC;AACJ;MAKY,mBAAmB,CAAA;iIAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;qHAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,SAAS;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;IAC5C,OAAO,CAAC,IAAqB,KAA6B;QACxD,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,0DAA0D;QAClE;AAEA,QAAA,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI;AAAE,YAAA,OAAO,IAAI;AAEnC,QAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YACrC,OAAO;AACL,gBAAA,MAAM,EAAE,IAAI;aACb;QACH;AAEA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACtBA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-mce-file-input.mjs","sources":["../../../projects/file-input/src/lib/file-input.component.ts","../../../projects/file-input/src/lib/file-input.component.html","../../../projects/file-input/src/lib/file-input-helper.ts","../../../projects/file-input/src/lib/validators/max-size.validator.ts","../../../projects/file-input/src/lib/validators/accept.validator.ts","../../../projects/file-input/src/public-api.ts","../../../projects/file-input/src/ngx-mce-file-input.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Platform } from '@angular/cdk/platform';\n\nimport {\n ChangeDetectorRef,\n Component,\n Directive,\n DoCheck,\n ElementRef,\n forwardRef,\n Input,\n input,\n OnDestroy,\n Optional,\n Self,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ControlValueAccessor, FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { ErrorStateMatcher, ThemePalette } from '@angular/material/core';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { Subject } from 'rxjs';\nimport { FileOrArrayFile } from './file-input-type';\n\nlet nextUniqueId = 0;\n\nclass NgxMatInputMixinBase {\n readonly stateChanges = new Subject<void>();\n\n constructor(\n public _defaultErrorStateMatcher: ErrorStateMatcher,\n public _parentForm: NgForm,\n public _parentFormGroup: FormGroupDirective,\n /** @docs-private */\n public ngControl: NgControl,\n ) {}\n}\n\n@Directive({\n selector: '[ngxMatFileInputIcon]',\n})\nexport class NgxMatFileInputIcon {}\n\n@Component({\n selector: 'ngx-mat-file-input',\n templateUrl: 'file-input.component.html',\n styleUrls: ['file-input.component.scss'],\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'ngx-mat-file-input',\n },\n providers: [\n {\n provide: MatFormFieldControl,\n useExisting: forwardRef(() => NgxMatFileInputComponent),\n },\n ],\n exportAs: 'ngx-mat-file-input',\n imports: [MatIconModule, MatButtonModule],\n})\nexport class NgxMatFileInputComponent\n extends NgxMatInputMixinBase\n implements MatFormFieldControl<FileOrArrayFile>, OnDestroy, DoCheck, ControlValueAccessor\n{\n private _inputFileRef = viewChild<ElementRef>('inputFile');\n private _inputValueRef = viewChild<ElementRef>('inputValue');\n\n readonly color = input<ThemePalette>('primary');\n\n public fileNames: string = \"\";\n\n protected _uid = `ngx-mat-fileinput-${nextUniqueId++}`;\n protected _previousNativeValue: any;\n _ariaDescribedby: string = \"\";\n\n override stateChanges: Subject<void> = new Subject<void>();\n focused: boolean = false;\n errorState: boolean = false;\n controlType: string = 'ngx-mat-file-input';\n autofilled: boolean = false;\n\n /** Function when touched */\n _onTouched = () => {};\n\n /** Function when changed */\n _onChange: (value: FileOrArrayFile) => void = () => {};\n\n @Input()\n get disabled(): boolean {\n if (this.ngControl && this.ngControl.disabled !== null) {\n return this.ngControl.disabled;\n }\n return this._disabled;\n }\n set disabled(value: boolean) {\n this._disabled = coerceBooleanProperty(value);\n if (this.focused) {\n this.focused = false;\n this.stateChanges.next();\n }\n }\n protected _disabled = false;\n\n @Input()\n get id(): string {\n return this._id;\n }\n set id(value: string) {\n this._id = value || this._uid;\n }\n protected _id: string = \"\";\n\n @Input()\n get multiple(): boolean {\n return this._multiple;\n }\n set multiple(value: boolean) {\n this._multiple = coerceBooleanProperty(value);\n }\n protected _multiple = false;\n\n @Input()\n placeholder = 'Choose a file';\n separator = input<string>(',');\n\n @Input()\n get required(): boolean {\n return this._required;\n }\n set required(value: boolean) {\n this._required = coerceBooleanProperty(value);\n }\n protected _required = false;\n\n @Input() errorStateMatcher: ErrorStateMatcher | null = null;\n\n @Input()\n get value(): FileOrArrayFile | null {\n return this._value;\n }\n set value(value: FileOrArrayFile) {\n this._value = value;\n }\n protected _value: FileOrArrayFile | null = null;\n\n @Input()\n get readonly(): boolean {\n return this._readonly;\n }\n set readonly(value: boolean) {\n this._readonly = coerceBooleanProperty(value);\n }\n private _readonly = true;\n\n /**\n * Limiting accepted file types\n * Example: accept=\"image/png, image/jpeg\" or accept=\".png, .jpg, .jpeg\" — Accept PNG or JPEG files.\n */\n @Input()\n get accept(): string {\n return this._accept;\n }\n set accept(value: string) {\n this._accept = value;\n }\n private _accept: string = \"\";\n\n constructor(\n protected _elementRef: ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>,\n protected _platform: Platform,\n private _cd: ChangeDetectorRef,\n @Optional() @Self() override ngControl: NgControl,\n @Optional() _parentForm: NgForm,\n @Optional() _parentFormGroup: FormGroupDirective,\n _defaultErrorStateMatcher: ErrorStateMatcher,\n ) {\n super(_defaultErrorStateMatcher, _parentForm, _parentFormGroup, ngControl);\n\n this.id = this.id;\n\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n ngOnChanges() {\n this.stateChanges.next();\n }\n\n ngOnDestroy() {\n this.stateChanges.complete();\n }\n\n ngDoCheck() {\n if (this.ngControl) {\n this.updateErrorState();\n }\n }\n\n updateErrorState() {\n const control = this.ngControl ? this.ngControl.control : null;\n\n this.errorState = (this.errorStateMatcher ?? this._defaultErrorStateMatcher).isErrorState(\n control,\n this._parentForm,\n );\n }\n\n // Implemented as part of ControlValueAccessor.\n writeValue(value: FileOrArrayFile): void {\n this._updateInputValue(value);\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnChange(fn: (value: any) => void): void {\n this._onChange = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.stateChanges.next();\n }\n\n /** Focuses the input. */\n focus(options?: FocusOptions): void {\n this._inputValueRef()?.nativeElement.focus(options);\n }\n\n _focusChanged(isFocused: boolean) {\n if (isFocused !== this.focused && (!this.readonly || !isFocused)) {\n this.focused = isFocused;\n this.stateChanges.next();\n }\n }\n\n /** Mark the field as touched */\n _markAsTouched() {\n this._onTouched();\n this._cd.markForCheck();\n this.stateChanges.next();\n }\n\n protected _isBadInput() {\n let validity = (this._inputValueRef()?.nativeElement as HTMLInputElement).validity;\n return validity && validity.badInput;\n }\n\n get empty(): boolean {\n return !this._inputValueRef()?.nativeElement.value && !this._isBadInput() && !this.autofilled;\n }\n\n get shouldLabelFloat(): boolean {\n return this.focused || !this.empty;\n }\n\n setDescribedByIds(ids: string[]) {\n this._ariaDescribedby = ids.join(' ');\n }\n\n openFilePicker(event?: MouseEvent) {\n this._inputFileRef()?.nativeElement.click();\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n this._markAsTouched();\n }\n\n handleFiles(filelist: FileList) {\n if (filelist.length > 0) {\n const files: Array<File> = new Array();\n for (let i = 0; i < filelist.length; i++) {\n const f = filelist.item(i);\n if (f)\n files.push(f);\n }\n this._updateInputValue(files);\n this._resetInputFile();\n this._onChange(this.multiple ? files : files[0]);\n }\n }\n\n /** Handles a click on the control's container. */\n onContainerClick(event: MouseEvent) {}\n\n private _resetInputFile() {\n this._inputFileRef()!.nativeElement.value = '';\n }\n\n private _updateInputValue(files: FileOrArrayFile) {\n let text = null;\n if (files) {\n if (Array.isArray(files)) {\n text = this._multiple ? files.map((x) => x.name).join(this.separator()) : files[0].name;\n } else {\n text = files.name != null ? files.name : null;\n }\n }\n\n this._inputValueRef()!.nativeElement.value = text;\n }\n}\n","<input\n #inputValue\n autocomplete=\"off\"\n class=\"mat-mdc-input-element mat-mdc-form-field-input-control mdc-text-field__input\"\n [attr.id]=\"id\"\n [attr.placeholder]=\"placeholder\"\n [disabled]=\"disabled\"\n [required]=\"required\"\n [attr.readonly]=\"readonly || null\"\n [attr.aria-describedby]=\"_ariaDescribedby || null\"\n [attr.aria-invalid]=\"errorState\"\n [attr.aria-required]=\"required.toString()\"\n/>\n<div class=\"mat-mdc-form-field-suffix\">\n <button\n matSuffix\n mat-icon-button\n [color]=\"color()\"\n class=\"button-browse\"\n (click)=\"openFilePicker($event)\"\n type=\"button\"\n [disabled]=\"disabled\"\n >\n <ng-content select=\"[ngxMatFileInputIcon]\">\n <mat-icon class=\"ngx-mat-file-input--default-icon\">attach_file</mat-icon>\n </ng-content>\n </button>\n</div>\n<input\n type=\"file\"\n #inputFile\n (change)=\"handleFiles($event.target.files!)\"\n class=\"input-file\"\n [multiple]=\"multiple\"\n [accept]=\"accept\"\n/>\n","export function calculFileSize(number: number): string {\n if (number < 1024) {\n return number + 'bytes';\n } else if (number >= 1024 && number < 1048576) {\n return (number / 1024).toFixed(1) + 'KB';\n } else if (number >= 1048576) {\n return (number / 1048576).toFixed(1) + 'MB';\n }\n return `${number}`;\n}\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\n/**\n * Validator for size of file\n * @param max Max of size of file (in bytes)\n */\nexport function MaxSizeValidator(max: number): ValidatorFn {\n return (ctrl: AbstractControl): ValidationErrors | null => {\n max = Number(max);\n if (isNaN(max)) {\n throw 'MaxSizeValidator: max of size of file is invalid';\n }\n if (!ctrl.value) return null;\n let files: File[] = ctrl.value;\n if (!Array.isArray(ctrl.value)) {\n files = [ctrl.value];\n }\n if (!files.length) return null;\n const add = (a: any, b: any): number => a + b;\n const sumSize = files.map((x) => x.size).reduce(add);\n if (sumSize > max) {\n return {\n maxSize: true,\n };\n }\n return null;\n };\n}\n","import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms';\n\n/**\n * Validator for input file accept\n * @param accept Allowable type of file\n */\nexport function AcceptValidator(accept: string): ValidatorFn {\n return (ctrl: AbstractControl): ValidationErrors | null => {\n if (!accept) {\n throw 'AcceptValidator: allowable type of file can not be empty';\n }\n\n if (ctrl.value == null) return null;\n\n if (!accept.includes(ctrl.value.type)) {\n return {\n accept: true,\n };\n }\n\n return null;\n };\n}\n","/*\n * Public API Surface of file-input\n */\n\nexport * from './lib/file-input.component';\n\nexport * from './lib/file-input-type';\nexport * from './lib/file-input-helper';\nexport * from './lib/validators';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AA0BA,IAAI,YAAY,GAAG,CAAC;AAEpB,MAAM,oBAAoB,CAAA;AAIf,IAAA,yBAAA;AACA,IAAA,WAAA;AACA,IAAA,gBAAA;AAEA,IAAA,SAAA;AAPA,IAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;AAE3C,IAAA,WAAA,CACS,yBAA4C,EAC5C,WAAmB,EACnB,gBAAoC;;IAEpC,SAAoB,EAAA;QAJpB,IAAA,CAAA,yBAAyB,GAAzB,yBAAyB;QACzB,IAAA,CAAA,WAAW,GAAX,WAAW;QACX,IAAA,CAAA,gBAAgB,GAAhB,gBAAgB;QAEhB,IAAA,CAAA,SAAS,GAAT,SAAS;IACf;AACJ;MAKY,mBAAmB,CAAA;uGAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AAClC,iBAAA;;AAoBK,MAAO,wBACX,SAAQ,oBAAoB,CAAA;AA2GhB,IAAA,WAAA;AACA,IAAA,SAAA;A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6B;QACxD,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,0DAA0D;QAClE;AAEA,QAAA,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI;AAAE,YAAA,OAAO,IAAI;AAEnC,QAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YACrC,OAAO;AACL,gBAAA,MAAM,EAAE,IAAI;aACb;QACH;AAEA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACtBA;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ngx-mce/file-input",
3
- "version": "21.1.1",
3
+ "version": "21.2.0-next.2",
4
4
  "description": "Angular Material File Input",
5
- "author": "HO Hong Quan",
5
+ "author": "Felipe B.",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/fbf-prog64/angular-material-components.git"
@@ -13,16 +13,6 @@
13
13
  "homepage": "https://github.com/fbf-prog64/angular-material-components",
14
14
  "keywords": [
15
15
  "angular",
16
- "angular2",
17
- "angular 12",
18
- "angular 13",
19
- "angular 14",
20
- "angular 15",
21
- "angular 16",
22
- "angular 17",
23
- "angular 18",
24
- "angular 19",
25
- "angular 20",
26
16
  "angular-material",
27
17
  "angular material file input",
28
18
  "angular material file drop",
@@ -32,14 +22,23 @@
32
22
  "ngx-material-file-input"
33
23
  ],
34
24
  "license": "MIT",
25
+ "publishConfig": {
26
+ "directory": "../../dist/file-input",
27
+ "provenance": true,
28
+ "access": "public"
29
+ },
35
30
  "peerDependencies": {
36
- "@angular/platform-browser": "^21.0.0",
37
- "@angular/common": "^21.0.0",
38
- "@angular/core": "^21.0.0",
39
- "@angular/forms": "^21.0.0",
40
- "@angular/material": "^21.0.0",
41
- "@angular/cdk": "^21.0.0"
31
+ "@angular/platform-browser": "^21",
32
+ "@angular/common": "^21",
33
+ "@angular/core": "^21",
34
+ "@angular/forms": "^21",
35
+ "@angular/material": "^21",
36
+ "@angular/cdk": "^21"
42
37
  },
38
+ "dependencies": {
39
+ "tslib": "^2.3.0"
40
+ },
41
+ "sideEffects": false,
43
42
  "module": "fesm2022/ngx-mce-file-input.mjs",
44
43
  "typings": "types/ngx-mce-file-input.d.ts",
45
44
  "exports": {
@@ -50,9 +49,5 @@
50
49
  "types": "./types/ngx-mce-file-input.d.ts",
51
50
  "default": "./fesm2022/ngx-mce-file-input.mjs"
52
51
  }
53
- },
54
- "sideEffects": false,
55
- "dependencies": {
56
- "tslib": "^2.3.0"
57
52
  }
58
53
  }
@@ -35,7 +35,7 @@ declare class NgxMatFileInputComponent extends NgxMatInputMixinBase implements M
35
35
  protected _uid: string;
36
36
  protected _previousNativeValue: any;
37
37
  _ariaDescribedby: string;
38
- readonly stateChanges: Subject<void>;
38
+ stateChanges: Subject<void>;
39
39
  focused: boolean;
40
40
  errorState: boolean;
41
41
  controlType: string;
@@ -58,10 +58,10 @@ declare class NgxMatFileInputComponent extends NgxMatInputMixinBase implements M
58
58
  get required(): boolean;
59
59
  set required(value: boolean);
60
60
  protected _required: boolean;
61
- errorStateMatcher: ErrorStateMatcher;
62
- get value(): FileOrArrayFile;
61
+ errorStateMatcher: ErrorStateMatcher | null;
62
+ get value(): FileOrArrayFile | null;
63
63
  set value(value: FileOrArrayFile);
64
- protected _value: FileOrArrayFile;
64
+ protected _value: FileOrArrayFile | null;
65
65
  get readonly(): boolean;
66
66
  set readonly(value: boolean);
67
67
  private _readonly;