@mintplayer/ng-bootstrap 16.7.1 → 16.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/file-upload/src/component/file-upload.component.mjs +1 -1
- package/esm2022/for/src/for.directive.mjs +17 -19
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-for.mjs +16 -18
- package/fesm2022/mintplayer-ng-bootstrap-for.mjs.map +1 -1
- package/for/src/for.directive.d.ts +5 -3
- package/package.json +1 -1
|
@@ -61,7 +61,7 @@ export class BsFileUploadComponent {
|
|
|
61
61
|
return file.index;
|
|
62
62
|
}
|
|
63
63
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
64
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: BsFileUploadComponent, selector: "bs-file-upload", inputs: { dropFilesCaption: "dropFilesCaption", browseFilesCaption: "browseFilesCaption", placeholder: "placeholder", files: "files" }, outputs: { filesDropped: "filesDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" } }, ngImport: i0, template: "<div class=\"dropzone border position-relative p-5\" [class.dragging]=\"isDraggingFile\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder\" [placeholder]=\"placeholder\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder\"> -->\n <span class=\"h3 d-block\">{{ dropFilesCaption }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n <bs-list-group-item *ngFor=\"let upload of files; trackBy: trackByFile\">\n <ng-container *ngTemplateOutlet=\"fileTemplate ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>", styles: [".dropzone{z-index:1}.dropzone.dragging{border:4px solid #CB1535!important;background:#DC88A8;margin:-3px -3px -4px}.dropzone input{opacity:0;z-index:2;top:0;left:0}.dropzone .btn{z-index:5}.files-list{margin-top:-1px}.files-list .d-flex{max-width:400px}.text-grey{color:#999}.list-group span{margin:-5px auto}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.BsForDirective, selector: "[bsFor]", inputs: ["bsFor"] }, { kind: "component", type: i3.BsProgressBarComponent, selector: "bs-progress-bar", inputs: ["minimum", "maximum", "value", "color", "striped", "animated"] }, { kind: "component", type: i3.BsProgressComponent, selector: "bs-progress", inputs: ["height", "isIndeterminate"] }, { kind: "component", type: i4.BsListGroupComponent, selector: "bs-list-group" }, { kind: "component", type: i4.BsListGroupItemComponent, selector: "bs-list-group-item" }, { kind: "pipe", type: i5.BsFormatBytesPipe, name: "bsFormatBytes" }] }); }
|
|
64
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: BsFileUploadComponent, selector: "bs-file-upload", inputs: { dropFilesCaption: "dropFilesCaption", browseFilesCaption: "browseFilesCaption", placeholder: "placeholder", files: "files" }, outputs: { filesDropped: "filesDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" } }, ngImport: i0, template: "<div class=\"dropzone border position-relative p-5\" [class.dragging]=\"isDraggingFile\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder\" [placeholder]=\"placeholder\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder\"> -->\n <span class=\"h3 d-block\">{{ dropFilesCaption }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n <bs-list-group-item *ngFor=\"let upload of files; trackBy: trackByFile\">\n <ng-container *ngTemplateOutlet=\"fileTemplate ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>", styles: [".dropzone{z-index:1}.dropzone.dragging{border:4px solid #CB1535!important;background:#DC88A8;margin:-3px -3px -4px}.dropzone input{opacity:0;z-index:2;top:0;left:0}.dropzone .btn{z-index:5}.files-list{margin-top:-1px}.files-list .d-flex{max-width:400px}.text-grey{color:#999}.list-group span{margin:-5px auto}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.BsForDirective, selector: "label[bsFor]", inputs: ["bsFor"] }, { kind: "component", type: i3.BsProgressBarComponent, selector: "bs-progress-bar", inputs: ["minimum", "maximum", "value", "color", "striped", "animated"] }, { kind: "component", type: i3.BsProgressComponent, selector: "bs-progress", inputs: ["height", "isIndeterminate"] }, { kind: "component", type: i4.BsListGroupComponent, selector: "bs-list-group" }, { kind: "component", type: i4.BsListGroupItemComponent, selector: "bs-list-group-item" }, { kind: "pipe", type: i5.BsFormatBytesPipe, name: "bsFormatBytes" }] }); }
|
|
65
65
|
}
|
|
66
66
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsFileUploadComponent, decorators: [{
|
|
67
67
|
type: Component,
|
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
import { Directive, HostBinding,
|
|
1
|
+
import { Directive, HostBinding, Input } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export class BsForDirective {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.defaultCursor = true;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
this.bsFor.focus();
|
|
7
|
+
static { this.counter = 1; }
|
|
8
|
+
set bsFor(value) {
|
|
9
|
+
this.target = value;
|
|
10
|
+
if (this.target instanceof HTMLElement) {
|
|
11
|
+
if (!this.target.id) {
|
|
12
|
+
const count = BsForDirective.counter++;
|
|
13
|
+
this.target.id = `for-target-${count}`;
|
|
14
|
+
}
|
|
15
|
+
this.forValue = this.target.id;
|
|
19
16
|
}
|
|
17
|
+
// console.log('target', this.target);
|
|
20
18
|
}
|
|
21
19
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsForDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
22
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.2", type: BsForDirective, selector: "[bsFor]", inputs: { bsFor: "bsFor" }, host: {
|
|
20
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.2", type: BsForDirective, selector: "label[bsFor]", inputs: { bsFor: "bsFor" }, host: { properties: { "class.cursor-default": "this.defaultCursor", "attr.for": "this.forValue" } }, ngImport: i0 }); }
|
|
23
21
|
}
|
|
24
22
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsForDirective, decorators: [{
|
|
25
23
|
type: Directive,
|
|
26
24
|
args: [{
|
|
27
|
-
selector: '[bsFor]'
|
|
25
|
+
selector: 'label[bsFor]'
|
|
28
26
|
}]
|
|
29
27
|
}], propDecorators: { defaultCursor: [{
|
|
30
28
|
type: HostBinding,
|
|
31
29
|
args: ['class.cursor-default']
|
|
32
30
|
}], bsFor: [{
|
|
33
31
|
type: Input
|
|
34
|
-
}],
|
|
35
|
-
type:
|
|
36
|
-
args: ['
|
|
32
|
+
}], forValue: [{
|
|
33
|
+
type: HostBinding,
|
|
34
|
+
args: ['attr.for']
|
|
37
35
|
}] } });
|
|
38
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9yLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy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GhhcyBzb21lIFwiZm9jdXNcIiBtZXRob2RcbiAgLy8gICAgIHRoaXMudGFyZ2V0LmZvY3VzKCk7XG4gIC8vICAgfSBlbHNlIGlmICh0aGlzLnRhcmdldC50YWdOYW1lLnRvTG93ZXJDYXNlKCkgIT09ICdpbnB1dCcpIHtcbiAgLy8gICAgIC8vIEhUTUwgZWxlbWVudCwgYnV0IG5vdCBhbiBpbnB1dCwgcHJvYmFibHkgYSB0ZXh0YXJlYVxuICAvLyAgICAgdGhpcy50YXJnZXQuZm9jdXMoKTtcbiAgLy8gICB9IGVsc2UgaWYgKHRoaXMudGFyZ2V0LnR5cGUudG9Mb3dlckNhc2UoKSA9PT0gJ2ZpbGUnKSB7XG4gIC8vICAgICAvLyBIdG1sSW5wdXRFbGVtZW50IGZvciBhIGZpbGVcbiAgLy8gICAgIHRoaXMudGFyZ2V0LmNsaWNrKCk7XG4gIC8vICAgfSBlbHNlIHtcbiAgLy8gICAgIC8vIEh0bWxJbnB1dEVsZW1lbnRcbiAgLy8gICAgIHRoaXMudGFyZ2V0LmZvY3VzKCk7XG4gIC8vICAgfVxuICAvLyB9XG5cbn1cbiJdfQ==
|
|
@@ -87,7 +87,7 @@ class BsFileUploadComponent {
|
|
|
87
87
|
return file.index;
|
|
88
88
|
}
|
|
89
89
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
90
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: BsFileUploadComponent, selector: "bs-file-upload", inputs: { dropFilesCaption: "dropFilesCaption", browseFilesCaption: "browseFilesCaption", placeholder: "placeholder", files: "files" }, outputs: { filesDropped: "filesDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" } }, ngImport: i0, template: "<div class=\"dropzone border position-relative p-5\" [class.dragging]=\"isDraggingFile\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder\" [placeholder]=\"placeholder\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder\"> -->\n <span class=\"h3 d-block\">{{ dropFilesCaption }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n <bs-list-group-item *ngFor=\"let upload of files; trackBy: trackByFile\">\n <ng-container *ngTemplateOutlet=\"fileTemplate ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>", styles: [".dropzone{z-index:1}.dropzone.dragging{border:4px solid #CB1535!important;background:#DC88A8;margin:-3px -3px -4px}.dropzone input{opacity:0;z-index:2;top:0;left:0}.dropzone .btn{z-index:5}.files-list{margin-top:-1px}.files-list .d-flex{max-width:400px}.text-grey{color:#999}.list-group span{margin:-5px auto}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.BsForDirective, selector: "[bsFor]", inputs: ["bsFor"] }, { kind: "component", type: i3.BsProgressBarComponent, selector: "bs-progress-bar", inputs: ["minimum", "maximum", "value", "color", "striped", "animated"] }, { kind: "component", type: i3.BsProgressComponent, selector: "bs-progress", inputs: ["height", "isIndeterminate"] }, { kind: "component", type: i4.BsListGroupComponent, selector: "bs-list-group" }, { kind: "component", type: i4.BsListGroupItemComponent, selector: "bs-list-group-item" }, { kind: "pipe", type: BsFormatBytesPipe, name: "bsFormatBytes" }] }); }
|
|
90
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.2", type: BsFileUploadComponent, selector: "bs-file-upload", inputs: { dropFilesCaption: "dropFilesCaption", browseFilesCaption: "browseFilesCaption", placeholder: "placeholder", files: "files" }, outputs: { filesDropped: "filesDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" } }, ngImport: i0, template: "<div class=\"dropzone border position-relative p-5\" [class.dragging]=\"isDraggingFile\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder\" [placeholder]=\"placeholder\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder\"> -->\n <span class=\"h3 d-block\">{{ dropFilesCaption }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n <bs-list-group-item *ngFor=\"let upload of files; trackBy: trackByFile\">\n <ng-container *ngTemplateOutlet=\"fileTemplate ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>", styles: [".dropzone{z-index:1}.dropzone.dragging{border:4px solid #CB1535!important;background:#DC88A8;margin:-3px -3px -4px}.dropzone input{opacity:0;z-index:2;top:0;left:0}.dropzone .btn{z-index:5}.files-list{margin-top:-1px}.files-list .d-flex{max-width:400px}.text-grey{color:#999}.list-group span{margin:-5px auto}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.BsForDirective, selector: "label[bsFor]", inputs: ["bsFor"] }, { kind: "component", type: i3.BsProgressBarComponent, selector: "bs-progress-bar", inputs: ["minimum", "maximum", "value", "color", "striped", "animated"] }, { kind: "component", type: i3.BsProgressComponent, selector: "bs-progress", inputs: ["height", "isIndeterminate"] }, { kind: "component", type: i4.BsListGroupComponent, selector: "bs-list-group" }, { kind: "component", type: i4.BsListGroupItemComponent, selector: "bs-list-group-item" }, { kind: "pipe", type: BsFormatBytesPipe, name: "bsFormatBytes" }] }); }
|
|
91
91
|
}
|
|
92
92
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsFileUploadComponent, decorators: [{
|
|
93
93
|
type: Component,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-file-upload.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/file-upload/src/pipes/format-bytes/format-bytes.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/component/file-upload.component.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/component/file-upload.component.html","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/directive/file-upload-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/file-upload.module.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/mintplayer-ng-bootstrap-file-upload.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsFormatBytes'\n})\nexport class BsFormatBytesPipe implements PipeTransform {\n\n transform(value: number, decimals = 2) {\n if (value === 0) {\n return \"0 Bytes\";\n }\n\n const k = 1024;\n const dm = decimals <= 0 ? 0 : decimals;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n const i = Math.floor(Math.log(value) / Math.log(k));\n\n return parseFloat((value / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i];\n }\n\n}\n","import { Component, EventEmitter, HostListener, Input, Output, TemplateRef } from '@angular/core';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { FileUpload } from '../file-upload';\n\n@Component({\n selector: 'bs-file-upload',\n templateUrl: './file-upload.component.html',\n styleUrls: ['./file-upload.component.scss']\n})\nexport class BsFileUploadComponent {\n\n @Input() public dropFilesCaption = 'Drop your files here';\n @Input() public browseFilesCaption = 'Browse for files';\n @Input() public placeholder = 'Drop files to upload';\n\n colors = Color;\n isDraggingFile = false;\n fileTemplate?: TemplateRef<FileUpload>;\n @Input() public files: FileUpload[] = [];\n @Output() public filesDropped = new EventEmitter<FileUpload[]>();\n\n onChange(event: Event) {\n if (!event.target) return;\n if (!('files' in event.target)) return;\n if (!event.target['files']) return;\n\n const files = (<HTMLInputElement>event.target).files;\n if (!files) return;\n \n this.processDroppedFiles(files);\n }\n\n @HostListener('dragover', ['$event'])\n onDragOver(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n \n if (event.dataTransfer) {\n this.isDraggingFile = true;\n event.dataTransfer.effectAllowed = \"copy\";\n }\n }\n\n @HostListener('dragleave', ['$event'])\n onDragLeave(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isDraggingFile = false;\n }\n\n @HostListener('drop', ['$event'])\n onDrop(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isDraggingFile = false;\n if (event.dataTransfer && event.dataTransfer.files) {\n this.processDroppedFiles(event.dataTransfer.files);\n }\n }\n\n private processDroppedFiles(fileList: FileList) {\n const newFiles = [...Array(fileList.length).keys()]\n .map(i => fileList.item(i))\n .filter(f => !!f)\n .map((file, index) => <FileUpload>{ file, progress: 0, index: this.files.length + index });\n \n this.files.push(...newFiles);\n this.filesDropped.emit(newFiles);\n }\n\n trackByFile(index: number, file: FileUpload) {\n return file.index;\n }\n}\n","<div class=\"dropzone border position-relative p-5\" [class.dragging]=\"isDraggingFile\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder\" [placeholder]=\"placeholder\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder\"> -->\n <span class=\"h3 d-block\">{{ dropFilesCaption }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n <bs-list-group-item *ngFor=\"let upload of files; trackBy: trackByFile\">\n <ng-container *ngTemplateOutlet=\"fileTemplate ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>","import { Directive, TemplateRef } from '@angular/core';\nimport { BsFileUploadComponent } from '../component/file-upload.component';\n\n@Directive({\n selector: '[bsFileUploadTemplate]'\n})\nexport class BsFileUploadTemplateDirective {\n\n constructor(fileUploadComponent: BsFileUploadComponent, templateRef: TemplateRef<any>) {\n fileUploadComponent.fileTemplate = templateRef;\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { BsForModule } from '@mintplayer/ng-bootstrap/for';\nimport { BsProgressBarModule } from '@mintplayer/ng-bootstrap/progress-bar';\nimport { BsListGroupModule } from '@mintplayer/ng-bootstrap/list-group';\nimport { BsButtonTypeModule } from '@mintplayer/ng-bootstrap/button-type';\nimport { BsFileUploadComponent } from './component/file-upload.component';\nimport { BsFileUploadTemplateDirective } from './directive/file-upload-template.directive';\nimport { BsFormatBytesPipe } from './pipes/format-bytes/format-bytes.pipe';\n\n@NgModule({\n declarations: [\n BsFileUploadComponent,\n BsFileUploadTemplateDirective,\n BsFormatBytesPipe\n ],\n imports: [\n CommonModule,\n BsForModule,\n BsProgressBarModule,\n BsListGroupModule,\n BsButtonTypeModule,\n ],\n exports: [\n BsFileUploadComponent,\n BsFileUploadTemplateDirective,\n BsFormatBytesPipe\n ]\n})\nexport class BsFileUploadModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i5.BsFormatBytesPipe","i1.BsFileUploadComponent"],"mappings":";;;;;;;;;;;;;MAKa,iBAAiB,CAAA;AAE5B,IAAA,SAAS,CAAC,KAAa,EAAE,QAAQ,GAAG,CAAC,EAAA;QACnC,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,YAAA,OAAO,SAAS,CAAC;AAClB,SAAA;QAED,MAAM,CAAC,GAAG,IAAI,CAAC;AACf,QAAA,MAAM,EAAE,GAAG,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;QACxC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EA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,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAZ3B,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,iBAAiB;YACjB,kBAAkB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAQT,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAnB9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,qBAAqB;wBACrB,6BAA6B;wBAC7B,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,iBAAiB;wBACjB,kBAAkB;AACnB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,qBAAqB;wBACrB,6BAA6B;wBAC7B,iBAAiB;AAClB,qBAAA;AACF,iBAAA,CAAA;;;AC5BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-file-upload.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/file-upload/src/pipes/format-bytes/format-bytes.pipe.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/component/file-upload.component.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/component/file-upload.component.html","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/directive/file-upload-template.directive.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/src/file-upload.module.ts","../../../../libs/mintplayer-ng-bootstrap/file-upload/mintplayer-ng-bootstrap-file-upload.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'bsFormatBytes'\n})\nexport class BsFormatBytesPipe implements PipeTransform {\n\n transform(value: number, decimals = 2) {\n if (value === 0) {\n return \"0 Bytes\";\n }\n\n const k = 1024;\n const dm = decimals <= 0 ? 0 : decimals;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n const i = Math.floor(Math.log(value) / Math.log(k));\n\n return parseFloat((value / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i];\n }\n\n}\n","import { Component, EventEmitter, HostListener, Input, Output, TemplateRef } from '@angular/core';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { FileUpload } from '../file-upload';\n\n@Component({\n selector: 'bs-file-upload',\n templateUrl: './file-upload.component.html',\n styleUrls: ['./file-upload.component.scss']\n})\nexport class BsFileUploadComponent {\n\n @Input() public dropFilesCaption = 'Drop your files here';\n @Input() public browseFilesCaption = 'Browse for files';\n @Input() public placeholder = 'Drop files to upload';\n\n colors = Color;\n isDraggingFile = false;\n fileTemplate?: TemplateRef<FileUpload>;\n @Input() public files: FileUpload[] = [];\n @Output() public filesDropped = new EventEmitter<FileUpload[]>();\n\n onChange(event: Event) {\n if (!event.target) return;\n if (!('files' in event.target)) return;\n if (!event.target['files']) return;\n\n const files = (<HTMLInputElement>event.target).files;\n if (!files) return;\n \n this.processDroppedFiles(files);\n }\n\n @HostListener('dragover', ['$event'])\n onDragOver(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n \n if (event.dataTransfer) {\n this.isDraggingFile = true;\n event.dataTransfer.effectAllowed = \"copy\";\n }\n }\n\n @HostListener('dragleave', ['$event'])\n onDragLeave(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isDraggingFile = false;\n }\n\n @HostListener('drop', ['$event'])\n onDrop(event: DragEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isDraggingFile = false;\n if (event.dataTransfer && event.dataTransfer.files) {\n this.processDroppedFiles(event.dataTransfer.files);\n }\n }\n\n private processDroppedFiles(fileList: FileList) {\n const newFiles = [...Array(fileList.length).keys()]\n .map(i => fileList.item(i))\n .filter(f => !!f)\n .map((file, index) => <FileUpload>{ file, progress: 0, index: this.files.length + index });\n \n this.files.push(...newFiles);\n this.filesDropped.emit(newFiles);\n }\n\n trackByFile(index: number, file: FileUpload) {\n return file.index;\n }\n}\n","<div class=\"dropzone border position-relative p-5\" [class.dragging]=\"isDraggingFile\">\n <input type=\"file\" multiple #fileUpload (change)=\"onChange($event)\" [title]=\"placeholder\" [placeholder]=\"placeholder\" class=\"position-absolute w-100 h-100\">\n <!-- <img src=\"/assets/ic-file-upload.svg\" [alt]=\"placeholder\"> -->\n <span class=\"h3 d-block\">{{ dropFilesCaption }}</span>\n <label class=\"btn btn-primary position-relative\" [bsFor]=\"fileUpload\">{{ browseFilesCaption }}</label>\n</div>\n<bs-list-group class=\"files-list\">\n <bs-list-group-item *ngFor=\"let upload of files; trackBy: trackByFile\">\n <ng-container *ngTemplateOutlet=\"fileTemplate ?? defaultFileTemplate; context: { $implicit: upload }\"></ng-container>\n </bs-list-group-item>\n</bs-list-group>\n\n<ng-template #defaultFileTemplate let-upload>\n <div class=\"d-flex flex-row mx-auto\">\n <div class=\"file-img\"></div>\n <div class=\"flex-grow-1 text-start px-2\">\n <span class=\"d-block text-truncate text-secondary\">{{ upload.file.name }}</span>\n <span class=\"d-block text-grey mb-0\">{{ upload.file.size | bsFormatBytes }}</span>\n <bs-progress [height]=\"4\">\n <bs-progress-bar [minimum]=\"0\" [maximum]=\"upload.file.size\" [value]=\"upload.progress\"></bs-progress-bar>\n </bs-progress>\n </div>\n </div>\n</ng-template>","import { Directive, TemplateRef } from '@angular/core';\nimport { BsFileUploadComponent } from '../component/file-upload.component';\n\n@Directive({\n selector: '[bsFileUploadTemplate]'\n})\nexport class BsFileUploadTemplateDirective {\n\n constructor(fileUploadComponent: BsFileUploadComponent, templateRef: TemplateRef<any>) {\n fileUploadComponent.fileTemplate = templateRef;\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { BsForModule } from '@mintplayer/ng-bootstrap/for';\nimport { BsProgressBarModule } from '@mintplayer/ng-bootstrap/progress-bar';\nimport { BsListGroupModule } from '@mintplayer/ng-bootstrap/list-group';\nimport { BsButtonTypeModule } from '@mintplayer/ng-bootstrap/button-type';\nimport { BsFileUploadComponent } from './component/file-upload.component';\nimport { BsFileUploadTemplateDirective } from './directive/file-upload-template.directive';\nimport { BsFormatBytesPipe } from './pipes/format-bytes/format-bytes.pipe';\n\n@NgModule({\n declarations: [\n BsFileUploadComponent,\n BsFileUploadTemplateDirective,\n BsFormatBytesPipe\n ],\n imports: [\n CommonModule,\n BsForModule,\n BsProgressBarModule,\n BsListGroupModule,\n BsButtonTypeModule,\n ],\n exports: [\n BsFileUploadComponent,\n BsFileUploadTemplateDirective,\n BsFormatBytesPipe\n ]\n})\nexport class BsFileUploadModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i5.BsFormatBytesPipe","i1.BsFileUploadComponent"],"mappings":";;;;;;;;;;;;;MAKa,iBAAiB,CAAA;AAE5B,IAAA,SAAS,CAAC,KAAa,EAAE,QAAQ,GAAG,CAAC,EAAA;QACnC,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,YAAA,OAAO,SAAS,CAAC;AAClB,SAAA;QAED,MAAM,CAAC,GAAG,IAAI,CAAC;AACf,QAAA,MAAM,EAAE,GAAG,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;QACxC,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACxE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAEpD,OAAO,UAAU,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;KAC1E;8GAbU,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,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;wBACP,qBAAqB;wBACrB,6BAA6B;wBAC7B,iBAAiB;AAClB,qBAAA;AACF,iBAAA,CAAA;;;AC5BD;;AAEG;;;;"}
|
|
@@ -1,41 +1,39 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, HostBinding, Input,
|
|
2
|
+
import { Directive, HostBinding, Input, NgModule } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
|
|
5
5
|
class BsForDirective {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.defaultCursor = true;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
this.bsFor.focus();
|
|
9
|
+
static { this.counter = 1; }
|
|
10
|
+
set bsFor(value) {
|
|
11
|
+
this.target = value;
|
|
12
|
+
if (this.target instanceof HTMLElement) {
|
|
13
|
+
if (!this.target.id) {
|
|
14
|
+
const count = BsForDirective.counter++;
|
|
15
|
+
this.target.id = `for-target-${count}`;
|
|
16
|
+
}
|
|
17
|
+
this.forValue = this.target.id;
|
|
21
18
|
}
|
|
19
|
+
// console.log('target', this.target);
|
|
22
20
|
}
|
|
23
21
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsForDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
24
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.2", type: BsForDirective, selector: "[bsFor]", inputs: { bsFor: "bsFor" }, host: {
|
|
22
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.2", type: BsForDirective, selector: "label[bsFor]", inputs: { bsFor: "bsFor" }, host: { properties: { "class.cursor-default": "this.defaultCursor", "attr.for": "this.forValue" } }, ngImport: i0 }); }
|
|
25
23
|
}
|
|
26
24
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.2", ngImport: i0, type: BsForDirective, decorators: [{
|
|
27
25
|
type: Directive,
|
|
28
26
|
args: [{
|
|
29
|
-
selector: '[bsFor]'
|
|
27
|
+
selector: 'label[bsFor]'
|
|
30
28
|
}]
|
|
31
29
|
}], propDecorators: { defaultCursor: [{
|
|
32
30
|
type: HostBinding,
|
|
33
31
|
args: ['class.cursor-default']
|
|
34
32
|
}], bsFor: [{
|
|
35
33
|
type: Input
|
|
36
|
-
}],
|
|
37
|
-
type:
|
|
38
|
-
args: ['
|
|
34
|
+
}], forValue: [{
|
|
35
|
+
type: HostBinding,
|
|
36
|
+
args: ['attr.for']
|
|
39
37
|
}] } });
|
|
40
38
|
|
|
41
39
|
class BsForModule {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-for.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/for/src/for.directive.ts","../../../../libs/mintplayer-ng-bootstrap/for/src/for.module.ts","../../../../libs/mintplayer-ng-bootstrap/for/mintplayer-ng-bootstrap-for.ts"],"sourcesContent":["import { Directive, HostBinding, HostListener, Input } from '@angular/core';\n\n@Directive({\n selector: '[bsFor]'\n})\nexport class BsForDirective {\n\n @HostBinding('class.cursor-default') defaultCursor = true;\n\n @Input() bsFor: any;\n @HostListener('click') onMouseClick() {\n
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-for.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/for/src/for.directive.ts","../../../../libs/mintplayer-ng-bootstrap/for/src/for.module.ts","../../../../libs/mintplayer-ng-bootstrap/for/mintplayer-ng-bootstrap-for.ts"],"sourcesContent":["import { Directive, HostBinding, HostListener, Input } from '@angular/core';\n\n@Directive({\n selector: 'label[bsFor]'\n})\nexport class BsForDirective {\n\n @HostBinding('class.cursor-default') defaultCursor = true;\n\n static counter = 1;\n private target: any;\n @Input() public set bsFor(value: any) {\n this.target = value;\n if (this.target instanceof HTMLElement) {\n if (!this.target.id) {\n const count = BsForDirective.counter++;\n this.target.id = `for-target-${count}`;\n }\n this.forValue = this.target.id;\n }\n // console.log('target', this.target);\n }\n\n @HostBinding('attr.for') forValue?: string;\n \n // @HostListener('click') onMouseClick() {\n // if (!('tagName' in this.target)) {\n // // Not a form-control, let's just assume the class has some \"focus\" method\n // this.target.focus();\n // } else if (this.target.tagName.toLowerCase() !== 'input') {\n // // HTML element, but not an input, probably a textarea\n // this.target.focus();\n // } else if (this.target.type.toLowerCase() === 'file') {\n // // HtmlInputElement for a file\n // this.target.click();\n // } else {\n // // HtmlInputElement\n // this.target.focus();\n // }\n // }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { BsForDirective } from './for.directive';\n\n@NgModule({\n declarations: [\n BsForDirective\n ],\n imports: [\n CommonModule\n ],\n exports: [\n BsForDirective\n ]\n})\nexport class BsForModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAKa,cAAc,CAAA;AAH3B,IAAA,WAAA,GAAA;QAKuC,IAAa,CAAA,aAAA,GAAG,IAAI,CAAC;AAkC3D,KAAA;aAhCQ,IAAO,CAAA,OAAA,GAAG,CAAH,CAAK,EAAA;IAEnB,IAAoB,KAAK,CAAC,KAAU,EAAA;AAClC,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;AACpB,QAAA,IAAI,IAAI,CAAC,MAAM,YAAY,WAAW,EAAE;AACtC,YAAA,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;AACnB,gBAAA,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;gBACvC,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,CAAc,WAAA,EAAA,KAAK,EAAE,CAAC;AACxC,aAAA;YACD,IAAI,CAAC,QAAQ,GAAG,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,EAAA,EAAA,IAAA,EAAA,WAAW,YANpB,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAMH,WAAW,EAAA,UAAA,EAAA,CAAA;kBAXvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,cAAc;AACf,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,cAAc;AACf,qBAAA;AACF,iBAAA,CAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class BsForDirective {
|
|
3
3
|
defaultCursor: boolean;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
static counter: number;
|
|
5
|
+
private target;
|
|
6
|
+
set bsFor(value: any);
|
|
7
|
+
forValue?: string;
|
|
6
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<BsForDirective, never>;
|
|
7
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BsForDirective, "[bsFor]", never, { "bsFor": { "alias": "bsFor"; "required": false; }; }, {}, never, never, false, never>;
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BsForDirective, "label[bsFor]", never, { "bsFor": { "alias": "bsFor"; "required": false; }; }, {}, never, never, false, never>;
|
|
8
10
|
}
|