@yoozsoft/yoozsoft-ng 5.0.1 → 5.0.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.
@@ -24,7 +24,7 @@ class YsFileUploadComponent {
24
24
  */
25
25
  uploadLabel = 'Choose File';
26
26
  /**Style class of upload button */
27
- uploadStyleClass;
27
+ uploadStyleClass = 'btn-primary';
28
28
  /**Icon class of upload button */
29
29
  uploadIconClass = 'fa fa-paperclip';
30
30
  /**Display choosed file remove button */
@@ -125,7 +125,7 @@ class YsFileUploadComponent {
125
125
  useExisting: forwardRef(() => YsFileUploadComponent),
126
126
  multi: true
127
127
  }
128
- ], ngImport: i0, template: "<input class=\"form-control d-none file-upload\" type=\"file\" id=\"ysFileUpload\" #ysFileUpload [multiple]=\"multiple\"\n [accept]=\"accept\" [disabled]=\"disabled\" (change)=\"onChangeFiles($event)\">\n\n <div class=\"file-upload\" [ngClass]=\"styleClass\">\n <div class=\"row\">\n <div class=\"col\">\n <button class=\"btn btn-primary btn-upload {{uploadStyleClass}}\" (click)=\"ysFileUpload.click()\"\n [disabled]=\"disabled\">\n <i [ngClass]=\"uploadIconClass\"></i>\n @if (uploadLabel) {\n <span class=\"ms-2\">{{uploadLabel}}</span>\n }\n </button>\n\n @if (noFileMessage) {\n <span class=\"ms-2\">{{files.length ? '' : noFileMessage}}</span>\n }\n\n @if (files.length) {\n <ul class=\"file-upload-list list-group mt-2\"\n [ngClass]=\"{'list-group-horizontal overflow-auto': isHorizontal}\">\n @for (file of files; track file) {\n <a class=\"file-upload-item list-group-item d-flex align-items-center\" role=\"button\"\n (click)=\"onSelectFile(file)\"\n [ngClass]=\"{'active': file == selectedFile, 'disabled': disabled}\">\n <span class=\"me-2\">{{file.name}}</span>\n @if (isRemove) {\n <button class=\"btn btn-outline-danger btn-sm ms-auto\" type=\"button\"\n id=\"removeFileButton\" (click)=\"removeFile(file); $event.stopPropagation();\"\n [disabled]=\"disabled\">\n <i [ngClass]=\"removeIconClass\"></i>\n </button>\n }\n </a>\n }\n </ul>\n }\n\n </div>\n </div>\n </div>\n\n @if (progressValue) {\n <div class=\"progress mt-2\" [ngClass]=\"progressStyleClass\">\n <div class=\"progress-bar\" role=\"progressbar\" [style.width.%]=\"progressValue\" [attr.aria-valuenow]=\"progressValue\"\n aria-valuemin=\"0\" [attr.aria-valuemax]=\"progressValueMax\"></div>\n @if (isCancel && progressValue < progressValueMax) {\n <button class=\"btn btn-danger btn-sm btn-upload-cancel d-flex\"\n (click)=\"cancelUpload()\">\n <i class=\"fa fa-times\"></i>\n </button>\n }\n </div>\n }", styles: [".progress{height:20px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
128
+ ], ngImport: i0, template: "<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-upload\" [ngClass]=\"uploadStyleClass\" (click)=\"ysFileUpload.click()\"\r\n [disabled]=\"disabled\">\r\n <i [ngClass]=\"uploadIconClass\"></i>\r\n @if (uploadLabel) {\r\n <span class=\"ms-2\">{{uploadLabel}}</span>\r\n }\r\n </button>\r\n\r\n @if (noFileMessage) {\r\n <span class=\"ms-2\">{{files.length ? '' : noFileMessage}}</span>\r\n }\r\n\r\n @if (files.length) {\r\n <ul class=\"file-upload-list list-group mt-2\"\r\n [ngClass]=\"{'list-group-horizontal overflow-auto': isHorizontal}\">\r\n @for (file of files; track file) {\r\n <a class=\"file-upload-item list-group-item d-flex align-items-center\" role=\"button\"\r\n (click)=\"onSelectFile(file)\"\r\n [ngClass]=\"{'active': file == selectedFile, 'disabled': disabled}\">\r\n <span class=\"me-2\">{{file.name}}</span>\r\n @if (isRemove) {\r\n <button 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 }\r\n </a>\r\n }\r\n </ul>\r\n }\r\n\r\n </div>\r\n </div>\r\n </div>\r\n\r\n @if (progressValue) {\r\n <div class=\"progress mt-2\" [ngClass]=\"progressStyleClass\">\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 @if (isCancel && progressValue < progressValueMax) {\r\n <button 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 }\r\n </div>\r\n }", styles: [".progress{height:20px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
129
129
  }
130
130
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: YsFileUploadComponent, decorators: [{
131
131
  type: Component,
@@ -135,7 +135,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
135
135
  useExisting: forwardRef(() => YsFileUploadComponent),
136
136
  multi: true
137
137
  }
138
- ], template: "<input class=\"form-control d-none file-upload\" type=\"file\" id=\"ysFileUpload\" #ysFileUpload [multiple]=\"multiple\"\n [accept]=\"accept\" [disabled]=\"disabled\" (change)=\"onChangeFiles($event)\">\n\n <div class=\"file-upload\" [ngClass]=\"styleClass\">\n <div class=\"row\">\n <div class=\"col\">\n <button class=\"btn btn-primary btn-upload {{uploadStyleClass}}\" (click)=\"ysFileUpload.click()\"\n [disabled]=\"disabled\">\n <i [ngClass]=\"uploadIconClass\"></i>\n @if (uploadLabel) {\n <span class=\"ms-2\">{{uploadLabel}}</span>\n }\n </button>\n\n @if (noFileMessage) {\n <span class=\"ms-2\">{{files.length ? '' : noFileMessage}}</span>\n }\n\n @if (files.length) {\n <ul class=\"file-upload-list list-group mt-2\"\n [ngClass]=\"{'list-group-horizontal overflow-auto': isHorizontal}\">\n @for (file of files; track file) {\n <a class=\"file-upload-item list-group-item d-flex align-items-center\" role=\"button\"\n (click)=\"onSelectFile(file)\"\n [ngClass]=\"{'active': file == selectedFile, 'disabled': disabled}\">\n <span class=\"me-2\">{{file.name}}</span>\n @if (isRemove) {\n <button class=\"btn btn-outline-danger btn-sm ms-auto\" type=\"button\"\n id=\"removeFileButton\" (click)=\"removeFile(file); $event.stopPropagation();\"\n [disabled]=\"disabled\">\n <i [ngClass]=\"removeIconClass\"></i>\n </button>\n }\n </a>\n }\n </ul>\n }\n\n </div>\n </div>\n </div>\n\n @if (progressValue) {\n <div class=\"progress mt-2\" [ngClass]=\"progressStyleClass\">\n <div class=\"progress-bar\" role=\"progressbar\" [style.width.%]=\"progressValue\" [attr.aria-valuenow]=\"progressValue\"\n aria-valuemin=\"0\" [attr.aria-valuemax]=\"progressValueMax\"></div>\n @if (isCancel && progressValue < progressValueMax) {\n <button class=\"btn btn-danger btn-sm btn-upload-cancel d-flex\"\n (click)=\"cancelUpload()\">\n <i class=\"fa fa-times\"></i>\n </button>\n }\n </div>\n }", styles: [".progress{height:20px}\n"] }]
138
+ ], template: "<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-upload\" [ngClass]=\"uploadStyleClass\" (click)=\"ysFileUpload.click()\"\r\n [disabled]=\"disabled\">\r\n <i [ngClass]=\"uploadIconClass\"></i>\r\n @if (uploadLabel) {\r\n <span class=\"ms-2\">{{uploadLabel}}</span>\r\n }\r\n </button>\r\n\r\n @if (noFileMessage) {\r\n <span class=\"ms-2\">{{files.length ? '' : noFileMessage}}</span>\r\n }\r\n\r\n @if (files.length) {\r\n <ul class=\"file-upload-list list-group mt-2\"\r\n [ngClass]=\"{'list-group-horizontal overflow-auto': isHorizontal}\">\r\n @for (file of files; track file) {\r\n <a class=\"file-upload-item list-group-item d-flex align-items-center\" role=\"button\"\r\n (click)=\"onSelectFile(file)\"\r\n [ngClass]=\"{'active': file == selectedFile, 'disabled': disabled}\">\r\n <span class=\"me-2\">{{file.name}}</span>\r\n @if (isRemove) {\r\n <button 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 }\r\n </a>\r\n }\r\n </ul>\r\n }\r\n\r\n </div>\r\n </div>\r\n </div>\r\n\r\n @if (progressValue) {\r\n <div class=\"progress mt-2\" [ngClass]=\"progressStyleClass\">\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 @if (isCancel && progressValue < progressValueMax) {\r\n <button 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 }\r\n </div>\r\n }", styles: [".progress{height:20px}\n"] }]
139
139
  }], ctorParameters: () => [], propDecorators: { styleClass: [{
140
140
  type: Input
141
141
  }], multiple: [{
@@ -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 } 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: [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\"\n [accept]=\"accept\" [disabled]=\"disabled\" (change)=\"onChangeFiles($event)\">\n\n <div class=\"file-upload\" [ngClass]=\"styleClass\">\n <div class=\"row\">\n <div class=\"col\">\n <button class=\"btn btn-primary btn-upload {{uploadStyleClass}}\" (click)=\"ysFileUpload.click()\"\n [disabled]=\"disabled\">\n <i [ngClass]=\"uploadIconClass\"></i>\n @if (uploadLabel) {\n <span class=\"ms-2\">{{uploadLabel}}</span>\n }\n </button>\n\n @if (noFileMessage) {\n <span class=\"ms-2\">{{files.length ? '' : noFileMessage}}</span>\n }\n\n @if (files.length) {\n <ul class=\"file-upload-list list-group mt-2\"\n [ngClass]=\"{'list-group-horizontal overflow-auto': isHorizontal}\">\n @for (file of files; track file) {\n <a class=\"file-upload-item list-group-item d-flex align-items-center\" role=\"button\"\n (click)=\"onSelectFile(file)\"\n [ngClass]=\"{'active': file == selectedFile, 'disabled': disabled}\">\n <span class=\"me-2\">{{file.name}}</span>\n @if (isRemove) {\n <button class=\"btn btn-outline-danger btn-sm ms-auto\" type=\"button\"\n id=\"removeFileButton\" (click)=\"removeFile(file); $event.stopPropagation();\"\n [disabled]=\"disabled\">\n <i [ngClass]=\"removeIconClass\"></i>\n </button>\n }\n </a>\n }\n </ul>\n }\n\n </div>\n </div>\n </div>\n\n @if (progressValue) {\n <div class=\"progress mt-2\" [ngClass]=\"progressStyleClass\">\n <div class=\"progress-bar\" role=\"progressbar\" [style.width.%]=\"progressValue\" [attr.aria-valuenow]=\"progressValue\"\n aria-valuemin=\"0\" [attr.aria-valuemax]=\"progressValueMax\"></div>\n @if (isCancel && progressValue < progressValueMax) {\n <button class=\"btn btn-danger btn-sm btn-upload-cancel d-flex\"\n (click)=\"cancelUpload()\">\n <i class=\"fa fa-times\"></i>\n </button>\n }\n </div>\n }","/*\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,CAAC,EAAE;AACvB,YAAA,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG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AAA,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;;;;"}
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 } 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: [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 = 'btn-primary';\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-upload\" [ngClass]=\"uploadStyleClass\" (click)=\"ysFileUpload.click()\"\r\n [disabled]=\"disabled\">\r\n <i [ngClass]=\"uploadIconClass\"></i>\r\n @if (uploadLabel) {\r\n <span class=\"ms-2\">{{uploadLabel}}</span>\r\n }\r\n </button>\r\n\r\n @if (noFileMessage) {\r\n <span class=\"ms-2\">{{files.length ? '' : noFileMessage}}</span>\r\n }\r\n\r\n @if (files.length) {\r\n <ul class=\"file-upload-list list-group mt-2\"\r\n [ngClass]=\"{'list-group-horizontal overflow-auto': isHorizontal}\">\r\n @for (file of files; track file) {\r\n <a class=\"file-upload-item list-group-item d-flex align-items-center\" role=\"button\"\r\n (click)=\"onSelectFile(file)\"\r\n [ngClass]=\"{'active': file == selectedFile, 'disabled': disabled}\">\r\n <span class=\"me-2\">{{file.name}}</span>\r\n @if (isRemove) {\r\n <button 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 }\r\n </a>\r\n }\r\n </ul>\r\n }\r\n\r\n </div>\r\n </div>\r\n </div>\r\n\r\n @if (progressValue) {\r\n <div class=\"progress mt-2\" [ngClass]=\"progressStyleClass\">\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 @if (isCancel && progressValue < progressValueMax) {\r\n <button 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 }\r\n </div>\r\n }","/*\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;;IAEpC,gBAAgB,GAAY,aAAa;;IAEzC,eAAe,GAAW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';
1
2
  import * as i0 from '@angular/core';
2
- import { forwardRef, Input, Component } from '@angular/core';
3
+ import { EventEmitter, forwardRef, Output, Input, Component } from '@angular/core';
3
4
  import * as i1 from '@angular/forms';
4
5
  import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
5
6
 
@@ -12,9 +13,9 @@ class YsSelectComponent {
12
13
  placeholder;
13
14
  styleClass;
14
15
  invalid = false;
15
- invalidStyleClass = 'is-invalid';
16
+ invalidFeedback;
16
17
  valid = false;
17
- validStyleClass = 'is-valid';
18
+ validFeedback;
18
19
  /**Support multiple attribute */
19
20
  multiple = false;
20
21
  /**Size of multiple attribute */
@@ -22,6 +23,7 @@ class YsSelectComponent {
22
23
  /**Display clear button */
23
24
  isClear = false;
24
25
  disabled = false;
26
+ onSelect = new EventEmitter();
25
27
  onChange = () => { };
26
28
  onTouched = () => { };
27
29
  value;
@@ -60,6 +62,7 @@ class YsSelectComponent {
60
62
  onModelChange(option) {
61
63
  this.onChange(option);
62
64
  this.onTouched(option);
65
+ this.onSelect.emit(option);
63
66
  }
64
67
  clearValue() {
65
68
  this.multiple ? this.value = [] : this.value = null;
@@ -69,23 +72,23 @@ class YsSelectComponent {
69
72
  return typeof item == 'object';
70
73
  }
71
74
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: YsSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
72
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: YsSelectComponent, isStandalone: true, selector: "ys-select", inputs: { id: "id", options: "options", optionLabel: "optionLabel", placeholder: "placeholder", styleClass: "styleClass", invalid: "invalid", invalidStyleClass: "invalidStyleClass", valid: "valid", validStyleClass: "validStyleClass", multiple: "multiple", size: "size", isClear: "isClear", disabled: "disabled" }, providers: [
75
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: YsSelectComponent, isStandalone: true, selector: "ys-select", inputs: { id: "id", options: "options", optionLabel: "optionLabel", placeholder: "placeholder", styleClass: "styleClass", invalid: "invalid", invalidFeedback: "invalidFeedback", valid: "valid", validFeedback: "validFeedback", multiple: "multiple", size: "size", isClear: "isClear", disabled: "disabled" }, outputs: { onSelect: "onSelect" }, providers: [
73
76
  {
74
77
  provide: NG_VALUE_ACCESSOR,
75
78
  useExisting: forwardRef(() => YsSelectComponent),
76
79
  multi: true
77
80
  }
78
- ], ngImport: i0, template: "<div class=\"input-group ys-select\">\n\n @if (!multiple) {\n <select [id]=\"id\"\n class=\"form-select {{styleClass}} {{invalid && invalidStyleClass}} {{valid && validStyleClass}}\"\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\">\n @if (placeholder) {\n <option selected disabled [ngValue]=\"null\" class=\"d-none\"> {{placeholder}}\n </option>\n }\n @for (item of options; track item; let i = $index) {\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\n {{isObject(item) ? item[optionLabel] : item}}\n </option>\n }\n </select>\n }\n\n @if (multiple) {\n <select [id]=\"id\"\n class=\"form-select {{styleClass}} {{invalid && invalidStyleClass}} {{valid && validStyleClass}}\"\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\"\n [multiple]=\"multiple\" [size]=\"size\">\n @if (placeholder) {\n <option selected disabled [ngValue]=\"null\"> {{placeholder}}\n </option>\n }\n @for (item of options; track item; let i = $index) {\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\n {{isObject(item) ? item[optionLabel] : item}}\n </option>\n }\n </select>\n }\n\n @if (isClear) {\n <button class=\"btn btn-outline-secondary btn-clear\" type=\"button\" id=\"btn-clear\"\n (click)=\"clearValue()\" [disabled]=\"disabled\">\n <span class=\"fa fa-times\"></span>\n </button>\n }\n</div>", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
81
+ ], ngImport: i0, template: "<div class=\"ys-select\" [ngClass]=\"{'input-group': isClear, 'is-valid': valid, 'is-invalid': invalid}\">\r\n\r\n @if (!multiple) {\r\n <select [id]=\"id\" class=\"form-select {{styleClass}}\" [ngClass]=\"{'is-valid': valid, 'is-invalid': invalid}\"\r\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\">\r\n @if (placeholder) {\r\n <option selected disabled [ngValue]=\"null\" class=\"d-none\"> {{placeholder}}\r\n </option>\r\n }\r\n @for (item of options; track item; let i = $index) {\r\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\r\n {{isObject(item) ? item[optionLabel] : item}}\r\n </option>\r\n }\r\n </select>\r\n }\r\n\r\n @if (multiple) {\r\n <select [id]=\"id\" class=\"form-select {{styleClass}}\" [ngClass]=\"{'is-valid': valid, 'is-invalid': invalid}\"\r\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\"\r\n [multiple]=\"multiple\" [size]=\"size\">\r\n @if (placeholder) {\r\n <option selected disabled [ngValue]=\"null\"> {{placeholder}}\r\n </option>\r\n }\r\n @for (item of options; track item; let i = $index) {\r\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\r\n {{isObject(item) ? item[optionLabel] : item}}\r\n </option>\r\n }\r\n </select>\r\n }\r\n\r\n @if (isClear) {\r\n <button class=\"btn btn-outline-secondary btn-clear\" type=\"button\" id=\"btn-clear\" (click)=\"clearValue()\"\r\n [disabled]=\"disabled\">\r\n <span class=\"fa fa-times\"></span>\r\n </button>\r\n }\r\n</div>\r\n\r\n@if(valid && validFeedback){\r\n<div class=\"valid-feedback\">{{validFeedback}}</div>\r\n}\r\n@if(invalid && invalidFeedback){\r\n<div class=\"invalid-feedback\">{{invalidFeedback}}</div>\r\n}", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.SelectMultipleControlValueAccessor, selector: "select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
79
82
  }
80
83
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: YsSelectComponent, decorators: [{
81
84
  type: Component,
82
- args: [{ selector: 'ys-select', imports: [FormsModule], providers: [
85
+ args: [{ selector: 'ys-select', imports: [FormsModule, NgClass], providers: [
83
86
  {
84
87
  provide: NG_VALUE_ACCESSOR,
85
88
  useExisting: forwardRef(() => YsSelectComponent),
86
89
  multi: true
87
90
  }
88
- ], template: "<div class=\"input-group ys-select\">\n\n @if (!multiple) {\n <select [id]=\"id\"\n class=\"form-select {{styleClass}} {{invalid && invalidStyleClass}} {{valid && validStyleClass}}\"\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\">\n @if (placeholder) {\n <option selected disabled [ngValue]=\"null\" class=\"d-none\"> {{placeholder}}\n </option>\n }\n @for (item of options; track item; let i = $index) {\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\n {{isObject(item) ? item[optionLabel] : item}}\n </option>\n }\n </select>\n }\n\n @if (multiple) {\n <select [id]=\"id\"\n class=\"form-select {{styleClass}} {{invalid && invalidStyleClass}} {{valid && validStyleClass}}\"\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\"\n [multiple]=\"multiple\" [size]=\"size\">\n @if (placeholder) {\n <option selected disabled [ngValue]=\"null\"> {{placeholder}}\n </option>\n }\n @for (item of options; track item; let i = $index) {\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\n {{isObject(item) ? item[optionLabel] : item}}\n </option>\n }\n </select>\n }\n\n @if (isClear) {\n <button class=\"btn btn-outline-secondary btn-clear\" type=\"button\" id=\"btn-clear\"\n (click)=\"clearValue()\" [disabled]=\"disabled\">\n <span class=\"fa fa-times\"></span>\n </button>\n }\n</div>" }]
91
+ ], template: "<div class=\"ys-select\" [ngClass]=\"{'input-group': isClear, 'is-valid': valid, 'is-invalid': invalid}\">\r\n\r\n @if (!multiple) {\r\n <select [id]=\"id\" class=\"form-select {{styleClass}}\" [ngClass]=\"{'is-valid': valid, 'is-invalid': invalid}\"\r\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\">\r\n @if (placeholder) {\r\n <option selected disabled [ngValue]=\"null\" class=\"d-none\"> {{placeholder}}\r\n </option>\r\n }\r\n @for (item of options; track item; let i = $index) {\r\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\r\n {{isObject(item) ? item[optionLabel] : item}}\r\n </option>\r\n }\r\n </select>\r\n }\r\n\r\n @if (multiple) {\r\n <select [id]=\"id\" class=\"form-select {{styleClass}}\" [ngClass]=\"{'is-valid': valid, 'is-invalid': invalid}\"\r\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\"\r\n [multiple]=\"multiple\" [size]=\"size\">\r\n @if (placeholder) {\r\n <option selected disabled [ngValue]=\"null\"> {{placeholder}}\r\n </option>\r\n }\r\n @for (item of options; track item; let i = $index) {\r\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\r\n {{isObject(item) ? item[optionLabel] : item}}\r\n </option>\r\n }\r\n </select>\r\n }\r\n\r\n @if (isClear) {\r\n <button class=\"btn btn-outline-secondary btn-clear\" type=\"button\" id=\"btn-clear\" (click)=\"clearValue()\"\r\n [disabled]=\"disabled\">\r\n <span class=\"fa fa-times\"></span>\r\n </button>\r\n }\r\n</div>\r\n\r\n@if(valid && validFeedback){\r\n<div class=\"valid-feedback\">{{validFeedback}}</div>\r\n}\r\n@if(invalid && invalidFeedback){\r\n<div class=\"invalid-feedback\">{{invalidFeedback}}</div>\r\n}" }]
89
92
  }], propDecorators: { id: [{
90
93
  type: Input
91
94
  }], options: [{
@@ -98,11 +101,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
98
101
  type: Input
99
102
  }], invalid: [{
100
103
  type: Input
101
- }], invalidStyleClass: [{
104
+ }], invalidFeedback: [{
102
105
  type: Input
103
106
  }], valid: [{
104
107
  type: Input
105
- }], validStyleClass: [{
108
+ }], validFeedback: [{
106
109
  type: Input
107
110
  }], multiple: [{
108
111
  type: Input
@@ -112,6 +115,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
112
115
  type: Input
113
116
  }], disabled: [{
114
117
  type: Input
118
+ }], onSelect: [{
119
+ type: Output
115
120
  }] } });
116
121
 
117
122
  /*
@@ -1 +1 @@
1
- {"version":3,"file":"yoozsoft-yoozsoft-ng-select.mjs","sources":["../../../../projects/yoozsoft/yoozsoft-ng/select/src/ys-select/ys-select.component.ts","../../../../projects/yoozsoft/yoozsoft-ng/select/src/ys-select/ys-select.component.html","../../../../projects/yoozsoft/yoozsoft-ng/select/public-api.ts","../../../../projects/yoozsoft/yoozsoft-ng/select/yoozsoft-yoozsoft-ng-select.ts"],"sourcesContent":["\r\nimport { Component, forwardRef, Input } from '@angular/core';\r\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\r\n\r\n@Component({\r\n selector: 'ys-select',\r\n imports: [FormsModule],\r\n templateUrl: './ys-select.component.html',\r\n styleUrl: './ys-select.component.scss',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => YsSelectComponent),\r\n multi: true\r\n }\r\n ]\r\n})\r\nexport class YsSelectComponent implements ControlValueAccessor {\r\n\r\n /**ُSelect element id */\r\n @Input() id: string = 'ys-select';\r\n @Input() options: any[] = [];\r\n /**Name of field to display in option title */\r\n @Input() optionLabel: string = 'label';\r\n @Input() placeholder?: string;\r\n @Input() styleClass?: string;\r\n @Input() invalid?: boolean = false;\r\n @Input() invalidStyleClass?: string = 'is-invalid';\r\n @Input() valid?: boolean = false;\r\n @Input() validStyleClass?: string = 'is-valid';\r\n /**Support multiple attribute */\r\n @Input() multiple?: boolean = false;\r\n /**Size of multiple attribute */\r\n @Input() size?: number;\r\n /**Display clear button */\r\n @Input() isClear?: boolean = false;\r\n\r\n @Input() disabled: boolean = false;\r\n onChange: any = () => { }\r\n onTouched: any = () => { }\r\n\r\n value?: any;\r\n\r\n writeValue(obj: any): void {\r\n if (!this.multiple && this.placeholder && !obj) {\r\n this.value = null;\r\n this.onChange(this.value);\r\n return;\r\n }\r\n\r\n if (this.multiple && !obj) {\r\n this.multiple ? this.value = [] : this.value = null;\r\n this.onChange(this.value);\r\n return;\r\n }\r\n\r\n if (!this.multiple && obj && Array.isArray(obj)) {\r\n if (obj.length) {\r\n this.value = obj[0];\r\n }\r\n else {\r\n this.value = null;\r\n }\r\n this.onChange(this.value);\r\n return;\r\n }\r\n\r\n this.value = 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 onModelChange(option: any) {\r\n this.onChange(option);\r\n this.onTouched(option);\r\n }\r\n\r\n clearValue() {\r\n this.multiple ? this.value = [] : this.value = null;\r\n this.onModelChange(this.value);\r\n }\r\n\r\n isObject(item: any) {\r\n return typeof item == 'object';\r\n }\r\n\r\n}\r\n","<div class=\"input-group ys-select\">\n\n @if (!multiple) {\n <select [id]=\"id\"\n class=\"form-select {{styleClass}} {{invalid && invalidStyleClass}} {{valid && validStyleClass}}\"\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\">\n @if (placeholder) {\n <option selected disabled [ngValue]=\"null\" class=\"d-none\"> {{placeholder}}\n </option>\n }\n @for (item of options; track item; let i = $index) {\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\n {{isObject(item) ? item[optionLabel] : item}}\n </option>\n }\n </select>\n }\n\n @if (multiple) {\n <select [id]=\"id\"\n class=\"form-select {{styleClass}} {{invalid && invalidStyleClass}} {{valid && validStyleClass}}\"\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\"\n [multiple]=\"multiple\" [size]=\"size\">\n @if (placeholder) {\n <option selected disabled [ngValue]=\"null\"> {{placeholder}}\n </option>\n }\n @for (item of options; track item; let i = $index) {\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\n {{isObject(item) ? item[optionLabel] : item}}\n </option>\n }\n </select>\n }\n\n @if (isClear) {\n <button class=\"btn btn-outline-secondary btn-clear\" type=\"button\" id=\"btn-clear\"\n (click)=\"clearValue()\" [disabled]=\"disabled\">\n <span class=\"fa fa-times\"></span>\n </button>\n }\n</div>","/*\r\n * Public API Surface of ys-select\r\n */\r\n\r\nexport * from './src/ys-select/ys-select.component';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAiBa,iBAAiB,CAAA;;IAGnB,EAAE,GAAW,WAAW;IACxB,OAAO,GAAU,EAAE;;IAEnB,WAAW,GAAW,OAAO;AAC7B,IAAA,WAAW;AACX,IAAA,UAAU;IACV,OAAO,GAAa,KAAK;IACzB,iBAAiB,GAAY,YAAY;IACzC,KAAK,GAAa,KAAK;IACvB,eAAe,GAAY,UAAU;;IAErC,QAAQ,GAAa,KAAK;;AAE1B,IAAA,IAAI;;IAEJ,OAAO,GAAa,KAAK;IAEzB,QAAQ,GAAY,KAAK;AAClC,IAAA,QAAQ,GAAQ,MAAK,GAAI;AACzB,IAAA,SAAS,GAAQ,MAAK,GAAI;AAE1B,IAAA,KAAK;AAEL,IAAA,UAAU,CAAC,GAAQ,EAAA;AACjB,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,GAAG,EAAE;AAC9C,YAAA,IAAI,CAAC,KAAK,GAAG,IAAI;AACjB,YAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;YACzB;;AAGF,QAAA,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;AACzB,YAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI;AACnD,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soft-ng-select.mjs","sources":["../../../../projects/yoozsoft/yoozsoft-ng/select/src/ys-select/ys-select.component.ts","../../../../projects/yoozsoft/yoozsoft-ng/select/src/ys-select/ys-select.component.html","../../../../projects/yoozsoft/yoozsoft-ng/select/public-api.ts","../../../../projects/yoozsoft/yoozsoft-ng/select/yoozsoft-yoozsoft-ng-select.ts"],"sourcesContent":["\r\nimport { NgClass } from '@angular/common';\r\nimport { Component, EventEmitter, forwardRef, Input, Output } from '@angular/core';\r\nimport { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\r\n\r\n@Component({\r\n selector: 'ys-select',\r\n imports: [FormsModule, NgClass],\r\n templateUrl: './ys-select.component.html',\r\n styleUrl: './ys-select.component.scss',\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => YsSelectComponent),\r\n multi: true\r\n }\r\n ]\r\n})\r\nexport class YsSelectComponent implements ControlValueAccessor {\r\n\r\n /**ُSelect element id */\r\n @Input() id: string = 'ys-select';\r\n @Input() options: any[] = [];\r\n /**Name of field to display in option title */\r\n @Input() optionLabel: string = 'label';\r\n @Input() placeholder?: string;\r\n @Input() styleClass?: string;\r\n @Input() invalid?: boolean = false;\r\n @Input() invalidFeedback?: string;\r\n @Input() valid?: boolean = false;\r\n @Input() validFeedback?: string;\r\n /**Support multiple attribute */\r\n @Input() multiple?: boolean = false;\r\n /**Size of multiple attribute */\r\n @Input() size?: number;\r\n /**Display clear button */\r\n @Input() isClear?: boolean = false;\r\n\r\n @Input() disabled: boolean = false;\r\n @Output() onSelect: EventEmitter<any> = new EventEmitter<any>();\r\n\r\n onChange: any = () => { }\r\n onTouched: any = () => { }\r\n\r\n value?: any;\r\n\r\n writeValue(obj: any): void {\r\n if (!this.multiple && this.placeholder && !obj) {\r\n this.value = null;\r\n this.onChange(this.value);\r\n return;\r\n }\r\n\r\n if (this.multiple && !obj) {\r\n this.multiple ? this.value = [] : this.value = null;\r\n this.onChange(this.value);\r\n return;\r\n }\r\n\r\n if (!this.multiple && obj && Array.isArray(obj)) {\r\n if (obj.length) {\r\n this.value = obj[0];\r\n }\r\n else {\r\n this.value = null;\r\n }\r\n this.onChange(this.value);\r\n return;\r\n }\r\n\r\n this.value = 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 onModelChange(option: any) {\r\n this.onChange(option);\r\n this.onTouched(option);\r\n this.onSelect.emit(option);\r\n }\r\n\r\n clearValue() {\r\n this.multiple ? this.value = [] : this.value = null;\r\n this.onModelChange(this.value);\r\n }\r\n\r\n isObject(item: any) {\r\n return typeof item == 'object';\r\n }\r\n\r\n}\r\n","<div class=\"ys-select\" [ngClass]=\"{'input-group': isClear, 'is-valid': valid, 'is-invalid': invalid}\">\r\n\r\n @if (!multiple) {\r\n <select [id]=\"id\" class=\"form-select {{styleClass}}\" [ngClass]=\"{'is-valid': valid, 'is-invalid': invalid}\"\r\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\">\r\n @if (placeholder) {\r\n <option selected disabled [ngValue]=\"null\" class=\"d-none\"> {{placeholder}}\r\n </option>\r\n }\r\n @for (item of options; track item; let i = $index) {\r\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\r\n {{isObject(item) ? item[optionLabel] : item}}\r\n </option>\r\n }\r\n </select>\r\n }\r\n\r\n @if (multiple) {\r\n <select [id]=\"id\" class=\"form-select {{styleClass}}\" [ngClass]=\"{'is-valid': valid, 'is-invalid': invalid}\"\r\n aria-label=\"Select option\" [(ngModel)]=\"value\" (ngModelChange)=\"onModelChange($event)\" [disabled]=\"disabled\"\r\n [multiple]=\"multiple\" [size]=\"size\">\r\n @if (placeholder) {\r\n <option selected disabled [ngValue]=\"null\"> {{placeholder}}\r\n </option>\r\n }\r\n @for (item of options; track item; let i = $index) {\r\n <option [selected]=\" i === 0 && !placeholder \" [ngValue]=\"item\">\r\n {{isObject(item) ? item[optionLabel] : item}}\r\n </option>\r\n }\r\n </select>\r\n }\r\n\r\n @if (isClear) {\r\n <button class=\"btn btn-outline-secondary btn-clear\" type=\"button\" id=\"btn-clear\" (click)=\"clearValue()\"\r\n [disabled]=\"disabled\">\r\n <span class=\"fa fa-times\"></span>\r\n </button>\r\n }\r\n</div>\r\n\r\n@if(valid && validFeedback){\r\n<div class=\"valid-feedback\">{{validFeedback}}</div>\r\n}\r\n@if(invalid && invalidFeedback){\r\n<div class=\"invalid-feedback\">{{invalidFeedback}}</div>\r\n}","/*\r\n * Public API Surface of ys-select\r\n */\r\n\r\nexport * from './src/ys-select/ys-select.component';\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAkBa,iBAAiB,CAAA;;IAGnB,EAAE,GAAW,WAAW;IACxB,OAAO,GAAU,EAAE;;IAEnB,WAAW,GAAW,OAAO;AAC7B,IAAA,WAAW;AACX,IAAA,UAAU;IACV,OAAO,GAAa,KAAK;AACzB,IAAA,eAAe;IACf,KAAK,GAAa,KAAK;AACvB,IAAA,aAAa;;IAEb,QAAQ,GAAa,KAAK;;AAE1B,IAAA,IAAI;;IAEJ,OAAO,GAAa,KAAK;IAEzB,QAAQ,GAAY,KAAK;AACxB,IAAA,QAAQ,GAAsB,IAAI,YAAY,EAAO;AAE/D,IAAA,QAAQ,GAAQ,MAAK,GAAI;AACzB,IAAA,SAAS,GAAQ,MAAK,GAAI;AAE1B,IAAA,KAAK;AAEL,IAAA,UAAU,CAAC,GAAQ,EAAA;AACjB,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,GAAG,EAAE;AAC9C,YAAA,IAAI,CAAC,KAAK,GAAG,IAAI;AACjB,YAAA,IAAI,CAAC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E;AACR;AACF,qBAAA,EAAA,QAAA,EAAA,41DAAA,EAAA;8BAKQ,EAAE,EAAA,CAAA;sBAAV;gBACQ,OAAO,EAAA,CAAA;sBAAf;gBAEQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,OAAO,EAAA,CAAA;sBAAf;gBACQ,eAAe,EAAA,CAAA;sBAAvB;gBACQ,KAAK,EAAA,CAAA;sBAAb;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBAEQ,QAAQ,EAAA,CAAA;sBAAhB;gBAEQ,IAAI,EAAA,CAAA;sBAAZ;gBAEQ,OAAO,EAAA,CAAA;sBAAf;gBAEQ,QAAQ,EAAA,CAAA;sBAAhB;gBACS,QAAQ,EAAA,CAAA;sBAAjB;;;AEvCH;;AAEG;;ACFH;;AAEG;;;;"}
@@ -116,11 +116,11 @@ class YsTiffViewerComponent {
116
116
  });
117
117
  }
118
118
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: YsTiffViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
119
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: YsTiffViewerComponent, isStandalone: true, selector: "ys-tiff-viewer", inputs: { buffer: "buffer", currentPageReportTemplate: "currentPageReportTemplate", styleClass: "styleClass", noFileMessage: "noFileMessage", firstIconClass: "firstIconClass", previousIconClass: "previousIconClass", nextIconClass: "nextIconClass", lastIconClass: "lastIconClass" }, ngImport: i0, template: "<div class=\"row\">\n <div class=\"col d-flex justify-content-between align-items-center mt-2\">\n <div>\n <button class=\"btn btn-outline-primary mb-0 me-2\" [ngClass]=\"{'ml-auto': isIFDs}\" type=\"button\"\n (click)=\"first()\" [disabled]=\"isFirstImage\">\n <i [ngClass]=\"firstIconClass\"></i>\n </button>\n <button class=\"btn btn-outline-primary mb-0\" type=\"button\" (click)=\"previous()\" [disabled]=\"isFirstImage\">\n <i [ngClass]=\"previousIconClass\"></i>\n </button>\n </div>\n\n @if (isIFDs) {\n <span [innerHtml]=\"currentPageReportTemplate\">\n </span>\n }\n\n <div>\n <button class=\"btn btn-outline-primary mb-0 me-2\" type=\"button\" (click)=\"next()\" [disabled]=\"isLastImage\">\n <i [ngClass]=\"nextIconClass\"></i>\n </button>\n <button class=\"btn btn-outline-primary mb-0\" [ngClass]=\"{'mr-auto': isIFDs}\" type=\"button\" (click)=\"last()\"\n [disabled]=\"isLastImage\">\n <i [ngClass]=\"lastIconClass\"></i>\n </button>\n </div>\n\n\n </div>\n</div>\n<div class=\"row\">\n <div class=\"col\">\n <div class=\"canvas-container card d-flex justify-content-center align-items-center mt-1 {{styleClass}}\">\n @if (!isIFDs && noFileMessage) {\n <span>{{noFileMessage}}</span>\n }\n <canvas #tiffCanvas id=\"tiffCanvas\" class=\"canvas-image img-fluid\" [ngClass]=\"{'d-none': !isIFDs}\"></canvas>\n <div class=\"backdrop position-absolute w-100 h-100 d-flex justify-content-center align-items-center\"\n [ngClass]=\"{'d-none': !isDecoding}\">\n\n </div>\n <div class=\"spinner-border text-info position-absolute\" style=\"width: 3rem; height: 3rem;\" role=\"status\"\n [ngClass]=\"{'d-none': !isDecoding}\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n </div>\n </div>\n</div>", styles: [".backdrop{background-color:rgba(var(--bs-dark-rgb),.3)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
119
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: YsTiffViewerComponent, isStandalone: true, selector: "ys-tiff-viewer", inputs: { buffer: "buffer", currentPageReportTemplate: "currentPageReportTemplate", styleClass: "styleClass", noFileMessage: "noFileMessage", firstIconClass: "firstIconClass", previousIconClass: "previousIconClass", nextIconClass: "nextIconClass", lastIconClass: "lastIconClass" }, ngImport: i0, template: "<div class=\"row\">\r\n <div class=\"col d-flex justify-content-between align-items-center\">\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 @if (isIFDs) {\r\n <span [innerHtml]=\"currentPageReportTemplate\">\r\n </span>\r\n }\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 @if (!isIFDs && noFileMessage) {\r\n <span>{{noFileMessage}}</span>\r\n }\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>", styles: [".backdrop{background-color:rgba(var(--bs-dark-rgb),.3)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
120
120
  }
121
121
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: YsTiffViewerComponent, decorators: [{
122
122
  type: Component,
123
- args: [{ selector: 'ys-tiff-viewer', imports: [NgClass], template: "<div class=\"row\">\n <div class=\"col d-flex justify-content-between align-items-center mt-2\">\n <div>\n <button class=\"btn btn-outline-primary mb-0 me-2\" [ngClass]=\"{'ml-auto': isIFDs}\" type=\"button\"\n (click)=\"first()\" [disabled]=\"isFirstImage\">\n <i [ngClass]=\"firstIconClass\"></i>\n </button>\n <button class=\"btn btn-outline-primary mb-0\" type=\"button\" (click)=\"previous()\" [disabled]=\"isFirstImage\">\n <i [ngClass]=\"previousIconClass\"></i>\n </button>\n </div>\n\n @if (isIFDs) {\n <span [innerHtml]=\"currentPageReportTemplate\">\n </span>\n }\n\n <div>\n <button class=\"btn btn-outline-primary mb-0 me-2\" type=\"button\" (click)=\"next()\" [disabled]=\"isLastImage\">\n <i [ngClass]=\"nextIconClass\"></i>\n </button>\n <button class=\"btn btn-outline-primary mb-0\" [ngClass]=\"{'mr-auto': isIFDs}\" type=\"button\" (click)=\"last()\"\n [disabled]=\"isLastImage\">\n <i [ngClass]=\"lastIconClass\"></i>\n </button>\n </div>\n\n\n </div>\n</div>\n<div class=\"row\">\n <div class=\"col\">\n <div class=\"canvas-container card d-flex justify-content-center align-items-center mt-1 {{styleClass}}\">\n @if (!isIFDs && noFileMessage) {\n <span>{{noFileMessage}}</span>\n }\n <canvas #tiffCanvas id=\"tiffCanvas\" class=\"canvas-image img-fluid\" [ngClass]=\"{'d-none': !isIFDs}\"></canvas>\n <div class=\"backdrop position-absolute w-100 h-100 d-flex justify-content-center align-items-center\"\n [ngClass]=\"{'d-none': !isDecoding}\">\n\n </div>\n <div class=\"spinner-border text-info position-absolute\" style=\"width: 3rem; height: 3rem;\" role=\"status\"\n [ngClass]=\"{'d-none': !isDecoding}\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n </div>\n </div>\n</div>", styles: [".backdrop{background-color:rgba(var(--bs-dark-rgb),.3)}\n"] }]
123
+ args: [{ selector: 'ys-tiff-viewer', imports: [NgClass], template: "<div class=\"row\">\r\n <div class=\"col d-flex justify-content-between align-items-center\">\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 @if (isIFDs) {\r\n <span [innerHtml]=\"currentPageReportTemplate\">\r\n </span>\r\n }\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 @if (!isIFDs && noFileMessage) {\r\n <span>{{noFileMessage}}</span>\r\n }\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>", styles: [".backdrop{background-color:rgba(var(--bs-dark-rgb),.3)}\n"] }]
124
124
  }], propDecorators: { buffer: [{
125
125
  type: Input
126
126
  }], currentPageReportTemplate: [{
@@ -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 } 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: [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\">\n <div class=\"col d-flex justify-content-between align-items-center mt-2\">\n <div>\n <button class=\"btn btn-outline-primary mb-0 me-2\" [ngClass]=\"{'ml-auto': isIFDs}\" type=\"button\"\n (click)=\"first()\" [disabled]=\"isFirstImage\">\n <i [ngClass]=\"firstIconClass\"></i>\n </button>\n <button class=\"btn btn-outline-primary mb-0\" type=\"button\" (click)=\"previous()\" [disabled]=\"isFirstImage\">\n <i [ngClass]=\"previousIconClass\"></i>\n </button>\n </div>\n\n @if (isIFDs) {\n <span [innerHtml]=\"currentPageReportTemplate\">\n </span>\n }\n\n <div>\n <button class=\"btn btn-outline-primary mb-0 me-2\" type=\"button\" (click)=\"next()\" [disabled]=\"isLastImage\">\n <i [ngClass]=\"nextIconClass\"></i>\n </button>\n <button class=\"btn btn-outline-primary mb-0\" [ngClass]=\"{'mr-auto': isIFDs}\" type=\"button\" (click)=\"last()\"\n [disabled]=\"isLastImage\">\n <i [ngClass]=\"lastIconClass\"></i>\n </button>\n </div>\n\n\n </div>\n</div>\n<div class=\"row\">\n <div class=\"col\">\n <div class=\"canvas-container card d-flex justify-content-center align-items-center mt-1 {{styleClass}}\">\n @if (!isIFDs && noFileMessage) {\n <span>{{noFileMessage}}</span>\n }\n <canvas #tiffCanvas id=\"tiffCanvas\" class=\"canvas-image img-fluid\" [ngClass]=\"{'d-none': !isIFDs}\"></canvas>\n <div class=\"backdrop position-absolute w-100 h-100 d-flex justify-content-center align-items-center\"\n [ngClass]=\"{'d-none': !isDecoding}\">\n\n </div>\n <div class=\"spinner-border text-info position-absolute\" style=\"width: 3rem; height: 3rem;\" role=\"status\"\n [ngClass]=\"{'d-none': !isDecoding}\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n </div>\n </div>\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,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iBd,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 } 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: [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\">\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 @if (isIFDs) {\r\n <span [innerHtml]=\"currentPageReportTemplate\">\r\n </span>\r\n }\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 @if (!isIFDs && noFileMessage) {\r\n <span>{{noFileMessage}}</span>\r\n }\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,IAA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,EAAA,CAAA;kBANjC,SAAS;+BACE,gBAAgB,EAAA,OAAA,EACjB,CAAC,OAAO,CAAC,EAAA,QAAA,EAAA,w8DAAA,EAAA,MAAA,EAAA,CAAA,2DAAA,CAAA,EAAA;8BAiBd,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;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoozsoft/yoozsoft-ng",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^20.0.0",
6
6
  "@angular/core": "^20.0.0"
@@ -35,14 +35,14 @@
35
35
  "types": "./index.d.ts",
36
36
  "default": "./fesm2022/yoozsoft-yoozsoft-ng.mjs"
37
37
  },
38
- "./datepicker": {
39
- "types": "./datepicker/index.d.ts",
40
- "default": "./fesm2022/yoozsoft-yoozsoft-ng-datepicker.mjs"
41
- },
42
38
  "./directives": {
43
39
  "types": "./directives/index.d.ts",
44
40
  "default": "./fesm2022/yoozsoft-yoozsoft-ng-directives.mjs"
45
41
  },
42
+ "./datepicker": {
43
+ "types": "./datepicker/index.d.ts",
44
+ "default": "./fesm2022/yoozsoft-yoozsoft-ng-datepicker.mjs"
45
+ },
46
46
  "./file-upload": {
47
47
  "types": "./file-upload/index.d.ts",
48
48
  "default": "./fesm2022/yoozsoft-yoozsoft-ng-file-upload.mjs"
@@ -75,14 +75,14 @@
75
75
  "types": "./select/index.d.ts",
76
76
  "default": "./fesm2022/yoozsoft-yoozsoft-ng-select.mjs"
77
77
  },
78
- "./sidebar": {
79
- "types": "./sidebar/index.d.ts",
80
- "default": "./fesm2022/yoozsoft-yoozsoft-ng-sidebar.mjs"
81
- },
82
78
  "./tiff-viewer": {
83
79
  "types": "./tiff-viewer/index.d.ts",
84
80
  "default": "./fesm2022/yoozsoft-yoozsoft-ng-tiff-viewer.mjs"
85
81
  },
82
+ "./sidebar": {
83
+ "types": "./sidebar/index.d.ts",
84
+ "default": "./fesm2022/yoozsoft-yoozsoft-ng-sidebar.mjs"
85
+ },
86
86
  "./toast": {
87
87
  "types": "./toast/index.d.ts",
88
88
  "default": "./fesm2022/yoozsoft-yoozsoft-ng-toast.mjs"
package/select/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { ControlValueAccessor } from '@angular/forms';
2
1
  import * as i0 from '@angular/core';
2
+ import { EventEmitter } from '@angular/core';
3
+ import { ControlValueAccessor } from '@angular/forms';
3
4
 
4
5
  declare class YsSelectComponent implements ControlValueAccessor {
5
6
  /**ُSelect element id */
@@ -10,9 +11,9 @@ declare class YsSelectComponent implements ControlValueAccessor {
10
11
  placeholder?: string;
11
12
  styleClass?: string;
12
13
  invalid?: boolean;
13
- invalidStyleClass?: string;
14
+ invalidFeedback?: string;
14
15
  valid?: boolean;
15
- validStyleClass?: string;
16
+ validFeedback?: string;
16
17
  /**Support multiple attribute */
17
18
  multiple?: boolean;
18
19
  /**Size of multiple attribute */
@@ -20,6 +21,7 @@ declare class YsSelectComponent implements ControlValueAccessor {
20
21
  /**Display clear button */
21
22
  isClear?: boolean;
22
23
  disabled: boolean;
24
+ onSelect: EventEmitter<any>;
23
25
  onChange: any;
24
26
  onTouched: any;
25
27
  value?: any;
@@ -31,7 +33,7 @@ declare class YsSelectComponent implements ControlValueAccessor {
31
33
  clearValue(): void;
32
34
  isObject(item: any): boolean;
33
35
  static ɵfac: i0.ɵɵFactoryDeclaration<YsSelectComponent, never>;
34
- static ɵcmp: i0.ɵɵComponentDeclaration<YsSelectComponent, "ys-select", never, { "id": { "alias": "id"; "required": false; }; "options": { "alias": "options"; "required": false; }; "optionLabel": { "alias": "optionLabel"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "invalidStyleClass": { "alias": "invalidStyleClass"; "required": false; }; "valid": { "alias": "valid"; "required": false; }; "validStyleClass": { "alias": "validStyleClass"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "size": { "alias": "size"; "required": false; }; "isClear": { "alias": "isClear"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<YsSelectComponent, "ys-select", never, { "id": { "alias": "id"; "required": false; }; "options": { "alias": "options"; "required": false; }; "optionLabel": { "alias": "optionLabel"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "invalidFeedback": { "alias": "invalidFeedback"; "required": false; }; "valid": { "alias": "valid"; "required": false; }; "validFeedback": { "alias": "validFeedback"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "size": { "alias": "size"; "required": false; }; "isClear": { "alias": "isClear"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "onSelect": "onSelect"; }, never, never, true, never>;
35
37
  }
36
38
 
37
39
  export { YsSelectComponent };