@yoozsoft/yoozsoft-ng 4.0.6 → 4.0.7
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/fesm2022/yoozsoft-yoozsoft-ng-file-upload.mjs +10 -4
- package/fesm2022/yoozsoft-yoozsoft-ng-file-upload.mjs.map +1 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-tiff-viewer.mjs +2 -1
- package/fesm2022/yoozsoft-yoozsoft-ng-tiff-viewer.mjs.map +1 -1
- package/file-upload/src/ys-file-upload/ys-file-upload.component.d.ts +3 -1
- package/package.json +12 -12
|
@@ -49,6 +49,8 @@ class YsFileUploadComponent {
|
|
|
49
49
|
choosed = new EventEmitter();
|
|
50
50
|
/**Event of selected file in the list of choosed file*/
|
|
51
51
|
select = new EventEmitter();
|
|
52
|
+
/**Event of removed file in the list of choosed file*/
|
|
53
|
+
removed = new EventEmitter();
|
|
52
54
|
/**Event of cancel upload button */
|
|
53
55
|
cancel = new EventEmitter();
|
|
54
56
|
/**Disable elements */
|
|
@@ -99,13 +101,15 @@ class YsFileUploadComponent {
|
|
|
99
101
|
removeFile(file) {
|
|
100
102
|
const index = this.files.indexOf(file);
|
|
101
103
|
this.files.splice(index, 1);
|
|
102
|
-
this.onChange(this.multiple ? this.files : this.files[0]);
|
|
104
|
+
// this.onChange(this.multiple ? this.files : this.files[0]);
|
|
105
|
+
this.onChange(this.files);
|
|
103
106
|
this.onTouched(this.files);
|
|
104
|
-
this.choosed.emit(this.files);
|
|
107
|
+
// this.choosed.emit(this.files);
|
|
105
108
|
if (this.selectedFile == file) {
|
|
106
109
|
this.selectedFile = null;
|
|
107
|
-
this.select.emit(null);
|
|
110
|
+
// this.select.emit(null);
|
|
108
111
|
}
|
|
112
|
+
this.removed.emit(file);
|
|
109
113
|
}
|
|
110
114
|
onSelectFile(file) {
|
|
111
115
|
this.selectedFile = file;
|
|
@@ -115,7 +119,7 @@ class YsFileUploadComponent {
|
|
|
115
119
|
this.cancel.emit();
|
|
116
120
|
}
|
|
117
121
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: YsFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
118
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: YsFileUploadComponent, isStandalone: true, selector: "ys-file-upload", inputs: { styleClass: "styleClass", multiple: "multiple", accept: "accept", uploadLabel: "uploadLabel", uploadStyleClass: "uploadStyleClass", uploadIconClass: "uploadIconClass", isRemove: "isRemove", removeIconClass: "removeIconClass", isHorizontal: "isHorizontal", noFileMessage: "noFileMessage", progressStyleClass: "progressStyleClass", progressValue: "progressValue", progressValueMax: "progressValueMax", isCancel: "isCancel", disabled: "disabled" }, outputs: { choosed: "choosed", select: "select", cancel: "cancel" }, providers: [
|
|
122
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: YsFileUploadComponent, isStandalone: true, selector: "ys-file-upload", inputs: { styleClass: "styleClass", multiple: "multiple", accept: "accept", uploadLabel: "uploadLabel", uploadStyleClass: "uploadStyleClass", uploadIconClass: "uploadIconClass", isRemove: "isRemove", removeIconClass: "removeIconClass", isHorizontal: "isHorizontal", noFileMessage: "noFileMessage", progressStyleClass: "progressStyleClass", progressValue: "progressValue", progressValueMax: "progressValueMax", isCancel: "isCancel", disabled: "disabled" }, outputs: { choosed: "choosed", select: "select", removed: "removed", cancel: "cancel" }, providers: [
|
|
119
123
|
{
|
|
120
124
|
provide: NG_VALUE_ACCESSOR,
|
|
121
125
|
useExisting: forwardRef(() => YsFileUploadComponent),
|
|
@@ -164,6 +168,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
|
|
|
164
168
|
type: Output
|
|
165
169
|
}], select: [{
|
|
166
170
|
type: Output
|
|
171
|
+
}], removed: [{
|
|
172
|
+
type: Output
|
|
167
173
|
}], cancel: [{
|
|
168
174
|
type: Output
|
|
169
175
|
}], disabled: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yoozsoft-yoozsoft-ng-file-upload.mjs","sources":["../../../../projects/yoozsoft/yoozsoft-ng/file-upload/src/ys-file-upload/ys-file-upload.component.ts","../../../../projects/yoozsoft/yoozsoft-ng/file-upload/src/ys-file-upload/ys-file-upload.component.html","../../../../projects/yoozsoft/yoozsoft-ng/file-upload/public-api.ts","../../../../projects/yoozsoft/yoozsoft-ng/file-upload/yoozsoft-yoozsoft-ng-file-upload.ts"],"sourcesContent":["import { NgClass, NgFor, NgIf } from '@angular/common';\r\nimport { Component, EventEmitter, forwardRef, Input, Output } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\n\r\n@Component({\r\n selector: 'ys-file-upload',\r\n imports: [NgIf, NgFor, NgClass],\r\n templateUrl: './ys-file-upload.component.html',\r\n styleUrl: './ys-file-upload.component.scss',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => YsFileUploadComponent),\r\n multi: true\r\n }\r\n ]\r\n})\r\nexport class YsFileUploadComponent implements ControlValueAccessor {\r\n\r\n private fileList?: FileList;\r\n files: File[] = [];\r\n selectedFile: File | null = null;\r\n\r\n @Input() styleClass?: string;\r\n /**\r\n * Allowing upload multiple files\r\n * Default is false\r\n */\r\n @Input() multiple: boolean = false;\r\n /**\r\n * Acceptable type of files\r\n * Default is all file type\r\n */\r\n @Input() accept: string = '*/*';\r\n /**\r\n * Upload button label\r\n * Default is Choose File\r\n */\r\n @Input() uploadLabel?: string = 'Choose File';\r\n /**Style class of upload button */\r\n @Input() uploadStyleClass?: string;\r\n /**Icon class of upload button */\r\n @Input() uploadIconClass: string = 'fa fa-paperclip';\r\n\r\n /**Display choosed file remove button */\r\n @Input() isRemove: boolean = true;\r\n /**Icon of remove item button */\r\n @Input() removeIconClass: string = 'fa fa-times';\r\n\r\n /**\r\n * Files list display direction\r\n * Default is vertical (false)\r\n */\r\n @Input() isHorizontal: boolean = false;\r\n\r\n /**Message displayed before choosing file */\r\n @Input() noFileMessage: string = \"No file chosen\";\r\n\r\n @Input() progressStyleClass?: string;\r\n /**Value of progress element */\r\n @Input() progressValue?: number;\r\n /**Max value of progress element */\r\n @Input() progressValueMax: number = 100;\r\n /**Display cancel upload button */\r\n @Input() isCancel: boolean = false;\r\n\r\n /**Event to get choosed files */\r\n @Output() choosed: EventEmitter<File[]> = new EventEmitter();\r\n /**Event of selected file in the list of choosed file*/\r\n @Output() select: EventEmitter<File | null> = new EventEmitter();\r\n /**Event of cancel upload button */\r\n @Output() cancel: EventEmitter<void> = new EventEmitter();\r\n\r\n /**Disable elements */\r\n @Input() disabled: boolean = false;\r\n onChange: any = () => { }\r\n onTouched: any = () => { }\r\n\r\n constructor() { }\r\n\r\n writeValue(obj: any): void {\r\n if (!obj) {\r\n this.files = [];\r\n return;\r\n }\r\n\r\n if (!Array.isArray(obj)) {\r\n this.files = [obj];\r\n return;\r\n }\r\n\r\n this.files = obj;\r\n }\r\n registerOnChange(fn: any): void {\r\n this.onChange = fn;\r\n }\r\n registerOnTouched(fn: any): void {\r\n this.onTouched = fn;\r\n }\r\n setDisabledState?(isDisabled: boolean): void {\r\n this.disabled = isDisabled;\r\n }\r\n\r\n onChangeFiles(event: any) {\r\n this.fileList = event.target.files;\r\n\r\n if (this.fileList?.length) {\r\n\r\n if (!this.multiple) {\r\n this.files = [];\r\n }\r\n\r\n for (let i = 0; i < this.fileList.length; i++) {\r\n const file: File = this.fileList.item(i)!;\r\n this.files.push(file);\r\n }\r\n\r\n this.files.sort((a, b) => a.name > b.name ? -1 : 1);\r\n\r\n } else {\r\n this.files = [];\r\n }\r\n\r\n this.onChange(this.files);\r\n this.onTouched(this.files);\r\n\r\n this.choosed.emit(this.files);\r\n\r\n event.target.value = null;\r\n\r\n }\r\n\r\n removeFile(file: File) {\r\n const index = this.files.indexOf(file);\r\n this.files.splice(index, 1);\r\n\r\n this.onChange(this.multiple ? this.files : this.files[0]);\r\n this.onTouched(this.files);\r\n\r\n this.choosed.emit(this.files);\r\n\r\n if (this.selectedFile == file) {\r\n this.selectedFile = null;\r\n this.select.emit(null);\r\n }\r\n }\r\n\r\n onSelectFile(file: File) {\r\n this.selectedFile = file;\r\n this.select.emit(this.selectedFile);\r\n }\r\n\r\n cancelUpload() {\r\n this.cancel.emit();\r\n }\r\n\r\n}\r\n","<input class=\"form-control d-none file-upload\" type=\"file\" id=\"ysFileUpload\" #ysFileUpload [multiple]=\"multiple\"\r\n [accept]=\"accept\" [disabled]=\"disabled\" (change)=\"onChangeFiles($event)\">\r\n\r\n<div class=\"file-upload\" [ngClass]=\"styleClass\">\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <button class=\"btn btn-primary btn-upload {{uploadStyleClass}}\" (click)=\"ysFileUpload.click()\"\r\n [disabled]=\"disabled\">\r\n <i [ngClass]=\"uploadIconClass\"></i>\r\n <span class=\"ms-2\" *ngIf=\"uploadLabel\">{{uploadLabel}}</span>\r\n </button>\r\n\r\n <span class=\"ms-2\" *ngIf=\"noFileMessage\">{{files.length ? '' : noFileMessage}}</span>\r\n\r\n <ul *ngIf=\"files.length\" class=\"file-upload-list list-group mt-2\"\r\n [ngClass]=\"{'list-group-horizontal overflow-auto': isHorizontal}\">\r\n <a class=\"file-upload-item list-group-item d-flex align-items-center\" role=\"button\"\r\n *ngFor=\"let file of files\" (click)=\"onSelectFile(file)\"\r\n [ngClass]=\"{'active': file == selectedFile, 'disabled': disabled}\">\r\n <span class=\"me-2\">{{file.name}}</span>\r\n <button *ngIf=\"isRemove\" class=\"btn btn-outline-danger btn-sm ms-auto\" type=\"button\"\r\n id=\"removeFileButton\" (click)=\"removeFile(file); $event.stopPropagation();\"\r\n [disabled]=\"disabled\">\r\n <i [ngClass]=\"removeIconClass\"></i>\r\n </button>\r\n </a>\r\n </ul>\r\n\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div class=\"progress mt-2\" [ngClass]=\"progressStyleClass\" *ngIf=\"progressValue\">\r\n <div class=\"progress-bar\" role=\"progressbar\" [style.width.%]=\"progressValue\" [attr.aria-valuenow]=\"progressValue\"\r\n aria-valuemin=\"0\" [attr.aria-valuemax]=\"progressValueMax\"></div>\r\n\r\n <button *ngIf=\"isCancel && progressValue < progressValueMax\" class=\"btn btn-danger btn-sm btn-upload-cancel d-flex\"\r\n (click)=\"cancelUpload()\">\r\n <i class=\"fa fa-times\"></i>\r\n </button>\r\n</div>","/*\r\n * Public API Surface of ys-select\r\n */\r\n\r\nexport * from './src/ys-file-upload/ys-file-upload.component';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAiBa,qBAAqB,CAAA;AAExB,IAAA,QAAQ;IAChB,KAAK,GAAW,EAAE;IAClB,YAAY,GAAgB,IAAI;AAEvB,IAAA,UAAU;AACnB;;;AAGG;IACM,QAAQ,GAAY,KAAK;AAClC;;;AAGG;IACM,MAAM,GAAW,KAAK;AAC/B;;;AAGG;IACM,WAAW,GAAY,aAAa;;AAEpC,IAAA,gBAAgB;;IAEhB,eAAe,GAAW,iBAAiB;;IAG3C,QAAQ,GAAY,IAAI;;IAExB,eAAe,GAAW,aAAa;AAEhD;;;AAGG;IACM,YAAY,GAAY,KAAK;;IAG7B,aAAa,GAAW,gBAAgB;AAExC,IAAA,kBAAkB;;AAElB,IAAA,aAAa;;IAEb,gBAAgB,GAAW,GAAG;;IAE9B,QAAQ,GAAY,KAAK;;AAGxB,IAAA,OAAO,GAAyB,IAAI,YAAY,EAAE;;AAElD,IAAA,MAAM,GAA8B,IAAI,YAAY,EAAE;;AAEtD,IAAA,MAAM,GAAuB,IAAI,YAAY,EAAE;;IAGhD,QAAQ,GAAY,KAAK;AAClC,IAAA,QAAQ,GAAQ,MAAK,GAAI;AACzB,IAAA,SAAS,GAAQ,MAAK,GAAI;AAE1B,IAA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kBAbjC,SAAS;+BACE,gBAAgB,EAAA,OAAA,EACjB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,EAGpB,SAAA,EAAA;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAE,UAAU,CAAC,2BAA2B,CAAC;AACpD,4BAAA,KAAK,EAAE;AACR;AACF,qBAAA,EAAA,QAAA,EAAA,ivEAAA,EAAA,MAAA,EAAA,CAAA,0BAAA,CAAA,EAAA;wDAQQ,UAAU,EAAA,CAAA;sBAAlB;gBAKQ,QAAQ,EAAA,CAAA;sBAAhB;gBAKQ,MAAM,EAAA,CAAA;sBAAd;gBAKQ,WAAW,EAAA,CAAA;sBAAnB;gBAEQ,gBAAgB,EAAA,CAAA;sBAAxB;gBAEQ,eAAe,EAAA,CAAA;sBAAvB;gBAGQ,QAAQ,EAAA,CAAA;sBAAhB;gBAEQ,eAAe,EAAA,CAAA;sBAAvB;gBAMQ,YAAY,EAAA,CAAA;sBAApB;gBAGQ,aAAa,EAAA,CAAA;sBAArB;gBAEQ,kBAAkB,EAAA,CAAA;sBAA1B;gBAEQ,aAAa,EAAA,CAAA;sBAArB;gBAEQ,gBAAgB,EAAA,CAAA;sBAAxB;gBAEQ,QAAQ,EAAA,CAAA;sBAAhB;gBAGS,OAAO,EAAA,CAAA;sBAAhB;gBAES,MAAM,EAAA,CAAA;sBAAf;gBAES,MAAM,EAAA,CAAA;sBAAf;gBAGQ,QAAQ,EAAA,CAAA;sBAAhB;;;AE1EH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"yoozsoft-yoozsoft-ng-file-upload.mjs","sources":["../../../../projects/yoozsoft/yoozsoft-ng/file-upload/src/ys-file-upload/ys-file-upload.component.ts","../../../../projects/yoozsoft/yoozsoft-ng/file-upload/src/ys-file-upload/ys-file-upload.component.html","../../../../projects/yoozsoft/yoozsoft-ng/file-upload/public-api.ts","../../../../projects/yoozsoft/yoozsoft-ng/file-upload/yoozsoft-yoozsoft-ng-file-upload.ts"],"sourcesContent":["import { NgClass, NgFor, NgIf } from '@angular/common';\r\nimport { Component, EventEmitter, forwardRef, Input, Output } from '@angular/core';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\n\r\n@Component({\r\n selector: 'ys-file-upload',\r\n imports: [NgIf, NgFor, NgClass],\r\n templateUrl: './ys-file-upload.component.html',\r\n styleUrl: './ys-file-upload.component.scss',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => YsFileUploadComponent),\r\n multi: true\r\n }\r\n ]\r\n})\r\nexport class YsFileUploadComponent implements ControlValueAccessor {\r\n\r\n private fileList?: FileList;\r\n files: File[] = [];\r\n selectedFile: File | null = null;\r\n\r\n @Input() styleClass?: string;\r\n /**\r\n * Allowing upload multiple files\r\n * Default is false\r\n */\r\n @Input() multiple: boolean = false;\r\n /**\r\n * Acceptable type of files\r\n * Default is all file type\r\n */\r\n @Input() accept: string = '*/*';\r\n /**\r\n * Upload button label\r\n * Default is Choose File\r\n */\r\n @Input() uploadLabel?: string = 'Choose File';\r\n /**Style class of upload button */\r\n @Input() uploadStyleClass?: string;\r\n /**Icon class of upload button */\r\n @Input() uploadIconClass: string = 'fa fa-paperclip';\r\n\r\n /**Display choosed file remove button */\r\n @Input() isRemove: boolean = true;\r\n /**Icon of remove item button */\r\n @Input() removeIconClass: string = 'fa fa-times';\r\n\r\n /**\r\n * Files list display direction\r\n * Default is vertical (false)\r\n */\r\n @Input() isHorizontal: boolean = false;\r\n\r\n /**Message displayed before choosing file */\r\n @Input() noFileMessage: string = \"No file chosen\";\r\n\r\n @Input() progressStyleClass?: string;\r\n /**Value of progress element */\r\n @Input() progressValue?: number;\r\n /**Max value of progress element */\r\n @Input() progressValueMax: number = 100;\r\n /**Display cancel upload button */\r\n @Input() isCancel: boolean = false;\r\n\r\n /**Event to get choosed files */\r\n @Output() choosed: EventEmitter<File[]> = new EventEmitter();\r\n /**Event of selected file in the list of choosed file*/\r\n @Output() select: EventEmitter<File | null> = new EventEmitter();\r\n /**Event of removed file in the list of choosed file*/\r\n @Output() removed: EventEmitter<File> = new EventEmitter();\r\n /**Event of cancel upload button */\r\n @Output() cancel: EventEmitter<void> = new EventEmitter();\r\n\r\n /**Disable elements */\r\n @Input() disabled: boolean = false;\r\n onChange: any = () => { }\r\n onTouched: any = () => { }\r\n\r\n constructor() { }\r\n\r\n writeValue(obj: any): void {\r\n if (!obj) {\r\n this.files = [];\r\n return;\r\n }\r\n\r\n if (!Array.isArray(obj)) {\r\n this.files = [obj];\r\n return;\r\n }\r\n\r\n this.files = obj;\r\n }\r\n registerOnChange(fn: any): void {\r\n this.onChange = fn;\r\n }\r\n registerOnTouched(fn: any): void {\r\n this.onTouched = fn;\r\n }\r\n setDisabledState?(isDisabled: boolean): void {\r\n this.disabled = isDisabled;\r\n }\r\n\r\n onChangeFiles(event: any) {\r\n this.fileList = event.target.files;\r\n\r\n if (this.fileList?.length) {\r\n\r\n if (!this.multiple) {\r\n this.files = [];\r\n }\r\n\r\n for (let i = 0; i < this.fileList.length; i++) {\r\n const file: File = this.fileList.item(i)!;\r\n this.files.push(file);\r\n }\r\n\r\n this.files.sort((a, b) => a.name > b.name ? -1 : 1);\r\n\r\n } else {\r\n this.files = [];\r\n }\r\n\r\n this.onChange(this.files);\r\n this.onTouched(this.files);\r\n\r\n this.choosed.emit(this.files);\r\n\r\n event.target.value = null;\r\n\r\n }\r\n\r\n removeFile(file: File) {\r\n const index = this.files.indexOf(file);\r\n this.files.splice(index, 1);\r\n\r\n // this.onChange(this.multiple ? this.files : this.files[0]);\r\n this.onChange(this.files);\r\n this.onTouched(this.files);\r\n\r\n // this.choosed.emit(this.files);\r\n\r\n if (this.selectedFile == file) {\r\n this.selectedFile = null;\r\n // this.select.emit(null);\r\n }\r\n\r\n this.removed.emit(file);\r\n }\r\n\r\n onSelectFile(file: File) {\r\n this.selectedFile = file;\r\n this.select.emit(this.selectedFile);\r\n }\r\n\r\n cancelUpload() {\r\n this.cancel.emit();\r\n }\r\n\r\n}\r\n","<input class=\"form-control d-none file-upload\" type=\"file\" id=\"ysFileUpload\" #ysFileUpload [multiple]=\"multiple\"\r\n [accept]=\"accept\" [disabled]=\"disabled\" (change)=\"onChangeFiles($event)\">\r\n\r\n<div class=\"file-upload\" [ngClass]=\"styleClass\">\r\n <div class=\"row\">\r\n <div class=\"col\">\r\n <button class=\"btn btn-primary btn-upload {{uploadStyleClass}}\" (click)=\"ysFileUpload.click()\"\r\n [disabled]=\"disabled\">\r\n <i [ngClass]=\"uploadIconClass\"></i>\r\n <span class=\"ms-2\" *ngIf=\"uploadLabel\">{{uploadLabel}}</span>\r\n </button>\r\n\r\n <span class=\"ms-2\" *ngIf=\"noFileMessage\">{{files.length ? '' : noFileMessage}}</span>\r\n\r\n <ul *ngIf=\"files.length\" class=\"file-upload-list list-group mt-2\"\r\n [ngClass]=\"{'list-group-horizontal overflow-auto': isHorizontal}\">\r\n <a class=\"file-upload-item list-group-item d-flex align-items-center\" role=\"button\"\r\n *ngFor=\"let file of files\" (click)=\"onSelectFile(file)\"\r\n [ngClass]=\"{'active': file == selectedFile, 'disabled': disabled}\">\r\n <span class=\"me-2\">{{file.name}}</span>\r\n <button *ngIf=\"isRemove\" class=\"btn btn-outline-danger btn-sm ms-auto\" type=\"button\"\r\n id=\"removeFileButton\" (click)=\"removeFile(file); $event.stopPropagation();\"\r\n [disabled]=\"disabled\">\r\n <i [ngClass]=\"removeIconClass\"></i>\r\n </button>\r\n </a>\r\n </ul>\r\n\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<div class=\"progress mt-2\" [ngClass]=\"progressStyleClass\" *ngIf=\"progressValue\">\r\n <div class=\"progress-bar\" role=\"progressbar\" [style.width.%]=\"progressValue\" [attr.aria-valuenow]=\"progressValue\"\r\n aria-valuemin=\"0\" [attr.aria-valuemax]=\"progressValueMax\"></div>\r\n\r\n <button *ngIf=\"isCancel && progressValue < progressValueMax\" class=\"btn btn-danger btn-sm btn-upload-cancel d-flex\"\r\n (click)=\"cancelUpload()\">\r\n <i class=\"fa fa-times\"></i>\r\n </button>\r\n</div>","/*\r\n * Public API Surface of ys-select\r\n */\r\n\r\nexport * from './src/ys-file-upload/ys-file-upload.component';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAiBa,qBAAqB,CAAA;AAExB,IAAA,QAAQ;IAChB,KAAK,GAAW,EAAE;IAClB,YAAY,GAAgB,IAAI;AAEvB,IAAA,UAAU;AACnB;;;AAGG;IACM,QAAQ,GAAY,KAAK;AAClC;;;AAGG;IACM,MAAM,GAAW,KAAK;AAC/B;;;AAGG;IACM,WAAW,GAAY,aAAa;;AAEpC,IAAA,gBAAgB;;IAEhB,eAAe,GAAW,iBAAiB;;IAG3C,QAAQ,GAAY,IAAI;;IAExB,eAAe,GAAW,aAAa;AAEhD;;;AAGG;IACM,YAAY,GAAY,KAAK;;IAG7B,aAAa,GAAW,gBAAgB;AAExC,IAAA,kBAAkB;;AAElB,IAAA,aAAa;;IAEb,gBAAgB,GAAW,GAAG;;IAE9B,QAAQ,GAAY,KAAK;;AAGxB,IAAA,OAAO,GAAyB,IAAI,YAAY,EAAE;;AAElD,IAAA,MAAM,GAA8B,IAAI,YAAY,EAAE;;AAEtD,IAAA,OAAO,GAAuB,IAAI,YAAY,EAAE;;AAEhD,IAAA,MAAM,GAAuB,IAAI,YAAY,EAAE;;IAGhD,QAAQ,GAAY,KAAK;AAClC,IAAA,QAAQ,GAAQ,MAAK,GAAI;AACzB,IAAA,SAAS,GAAQ,MAAK,GAAI;AAE1B,IAAA,WAAA,GAAA;AAEA,IAAA,UAAU,CAAC,GAAQ,EAAA;QACjB,IAAI,CAAC,GAAG,EAAE;AACR,YAAA,IAAI,CAAC,KAAK,GAAG,EAAE;YACf;;QAGF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAA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MAAA,EAAA,CAAA,0BAAA,CAAA,EAAA;wDAQQ,UAAU,EAAA,CAAA;sBAAlB;gBAKQ,QAAQ,EAAA,CAAA;sBAAhB;gBAKQ,MAAM,EAAA,CAAA;sBAAd;gBAKQ,WAAW,EAAA,CAAA;sBAAnB;gBAEQ,gBAAgB,EAAA,CAAA;sBAAxB;gBAEQ,eAAe,EAAA,CAAA;sBAAvB;gBAGQ,QAAQ,EAAA,CAAA;sBAAhB;gBAEQ,eAAe,EAAA,CAAA;sBAAvB;gBAMQ,YAAY,EAAA,CAAA;sBAApB;gBAGQ,aAAa,EAAA,CAAA;sBAArB;gBAEQ,kBAAkB,EAAA,CAAA;sBAA1B;gBAEQ,aAAa,EAAA,CAAA;sBAArB;gBAEQ,gBAAgB,EAAA,CAAA;sBAAxB;gBAEQ,QAAQ,EAAA,CAAA;sBAAhB;gBAGS,OAAO,EAAA,CAAA;sBAAhB;gBAES,MAAM,EAAA,CAAA;sBAAf;gBAES,OAAO,EAAA,CAAA;sBAAhB;gBAES,MAAM,EAAA,CAAA;sBAAf;gBAGQ,QAAQ,EAAA,CAAA;sBAAhB;;;AE5EH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -45,6 +45,8 @@ class YsTiffViewerComponent {
|
|
|
45
45
|
async convertSource(buffer) {
|
|
46
46
|
this.canvas = document.getElementById("tiffCanvas");
|
|
47
47
|
this.context = this.canvas.getContext("2d");
|
|
48
|
+
this.IFDs = [];
|
|
49
|
+
this.currentIFDIndex = 0;
|
|
48
50
|
if (!buffer) {
|
|
49
51
|
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
50
52
|
return;
|
|
@@ -57,7 +59,6 @@ class YsTiffViewerComponent {
|
|
|
57
59
|
this.IFDs.forEach((ifd) => {
|
|
58
60
|
UTIF.decodeImage(buffer, ifd);
|
|
59
61
|
});
|
|
60
|
-
this.currentIFDIndex = 0;
|
|
61
62
|
this.putImage(this.currentIFDIndex);
|
|
62
63
|
this.isDecoding = false;
|
|
63
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yoozsoft-yoozsoft-ng-tiff-viewer.mjs","sources":["../../../../projects/yoozsoft/yoozsoft-ng/tiff-viewer/src/ys-tiff-viewer/ys-tiff-viewer.component.ts","../../../../projects/yoozsoft/yoozsoft-ng/tiff-viewer/src/ys-tiff-viewer/ys-tiff-viewer.component.html","../../../../projects/yoozsoft/yoozsoft-ng/tiff-viewer/public-api.ts","../../../../projects/yoozsoft/yoozsoft-ng/tiff-viewer/yoozsoft-yoozsoft-ng-tiff-viewer.ts"],"sourcesContent":["import { NgClass, NgIf } from '@angular/common';\r\nimport { Component, Input } from '@angular/core';\r\n\r\ndeclare var UTIF: any;\r\n\r\n@Component({\r\n selector: 'ys-tiff-viewer',\r\n imports: [NgIf, NgClass],\r\n templateUrl: './ys-tiff-viewer.component.html',\r\n styleUrl: './ys-tiff-viewer.component.scss'\r\n})\r\nexport class YsTiffViewerComponent {\r\n\r\n private canvas: any;\r\n private context: any;\r\n /**image file directories */\r\n private IFDs: any[] = [];\r\n private currentIFDIndex: number = 0;\r\n isDecoding: boolean = false;\r\n\r\n private _buffer: ArrayBuffer | File | Blob | null | undefined;\r\n /**Uint8Array source */\r\n /**ArrayBuffer containing TIFF or EXIF data */\r\n @Input()\r\n get buffer(): ArrayBuffer | File | Blob | null | undefined { return this._buffer; }\r\n set buffer(value: ArrayBuffer | File | Blob | null | undefined) { this._buffer = value; this.convertSource(this._buffer); }\r\n\r\n _currentPageReportTemplate?: string = \"Page {current} of {total}\";\r\n /**Current page report template */\r\n @Input()\r\n get currentPageReportTemplate(): string | undefined {\r\n return this._currentPageReportTemplate?.\r\n replace('{current}', `<strong>${this.currentIFDIndex + 1}</strong>`).\r\n replace('{total}', `<strong>${this.IFDs.length}</strong>`);\r\n }\r\n set currentPageReportTemplate(value: string | undefined) { this._currentPageReportTemplate = value; }\r\n\r\n /**Canvas container style class */\r\n @Input() styleClass?: string;\r\n /**Message displayed before filling the input buffer */\r\n @Input() noFileMessage?: string = \"No image file\";\r\n\r\n /**First button icon class */\r\n @Input() firstIconClass: string = 'fa fa-fast-backward';\r\n /**Previous button icon class */\r\n @Input() previousIconClass: string = 'fa fa-step-backward';\r\n /**Next button icon class */\r\n @Input() nextIconClass: string = 'fa fa-step-forward';\r\n /**Last button icon class */\r\n @Input() lastIconClass: string = 'fa fa-fast-forward';\r\n\r\n get isIFDs(): boolean { return this.IFDs.length > 0; }\r\n get isFirstImage(): boolean { return !this.isIFDs || (this.currentIFDIndex == 0); }\r\n get isLastImage(): boolean { return !this.isIFDs || (this.currentIFDIndex == this.IFDs.length - 1); }\r\n\r\n\r\n /**\r\n * Convert buffer to an array of \"IFDs\" (image file directories)\r\n * @param buffer ArrayBuffer containing TIFF or EXIF data\r\n * @returns \r\n */\r\n async convertSource(buffer: ArrayBuffer | File | Blob | null | undefined) {\r\n this.canvas = document.getElementById(\"tiffCanvas\");\r\n this.context = this.canvas.getContext(\"2d\");\r\n\r\n if (!buffer) {\r\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n return;\r\n }\r\n\r\n if (buffer instanceof File || buffer instanceof Blob) {\r\n buffer = await this.getAsByteArray(buffer);\r\n }\r\n\r\n this.isDecoding = true;\r\n\r\n this.IFDs = UTIF.decode(buffer);\r\n\r\n this.IFDs.forEach((ifd: any) => {\r\n UTIF.decodeImage(buffer, ifd);\r\n });\r\n\r\n this.currentIFDIndex = 0;\r\n this.putImage(this.currentIFDIndex);\r\n\r\n this.isDecoding = false;\r\n }\r\n\r\n putImage(index: number) {\r\n if (!this.IFDs.length) {\r\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n return;\r\n }\r\n\r\n const tiffImage = this.IFDs[index];\r\n const rgbaImage = UTIF.toRGBA8(tiffImage); // Uint8Array with RGBA pixels\r\n\r\n const data = new Uint8ClampedArray(rgbaImage);\r\n const imageData = new ImageData(data, tiffImage.width, tiffImage.height);\r\n\r\n this.context.canvas.width = tiffImage.width;\r\n this.context.canvas.height = tiffImage.height;\r\n // Draw image data to the canvas\r\n this.context.putImageData(imageData, 0, 0);\r\n }\r\n\r\n\r\n first() {\r\n this.currentIFDIndex = 0;\r\n this.putImage(this.currentIFDIndex);\r\n }\r\n previous() {\r\n this.currentIFDIndex -= 1;\r\n if (this.currentIFDIndex < 0) {\r\n this.currentIFDIndex = 0;\r\n return;\r\n }\r\n this.putImage(this.currentIFDIndex);\r\n }\r\n\r\n next() {\r\n this.currentIFDIndex += 1;\r\n if (this.currentIFDIndex > (this.IFDs.length - 1)) {\r\n this.currentIFDIndex = this.IFDs.length - 1;\r\n return;\r\n }\r\n this.putImage(this.currentIFDIndex);\r\n }\r\n last() {\r\n this.currentIFDIndex = this.IFDs.length - 1;\r\n this.putImage(this.currentIFDIndex);\r\n }\r\n\r\n async getAsByteArray(blob: Blob) {\r\n var res = new Uint8Array(await this.readFile(blob))\r\n return res;\r\n }\r\n\r\n async readFile(blob: Blob): Promise<ArrayBuffer> {\r\n return new Promise((resolve, reject) => {\r\n // Create file reader\r\n let reader = new FileReader()\r\n\r\n // Register event listeners\r\n reader.onload = () => resolve(reader.result as ArrayBuffer);\r\n reader.onerror = error => reject(error);\r\n\r\n // Read file\r\n reader.readAsArrayBuffer(blob);\r\n })\r\n }\r\n\r\n}\r\n","<div class=\"row\">\r\n <div class=\"col d-flex justify-content-between align-items-center mt-2\">\r\n <div>\r\n <button class=\"btn btn-outline-primary mb-0 me-2\" [ngClass]=\"{'ml-auto': isIFDs}\" type=\"button\"\r\n (click)=\"first()\" [disabled]=\"isFirstImage\">\r\n <i [ngClass]=\"firstIconClass\"></i>\r\n </button>\r\n <button class=\"btn btn-outline-primary mb-0\" type=\"button\" (click)=\"previous()\" [disabled]=\"isFirstImage\">\r\n <i [ngClass]=\"previousIconClass\"></i>\r\n </button>\r\n </div>\r\n\r\n <span *ngIf=\"isIFDs\" [innerHtml]=\"currentPageReportTemplate\">\r\n </span>\r\n\r\n <div>\r\n <button class=\"btn btn-outline-primary mb-0 me-2\" type=\"button\" (click)=\"next()\" [disabled]=\"isLastImage\">\r\n <i [ngClass]=\"nextIconClass\"></i>\r\n </button>\r\n <button class=\"btn btn-outline-primary mb-0\" [ngClass]=\"{'mr-auto': isIFDs}\" type=\"button\" (click)=\"last()\"\r\n [disabled]=\"isLastImage\">\r\n <i [ngClass]=\"lastIconClass\"></i>\r\n </button>\r\n </div>\r\n\r\n\r\n </div>\r\n</div>\r\n<div class=\"row\">\r\n <div class=\"col\">\r\n <div class=\"canvas-container card d-flex justify-content-center align-items-center mt-1 {{styleClass}}\">\r\n <span *ngIf=\"!isIFDs && noFileMessage\">{{noFileMessage}}</span>\r\n <canvas #tiffCanvas id=\"tiffCanvas\" class=\"canvas-image img-fluid\" [ngClass]=\"{'d-none': !isIFDs}\"></canvas>\r\n <div class=\"backdrop position-absolute w-100 h-100 d-flex justify-content-center align-items-center\"\r\n [ngClass]=\"{'d-none': !isDecoding}\">\r\n\r\n </div>\r\n <div class=\"spinner-border text-info position-absolute\" style=\"width: 3rem; height: 3rem;\" role=\"status\"\r\n [ngClass]=\"{'d-none': !isDecoding}\">\r\n <span class=\"visually-hidden\">Loading...</span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>","/*\r\n * Public API Surface of ys-sidebar\r\n */\r\n\r\nexport * from './src/ys-tiff-viewer/ys-tiff-viewer.component';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAWa,qBAAqB,CAAA;AAExB,IAAA,MAAM;AACN,IAAA,OAAO;;IAEP,IAAI,GAAU,EAAE;IAChB,eAAe,GAAW,CAAC;IACnC,UAAU,GAAY,KAAK;AAEnB,IAAA,OAAO;;;IAGf,IACI,MAAM,KAAmD,OAAO,IAAI,CAAC,OAAO,CAAC;IACjF,IAAI,MAAM,CAAC,KAAmD,EAAA,EAAI,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,a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A,CAAA,EAAA;8BAiBpB,MAAM,EAAA,CAAA;sBADT;gBAOG,yBAAyB,EAAA,CAAA;sBAD5B;gBASQ,UAAU,EAAA,CAAA;sBAAlB;gBAEQ,aAAa,EAAA,CAAA;sBAArB;gBAGQ,cAAc,EAAA,CAAA;sBAAtB;gBAEQ,iBAAiB,EAAA,CAAA;sBAAzB;gBAEQ,aAAa,EAAA,CAAA;sBAArB;gBAEQ,aAAa,EAAA,CAAA;sBAArB;;;AEjDH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"yoozsoft-yoozsoft-ng-tiff-viewer.mjs","sources":["../../../../projects/yoozsoft/yoozsoft-ng/tiff-viewer/src/ys-tiff-viewer/ys-tiff-viewer.component.ts","../../../../projects/yoozsoft/yoozsoft-ng/tiff-viewer/src/ys-tiff-viewer/ys-tiff-viewer.component.html","../../../../projects/yoozsoft/yoozsoft-ng/tiff-viewer/public-api.ts","../../../../projects/yoozsoft/yoozsoft-ng/tiff-viewer/yoozsoft-yoozsoft-ng-tiff-viewer.ts"],"sourcesContent":["import { NgClass, NgIf } from '@angular/common';\r\nimport { Component, Input } from '@angular/core';\r\n\r\ndeclare var UTIF: any;\r\n\r\n@Component({\r\n selector: 'ys-tiff-viewer',\r\n imports: [NgIf, NgClass],\r\n templateUrl: './ys-tiff-viewer.component.html',\r\n styleUrl: './ys-tiff-viewer.component.scss'\r\n})\r\nexport class YsTiffViewerComponent {\r\n\r\n private canvas: any;\r\n private context: any;\r\n /**image file directories */\r\n private IFDs: any[] = [];\r\n private currentIFDIndex: number = 0;\r\n isDecoding: boolean = false;\r\n\r\n private _buffer: ArrayBuffer | File | Blob | null | undefined;\r\n /**Uint8Array source */\r\n /**ArrayBuffer containing TIFF or EXIF data */\r\n @Input()\r\n get buffer(): ArrayBuffer | File | Blob | null | undefined { return this._buffer; }\r\n set buffer(value: ArrayBuffer | File | Blob | null | undefined) { this._buffer = value; this.convertSource(this._buffer); }\r\n\r\n _currentPageReportTemplate?: string = \"Page {current} of {total}\";\r\n /**Current page report template */\r\n @Input()\r\n get currentPageReportTemplate(): string | undefined {\r\n return this._currentPageReportTemplate?.\r\n replace('{current}', `<strong>${this.currentIFDIndex + 1}</strong>`).\r\n replace('{total}', `<strong>${this.IFDs.length}</strong>`);\r\n }\r\n set currentPageReportTemplate(value: string | undefined) { this._currentPageReportTemplate = value; }\r\n\r\n /**Canvas container style class */\r\n @Input() styleClass?: string;\r\n /**Message displayed before filling the input buffer */\r\n @Input() noFileMessage?: string = \"No image file\";\r\n\r\n /**First button icon class */\r\n @Input() firstIconClass: string = 'fa fa-fast-backward';\r\n /**Previous button icon class */\r\n @Input() previousIconClass: string = 'fa fa-step-backward';\r\n /**Next button icon class */\r\n @Input() nextIconClass: string = 'fa fa-step-forward';\r\n /**Last button icon class */\r\n @Input() lastIconClass: string = 'fa fa-fast-forward';\r\n\r\n get isIFDs(): boolean { return this.IFDs.length > 0; }\r\n get isFirstImage(): boolean { return !this.isIFDs || (this.currentIFDIndex == 0); }\r\n get isLastImage(): boolean { return !this.isIFDs || (this.currentIFDIndex == this.IFDs.length - 1); }\r\n\r\n\r\n /**\r\n * Convert buffer to an array of \"IFDs\" (image file directories)\r\n * @param buffer ArrayBuffer containing TIFF or EXIF data\r\n * @returns \r\n */\r\n async convertSource(buffer: ArrayBuffer | File | Blob | null | undefined) {\r\n this.canvas = document.getElementById(\"tiffCanvas\");\r\n this.context = this.canvas.getContext(\"2d\");\r\n this.IFDs = [];\r\n this.currentIFDIndex = 0;\r\n\r\n if (!buffer) {\r\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n return;\r\n }\r\n\r\n if (buffer instanceof File || buffer instanceof Blob) {\r\n buffer = await this.getAsByteArray(buffer);\r\n }\r\n\r\n this.isDecoding = true;\r\n\r\n this.IFDs = UTIF.decode(buffer);\r\n\r\n this.IFDs.forEach((ifd: any) => {\r\n UTIF.decodeImage(buffer, ifd);\r\n });\r\n\r\n this.putImage(this.currentIFDIndex);\r\n\r\n this.isDecoding = false;\r\n }\r\n\r\n putImage(index: number) {\r\n if (!this.IFDs.length) {\r\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n return;\r\n }\r\n\r\n const tiffImage = this.IFDs[index];\r\n const rgbaImage = UTIF.toRGBA8(tiffImage); // Uint8Array with RGBA pixels\r\n\r\n const data = new Uint8ClampedArray(rgbaImage);\r\n const imageData = new ImageData(data, tiffImage.width, tiffImage.height);\r\n\r\n this.context.canvas.width = tiffImage.width;\r\n this.context.canvas.height = tiffImage.height;\r\n // Draw image data to the canvas\r\n this.context.putImageData(imageData, 0, 0);\r\n }\r\n\r\n\r\n first() {\r\n this.currentIFDIndex = 0;\r\n this.putImage(this.currentIFDIndex);\r\n }\r\n previous() {\r\n this.currentIFDIndex -= 1;\r\n if (this.currentIFDIndex < 0) {\r\n this.currentIFDIndex = 0;\r\n return;\r\n }\r\n this.putImage(this.currentIFDIndex);\r\n }\r\n\r\n next() {\r\n this.currentIFDIndex += 1;\r\n if (this.currentIFDIndex > (this.IFDs.length - 1)) {\r\n this.currentIFDIndex = this.IFDs.length - 1;\r\n return;\r\n }\r\n this.putImage(this.currentIFDIndex);\r\n }\r\n last() {\r\n this.currentIFDIndex = this.IFDs.length - 1;\r\n this.putImage(this.currentIFDIndex);\r\n }\r\n\r\n async getAsByteArray(blob: Blob) {\r\n var res = new Uint8Array(await this.readFile(blob))\r\n return res;\r\n }\r\n\r\n async readFile(blob: Blob): Promise<ArrayBuffer> {\r\n return new Promise((resolve, reject) => {\r\n // Create file reader\r\n let reader = new FileReader()\r\n\r\n // Register event listeners\r\n reader.onload = () => resolve(reader.result as ArrayBuffer);\r\n reader.onerror = error => reject(error);\r\n\r\n // Read file\r\n reader.readAsArrayBuffer(blob);\r\n })\r\n }\r\n\r\n}\r\n","<div class=\"row\">\r\n <div class=\"col d-flex justify-content-between align-items-center mt-2\">\r\n <div>\r\n <button class=\"btn btn-outline-primary mb-0 me-2\" [ngClass]=\"{'ml-auto': isIFDs}\" type=\"button\"\r\n (click)=\"first()\" [disabled]=\"isFirstImage\">\r\n <i [ngClass]=\"firstIconClass\"></i>\r\n </button>\r\n <button class=\"btn btn-outline-primary mb-0\" type=\"button\" (click)=\"previous()\" [disabled]=\"isFirstImage\">\r\n <i [ngClass]=\"previousIconClass\"></i>\r\n </button>\r\n </div>\r\n\r\n <span *ngIf=\"isIFDs\" [innerHtml]=\"currentPageReportTemplate\">\r\n </span>\r\n\r\n <div>\r\n <button class=\"btn btn-outline-primary mb-0 me-2\" type=\"button\" (click)=\"next()\" [disabled]=\"isLastImage\">\r\n <i [ngClass]=\"nextIconClass\"></i>\r\n </button>\r\n <button class=\"btn btn-outline-primary mb-0\" [ngClass]=\"{'mr-auto': isIFDs}\" type=\"button\" (click)=\"last()\"\r\n [disabled]=\"isLastImage\">\r\n <i [ngClass]=\"lastIconClass\"></i>\r\n </button>\r\n </div>\r\n\r\n\r\n </div>\r\n</div>\r\n<div class=\"row\">\r\n <div class=\"col\">\r\n <div class=\"canvas-container card d-flex justify-content-center align-items-center mt-1 {{styleClass}}\">\r\n <span *ngIf=\"!isIFDs && noFileMessage\">{{noFileMessage}}</span>\r\n <canvas #tiffCanvas id=\"tiffCanvas\" class=\"canvas-image img-fluid\" [ngClass]=\"{'d-none': !isIFDs}\"></canvas>\r\n <div class=\"backdrop position-absolute w-100 h-100 d-flex justify-content-center align-items-center\"\r\n [ngClass]=\"{'d-none': !isDecoding}\">\r\n\r\n </div>\r\n <div class=\"spinner-border text-info position-absolute\" style=\"width: 3rem; height: 3rem;\" role=\"status\"\r\n [ngClass]=\"{'d-none': !isDecoding}\">\r\n <span class=\"visually-hidden\">Loading...</span>\r\n </div>\r\n </div>\r\n </div>\r\n</div>","/*\r\n * Public API Surface of ys-sidebar\r\n */\r\n\r\nexport * from './src/ys-tiff-viewer/ys-tiff-viewer.component';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;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AAA,IAAA,EAAA,IAAI,6FAAE,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAIZ,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBANjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EACjB,OAAA,EAAA,CAAC,IAAI,EAAE,OAAO,CAAC,EAAA,QAAA,EAAA,2mEAAA,EAAA,MAAA,EAAA,CAAA,2DAAA,CAAA,EAAA;8BAiBpB,MAAM,EAAA,CAAA;sBADT;gBAOG,yBAAyB,EAAA,CAAA;sBAD5B;gBASQ,UAAU,EAAA,CAAA;sBAAlB;gBAEQ,aAAa,EAAA,CAAA;sBAArB;gBAGQ,cAAc,EAAA,CAAA;sBAAtB;gBAEQ,iBAAiB,EAAA,CAAA;sBAAzB;gBAEQ,aAAa,EAAA,CAAA;sBAArB;gBAEQ,aAAa,EAAA,CAAA;sBAArB;;;AEjDH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -47,6 +47,8 @@ export declare class YsFileUploadComponent implements ControlValueAccessor {
|
|
|
47
47
|
choosed: EventEmitter<File[]>;
|
|
48
48
|
/**Event of selected file in the list of choosed file*/
|
|
49
49
|
select: EventEmitter<File | null>;
|
|
50
|
+
/**Event of removed file in the list of choosed file*/
|
|
51
|
+
removed: EventEmitter<File>;
|
|
50
52
|
/**Event of cancel upload button */
|
|
51
53
|
cancel: EventEmitter<void>;
|
|
52
54
|
/**Disable elements */
|
|
@@ -63,5 +65,5 @@ export declare class YsFileUploadComponent implements ControlValueAccessor {
|
|
|
63
65
|
onSelectFile(file: File): void;
|
|
64
66
|
cancelUpload(): void;
|
|
65
67
|
static ɵfac: i0.ɵɵFactoryDeclaration<YsFileUploadComponent, never>;
|
|
66
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<YsFileUploadComponent, "ys-file-upload", never, { "styleClass": { "alias": "styleClass"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "uploadLabel": { "alias": "uploadLabel"; "required": false; }; "uploadStyleClass": { "alias": "uploadStyleClass"; "required": false; }; "uploadIconClass": { "alias": "uploadIconClass"; "required": false; }; "isRemove": { "alias": "isRemove"; "required": false; }; "removeIconClass": { "alias": "removeIconClass"; "required": false; }; "isHorizontal": { "alias": "isHorizontal"; "required": false; }; "noFileMessage": { "alias": "noFileMessage"; "required": false; }; "progressStyleClass": { "alias": "progressStyleClass"; "required": false; }; "progressValue": { "alias": "progressValue"; "required": false; }; "progressValueMax": { "alias": "progressValueMax"; "required": false; }; "isCancel": { "alias": "isCancel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "choosed": "choosed"; "select": "select"; "cancel": "cancel"; }, never, never, true, never>;
|
|
68
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<YsFileUploadComponent, "ys-file-upload", never, { "styleClass": { "alias": "styleClass"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "uploadLabel": { "alias": "uploadLabel"; "required": false; }; "uploadStyleClass": { "alias": "uploadStyleClass"; "required": false; }; "uploadIconClass": { "alias": "uploadIconClass"; "required": false; }; "isRemove": { "alias": "isRemove"; "required": false; }; "removeIconClass": { "alias": "removeIconClass"; "required": false; }; "isHorizontal": { "alias": "isHorizontal"; "required": false; }; "noFileMessage": { "alias": "noFileMessage"; "required": false; }; "progressStyleClass": { "alias": "progressStyleClass"; "required": false; }; "progressValue": { "alias": "progressValue"; "required": false; }; "progressValueMax": { "alias": "progressValueMax"; "required": false; }; "isCancel": { "alias": "isCancel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "choosed": "choosed"; "select": "select"; "removed": "removed"; "cancel": "cancel"; }, never, never, true, never>;
|
|
67
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoozsoft/yoozsoft-ng",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.7",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^19.0.0",
|
|
6
6
|
"@angular/core": "^19.0.0"
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
"types": "./datepicker/index.d.ts",
|
|
40
40
|
"default": "./fesm2022/yoozsoft-yoozsoft-ng-datepicker.mjs"
|
|
41
41
|
},
|
|
42
|
-
"./file-upload": {
|
|
43
|
-
"types": "./file-upload/index.d.ts",
|
|
44
|
-
"default": "./fesm2022/yoozsoft-yoozsoft-ng-file-upload.mjs"
|
|
45
|
-
},
|
|
46
42
|
"./directives": {
|
|
47
43
|
"types": "./directives/index.d.ts",
|
|
48
44
|
"default": "./fesm2022/yoozsoft-yoozsoft-ng-directives.mjs"
|
|
49
45
|
},
|
|
50
|
-
"./
|
|
51
|
-
"types": "./
|
|
52
|
-
"default": "./fesm2022/yoozsoft-yoozsoft-ng-
|
|
46
|
+
"./file-upload": {
|
|
47
|
+
"types": "./file-upload/index.d.ts",
|
|
48
|
+
"default": "./fesm2022/yoozsoft-yoozsoft-ng-file-upload.mjs"
|
|
53
49
|
},
|
|
54
50
|
"./footer": {
|
|
55
51
|
"types": "./footer/index.d.ts",
|
|
56
52
|
"default": "./fesm2022/yoozsoft-yoozsoft-ng-footer.mjs"
|
|
57
53
|
},
|
|
54
|
+
"./loading": {
|
|
55
|
+
"types": "./loading/index.d.ts",
|
|
56
|
+
"default": "./fesm2022/yoozsoft-yoozsoft-ng-loading.mjs"
|
|
57
|
+
},
|
|
58
58
|
"./navbar": {
|
|
59
59
|
"types": "./navbar/index.d.ts",
|
|
60
60
|
"default": "./fesm2022/yoozsoft-yoozsoft-ng-navbar.mjs"
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"types": "./password-strength/index.d.ts",
|
|
68
68
|
"default": "./fesm2022/yoozsoft-yoozsoft-ng-password-strength.mjs"
|
|
69
69
|
},
|
|
70
|
-
"./select": {
|
|
71
|
-
"types": "./select/index.d.ts",
|
|
72
|
-
"default": "./fesm2022/yoozsoft-yoozsoft-ng-select.mjs"
|
|
73
|
-
},
|
|
74
70
|
"./progress": {
|
|
75
71
|
"types": "./progress/index.d.ts",
|
|
76
72
|
"default": "./fesm2022/yoozsoft-yoozsoft-ng-progress.mjs"
|
|
77
73
|
},
|
|
74
|
+
"./select": {
|
|
75
|
+
"types": "./select/index.d.ts",
|
|
76
|
+
"default": "./fesm2022/yoozsoft-yoozsoft-ng-select.mjs"
|
|
77
|
+
},
|
|
78
78
|
"./sidebar": {
|
|
79
79
|
"types": "./sidebar/index.d.ts",
|
|
80
80
|
"default": "./fesm2022/yoozsoft-yoozsoft-ng-sidebar.mjs"
|