@ngx-mce/file-input 21.2.6-next.1 → 21.2.6-next.3
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.
|
@@ -1,31 +1,23 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
|
+
import { Platform } from '@angular/cdk/platform';
|
|
2
3
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Directive, viewChild, input,
|
|
4
|
-
import
|
|
4
|
+
import { Directive, viewChild, input, inject, ElementRef, ChangeDetectorRef, forwardRef, Input, ViewEncapsulation, Component } from '@angular/core';
|
|
5
|
+
import { NgControl, NgForm, FormGroupDirective } from '@angular/forms';
|
|
6
|
+
import * as i2 from '@angular/material/button';
|
|
5
7
|
import { MatButtonModule } from '@angular/material/button';
|
|
8
|
+
import { ErrorStateMatcher } from '@angular/material/core';
|
|
6
9
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
7
|
-
import * as
|
|
10
|
+
import * as i1 from '@angular/material/icon';
|
|
8
11
|
import { MatIconModule } from '@angular/material/icon';
|
|
9
12
|
import { Subject } from 'rxjs';
|
|
10
|
-
import * as i1 from '@angular/cdk/platform';
|
|
11
|
-
import * as i2 from '@angular/forms';
|
|
12
|
-
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
16
|
stateChanges = new Subject();
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this._parentForm = _parentForm;
|
|
26
|
-
this._parentFormGroup = _parentFormGroup;
|
|
27
|
-
this.ngControl = ngControl;
|
|
28
|
-
}
|
|
17
|
+
ngControl = null;
|
|
18
|
+
_parentForm = null;
|
|
19
|
+
_parentFormGroup = null;
|
|
20
|
+
_defaultErrorStateMatcher = null;
|
|
29
21
|
}
|
|
30
22
|
class NgxMatFileInputIcon {
|
|
31
23
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NgxMatFileInputIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -38,16 +30,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
|
|
|
38
30
|
}]
|
|
39
31
|
}] });
|
|
40
32
|
class NgxMatFileInputComponent extends NgxMatInputMixinBase {
|
|
41
|
-
_elementRef;
|
|
42
|
-
_platform;
|
|
43
|
-
_cd;
|
|
44
|
-
ngControl;
|
|
45
33
|
_inputFileRef = viewChild('inputFile', ...(ngDevMode ? [{ debugName: "_inputFileRef" }] : /* istanbul ignore next */ []));
|
|
46
34
|
_inputValueRef = viewChild('inputValue', ...(ngDevMode ? [{ debugName: "_inputValueRef" }] : /* istanbul ignore next */ []));
|
|
47
35
|
color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
48
36
|
fileNames = "";
|
|
49
37
|
_uid = `ngx-mat-fileinput-${nextUniqueId++}`;
|
|
50
|
-
_previousNativeValue;
|
|
51
38
|
_ariaDescribedby = "";
|
|
52
39
|
stateChanges = new Subject();
|
|
53
40
|
focused = false;
|
|
@@ -55,9 +42,13 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
|
|
|
55
42
|
controlType = 'ngx-mat-file-input';
|
|
56
43
|
autofilled = false;
|
|
57
44
|
/** Function when touched */
|
|
58
|
-
_onTouched = () => {
|
|
45
|
+
_onTouched = () => {
|
|
46
|
+
// Intentionally empty.
|
|
47
|
+
};
|
|
59
48
|
/** Function when changed */
|
|
60
|
-
_onChange = () => {
|
|
49
|
+
_onChange = () => {
|
|
50
|
+
// Intentionally empty.
|
|
51
|
+
};
|
|
61
52
|
get disabled() {
|
|
62
53
|
if (this.ngControl && this.ngControl.disabled !== null) {
|
|
63
54
|
return this.ngControl.disabled;
|
|
@@ -121,13 +112,15 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
|
|
|
121
112
|
this._accept = value;
|
|
122
113
|
}
|
|
123
114
|
_accept = "";
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
115
|
+
_elementRef = inject((ElementRef));
|
|
116
|
+
_platform = inject(Platform);
|
|
117
|
+
_cd = inject(ChangeDetectorRef);
|
|
118
|
+
ngControl = inject(NgControl, { optional: true, self: true });
|
|
119
|
+
_parentForm = inject(NgForm, { optional: true });
|
|
120
|
+
_parentFormGroup = inject(FormGroupDirective, { optional: true });
|
|
121
|
+
_defaultErrorStateMatcher = inject(ErrorStateMatcher);
|
|
122
|
+
constructor() {
|
|
123
|
+
super();
|
|
131
124
|
if (this.ngControl) {
|
|
132
125
|
this.ngControl.valueAccessor = this;
|
|
133
126
|
}
|
|
@@ -181,7 +174,7 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
|
|
|
181
174
|
this.stateChanges.next();
|
|
182
175
|
}
|
|
183
176
|
_isBadInput() {
|
|
184
|
-
|
|
177
|
+
const validity = (this._inputValueRef()?.nativeElement).validity;
|
|
185
178
|
return validity && validity.badInput;
|
|
186
179
|
}
|
|
187
180
|
get empty() {
|
|
@@ -203,7 +196,7 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
|
|
|
203
196
|
}
|
|
204
197
|
handleFiles(filelist) {
|
|
205
198
|
if (filelist.length > 0) {
|
|
206
|
-
const files =
|
|
199
|
+
const files = [];
|
|
207
200
|
for (let i = 0; i < filelist.length; i++) {
|
|
208
201
|
const f = filelist.item(i);
|
|
209
202
|
if (f)
|
|
@@ -215,7 +208,9 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
|
|
|
215
208
|
}
|
|
216
209
|
}
|
|
217
210
|
/** Handles a click on the control's container. */
|
|
218
|
-
onContainerClick(
|
|
211
|
+
onContainerClick(_) {
|
|
212
|
+
// Intentionally empty.
|
|
213
|
+
}
|
|
219
214
|
_resetInputFile() {
|
|
220
215
|
this._inputFileRef().nativeElement.value = '';
|
|
221
216
|
}
|
|
@@ -231,13 +226,13 @@ class NgxMatFileInputComponent extends NgxMatInputMixinBase {
|
|
|
231
226
|
}
|
|
232
227
|
this._inputValueRef().nativeElement.value = text;
|
|
233
228
|
}
|
|
234
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NgxMatFileInputComponent, deps: [
|
|
229
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NgxMatFileInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
235
230
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.6", 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: [
|
|
236
231
|
{
|
|
237
232
|
provide: MatFormFieldControl,
|
|
238
233
|
useExisting: forwardRef(() => NgxMatFileInputComponent),
|
|
239
234
|
},
|
|
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:
|
|
235
|
+
], 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: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
241
236
|
}
|
|
242
237
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: NgxMatFileInputComponent, decorators: [{
|
|
243
238
|
type: Component,
|
|
@@ -249,15 +244,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
|
|
|
249
244
|
useExisting: forwardRef(() => NgxMatFileInputComponent),
|
|
250
245
|
},
|
|
251
246
|
], 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"] }]
|
|
252
|
-
}], ctorParameters: () => [{ type: i0.
|
|
253
|
-
type: Optional
|
|
254
|
-
}, {
|
|
255
|
-
type: Self
|
|
256
|
-
}] }, { type: i2.NgForm, decorators: [{
|
|
257
|
-
type: Optional
|
|
258
|
-
}] }, { type: i2.FormGroupDirective, decorators: [{
|
|
259
|
-
type: Optional
|
|
260
|
-
}] }, { type: i3.ErrorStateMatcher }], propDecorators: { _inputFileRef: [{ type: i0.ViewChild, args: ['inputFile', { isSignal: true }] }], _inputValueRef: [{ type: i0.ViewChild, args: ['inputValue', { isSignal: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], disabled: [{
|
|
247
|
+
}], ctorParameters: () => [], propDecorators: { _inputFileRef: [{ type: i0.ViewChild, args: ['inputFile', { isSignal: true }] }], _inputValueRef: [{ type: i0.ViewChild, args: ['inputValue', { isSignal: true }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], disabled: [{
|
|
261
248
|
type: Input
|
|
262
249
|
}], id: [{
|
|
263
250
|
type: Input
|
|
@@ -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 = \"\";\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;AACF,IAAA,GAAA;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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 inject,\n Input,\n input,\n OnChanges,\n OnDestroy,\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\n readonly stateChanges = new Subject<void>();\n\n protected ngControl: NgControl | null = null;\n protected _parentForm: NgForm | null = null;\n protected _parentFormGroup: FormGroupDirective | null = null;\n protected _defaultErrorStateMatcher: ErrorStateMatcher | null = null;\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>, OnChanges, 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 = \"\";\n\n protected _uid = `ngx-mat-fileinput-${nextUniqueId++}`;\n _ariaDescribedby = \"\";\n\n override stateChanges: Subject<void> = new Subject<void>();\n focused = false;\n errorState = false;\n controlType = 'ngx-mat-file-input';\n autofilled = false;\n\n /** Function when touched */\n _onTouched = () => {\n // Intentionally empty.\n };\n\n /** Function when changed */\n _onChange: (value: FileOrArrayFile) => void = () => {\n // Intentionally empty.\n };\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 = \"\";\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 = \"\";\n\n protected _elementRef = inject(ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>);\n protected _platform = inject(Platform);\n private _cd = inject(ChangeDetectorRef);\n\n override ngControl = inject(NgControl, { optional: true, self: true });\n protected override _parentForm = inject(NgForm, { optional: true });\n protected override _parentFormGroup = inject(FormGroupDirective, { optional: true });\n protected override _defaultErrorStateMatcher = inject(ErrorStateMatcher);\n\n constructor() {\n super();\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: FileOrArrayFile) => 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 const 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: File[] = [];\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(_: MouseEvent) {\n // Intentionally empty.\n }\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: number, b: number): 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;AAEf,IAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;IAEjC,SAAS,GAAqB,IAAI;IAClC,WAAW,GAAkB,IAAI;IACjC,gBAAgB,GAA8B,IAAI;IAClD,yBAAyB,GAA6B,IAAI;AAErE;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;AAGpB,IAAA,aAAa,GAAG,SAAS,CAAa,WAAW,oFAAC;AAClD,IAAA,cAAc,GAAG,SAAS,CAAa,YAAY,qFAAC;AAEnD,IAAA,KAAK,GAAG,KAAK,CAAe,SAAS,4EAAC;IAExC,SAAS,GAAG,EAAE;AAEX,IAAA,IAAI,GAAG,CAAA,kBAAA,EAAqB,YAAY,EAAE,EAAE;IACtD,gBAAgB,GAAG,EAAE;AAEZ,IAAA,YAAY,GA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C,KAAK,CAAC;QACtB;QACA,IAAI,CAAC,KAAK,CAAC,MAAM;AAAE,YAAA,OAAO,IAAI;AAC9B,QAAA,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,KAAa,CAAC,GAAG,CAAC;QACnD,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;AACpD,QAAA,IAAI,OAAO,GAAG,GAAG,EAAE;YACjB,OAAO;AACL,gBAAA,OAAO,EAAE,IAAI;aACd;QACH;AACA,QAAA,OAAO,IAAI;AACb,IAAA,CAAC;AACH;;ACzBA;;;AAGG;AACG,SAAU,eAAe,CAAC,MAAc,EAAA;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;;;;"}
|
package/package.json
CHANGED
|
@@ -1,39 +1,30 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnDestroy, DoCheck, ElementRef
|
|
2
|
+
import { OnChanges, OnDestroy, DoCheck, ElementRef } from '@angular/core';
|
|
3
3
|
import { Platform } from '@angular/cdk/platform';
|
|
4
|
-
import { NgForm, FormGroupDirective,
|
|
4
|
+
import { NgControl, NgForm, FormGroupDirective, ControlValueAccessor, ValidatorFn } from '@angular/forms';
|
|
5
5
|
import { ErrorStateMatcher, ThemePalette } from '@angular/material/core';
|
|
6
6
|
import { MatFormFieldControl } from '@angular/material/form-field';
|
|
7
7
|
import { Subject } from 'rxjs';
|
|
8
8
|
|
|
9
|
-
type FileOrArrayFile = File |
|
|
9
|
+
type FileOrArrayFile = File | File[];
|
|
10
10
|
|
|
11
11
|
declare class NgxMatInputMixinBase {
|
|
12
|
-
_defaultErrorStateMatcher: ErrorStateMatcher;
|
|
13
|
-
_parentForm: NgForm;
|
|
14
|
-
_parentFormGroup: FormGroupDirective;
|
|
15
|
-
/** @docs-private */
|
|
16
|
-
ngControl: NgControl;
|
|
17
12
|
readonly stateChanges: Subject<void>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
protected ngControl: NgControl | null;
|
|
14
|
+
protected _parentForm: NgForm | null;
|
|
15
|
+
protected _parentFormGroup: FormGroupDirective | null;
|
|
16
|
+
protected _defaultErrorStateMatcher: ErrorStateMatcher | null;
|
|
21
17
|
}
|
|
22
18
|
declare class NgxMatFileInputIcon {
|
|
23
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatFileInputIcon, never>;
|
|
24
20
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxMatFileInputIcon, "[ngxMatFileInputIcon]", never, {}, {}, never, never, true, never>;
|
|
25
21
|
}
|
|
26
|
-
declare class NgxMatFileInputComponent extends NgxMatInputMixinBase implements MatFormFieldControl<FileOrArrayFile>, OnDestroy, DoCheck, ControlValueAccessor {
|
|
27
|
-
protected _elementRef: ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>;
|
|
28
|
-
protected _platform: Platform;
|
|
29
|
-
private _cd;
|
|
30
|
-
ngControl: NgControl;
|
|
22
|
+
declare class NgxMatFileInputComponent extends NgxMatInputMixinBase implements MatFormFieldControl<FileOrArrayFile>, OnChanges, OnDestroy, DoCheck, ControlValueAccessor {
|
|
31
23
|
private _inputFileRef;
|
|
32
24
|
private _inputValueRef;
|
|
33
25
|
readonly color: i0.InputSignal<ThemePalette>;
|
|
34
26
|
fileNames: string;
|
|
35
27
|
protected _uid: string;
|
|
36
|
-
protected _previousNativeValue: any;
|
|
37
28
|
_ariaDescribedby: string;
|
|
38
29
|
stateChanges: Subject<void>;
|
|
39
30
|
focused: boolean;
|
|
@@ -72,13 +63,20 @@ declare class NgxMatFileInputComponent extends NgxMatInputMixinBase implements M
|
|
|
72
63
|
get accept(): string;
|
|
73
64
|
set accept(value: string);
|
|
74
65
|
private _accept;
|
|
75
|
-
|
|
66
|
+
protected _elementRef: ElementRef<any>;
|
|
67
|
+
protected _platform: Platform;
|
|
68
|
+
private _cd;
|
|
69
|
+
ngControl: NgControl | null;
|
|
70
|
+
protected _parentForm: NgForm | null;
|
|
71
|
+
protected _parentFormGroup: FormGroupDirective | null;
|
|
72
|
+
protected _defaultErrorStateMatcher: ErrorStateMatcher;
|
|
73
|
+
constructor();
|
|
76
74
|
ngOnChanges(): void;
|
|
77
75
|
ngOnDestroy(): void;
|
|
78
76
|
ngDoCheck(): void;
|
|
79
77
|
updateErrorState(): void;
|
|
80
78
|
writeValue(value: FileOrArrayFile): void;
|
|
81
|
-
registerOnChange(fn: (value:
|
|
79
|
+
registerOnChange(fn: (value: FileOrArrayFile) => void): void;
|
|
82
80
|
registerOnTouched(fn: () => void): void;
|
|
83
81
|
setDisabledState(isDisabled: boolean): void;
|
|
84
82
|
/** Focuses the input. */
|
|
@@ -93,10 +91,10 @@ declare class NgxMatFileInputComponent extends NgxMatInputMixinBase implements M
|
|
|
93
91
|
openFilePicker(event?: MouseEvent): void;
|
|
94
92
|
handleFiles(filelist: FileList): void;
|
|
95
93
|
/** Handles a click on the control's container. */
|
|
96
|
-
onContainerClick(
|
|
94
|
+
onContainerClick(_: MouseEvent): void;
|
|
97
95
|
private _resetInputFile;
|
|
98
96
|
private _updateInputValue;
|
|
99
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatFileInputComponent,
|
|
97
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxMatFileInputComponent, never>;
|
|
100
98
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgxMatFileInputComponent, "ngx-mat-file-input", ["ngx-mat-file-input"], { "color": { "alias": "color"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; "id": { "alias": "id"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "separator": { "alias": "separator"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; }; "value": { "alias": "value"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; }, {}, never, ["[ngxMatFileInputIcon]"], true, never>;
|
|
101
99
|
}
|
|
102
100
|
|