@ptsecurity/mosaic 15.3.2 → 15.4.1
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/_theming.scss +675 -42
- package/_visual.scss +132 -42
- package/button/button.component.d.ts +1 -0
- package/button-toggle/_button-toggle-theme.scss +92 -0
- package/button-toggle/button-toggle.component.d.ts +6 -2
- package/button-toggle/button-toggle.module.d.ts +2 -1
- package/button-toggle/button-toggle.scss +109 -81
- package/core/styles/_mosaic-theme.scss +6 -0
- package/core/styles/theming/_components-theming.scss +92 -0
- package/core/utils/data-size/config.d.ts +20 -0
- package/core/utils/data-size/data-size.pipe.d.ts +13 -0
- package/core/utils/data-size/index.d.ts +3 -0
- package/core/utils/data-size/size.d.ts +16 -0
- package/core/utils/public-api.d.ts +1 -0
- package/ellipsis-center/ellipsis-center.directive.d.ts +27 -0
- package/ellipsis-center/index.d.ts +1 -0
- package/ellipsis-center/public-api.d.ts +1 -0
- package/esm2020/button/button.component.mjs +9 -7
- package/esm2020/button-toggle/button-toggle.component.mjs +28 -9
- package/esm2020/button-toggle/button-toggle.module.mjs +5 -4
- package/esm2020/core/utils/data-size/config.mjs +22 -0
- package/esm2020/core/utils/data-size/data-size.pipe.mjs +32 -0
- package/esm2020/core/utils/data-size/index.mjs +4 -0
- package/esm2020/core/utils/data-size/size.mjs +50 -0
- package/esm2020/core/utils/public-api.mjs +2 -1
- package/esm2020/core/version.mjs +2 -2
- package/esm2020/ellipsis-center/ellipsis-center.directive.mjs +106 -0
- package/esm2020/ellipsis-center/index.mjs +2 -0
- package/esm2020/ellipsis-center/ptsecurity-mosaic-ellipsis-center.mjs +5 -0
- package/esm2020/ellipsis-center/public-api.mjs +2 -0
- package/esm2020/file-upload/file-drop.mjs +43 -0
- package/esm2020/file-upload/file-upload.mjs +4 -0
- package/esm2020/file-upload/file-upload.module.mjs +66 -0
- package/esm2020/file-upload/index.mjs +2 -0
- package/esm2020/file-upload/multiple-file-upload.component.mjs +161 -0
- package/esm2020/file-upload/ptsecurity-mosaic-file-upload.mjs +5 -0
- package/esm2020/file-upload/public-api.mjs +6 -0
- package/esm2020/file-upload/single-file-upload.component.mjs +130 -0
- package/esm2020/select/select.component.mjs +5 -5
- package/esm2020/timezone/timezone-select.component.mjs +2 -2
- package/esm2020/tree-select/tree-select.component.mjs +8 -5
- package/fesm2015/ptsecurity-mosaic-button-toggle.mjs +31 -11
- package/fesm2015/ptsecurity-mosaic-button-toggle.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-button.mjs +9 -7
- package/fesm2015/ptsecurity-mosaic-button.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-core.mjs +101 -2
- package/fesm2015/ptsecurity-mosaic-core.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-ellipsis-center.mjs +113 -0
- package/fesm2015/ptsecurity-mosaic-ellipsis-center.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-file-upload.mjs +392 -0
- package/fesm2015/ptsecurity-mosaic-file-upload.mjs.map +1 -0
- package/fesm2015/ptsecurity-mosaic-select.mjs +4 -4
- package/fesm2015/ptsecurity-mosaic-select.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-timezone.mjs +2 -2
- package/fesm2015/ptsecurity-mosaic-timezone.mjs.map +1 -1
- package/fesm2015/ptsecurity-mosaic-tree-select.mjs +7 -4
- package/fesm2015/ptsecurity-mosaic-tree-select.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-button-toggle.mjs +31 -11
- package/fesm2020/ptsecurity-mosaic-button-toggle.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-button.mjs +9 -7
- package/fesm2020/ptsecurity-mosaic-button.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-core.mjs +101 -2
- package/fesm2020/ptsecurity-mosaic-core.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-ellipsis-center.mjs +111 -0
- package/fesm2020/ptsecurity-mosaic-ellipsis-center.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-file-upload.mjs +388 -0
- package/fesm2020/ptsecurity-mosaic-file-upload.mjs.map +1 -0
- package/fesm2020/ptsecurity-mosaic-select.mjs +4 -4
- package/fesm2020/ptsecurity-mosaic-select.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-timezone.mjs +2 -2
- package/fesm2020/ptsecurity-mosaic-timezone.mjs.map +1 -1
- package/fesm2020/ptsecurity-mosaic-tree-select.mjs +7 -4
- package/fesm2020/ptsecurity-mosaic-tree-select.mjs.map +1 -1
- package/file-upload/README.md +0 -0
- package/file-upload/_file-upload-theme.scss +174 -0
- package/file-upload/file-drop.d.ts +11 -0
- package/file-upload/file-upload.d.ts +22 -0
- package/file-upload/file-upload.module.d.ts +18 -0
- package/file-upload/file-upload.scss +46 -0
- package/file-upload/index.d.ts +1 -0
- package/file-upload/multiple-file-upload.component.d.ts +51 -0
- package/file-upload/multiple-file-upload.component.scss +148 -0
- package/file-upload/public-api.d.ts +5 -0
- package/file-upload/single-file-upload.component.d.ts +34 -0
- package/file-upload/single-file-upload.component.scss +60 -0
- package/package.json +18 -2
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/default-theme.css +1 -1
- package/select/_select-theme.scss +6 -0
- package/select/select.component.d.ts +1 -1
- package/select/select.scss +13 -0
- package/tree-select/_tree-select-theme.scss +6 -0
- package/tree-select/tree-select.component.d.ts +2 -2
- package/tree-select/tree-select.scss +13 -0
@@ -0,0 +1,113 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { Directive, Inject, Optional, Input, NgModule } from '@angular/core';
|
3
|
+
import { McTooltipTrigger, MC_TOOLTIP_SCROLL_STRATEGY } from '@ptsecurity/mosaic/tooltip';
|
4
|
+
import { Subject, Subscription } from 'rxjs';
|
5
|
+
import { debounceTime } from 'rxjs/operators';
|
6
|
+
import * as i1 from '@angular/cdk/overlay';
|
7
|
+
import * as i2 from '@angular/cdk/bidi';
|
8
|
+
|
9
|
+
const MIN_VISIBLE_LENGTH = 50;
|
10
|
+
class McEllipsisCenterDirective extends McTooltipTrigger {
|
11
|
+
constructor(overlay, elementRef, ngZone, scrollDispatcher, hostView, scrollStrategy, direction, renderer) {
|
12
|
+
super(overlay, elementRef, ngZone, scrollDispatcher, hostView, scrollStrategy, direction);
|
13
|
+
this.renderer = renderer;
|
14
|
+
this.minVisibleLength = MIN_VISIBLE_LENGTH;
|
15
|
+
this.resizeStream = new Subject();
|
16
|
+
this.resizeSubscription = Subscription.EMPTY;
|
17
|
+
this.debounceInterval = 50;
|
18
|
+
}
|
19
|
+
set mcEllipsisCenter(value) {
|
20
|
+
this._mcEllipsisCenter = value;
|
21
|
+
this.refresh();
|
22
|
+
}
|
23
|
+
ngOnInit() {
|
24
|
+
super.ngOnInit();
|
25
|
+
this.content = this._mcEllipsisCenter;
|
26
|
+
this.refresh();
|
27
|
+
}
|
28
|
+
ngAfterViewInit() {
|
29
|
+
this.resizeSubscription = this.resizeStream
|
30
|
+
.pipe(debounceTime(this.debounceInterval))
|
31
|
+
.subscribe(() => this.refresh());
|
32
|
+
}
|
33
|
+
ngOnDestroy() {
|
34
|
+
super.ngOnDestroy();
|
35
|
+
this.resizeSubscription.unsubscribe();
|
36
|
+
}
|
37
|
+
refresh() {
|
38
|
+
let start = '';
|
39
|
+
let end = '';
|
40
|
+
const dataTextStartLength = 0.75;
|
41
|
+
this.content = this._mcEllipsisCenter;
|
42
|
+
const [dataTextStart, dataTextEnd] = ['data-text-start', 'data-text-end'].map((querySelector) => {
|
43
|
+
const element = this.elementRef.nativeElement.querySelector(`.${querySelector}`);
|
44
|
+
if (element) {
|
45
|
+
this.renderer.removeChild(this.elementRef.nativeElement, element);
|
46
|
+
}
|
47
|
+
const newElement = this.renderer.createElement('span');
|
48
|
+
this.renderer.addClass(newElement, querySelector);
|
49
|
+
return newElement;
|
50
|
+
});
|
51
|
+
this.renderer.appendChild(dataTextStart, this.renderer.createText(this._mcEllipsisCenter));
|
52
|
+
this.renderer.appendChild(dataTextEnd, this.renderer.createText(end));
|
53
|
+
setTimeout(() => {
|
54
|
+
this.disabled = this.elementRef.nativeElement.clientWidth > dataTextStart.scrollWidth;
|
55
|
+
if (this.disabled) {
|
56
|
+
start = '';
|
57
|
+
end = this._mcEllipsisCenter;
|
58
|
+
}
|
59
|
+
else {
|
60
|
+
const sliceIndex = Math.round(this._mcEllipsisCenter.length * dataTextStartLength);
|
61
|
+
start = this._mcEllipsisCenter.slice(0, sliceIndex);
|
62
|
+
end = this._mcEllipsisCenter.slice(sliceIndex);
|
63
|
+
}
|
64
|
+
dataTextStart.innerText = start;
|
65
|
+
dataTextEnd.innerText = end;
|
66
|
+
});
|
67
|
+
this.renderer.appendChild(this.elementRef.nativeElement, dataTextStart);
|
68
|
+
this.renderer.appendChild(this.elementRef.nativeElement, dataTextEnd);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
/** @nocollapse */ McEllipsisCenterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McEllipsisCenterDirective, deps: [{ token: i1.Overlay }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i1.ScrollDispatcher }, { token: i0.ViewContainerRef }, { token: MC_TOOLTIP_SCROLL_STRATEGY }, { token: i2.Directionality, optional: true }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
72
|
+
/** @nocollapse */ McEllipsisCenterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.2", type: McEllipsisCenterDirective, selector: "[mcEllipsisCenter]", inputs: { mcEllipsisCenter: "mcEllipsisCenter", minVisibleLength: "minVisibleLength" }, host: { listeners: { "window:resize": "resizeStream.next($event)" }, classAttribute: "mc-ellipsis-center" }, usesInheritance: true, ngImport: i0 });
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McEllipsisCenterDirective, decorators: [{
|
74
|
+
type: Directive,
|
75
|
+
args: [{
|
76
|
+
selector: '[mcEllipsisCenter]',
|
77
|
+
host: {
|
78
|
+
class: 'mc-ellipsis-center',
|
79
|
+
'(window:resize)': 'resizeStream.next($event)'
|
80
|
+
}
|
81
|
+
}]
|
82
|
+
}], ctorParameters: function () {
|
83
|
+
return [{ type: i1.Overlay }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: i1.ScrollDispatcher }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{
|
84
|
+
type: Inject,
|
85
|
+
args: [MC_TOOLTIP_SCROLL_STRATEGY]
|
86
|
+
}] }, { type: i2.Directionality, decorators: [{
|
87
|
+
type: Optional
|
88
|
+
}] }, { type: i0.Renderer2 }];
|
89
|
+
}, propDecorators: { mcEllipsisCenter: [{
|
90
|
+
type: Input
|
91
|
+
}], minVisibleLength: [{
|
92
|
+
type: Input
|
93
|
+
}] } });
|
94
|
+
class McEllipsisCenterModule {
|
95
|
+
}
|
96
|
+
/** @nocollapse */ McEllipsisCenterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McEllipsisCenterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
97
|
+
/** @nocollapse */ McEllipsisCenterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.2", ngImport: i0, type: McEllipsisCenterModule, declarations: [McEllipsisCenterDirective], exports: [McEllipsisCenterDirective] });
|
98
|
+
/** @nocollapse */ McEllipsisCenterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McEllipsisCenterModule });
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McEllipsisCenterModule, decorators: [{
|
100
|
+
type: NgModule,
|
101
|
+
args: [{
|
102
|
+
imports: [],
|
103
|
+
exports: [McEllipsisCenterDirective],
|
104
|
+
declarations: [McEllipsisCenterDirective]
|
105
|
+
}]
|
106
|
+
}] });
|
107
|
+
|
108
|
+
/**
|
109
|
+
* Generated bundle index. Do not edit.
|
110
|
+
*/
|
111
|
+
|
112
|
+
export { McEllipsisCenterDirective, McEllipsisCenterModule };
|
113
|
+
//# sourceMappingURL=ptsecurity-mosaic-ellipsis-center.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ptsecurity-mosaic-ellipsis-center.mjs","sources":["../../../packages/mosaic/ellipsis-center/ellipsis-center.directive.ts","../../../packages/mosaic/ellipsis-center/ptsecurity-mosaic-ellipsis-center.ts"],"sourcesContent":["import { Directionality } from '@angular/cdk/bidi';\nimport { Overlay, ScrollDispatcher } from '@angular/cdk/overlay';\nimport {\n Directive,\n ElementRef,\n Input,\n OnInit,\n OnDestroy,\n NgZone,\n ViewContainerRef,\n Inject,\n Optional, Renderer2, AfterViewInit, NgModule\n} from '@angular/core';\nimport { McTooltipTrigger, MC_TOOLTIP_SCROLL_STRATEGY } from '@ptsecurity/mosaic/tooltip';\nimport { Subject, Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\n\n\nconst MIN_VISIBLE_LENGTH = 50;\n\n@Directive({\n selector: '[mcEllipsisCenter]',\n host: {\n class: 'mc-ellipsis-center',\n '(window:resize)': 'resizeStream.next($event)'\n }\n})\nexport class McEllipsisCenterDirective extends McTooltipTrigger\n implements OnInit, AfterViewInit, OnDestroy {\n @Input() set mcEllipsisCenter(value: string) {\n this._mcEllipsisCenter = value;\n this.refresh();\n }\n @Input() minVisibleLength: number = MIN_VISIBLE_LENGTH;\n\n readonly resizeStream = new Subject<Event>();\n\n private _mcEllipsisCenter: string;\n\n private resizeSubscription = Subscription.EMPTY;\n\n private readonly debounceInterval: number = 50;\n\n constructor(\n overlay: Overlay,\n elementRef: ElementRef<HTMLElement>,\n ngZone: NgZone,\n scrollDispatcher: ScrollDispatcher,\n hostView: ViewContainerRef,\n @Inject(MC_TOOLTIP_SCROLL_STRATEGY) scrollStrategy: any,\n @Optional() direction: Directionality,\n private renderer: Renderer2\n ) {\n super(overlay, elementRef, ngZone, scrollDispatcher, hostView, scrollStrategy, direction);\n }\n\n override ngOnInit(): void {\n super.ngOnInit();\n this.content = this._mcEllipsisCenter;\n this.refresh();\n }\n\n ngAfterViewInit(): void {\n this.resizeSubscription = this.resizeStream\n .pipe(debounceTime(this.debounceInterval))\n .subscribe(() => this.refresh());\n }\n\n ngOnDestroy() {\n super.ngOnDestroy();\n this.resizeSubscription.unsubscribe();\n }\n\n private refresh() {\n let start = '';\n let end = '';\n const dataTextStartLength = 0.75;\n this.content = this._mcEllipsisCenter;\n\n const [dataTextStart, dataTextEnd] = ['data-text-start', 'data-text-end'].map((querySelector) => {\n const element = this.elementRef.nativeElement.querySelector(`.${querySelector}`);\n if (element) {\n this.renderer.removeChild(this.elementRef.nativeElement, element);\n }\n const newElement = this.renderer.createElement('span');\n this.renderer.addClass(newElement, querySelector);\n\n return newElement;\n });\n\n this.renderer.appendChild(dataTextStart, this.renderer.createText(this._mcEllipsisCenter));\n this.renderer.appendChild(dataTextEnd, this.renderer.createText(end));\n setTimeout(() => {\n this.disabled = this.elementRef.nativeElement.clientWidth > dataTextStart.scrollWidth;\n if (this.disabled) {\n start = '';\n end = this._mcEllipsisCenter;\n } else {\n const sliceIndex: number = Math.round(this._mcEllipsisCenter.length * dataTextStartLength);\n\n start = this._mcEllipsisCenter.slice(0, sliceIndex);\n end = this._mcEllipsisCenter.slice(sliceIndex);\n }\n dataTextStart.innerText = start;\n dataTextEnd.innerText = end;\n });\n\n this.renderer.appendChild(this.elementRef.nativeElement, dataTextStart);\n this.renderer.appendChild(this.elementRef.nativeElement, dataTextEnd);\n }\n}\n\n@NgModule({\n imports: [],\n exports: [McEllipsisCenterDirective],\n declarations: [McEllipsisCenterDirective]\n})\nexport class McEllipsisCenterModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
@@ -0,0 +1,392 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { InjectionToken, EventEmitter, Directive, Output, TemplateRef, Component, ChangeDetectionStrategy, Optional, Inject, Input, ContentChild, ViewChild, NgModule } from '@angular/core';
|
3
|
+
import * as i2 from '@angular/common';
|
4
|
+
import { CommonModule } from '@angular/common';
|
5
|
+
import * as i5$1 from '@ptsecurity/mosaic/button';
|
6
|
+
import { McButtonModule } from '@ptsecurity/mosaic/button';
|
7
|
+
import * as i9 from '@ptsecurity/mosaic/core';
|
8
|
+
import { McDataSizeModule } from '@ptsecurity/mosaic/core';
|
9
|
+
import * as i7 from '@ptsecurity/mosaic/ellipsis-center';
|
10
|
+
import { McEllipsisCenterModule } from '@ptsecurity/mosaic/ellipsis-center';
|
11
|
+
import * as i6 from '@ptsecurity/mosaic/form-field';
|
12
|
+
import { McFormFieldModule } from '@ptsecurity/mosaic/form-field';
|
13
|
+
import * as i4 from '@ptsecurity/mosaic/icon';
|
14
|
+
import { McIconModule } from '@ptsecurity/mosaic/icon';
|
15
|
+
import * as i5 from '@ptsecurity/mosaic/list';
|
16
|
+
import { McListModule } from '@ptsecurity/mosaic/list';
|
17
|
+
import * as i3 from '@ptsecurity/mosaic/progress-spinner';
|
18
|
+
import { McProgressSpinnerModule } from '@ptsecurity/mosaic/progress-spinner';
|
19
|
+
import { McToolTipModule } from '@ptsecurity/mosaic/tooltip';
|
20
|
+
import { Subscription, BehaviorSubject } from 'rxjs';
|
21
|
+
import * as i1 from '@angular/cdk/a11y';
|
22
|
+
|
23
|
+
/* Object for labels customization inside file upload component */
|
24
|
+
const MC_FILE_UPLOAD_CONFIGURATION = new InjectionToken('McFileUploadConfiguration');
|
25
|
+
|
26
|
+
class McFileDropDirective {
|
27
|
+
constructor() {
|
28
|
+
this.filesDropped = new EventEmitter();
|
29
|
+
}
|
30
|
+
onDragOver(event) {
|
31
|
+
event.preventDefault();
|
32
|
+
event.stopPropagation();
|
33
|
+
this.dragover = true;
|
34
|
+
}
|
35
|
+
onDragLeave(event) {
|
36
|
+
event.preventDefault();
|
37
|
+
event.stopPropagation();
|
38
|
+
this.dragover = false;
|
39
|
+
}
|
40
|
+
onDrop(event) {
|
41
|
+
event.preventDefault();
|
42
|
+
event.stopPropagation();
|
43
|
+
this.dragover = false;
|
44
|
+
if (event.dataTransfer && event.dataTransfer.files.length > 0) {
|
45
|
+
this.filesDropped.emit(event.dataTransfer.files);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
/** @nocollapse */ McFileDropDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McFileDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
50
|
+
/** @nocollapse */ McFileDropDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.2", type: McFileDropDirective, selector: "[mcFileDrop]", outputs: { filesDropped: "filesDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" }, properties: { "class.dragover": "dragover" } }, exportAs: ["mcFileDrop"], ngImport: i0 });
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McFileDropDirective, decorators: [{
|
52
|
+
type: Directive,
|
53
|
+
args: [{
|
54
|
+
selector: '[mcFileDrop]',
|
55
|
+
exportAs: 'mcFileDrop',
|
56
|
+
host: {
|
57
|
+
'[class.dragover]': 'dragover',
|
58
|
+
'(dragover)': 'onDragOver($event)',
|
59
|
+
'(dragleave)': 'onDragLeave($event)',
|
60
|
+
'(drop)': 'onDrop($event)'
|
61
|
+
}
|
62
|
+
}]
|
63
|
+
}], propDecorators: { filesDropped: [{
|
64
|
+
type: Output
|
65
|
+
}] } });
|
66
|
+
|
67
|
+
let nextMultipleFileUploadUniqueId = 0;
|
68
|
+
const MC_MULTIPLE_FILE_UPLOAD_DEFAULT_CONFIGURATION = {
|
69
|
+
captionText: 'Перетащите сюда или',
|
70
|
+
captionTextWhenSelected: 'Перетащите еще или',
|
71
|
+
captionTextForCompactSize: 'Перетащите файлы или',
|
72
|
+
browseLink: 'выберите',
|
73
|
+
title: 'Загрузите файлы',
|
74
|
+
gridHeaders: {
|
75
|
+
file: 'Файл',
|
76
|
+
size: 'Размер'
|
77
|
+
}
|
78
|
+
};
|
79
|
+
class McMultipleFileUploadComponent {
|
80
|
+
constructor(focusMonitor, cdr, config) {
|
81
|
+
this.focusMonitor = focusMonitor;
|
82
|
+
this.cdr = cdr;
|
83
|
+
this.config = config;
|
84
|
+
this.errors = [];
|
85
|
+
this.files = [];
|
86
|
+
this.size = 'default';
|
87
|
+
this.inputId = `mc-multiple-file-upload-${nextMultipleFileUploadUniqueId++}`;
|
88
|
+
this.fileQueueChanged = new EventEmitter();
|
89
|
+
this.hasFocus = false;
|
90
|
+
this.focusMonitorSubscription = Subscription.EMPTY;
|
91
|
+
this.config = config || MC_MULTIPLE_FILE_UPLOAD_DEFAULT_CONFIGURATION;
|
92
|
+
this.columnDefs = [
|
93
|
+
{ header: this.config.gridHeaders.file, cssClass: 'file' },
|
94
|
+
{ header: this.config.gridHeaders.size, cssClass: 'size' },
|
95
|
+
{ header: '', cssClass: 'action' }
|
96
|
+
];
|
97
|
+
}
|
98
|
+
get acceptedFiles() {
|
99
|
+
return this.accept && this.accept.length > 0 ? this.accept.map((ext) => `.${ext}`).join(',') : '*/*';
|
100
|
+
}
|
101
|
+
get hasErrors() {
|
102
|
+
return this.errors && !!this.errors.length;
|
103
|
+
}
|
104
|
+
ngAfterViewInit() {
|
105
|
+
this.focusMonitorSubscription = this.focusMonitor.monitor(this.input)
|
106
|
+
.subscribe((origin) => this.onFocus(origin === 'keyboard'));
|
107
|
+
}
|
108
|
+
ngOnDestroy() {
|
109
|
+
this.focusMonitorSubscription.unsubscribe();
|
110
|
+
}
|
111
|
+
onFileSelectedViaClick({ target }) {
|
112
|
+
if (this.disabled) {
|
113
|
+
return;
|
114
|
+
}
|
115
|
+
this.files = [
|
116
|
+
...this.files,
|
117
|
+
...this.mapToFileItem(target.files)
|
118
|
+
];
|
119
|
+
this.onFileListChange();
|
120
|
+
}
|
121
|
+
onFileDropped(files) {
|
122
|
+
if (this.disabled) {
|
123
|
+
return;
|
124
|
+
}
|
125
|
+
this.files = [...this.files, ...this.mapToFileItem(files)];
|
126
|
+
this.onFileListChange();
|
127
|
+
}
|
128
|
+
deleteFile(index, event) {
|
129
|
+
if (this.disabled) {
|
130
|
+
return;
|
131
|
+
}
|
132
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
133
|
+
this.files.splice(index, 1);
|
134
|
+
this.files = [...this.files];
|
135
|
+
this.onFileListChange();
|
136
|
+
}
|
137
|
+
onFileListChange() {
|
138
|
+
this.fileQueueChanged.emit(this.files);
|
139
|
+
}
|
140
|
+
onFocus(focusState) {
|
141
|
+
if (this.disabled) {
|
142
|
+
return;
|
143
|
+
}
|
144
|
+
this.hasFocus = focusState;
|
145
|
+
this.cdr.markForCheck();
|
146
|
+
}
|
147
|
+
mapToFileItem(files) {
|
148
|
+
if (!files) {
|
149
|
+
return [];
|
150
|
+
}
|
151
|
+
return Array.from(files)
|
152
|
+
.filter((file) => this.isCorrectExtension(file))
|
153
|
+
.map((file) => ({
|
154
|
+
file,
|
155
|
+
hasError: this.validateFile(file),
|
156
|
+
loading: new BehaviorSubject(false),
|
157
|
+
progress: new BehaviorSubject(0)
|
158
|
+
}));
|
159
|
+
}
|
160
|
+
validateFile(file) {
|
161
|
+
if (this.customValidation && this.customValidation.length) {
|
162
|
+
const errorsPerFile = this.customValidation.reduce((errors, validatorFn) => {
|
163
|
+
errors.push(validatorFn(file));
|
164
|
+
return errors;
|
165
|
+
}, []).filter(Boolean);
|
166
|
+
this.errors = [
|
167
|
+
...this.errors,
|
168
|
+
...errorsPerFile
|
169
|
+
];
|
170
|
+
return !!errorsPerFile.length;
|
171
|
+
}
|
172
|
+
}
|
173
|
+
isCorrectExtension(file) {
|
174
|
+
const fileExt = file.name.split('.').pop() || '';
|
175
|
+
return this.acceptedFiles !== '*/*' && this.acceptedFiles.length > 0 ? this.acceptedFiles.includes(fileExt) : true;
|
176
|
+
}
|
177
|
+
}
|
178
|
+
/** @nocollapse */ McMultipleFileUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McMultipleFileUploadComponent, deps: [{ token: i1.FocusMonitor }, { token: i0.ChangeDetectorRef }, { token: MC_FILE_UPLOAD_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
179
|
+
/** @nocollapse */ McMultipleFileUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: McMultipleFileUploadComponent, selector: "mc-multiple-file-upload", inputs: { accept: "accept", disabled: "disabled", errors: "errors", files: "files", size: "size", inputId: "inputId", customValidation: "customValidation" }, outputs: { fileQueueChanged: "fileQueueChanged" }, host: { classAttribute: "mc-multiple-file-upload" }, queries: [{ propertyName: "customFileIcon", first: true, predicate: ["mcFileIcon"], descendants: true, read: TemplateRef }], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.selected]=\"files && files.length\"\n [ngClass]=\"size\"\n (filesDropped)=\"onFileDropped($event)\"\n>\n <ng-container *ngIf=\"!files.length; else fileOutput\">\n <div class=\"dropzone\">\n <ng-container *ngIf=\"size === 'default' else compactCaption\">\n <i mc-icon=\"mc-upload-to-cloud_64\"></i>\n <div class=\"dropzone__text\">\n <span class=\"multiple__header\">{{ config.title }}</span>\n <div>\n <span class=\"multiple__caption\">\n {{ config.captionText }}\n <label class=\"mc-link\"\n [class.mc-focused]=\"hasFocus\"\n [for]=\"inputId\">\n {{ config.browseLink }}\n </label>\n </span>\n </div>\n </div>\n </ng-container>\n </div>\n\n\n </ng-container>\n <input #input\n type=\"file\"\n class=\"cdk-visually-hidden\"\n multiple\n [id]=\"inputId\"\n [accept]=\"acceptedFiles\"\n [disabled]=\"disabled\"\n (change)=\"onFileSelectedViaClick($event)\"\n >\n</div>\n\n<div class=\"mc-file-upload__info-section\">\n <mc-hint class=\"mc-file-upload__hint\">\n <ng-content select=\"[hint]\"></ng-content>\n </mc-hint>\n\n <ng-container *ngIf=\"hasErrors\">\n <mc-hint class=\"mc-file-upload__hint mc-error\"\n *ngFor=\"let error of errors\">\n {{ error }}\n </mc-hint>\n </ng-container>\n</div>\n\n<ng-template #fileOutput>\n <div class=\"file-upload__dropzone\">\n <div class=\"mc-file-upload__grid\">\n <div class=\"mc-file-multiple-uploaded__header\">\n <div class=\"mc-file-multiple-uploaded__header-inner\">\n <div [class]=\"'mc-file-upload__' + column.cssClass\" *ngFor=\"let column of columnDefs\">\n {{ column.header }}\n </div>\n </div>\n </div>\n\n <mc-list-selection [autoSelect]=\"false\" [disabled]=\"disabled\">\n <mc-list-option\n class=\"multiple__uploaded-item\"\n [value]=\"file.file.name\"\n (keydown.delete)=\"deleteFile(index)\"\n (keydown.backspace)=\"deleteFile(index)\"\n *ngFor=\"let file of files; let index = index;\">\n <div class=\"mc-file-upload__row\" [class.error]=\"file.hasError\">\n <div class=\"mc-file-upload__file\">\n <ng-container *ngIf=\"{ loading: file.loading | async, progress: file.progress | async } as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\"\n [ngTemplateOutlet]=\"customFileIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: file }\"\n >\n </ng-container>\n\n <mc-progress-spinner\n class=\"pt-nat-file-upload-name-cell__icon\"\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <span class=\"file-item__text\" [mcEllipsisCenter]=\"file.file.name\" [minVisibleLength]=\"10\"></span>\n </div>\n <div class=\"mc-file-upload__size\">\n {{ file.file.size | mcDataSize }}\n </div>\n <div class=\"mc-file-upload__action\">\n <i mc-icon=\"mc-close-circle_16\" (click)=\"deleteFile(index, $event)\"></i>\n </div>\n </div>\n </mc-list-option>\n </mc-list-selection>\n </div>\n\n <div class=\"btn-upload\">\n <div class=\"dropzone\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ config.captionTextWhenSelected }}\n <label class=\"mc-link\"\n [class.mc-focused]=\"hasFocus\"\n [for]=\"inputId\">\n {{ config.browseLink }}\n </label>\n </span>\n </div>\n </div>\n </div>\n</ng-template>\n\n<ng-template #compactCaption>\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ config.captionText }}\n <label class=\"mc-link\"\n [class.mc-focused]=\"hasFocus\"\n [for]=\"inputId\">\n {{ config.browseLink }}\n </label>\n </span>\n</ng-template>\n", styles: ["@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative;cursor:pointer}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .dropzone .dropzone__text{margin-left:6px}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.mc-file-upload{border-radius:var(--mc-file-upload-size-multiple-border-radius, 4px);border-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-style:var(--mc-file-upload-size-multiple-border-style, dashed)}.mc-file-upload.default{min-height:176px;justify-content:center}.mc-file-upload.compact:not(.selected){height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:12px}.mc-file-upload .mc-list-option{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px)}.mc-file-upload .mc-list-option .mc-icon{margin-right:0}.mc-file-upload .mc-file-upload__grid{min-height:144px}.mc-file-upload .mc-file-multiple-uploaded__header-inner,.mc-file-upload .mc-file-upload__row{display:flex;align-items:center}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__file{width:65%;max-width:65%}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__size{width:64px;min-width:64px;text-align:left;flex-grow:1}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__action{padding-left:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px);padding-right:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px)}.mc-file-upload .mc-file-upload__row .mc-file-upload__file{display:flex;align-items:center}.mc-file-upload .mc-file-upload__row .mc-file-upload__file .file-item__text{margin-left:0;width:90%}.mc-file-upload .mc-file-multiple-uploaded__header{border-bottom-width:1px;border-bottom-style:solid}.mc-file-upload .mc-file-multiple-uploaded__header-inner{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px);border:2px solid transparent;border-bottom:unset;box-sizing:border-box;height:var(--mc-list-size-item-height, 32px)}.mc-file-upload .btn-upload .dropzone{margin:0;border-top-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-top-style:var(--mc-file-upload-size-multiple-border-style, dashed);padding:4px 12px}.mc-file-upload .file-upload__dropzone{width:100%;height:100%}.mc-hint{display:block}.mc-file-upload__hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i3.McProgressSpinner, selector: "mc-progress-spinner", inputs: ["color", "id", "value", "mode", "size"] }, { kind: "component", type: i4.McIcon, selector: "[mc-icon]", inputs: ["color"] }, { kind: "directive", type: i4.McIconCSSStyler, selector: "[mc-icon]" }, { kind: "component", type: i5.McListSelection, selector: "mc-list-selection", inputs: ["disabled", "autoSelect", "noUnselectLast", "horizontal", "tabIndex", "compareWith"], outputs: ["onSelectAll", "onCopy", "selectionChange"], exportAs: ["mcListSelection"] }, { kind: "component", type: i5.McListOption, selector: "mc-list-option", inputs: ["checkboxPosition", "value", "disabled", "showCheckbox", "selected"], exportAs: ["mcListOption"] }, { kind: "directive", type: i6.McHint, selector: "mc-hint", inputs: ["color", "id"] }, { kind: "directive", type: i7.McEllipsisCenterDirective, selector: "[mcEllipsisCenter]", inputs: ["mcEllipsisCenter", "minVisibleLength"] }, { kind: "directive", type: McFileDropDirective, selector: "[mcFileDrop]", outputs: ["filesDropped"], exportAs: ["mcFileDrop"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i9.McDataSizePipe, name: "mcDataSize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McMultipleFileUploadComponent, decorators: [{
|
181
|
+
type: Component,
|
182
|
+
args: [{ selector: 'mc-multiple-file-upload', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
183
|
+
class: 'mc-multiple-file-upload'
|
184
|
+
}, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.selected]=\"files && files.length\"\n [ngClass]=\"size\"\n (filesDropped)=\"onFileDropped($event)\"\n>\n <ng-container *ngIf=\"!files.length; else fileOutput\">\n <div class=\"dropzone\">\n <ng-container *ngIf=\"size === 'default' else compactCaption\">\n <i mc-icon=\"mc-upload-to-cloud_64\"></i>\n <div class=\"dropzone__text\">\n <span class=\"multiple__header\">{{ config.title }}</span>\n <div>\n <span class=\"multiple__caption\">\n {{ config.captionText }}\n <label class=\"mc-link\"\n [class.mc-focused]=\"hasFocus\"\n [for]=\"inputId\">\n {{ config.browseLink }}\n </label>\n </span>\n </div>\n </div>\n </ng-container>\n </div>\n\n\n </ng-container>\n <input #input\n type=\"file\"\n class=\"cdk-visually-hidden\"\n multiple\n [id]=\"inputId\"\n [accept]=\"acceptedFiles\"\n [disabled]=\"disabled\"\n (change)=\"onFileSelectedViaClick($event)\"\n >\n</div>\n\n<div class=\"mc-file-upload__info-section\">\n <mc-hint class=\"mc-file-upload__hint\">\n <ng-content select=\"[hint]\"></ng-content>\n </mc-hint>\n\n <ng-container *ngIf=\"hasErrors\">\n <mc-hint class=\"mc-file-upload__hint mc-error\"\n *ngFor=\"let error of errors\">\n {{ error }}\n </mc-hint>\n </ng-container>\n</div>\n\n<ng-template #fileOutput>\n <div class=\"file-upload__dropzone\">\n <div class=\"mc-file-upload__grid\">\n <div class=\"mc-file-multiple-uploaded__header\">\n <div class=\"mc-file-multiple-uploaded__header-inner\">\n <div [class]=\"'mc-file-upload__' + column.cssClass\" *ngFor=\"let column of columnDefs\">\n {{ column.header }}\n </div>\n </div>\n </div>\n\n <mc-list-selection [autoSelect]=\"false\" [disabled]=\"disabled\">\n <mc-list-option\n class=\"multiple__uploaded-item\"\n [value]=\"file.file.name\"\n (keydown.delete)=\"deleteFile(index)\"\n (keydown.backspace)=\"deleteFile(index)\"\n *ngFor=\"let file of files; let index = index;\">\n <div class=\"mc-file-upload__row\" [class.error]=\"file.hasError\">\n <div class=\"mc-file-upload__file\">\n <ng-container *ngIf=\"{ loading: file.loading | async, progress: file.progress | async } as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\"\n [ngTemplateOutlet]=\"customFileIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: file }\"\n >\n </ng-container>\n\n <mc-progress-spinner\n class=\"pt-nat-file-upload-name-cell__icon\"\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <span class=\"file-item__text\" [mcEllipsisCenter]=\"file.file.name\" [minVisibleLength]=\"10\"></span>\n </div>\n <div class=\"mc-file-upload__size\">\n {{ file.file.size | mcDataSize }}\n </div>\n <div class=\"mc-file-upload__action\">\n <i mc-icon=\"mc-close-circle_16\" (click)=\"deleteFile(index, $event)\"></i>\n </div>\n </div>\n </mc-list-option>\n </mc-list-selection>\n </div>\n\n <div class=\"btn-upload\">\n <div class=\"dropzone\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ config.captionTextWhenSelected }}\n <label class=\"mc-link\"\n [class.mc-focused]=\"hasFocus\"\n [for]=\"inputId\">\n {{ config.browseLink }}\n </label>\n </span>\n </div>\n </div>\n </div>\n</ng-template>\n\n<ng-template #compactCaption>\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text multiple__caption\">\n {{ config.captionText }}\n <label class=\"mc-link\"\n [class.mc-focused]=\"hasFocus\"\n [for]=\"inputId\">\n {{ config.browseLink }}\n </label>\n </span>\n</ng-template>\n", styles: ["@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative;cursor:pointer}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .dropzone .dropzone__text{margin-left:6px}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.mc-file-upload{border-radius:var(--mc-file-upload-size-multiple-border-radius, 4px);border-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-style:var(--mc-file-upload-size-multiple-border-style, dashed)}.mc-file-upload.default{min-height:176px;justify-content:center}.mc-file-upload.compact:not(.selected){height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:12px}.mc-file-upload .mc-list-option{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px)}.mc-file-upload .mc-list-option .mc-icon{margin-right:0}.mc-file-upload .mc-file-upload__grid{min-height:144px}.mc-file-upload .mc-file-multiple-uploaded__header-inner,.mc-file-upload .mc-file-upload__row{display:flex;align-items:center}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__file{width:65%;max-width:65%}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__size{width:64px;min-width:64px;text-align:left;flex-grow:1}.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__file,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__size,.mc-file-upload .mc-file-multiple-uploaded__header-inner .mc-file-upload__action,.mc-file-upload .mc-file-upload__row .mc-file-upload__file,.mc-file-upload .mc-file-upload__row .mc-file-upload__size,.mc-file-upload .mc-file-upload__row .mc-file-upload__action{padding-left:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px);padding-right:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px)}.mc-file-upload .mc-file-upload__row .mc-file-upload__file{display:flex;align-items:center}.mc-file-upload .mc-file-upload__row .mc-file-upload__file .file-item__text{margin-left:0;width:90%}.mc-file-upload .mc-file-multiple-uploaded__header{border-bottom-width:1px;border-bottom-style:solid}.mc-file-upload .mc-file-multiple-uploaded__header-inner{padding:var(--mc-file-upload-size-multiple-uploaded-item-horizontal-padding, 8px) var(--mc-file-upload-size-multiple-uploaded-item-vertical-padding, 8px);border:2px solid transparent;border-bottom:unset;box-sizing:border-box;height:var(--mc-list-size-item-height, 32px)}.mc-file-upload .btn-upload .dropzone{margin:0;border-top-width:var(--mc-file-upload-size-multiple-border-width, 1px);border-top-style:var(--mc-file-upload-size-multiple-border-style, dashed);padding:4px 12px}.mc-file-upload .file-upload__dropzone{width:100%;height:100%}.mc-hint{display:block}.mc-file-upload__hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n"] }]
|
185
|
+
}], ctorParameters: function () {
|
186
|
+
return [{ type: i1.FocusMonitor }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
187
|
+
type: Optional
|
188
|
+
}, {
|
189
|
+
type: Inject,
|
190
|
+
args: [MC_FILE_UPLOAD_CONFIGURATION]
|
191
|
+
}] }];
|
192
|
+
}, propDecorators: { accept: [{
|
193
|
+
type: Input
|
194
|
+
}], disabled: [{
|
195
|
+
type: Input
|
196
|
+
}], errors: [{
|
197
|
+
type: Input
|
198
|
+
}], files: [{
|
199
|
+
type: Input
|
200
|
+
}], size: [{
|
201
|
+
type: Input
|
202
|
+
}], inputId: [{
|
203
|
+
type: Input
|
204
|
+
}], customValidation: [{
|
205
|
+
type: Input
|
206
|
+
}], fileQueueChanged: [{
|
207
|
+
type: Output
|
208
|
+
}], customFileIcon: [{
|
209
|
+
type: ContentChild,
|
210
|
+
args: ['mcFileIcon', { static: false, read: TemplateRef }]
|
211
|
+
}], input: [{
|
212
|
+
type: ViewChild,
|
213
|
+
args: ['input']
|
214
|
+
}] } });
|
215
|
+
|
216
|
+
let nextSingleFileUploadUniqueId = 0;
|
217
|
+
const MC_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION = {
|
218
|
+
captionText: 'Перетащите файл или',
|
219
|
+
browseLink: 'выберите'
|
220
|
+
};
|
221
|
+
class McSingleFileUploadComponent {
|
222
|
+
constructor(focusMonitor, cdr, config) {
|
223
|
+
this.focusMonitor = focusMonitor;
|
224
|
+
this.cdr = cdr;
|
225
|
+
this.config = config;
|
226
|
+
this.disabled = false;
|
227
|
+
this.errors = [];
|
228
|
+
this.files = [];
|
229
|
+
this.inputId = `mc-single-file-upload-${nextSingleFileUploadUniqueId++}`;
|
230
|
+
this.fileQueueChanged = new EventEmitter();
|
231
|
+
this.hasFocus = false;
|
232
|
+
this.focusMonitorSubscription = Subscription.EMPTY;
|
233
|
+
this.config = config || MC_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION;
|
234
|
+
}
|
235
|
+
get acceptedFiles() {
|
236
|
+
return this.accept && this.accept.length > 0 ? this.accept.map((ext) => `.${ext}`).join(',') : '*/*';
|
237
|
+
}
|
238
|
+
ngAfterViewInit() {
|
239
|
+
this.focusMonitorSubscription = this.focusMonitor.monitor(this.input)
|
240
|
+
.subscribe((origin) => this.onFocus(origin === 'keyboard'));
|
241
|
+
}
|
242
|
+
ngOnDestroy() {
|
243
|
+
this.focusMonitorSubscription.unsubscribe();
|
244
|
+
}
|
245
|
+
onFileSelectedViaClick({ target }) {
|
246
|
+
if (this.disabled) {
|
247
|
+
return;
|
248
|
+
}
|
249
|
+
const files = target.files;
|
250
|
+
if (files) {
|
251
|
+
this.files = [this.mapToFileItem(files[0])];
|
252
|
+
this.fileQueueChanged.emit(this.files[0]);
|
253
|
+
}
|
254
|
+
}
|
255
|
+
deleteItem(event) {
|
256
|
+
if (this.disabled) {
|
257
|
+
return;
|
258
|
+
}
|
259
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
260
|
+
this.files = [];
|
261
|
+
this.errors = [];
|
262
|
+
this.fileQueueChanged.emit(null);
|
263
|
+
}
|
264
|
+
onFileDropped(files) {
|
265
|
+
if (this.disabled) {
|
266
|
+
return;
|
267
|
+
}
|
268
|
+
if (this.isCorrectExtension(files[0])) {
|
269
|
+
this.files = Array.from(files)
|
270
|
+
.map((file) => this.mapToFileItem(file));
|
271
|
+
this.fileQueueChanged.emit(this.files[0]);
|
272
|
+
}
|
273
|
+
}
|
274
|
+
onFocus(focusState) {
|
275
|
+
if (this.disabled) {
|
276
|
+
return;
|
277
|
+
}
|
278
|
+
this.hasFocus = focusState;
|
279
|
+
this.cdr.markForCheck();
|
280
|
+
}
|
281
|
+
mapToFileItem(file) {
|
282
|
+
this.validateFile(file);
|
283
|
+
return {
|
284
|
+
file,
|
285
|
+
progress: new BehaviorSubject(0),
|
286
|
+
loading: new BehaviorSubject(false)
|
287
|
+
};
|
288
|
+
}
|
289
|
+
validateFile(file) {
|
290
|
+
if (this.customValidation && this.customValidation.length) {
|
291
|
+
this.errors = this.customValidation.reduce((errors, validatorFn) => {
|
292
|
+
errors.push(validatorFn(file));
|
293
|
+
return errors;
|
294
|
+
}, []).filter(Boolean);
|
295
|
+
}
|
296
|
+
}
|
297
|
+
isCorrectExtension(file) {
|
298
|
+
const fileExt = file.name.split('.').pop() || '';
|
299
|
+
return this.acceptedFiles !== '*/*' && this.acceptedFiles.length > 0 ? this.acceptedFiles.includes(fileExt) : true;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
/** @nocollapse */ McSingleFileUploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McSingleFileUploadComponent, deps: [{ token: i1.FocusMonitor }, { token: i0.ChangeDetectorRef }, { token: MC_FILE_UPLOAD_CONFIGURATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
303
|
+
/** @nocollapse */ McSingleFileUploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: McSingleFileUploadComponent, selector: "mc-single-file-upload", inputs: { accept: "accept", disabled: "disabled", errors: "errors", files: "files", inputId: "inputId", customValidation: "customValidation" }, outputs: { fileQueueChanged: "fileQueueChanged" }, host: { classAttribute: "mc-single-file-upload" }, viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true }], ngImport: i0, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.mc-error]=\"errors && errors.length\"\n (filesDropped)=\"onFileDropped($event)\">\n <div class=\"dropzone\" *ngIf=\"!files.length; else fileOutput\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text\">\n {{ config.captionText }}\n <label class=\"mc-link\"\n [class.mc-focused]=\"hasFocus\"\n [for]=\"inputId\">\n {{ config.browseLink }}\n </label>\n </span>\n </div>\n <input #input\n type=\"file\"\n class=\"cdk-visually-hidden\"\n [id]=\"inputId\"\n [accept]=\"acceptedFiles\"\n [disabled]=\"disabled\"\n (change)=\"onFileSelectedViaClick($event)\"\n >\n</div>\n<mc-hint class=\"mc-file-upload__hint\">\n <ng-content select=\"[hint]\"></ng-content>\n</mc-hint>\n<ng-container *ngIf=\"errors && errors.length\">\n <mc-hint class=\"mc-file-upload__hint mc-error\" *ngFor=\"let error of errors\">{{ error }}</mc-hint>\n</ng-container>\n\n\n<ng-template #fileOutput>\n <div class=\"file-item\" *ngIf=\"files && files.length\">\n <div class=\"file-item__text-wrapper\">\n <ng-container *ngIf=\"{ loading: files[0].loading | async, progress: files[0].progress | async} as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\">\n <ng-content select=\"[mc-icon]\"></ng-content>\n </ng-container>\n\n <mc-progress-spinner\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <div class=\"file-item__text\" [mcEllipsisCenter]=\"files[0].file.name\" [minVisibleLength]=\"10\"></div>\n </div>\n <button mc-button\n class=\"mc-button_transparent\"\n [disabled]=\"disabled\"\n (keydown.delete)=\"deleteItem()\"\n (keydown.backspace)=\"deleteItem()\"\n (click)=\"deleteItem($event)\">\n <i mc-icon=\"mc-close-circle_16\"></i>\n </button>\n </div>\n</ng-template>\n", styles: ["@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative;cursor:pointer}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .dropzone .dropzone__text{margin-left:6px}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.mc-file-upload{height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:12px;border-radius:var(--mc-file-upload-size-single-border-radius, 4px);border-width:var(--mc-file-upload-size-single-border-width, 1px);border-style:var(--mc-file-upload-size-single-border-style, dashed)}.mc-file-upload .file-item{width:100%}.mc-file-upload .file-item .file-item__text-wrapper{display:flex;align-items:center;width:100%}.mc-file-upload .file-item .file-item__text-wrapper .file-item__text{margin-left:8px;width:120px;flex-grow:1}.mc-hint{display:block}.mc-file-upload__hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.McProgressSpinner, selector: "mc-progress-spinner", inputs: ["color", "id", "value", "mode", "size"] }, { kind: "component", type: i4.McIcon, selector: "[mc-icon]", inputs: ["color"] }, { kind: "directive", type: i4.McIconCSSStyler, selector: "[mc-icon]" }, { kind: "component", type: i5$1.McButton, selector: "[mc-button]", inputs: ["color", "tabIndex", "disabled"] }, { kind: "directive", type: i5$1.McButtonCssStyler, selector: "[mc-button]" }, { kind: "directive", type: i6.McHint, selector: "mc-hint", inputs: ["color", "id"] }, { kind: "directive", type: i7.McEllipsisCenterDirective, selector: "[mcEllipsisCenter]", inputs: ["mcEllipsisCenter", "minVisibleLength"] }, { kind: "directive", type: McFileDropDirective, selector: "[mcFileDrop]", outputs: ["filesDropped"], exportAs: ["mcFileDrop"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McSingleFileUploadComponent, decorators: [{
|
305
|
+
type: Component,
|
306
|
+
args: [{ selector: 'mc-single-file-upload', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
307
|
+
class: 'mc-single-file-upload'
|
308
|
+
}, template: "<div class=\"mc-file-upload\"\n mcFileDrop\n [class.disabled]=\"disabled\"\n [class.mc-error]=\"errors && errors.length\"\n (filesDropped)=\"onFileDropped($event)\">\n <div class=\"dropzone\" *ngIf=\"!files.length; else fileOutput\">\n <i mc-icon=\"mc-upload-to-cloud_24\"></i>\n <span class=\"dropzone__text\">\n {{ config.captionText }}\n <label class=\"mc-link\"\n [class.mc-focused]=\"hasFocus\"\n [for]=\"inputId\">\n {{ config.browseLink }}\n </label>\n </span>\n </div>\n <input #input\n type=\"file\"\n class=\"cdk-visually-hidden\"\n [id]=\"inputId\"\n [accept]=\"acceptedFiles\"\n [disabled]=\"disabled\"\n (change)=\"onFileSelectedViaClick($event)\"\n >\n</div>\n<mc-hint class=\"mc-file-upload__hint\">\n <ng-content select=\"[hint]\"></ng-content>\n</mc-hint>\n<ng-container *ngIf=\"errors && errors.length\">\n <mc-hint class=\"mc-file-upload__hint mc-error\" *ngFor=\"let error of errors\">{{ error }}</mc-hint>\n</ng-container>\n\n\n<ng-template #fileOutput>\n <div class=\"file-item\" *ngIf=\"files && files.length\">\n <div class=\"file-item__text-wrapper\">\n <ng-container *ngIf=\"{ loading: files[0].loading | async, progress: files[0].progress | async} as asyncData\">\n <ng-container *ngIf=\"!asyncData.loading\">\n <ng-content select=\"[mc-icon]\"></ng-content>\n </ng-container>\n\n <mc-progress-spinner\n [value]=\"asyncData.progress || 0\"\n *ngIf=\"asyncData.loading\"\n ></mc-progress-spinner>\n </ng-container>\n\n <div class=\"file-item__text\" [mcEllipsisCenter]=\"files[0].file.name\" [minVisibleLength]=\"10\"></div>\n </div>\n <button mc-button\n class=\"mc-button_transparent\"\n [disabled]=\"disabled\"\n (keydown.delete)=\"deleteItem()\"\n (keydown.backspace)=\"deleteItem()\"\n (click)=\"deleteItem($event)\">\n <i mc-icon=\"mc-close-circle_16\"></i>\n </button>\n </div>\n</ng-template>\n", styles: ["@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.mc-file-upload{box-sizing:border-box;display:flex;align-items:center;position:relative;cursor:pointer}.mc-file-upload .dropzone,.mc-file-upload .file-item{display:flex;align-items:center}.mc-file-upload .dropzone .dropzone__text{margin-left:6px}.mc-file-upload .mc-ellipsis-center{position:relative;display:flex}.mc-file-upload .mc-ellipsis-center .data-text-start{flex:0 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:pre}.mc-file-upload .mc-ellipsis-center .data-text-end{flex:1 0 auto;overflow:hidden;white-space:pre}\n", "@keyframes mc-progress{0%{background-position:0 0}to{background-position:29px 0}}.mc-progress{position:relative}.mc-progress:after{content:\"\";position:absolute;border-radius:inherit;inset:0;background:linear-gradient(135deg,rgba(0,0,0,.05) 10px,transparent 10px,transparent 20px,rgba(0,0,0,.05) 20px,rgba(0,0,0,.05) 30px,transparent 30px) repeat;background-size:29px 29px;animation:mc-progress 1s linear infinite}.mc-group{display:flex;flex-direction:row}.mc-group .mc-group_justified>.mc-group-item{width:100%}.mc-group .mc-group-item+.mc-group-item{margin-left:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-top-right-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-bottom-left-radius:0;border-top-left-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group{display:flex;flex-direction:column}.mc-vertical-group>.mc-group-item:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:first-child:not(:last-child)>.mc-form-field__container{border-bottom-right-radius:0;border-bottom-left-radius:0}.mc-vertical-group>.mc-group-item:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-left-radius:var(--mc-button-size-border-radius, 4px)}.mc-vertical-group>.mc-group-item:last-child:not(:first-child)>.mc-form-field__container{border-top-right-radius:0;border-top-left-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child){border-radius:0}.mc-vertical-group>.mc-group-item:not(:first-child):not(:last-child)>.mc-form-field__container{border-radius:0}.mc-vertical-group .mc-group-item+.mc-group-item{margin-top:calc(-1 * var(--mc-button-size-border-width, 1px))}.mc-no-select{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.mc-file-upload{height:var(--mc-file-upload-size-single-height, 48px);padding-top:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-bottom:var(--mc-file-upload-size-single-vertical-padding, 12px);padding-left:12px;border-radius:var(--mc-file-upload-size-single-border-radius, 4px);border-width:var(--mc-file-upload-size-single-border-width, 1px);border-style:var(--mc-file-upload-size-single-border-style, dashed)}.mc-file-upload .file-item{width:100%}.mc-file-upload .file-item .file-item__text-wrapper{display:flex;align-items:center;width:100%}.mc-file-upload .file-item .file-item__text-wrapper .file-item__text{margin-left:8px;width:120px;flex-grow:1}.mc-hint{display:block}.mc-file-upload__hint{margin-top:var(--mc-form-field-hint-size-margin-top, 4px)}\n"] }]
|
309
|
+
}], ctorParameters: function () {
|
310
|
+
return [{ type: i1.FocusMonitor }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
311
|
+
type: Optional
|
312
|
+
}, {
|
313
|
+
type: Inject,
|
314
|
+
args: [MC_FILE_UPLOAD_CONFIGURATION]
|
315
|
+
}] }];
|
316
|
+
}, propDecorators: { accept: [{
|
317
|
+
type: Input
|
318
|
+
}], disabled: [{
|
319
|
+
type: Input
|
320
|
+
}], errors: [{
|
321
|
+
type: Input
|
322
|
+
}], files: [{
|
323
|
+
type: Input
|
324
|
+
}], inputId: [{
|
325
|
+
type: Input
|
326
|
+
}], customValidation: [{
|
327
|
+
type: Input
|
328
|
+
}], fileQueueChanged: [{
|
329
|
+
type: Output
|
330
|
+
}], input: [{
|
331
|
+
type: ViewChild,
|
332
|
+
args: ['input']
|
333
|
+
}] } });
|
334
|
+
|
335
|
+
class McFileUploadModule {
|
336
|
+
}
|
337
|
+
/** @nocollapse */ McFileUploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McFileUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
338
|
+
/** @nocollapse */ McFileUploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.2", ngImport: i0, type: McFileUploadModule, declarations: [McFileDropDirective,
|
339
|
+
McSingleFileUploadComponent,
|
340
|
+
McMultipleFileUploadComponent], imports: [CommonModule,
|
341
|
+
McToolTipModule,
|
342
|
+
McProgressSpinnerModule,
|
343
|
+
McIconModule,
|
344
|
+
McButtonModule,
|
345
|
+
McListModule,
|
346
|
+
McFormFieldModule,
|
347
|
+
McEllipsisCenterModule,
|
348
|
+
McDataSizeModule], exports: [McSingleFileUploadComponent,
|
349
|
+
McMultipleFileUploadComponent,
|
350
|
+
McFileDropDirective] });
|
351
|
+
/** @nocollapse */ McFileUploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McFileUploadModule, imports: [CommonModule,
|
352
|
+
McToolTipModule,
|
353
|
+
McProgressSpinnerModule,
|
354
|
+
McIconModule,
|
355
|
+
McButtonModule,
|
356
|
+
McListModule,
|
357
|
+
McFormFieldModule,
|
358
|
+
McEllipsisCenterModule,
|
359
|
+
McDataSizeModule] });
|
360
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: McFileUploadModule, decorators: [{
|
361
|
+
type: NgModule,
|
362
|
+
args: [{
|
363
|
+
imports: [
|
364
|
+
CommonModule,
|
365
|
+
McToolTipModule,
|
366
|
+
McProgressSpinnerModule,
|
367
|
+
McIconModule,
|
368
|
+
McButtonModule,
|
369
|
+
McListModule,
|
370
|
+
McFormFieldModule,
|
371
|
+
McEllipsisCenterModule,
|
372
|
+
McDataSizeModule
|
373
|
+
],
|
374
|
+
declarations: [
|
375
|
+
McFileDropDirective,
|
376
|
+
McSingleFileUploadComponent,
|
377
|
+
McMultipleFileUploadComponent
|
378
|
+
],
|
379
|
+
exports: [
|
380
|
+
McSingleFileUploadComponent,
|
381
|
+
McMultipleFileUploadComponent,
|
382
|
+
McFileDropDirective
|
383
|
+
]
|
384
|
+
}]
|
385
|
+
}] });
|
386
|
+
|
387
|
+
/**
|
388
|
+
* Generated bundle index. Do not edit.
|
389
|
+
*/
|
390
|
+
|
391
|
+
export { MC_FILE_UPLOAD_CONFIGURATION, MC_MULTIPLE_FILE_UPLOAD_DEFAULT_CONFIGURATION, MC_SINGLE_FILE_UPLOAD_DEFAULT_CONFIGURATION, McFileDropDirective, McFileUploadModule, McMultipleFileUploadComponent, McSingleFileUploadComponent };
|
392
|
+
//# sourceMappingURL=ptsecurity-mosaic-file-upload.mjs.map
|