@ifsworld/granite-components 12.1.1 → 12.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, HostBinding, ContentChildren, NgModule, InjectionToken, Attribute, Inject, Optional, EventEmitter, QueryList, TemplateRef, Directive, ViewChild, Output, Self, HostListener, ContentChild, Pipe, inject } from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, HostBinding, ContentChildren, NgModule, InjectionToken, Attribute, Inject, Optional, EventEmitter, QueryList, TemplateRef, Directive, ViewChild, Output, Self, HostListener, ContentChild, Pipe, ElementRef, inject } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common';
4
4
  import { CommonModule, DOCUMENT } from '@angular/common';
5
5
  import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
@@ -1285,7 +1285,7 @@ const passiveEventListenerOptions = normalizePassiveListenerOptions({
1285
1285
  * Stripped-down version of Angular Material's menu trigger directive (.../menu/menu-trigger.ts)
1286
1286
  */
1287
1287
  class GraniteMenuTriggerForDirective {
1288
- constructor(_overlay, _element, _viewContainerRef,
1288
+ constructor(_overlay, _element, _viewContainerRef, _changeDetectionRef,
1289
1289
  /** If this is a _submenu_ trigger, it will have a parent menu */
1290
1290
  _parentMenu,
1291
1291
  //#region --- Touch device customizations ---
@@ -1307,6 +1307,7 @@ class GraniteMenuTriggerForDirective {
1307
1307
  this._overlay = _overlay;
1308
1308
  this._element = _element;
1309
1309
  this._viewContainerRef = _viewContainerRef;
1310
+ this._changeDetectionRef = _changeDetectionRef;
1310
1311
  this._parentMenu = _parentMenu;
1311
1312
  this._clientInput = _clientInput;
1312
1313
  this._clientOutput = _clientOutput;
@@ -1315,7 +1316,7 @@ class GraniteMenuTriggerForDirective {
1315
1316
  this._focusMonitor = _focusMonitor;
1316
1317
  this.openOnClick = true;
1317
1318
  /** Whether the associated menu is open */
1318
- this._isMenuOpen = false;
1319
+ this.isMenuOpened = false;
1319
1320
  // Tracking input type is necessary so it's possible to only auto-focus
1320
1321
  // the first item of the list when the menu is opened via the keyboard
1321
1322
  this.openedBy = null;
@@ -1487,11 +1488,11 @@ class GraniteMenuTriggerForDirective {
1487
1488
  }
1488
1489
  }
1489
1490
  isOpen() {
1490
- return this._isMenuOpen;
1491
+ return this.isMenuOpened;
1491
1492
  }
1492
1493
  /** Open the associated menu */
1493
1494
  openMenu() {
1494
- if (this._isMenuOpen) {
1495
+ if (this.isMenuOpened) {
1495
1496
  return;
1496
1497
  }
1497
1498
  this.openedEvent();
@@ -1579,7 +1580,7 @@ class GraniteMenuTriggerForDirective {
1579
1580
  }
1580
1581
  /** Toggles the menu between the open and closed states. */
1581
1582
  toggleMenu() {
1582
- if (this._isMenuOpen) {
1583
+ if (this.isMenuOpened) {
1583
1584
  this.closeMenu();
1584
1585
  }
1585
1586
  else if (this.openOnClick) {
@@ -1604,7 +1605,7 @@ class GraniteMenuTriggerForDirective {
1604
1605
  }
1605
1606
  /** Detach menu portal from overlay and update open state */
1606
1607
  _destroyMenu() {
1607
- if (!this._overlayRef || !this._isMenuOpen) {
1608
+ if (!this._overlayRef || !this.isMenuOpened) {
1608
1609
  return;
1609
1610
  }
1610
1611
  this._closingActionsSubscription.unsubscribe();
@@ -1700,7 +1701,10 @@ class GraniteMenuTriggerForDirective {
1700
1701
  }
1701
1702
  // Set state rather than toggle to support triggers sharing a menu
1702
1703
  _setIsMenuOpen(isOpen) {
1703
- this._isMenuOpen = isOpen;
1704
+ if (this.isMenuOpened !== isOpen) {
1705
+ this._changeDetectionRef.markForCheck();
1706
+ }
1707
+ this.isMenuOpened = isOpen;
1704
1708
  if (this.triggersSubmenu()) {
1705
1709
  this._menuItemInstance._highlighted =
1706
1710
  isOpen && this._clientOutput.device !== 'touch';
@@ -1788,7 +1792,7 @@ class GraniteMenuTriggerForDirective {
1788
1792
  ? this._parentMenu.closed
1789
1793
  : of(null);
1790
1794
  const hover = this._clientOutput.device === 'desktop' && this._parentMenu
1791
- ? this._parentMenu._hovered().pipe(filter((item) => item !== this._menuItemInstance), filter(() => this._isMenuOpen))
1795
+ ? this._parentMenu._hovered().pipe(filter((item) => item !== this._menuItemInstance), filter(() => this.isMenuOpened))
1792
1796
  : of(null);
1793
1797
  // Note: Quick fix. Feature reportedly exists in CDK for Angular 10
1794
1798
  // Filter to prevent closing when animating added though. Applied to
@@ -1919,8 +1923,8 @@ class GraniteMenuTriggerForDirective {
1919
1923
  ? offset + target
1920
1924
  : target * (-Math.pow(2, (-10 * current) / end) + 1) + offset;
1921
1925
  }
1922
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteMenuTriggerForDirective, deps: [{ token: i1$2.Overlay }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: GRANITE_MENU_PANEL, optional: true }, { token: GRANITE_CLIENT_INPUT, optional: true }, { token: GRANITE_CLIENT_OUTPUT, optional: true }, { token: GraniteMenuItemComponent, optional: true, self: true }, { token: i3.Directionality, optional: true }, { token: i1.FocusMonitor }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
1923
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteMenuTriggerForDirective, selector: "[graniteMenuTriggerFor]", inputs: { menu: ["graniteMenuTriggerFor", "menu"], openOnClick: "openOnClick" }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "mousedown": "_handleMousedown($event)", "keydown": "_handleKeydown($event)", "click": "_handleClick($event)" }, properties: { "attr.aria-expanded": "_isMenuOpen || null", "attr.aria-controls": "_isMenuOpen ? menu.panelId : null" }, classAttribute: "granite-menu-trigger" }, exportAs: ["graniteMenuTriggerFor"], usesOnChanges: true, ngImport: i0 }); }
1926
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteMenuTriggerForDirective, deps: [{ token: i1$2.Overlay }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }, { token: GRANITE_MENU_PANEL, optional: true }, { token: GRANITE_CLIENT_INPUT, optional: true }, { token: GRANITE_CLIENT_OUTPUT, optional: true }, { token: GraniteMenuItemComponent, optional: true, self: true }, { token: i3.Directionality, optional: true }, { token: i1.FocusMonitor }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive }); }
1927
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteMenuTriggerForDirective, selector: "[graniteMenuTriggerFor]", inputs: { menu: ["graniteMenuTriggerFor", "menu"], openOnClick: "openOnClick" }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "mousedown": "_handleMousedown($event)", "keydown": "_handleKeydown($event)", "click": "_handleClick($event)" }, properties: { "attr.aria-expanded": "isMenuOpened || null", "attr.aria-controls": "isMenuOpened ? menu.panelId : null" }, classAttribute: "granite-menu-trigger" }, exportAs: ["graniteMenuTriggerFor"], usesOnChanges: true, ngImport: i0 }); }
1924
1928
  }
1925
1929
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteMenuTriggerForDirective, decorators: [{
1926
1930
  type: Directive,
@@ -1930,14 +1934,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
1930
1934
  host: {
1931
1935
  class: 'granite-menu-trigger', // Required for test harness host selector
1932
1936
  'aria-haspopup': 'true',
1933
- '[attr.aria-expanded]': '_isMenuOpen || null',
1934
- '[attr.aria-controls]': '_isMenuOpen ? menu.panelId : null',
1937
+ '[attr.aria-expanded]': 'isMenuOpened || null',
1938
+ '[attr.aria-controls]': 'isMenuOpened ? menu.panelId : null',
1935
1939
  '(mousedown)': '_handleMousedown($event)',
1936
1940
  '(keydown)': '_handleKeydown($event)',
1937
1941
  '(click)': '_handleClick($event)',
1938
1942
  },
1939
1943
  }]
1940
- }], ctorParameters: () => [{ type: i1$2.Overlay }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: _MenuBaseComponent, decorators: [{
1944
+ }], ctorParameters: () => [{ type: i1$2.Overlay }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }, { type: _MenuBaseComponent, decorators: [{
1941
1945
  type: Inject,
1942
1946
  args: [GRANITE_MENU_PANEL]
1943
1947
  }, {
@@ -4860,6 +4864,329 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
4860
4864
  }]
4861
4865
  }] });
4862
4866
 
4867
+ const fileSizes = [
4868
+ 'Bytes',
4869
+ 'KB',
4870
+ 'MB',
4871
+ 'GB',
4872
+ 'TB',
4873
+ 'PB',
4874
+ 'EB',
4875
+ 'ZB',
4876
+ 'YB',
4877
+ ];
4878
+ var FileUploadStatus;
4879
+ (function (FileUploadStatus) {
4880
+ FileUploadStatus["NotStarted"] = "NotStarted";
4881
+ FileUploadStatus["InProgress"] = "InProgress";
4882
+ FileUploadStatus["Completed"] = "Completed";
4883
+ FileUploadStatus["Failed"] = "Failed";
4884
+ FileUploadStatus["Cancelled"] = "Cancelled";
4885
+ })(FileUploadStatus || (FileUploadStatus = {}));
4886
+ var FilUploadErrorTypes;
4887
+ (function (FilUploadErrorTypes) {
4888
+ FilUploadErrorTypes["ExtensionNotSupported"] = "ExtensionNotSupported";
4889
+ FilUploadErrorTypes["MultipleFilesNotSupported"] = "MultipleFilesNotSupported";
4890
+ })(FilUploadErrorTypes || (FilUploadErrorTypes = {}));
4891
+ const DEFAULT_MULTI_FILE_SUPPORT = false;
4892
+ const DEFAULT_ACCEPT_TYPE = '*.*';
4893
+ const DEFAULT_UPLOAD_TITLE = 'Upload Files';
4894
+ const DEFAULT_UPLOAD_ICON = 'icon-upload';
4895
+ const DEFAULT_FILE_BROWSE_BUTTON_ICON = 'icon-folder-alt';
4896
+ const DEFAULT_UPLOAD_FAILURE_ICON = 'icon-error';
4897
+ const DEFAULT_DROPZONE_TEXT = 'Drop here or';
4898
+ const DEFAULT_BROWSE_BUTTON_TEXT = 'Browse';
4899
+ const DEFAULT_DROP_PLACEHOLDER_TEXT = 'Drop files here';
4900
+ const DEFAULT_DROPZONE_HINT = '';
4901
+ const DEFAULT_REMOVE_BUTTON_TEXT = 'Remove';
4902
+ const DEFAULT_UPLOAD_BUTTON_TEXT = 'Upload';
4903
+ const DEFAULT_RETRY_BUTTON_TEXT = 'Retry';
4904
+ const DEFAULT_CANCEL_BUTTON_TEXT = 'Cancel';
4905
+
4906
+ function validFileTypes(mimeTypesStringToCheck, files) {
4907
+ const supportedFileMimeTypes = mimeTypesStringToCheck
4908
+ .split(',')
4909
+ .map((ext) => ext.trim());
4910
+ if (!files || files.length === 0) {
4911
+ return false;
4912
+ }
4913
+ return files.every((file) => {
4914
+ const fileType = file['type'];
4915
+ return fileType && supportedFileMimeTypes.includes(fileType);
4916
+ });
4917
+ }
4918
+
4919
+ class GraniteFileDragAndDropDirective {
4920
+ constructor() {
4921
+ this.currentFiles = [];
4922
+ this.droppedFiles = new EventEmitter();
4923
+ this.isFileOver = new EventEmitter();
4924
+ this.fileUploadValidation = new EventEmitter();
4925
+ }
4926
+ onDragOver(event) {
4927
+ event.preventDefault();
4928
+ event.stopPropagation();
4929
+ const transferFiles = event.dataTransfer?.items ?? [];
4930
+ if (!validFileTypes(this.accept, Array.from(transferFiles))) {
4931
+ this.fileBrowseError = true;
4932
+ this.fileUploadValidation.emit({
4933
+ isError: this.fileBrowseError,
4934
+ type: FilUploadErrorTypes.ExtensionNotSupported,
4935
+ });
4936
+ return;
4937
+ }
4938
+ if (!this.multiFileUploadEnabled &&
4939
+ (transferFiles.length > 1 || this.currentFiles.length >= 1)) {
4940
+ this.fileBrowseError = true;
4941
+ this.fileUploadValidation.emit({
4942
+ isError: this.fileBrowseError,
4943
+ type: FilUploadErrorTypes.MultipleFilesNotSupported,
4944
+ });
4945
+ return;
4946
+ }
4947
+ this.fileOver = true;
4948
+ this.isFileOver.emit(this.fileOver);
4949
+ }
4950
+ onDragLeave(event) {
4951
+ event.preventDefault();
4952
+ event.stopPropagation();
4953
+ this.fileOver = false;
4954
+ this.fileBrowseError = false;
4955
+ this.fileUploadValidation.emit({ isError: false, type: null });
4956
+ this.isFileOver.emit(this.fileOver);
4957
+ }
4958
+ onDrop(event) {
4959
+ event.preventDefault();
4960
+ event.stopPropagation();
4961
+ if (this.fileBrowseError) {
4962
+ this.fileBrowseError = false;
4963
+ this.fileUploadValidation.emit({
4964
+ isError: this.fileBrowseError,
4965
+ type: null,
4966
+ });
4967
+ return;
4968
+ }
4969
+ this.currentFiles = [
4970
+ ...this.currentFiles,
4971
+ ...Array.from(event.dataTransfer.files),
4972
+ ];
4973
+ this.fileOver = false;
4974
+ this.isFileOver.emit(this.fileOver);
4975
+ if (this.currentFiles.length > 0) {
4976
+ this.droppedFiles.emit(this.currentFiles);
4977
+ }
4978
+ }
4979
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteFileDragAndDropDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
4980
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: GraniteFileDragAndDropDirective, selector: "[graniteFileDragAndDrop]", inputs: { multiFileUploadEnabled: "multiFileUploadEnabled", accept: "accept", currentFiles: "currentFiles" }, outputs: { droppedFiles: "droppedFiles", isFileOver: "isFileOver", fileUploadValidation: "fileUploadValidation" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "onDrop($event)" }, properties: { "class.file-over": "this.fileOver", "class.file-error": "this.fileBrowseError" } }, exportAs: ["graniteFileDragAndDrop"], ngImport: i0 }); }
4981
+ }
4982
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteFileDragAndDropDirective, decorators: [{
4983
+ type: Directive,
4984
+ args: [{
4985
+ selector: '[graniteFileDragAndDrop]',
4986
+ exportAs: 'graniteFileDragAndDrop',
4987
+ }]
4988
+ }], propDecorators: { fileOver: [{
4989
+ type: HostBinding,
4990
+ args: ['class.file-over']
4991
+ }], fileBrowseError: [{
4992
+ type: HostBinding,
4993
+ args: ['class.file-error']
4994
+ }], multiFileUploadEnabled: [{
4995
+ type: Input
4996
+ }], accept: [{
4997
+ type: Input
4998
+ }], currentFiles: [{
4999
+ type: Input
5000
+ }], droppedFiles: [{
5001
+ type: Output
5002
+ }], isFileOver: [{
5003
+ type: Output
5004
+ }], fileUploadValidation: [{
5005
+ type: Output
5006
+ }], onDragOver: [{
5007
+ type: HostListener,
5008
+ args: ['dragover', ['$event']]
5009
+ }], onDragLeave: [{
5010
+ type: HostListener,
5011
+ args: ['dragleave', ['$event']]
5012
+ }], onDrop: [{
5013
+ type: HostListener,
5014
+ args: ['drop', ['$event']]
5015
+ }] } });
5016
+
5017
+ class GraniteFileUploadComponent {
5018
+ constructor() {
5019
+ this.accept = DEFAULT_ACCEPT_TYPE;
5020
+ this.uploadTitle = DEFAULT_UPLOAD_TITLE;
5021
+ this.uploadIcon = DEFAULT_UPLOAD_ICON;
5022
+ this.browseIcon = DEFAULT_FILE_BROWSE_BUTTON_ICON;
5023
+ this.errorIcon = DEFAULT_UPLOAD_FAILURE_ICON;
5024
+ this.dropZoneText = DEFAULT_DROPZONE_TEXT;
5025
+ this.browseButtonText = DEFAULT_BROWSE_BUTTON_TEXT;
5026
+ this.dropPlaceholderText = DEFAULT_DROP_PLACEHOLDER_TEXT;
5027
+ this.dropZoneHint = DEFAULT_DROPZONE_HINT;
5028
+ this.removeButtonText = DEFAULT_REMOVE_BUTTON_TEXT;
5029
+ this.uploadButtonText = DEFAULT_UPLOAD_BUTTON_TEXT;
5030
+ this.retryButtonText = DEFAULT_RETRY_BUTTON_TEXT;
5031
+ this.cancelButtonText = DEFAULT_CANCEL_BUTTON_TEXT;
5032
+ this.browseOrDragFiles = new EventEmitter();
5033
+ this.removeFiles = new EventEmitter();
5034
+ this.filesUpload = new EventEmitter();
5035
+ this.fileUploadValidation = new EventEmitter();
5036
+ this.selectedFiles = [];
5037
+ this.previewReadyFiles = [];
5038
+ this.isFileOnDropzone = false;
5039
+ this.FileUploadStatus = FileUploadStatus;
5040
+ this.fileError = false;
5041
+ // TODO: this becomes input when multiple file upload support with carousel component was done.
5042
+ this.supportMultiFileUpload = DEFAULT_MULTI_FILE_SUPPORT;
5043
+ this._uploadStatus = FileUploadStatus.NotStarted;
5044
+ this._autoUpload = true;
5045
+ }
5046
+ get uploadStatus() {
5047
+ return this._uploadStatus;
5048
+ }
5049
+ set uploadStatus(status) {
5050
+ this._uploadStatus = status;
5051
+ }
5052
+ get autoUpload() {
5053
+ return this._autoUpload;
5054
+ }
5055
+ set autoUpload(value) {
5056
+ this._autoUpload = coerceBooleanProperty(value);
5057
+ }
5058
+ fileBrowseHandler(event) {
5059
+ const target = event.target;
5060
+ const files = Array.from(target.files);
5061
+ if (!validFileTypes(this.accept, files)) {
5062
+ this.fileUploadValidation.emit({
5063
+ isError: true,
5064
+ type: FilUploadErrorTypes.ExtensionNotSupported,
5065
+ });
5066
+ this.fileDropRef.nativeElement.value = null;
5067
+ return;
5068
+ }
5069
+ this.selectedFiles = [...this.selectedFiles, ...files];
5070
+ this.previewReadyFiles = this.prepareSelectedFiles(this.selectedFiles);
5071
+ this.browseOrDragFiles.emit(this.previewReadyFiles);
5072
+ }
5073
+ fileRemoveHandler(index) {
5074
+ this.selectedFiles.splice(index, 1);
5075
+ this.previewReadyFiles.splice(index, 1);
5076
+ if (this.selectedFiles.length === 0 &&
5077
+ this.previewReadyFiles.length === 0) {
5078
+ this.fileDropRef.nativeElement.value = null;
5079
+ this.uploadStatus = FileUploadStatus.NotStarted;
5080
+ }
5081
+ this.removeFiles.emit(this.previewReadyFiles);
5082
+ }
5083
+ onFilesDropHandler(files) {
5084
+ if (!this.supportMultiFileUpload &&
5085
+ (this.selectedFiles.length === 1 || files.length !== 1)) {
5086
+ this.fileError = true;
5087
+ return;
5088
+ }
5089
+ this.selectedFiles = files;
5090
+ this.previewReadyFiles = this.prepareSelectedFiles(this.selectedFiles);
5091
+ this.browseOrDragFiles.emit(this.previewReadyFiles);
5092
+ }
5093
+ onFileOverDropzone(isFileOver) {
5094
+ this.isFileOnDropzone = isFileOver;
5095
+ }
5096
+ onFileDropError(validation) {
5097
+ this.fileError = validation.isError;
5098
+ this.fileDropErrorType = validation.type;
5099
+ }
5100
+ prepareSelectedFiles(files) {
5101
+ return files.map((file) => ({
5102
+ file,
5103
+ readableSize: this.formatBytesToReadableSize(file.size, 2),
5104
+ imageUrl: URL.createObjectURL(file),
5105
+ }));
5106
+ }
5107
+ uploadFiles() {
5108
+ this.filesUpload.emit();
5109
+ }
5110
+ retryUpload() {
5111
+ this.filesUpload.emit();
5112
+ }
5113
+ cancelUpload() {
5114
+ for (let i = 0; i < this.previewReadyFiles.length; i++) {
5115
+ this.fileRemoveHandler(i);
5116
+ }
5117
+ }
5118
+ formatBytesToReadableSize(bytes, decimals) {
5119
+ if (bytes === 0) {
5120
+ return `0 ${fileSizes[0]}`;
5121
+ }
5122
+ const bytesPerKB = 1024;
5123
+ const decimalPoints = decimals <= 0 ? 0 : decimals || 2;
5124
+ const exp = Math.floor(Math.log(bytes) / Math.log(bytesPerKB));
5125
+ return `${parseFloat((bytes / Math.pow(bytesPerKB, exp)).toFixed(decimalPoints))} ${fileSizes[exp]}`;
5126
+ }
5127
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5128
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: GraniteFileUploadComponent, selector: "granite-file-upload", inputs: { accept: "accept", uploadTitle: "uploadTitle", uploadIcon: "uploadIcon", browseIcon: "browseIcon", errorIcon: "errorIcon", dropZoneText: "dropZoneText", browseButtonText: "browseButtonText", dropPlaceholderText: "dropPlaceholderText", dropZoneHint: "dropZoneHint", removeButtonText: "removeButtonText", uploadButtonText: "uploadButtonText", retryButtonText: "retryButtonText", cancelButtonText: "cancelButtonText", uploadStatus: "uploadStatus", autoUpload: "autoUpload" }, outputs: { browseOrDragFiles: "browseOrDragFiles", removeFiles: "removeFiles", filesUpload: "filesUpload", fileUploadValidation: "fileUploadValidation" }, viewQueries: [{ propertyName: "fileDropRef", first: true, predicate: ["fileDropRef"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div class=\"file-upload-wrapper\">\n <h2 class=\"file-upload-title\">{{ uploadTitle }}</h2>\n <div\n class=\"file-dropzone\"\n graniteFileDragAndDrop\n (droppedFiles)=\"onFilesDropHandler($event)\"\n (isFileOver)=\"onFileOverDropzone($event)\"\n (fileUploadValidation)=\"onFileDropError($event)\"\n [multiFileUploadEnabled]=\"supportMultiFileUpload\"\n [accept]=\"accept\"\n [currentFiles]=\"selectedFiles\"\n >\n <input\n class=\"file-input\"\n #fileDropRef\n type=\"file\"\n title=\"fileUpload\"\n (change)=\"fileBrowseHandler($event)\"\n [multiple]=\"supportMultiFileUpload\"\n [accept]=\"accept\"\n />\n <div class=\"file-upload-body\">\n <ng-template #dropPlaceholder>\n <p class=\"drop-area-placeholder\">\n {{ dropPlaceholderText }}\n </p>\n </ng-template>\n <ng-container\n *ngIf=\"!isFileOnDropzone && !fileError; else dropPlaceholder\"\n >\n <div\n class=\"file-upload-browse\"\n *ngIf=\"previewReadyFiles.length === 0; else filePreview\"\n >\n <granite-icon\n class=\"file-upload-icon\"\n [fontIcon]=\"uploadIcon\"\n ></granite-icon>\n <div class=\"file-selection\">\n <h2 class=\"file-upload-body-text\">{{ dropZoneText }}</h2>\n <button\n class=\"file-select-button\"\n graniteButton\n (click)=\"fileDropRef.click()\"\n >\n <granite-icon\n class=\"browse-button-icon\"\n [fontIcon]=\"browseIcon\"\n ></granite-icon>\n <div class=\"browse-button-text\">{{ browseButtonText }}</div>\n </button>\n </div>\n <p *ngIf=\"dropZoneHint\" class=\"file-upload-hint\">\n {{ dropZoneHint }}\n </p>\n </div>\n <ng-template #filePreview>\n <div\n class=\"file-preview-container\"\n *ngFor=\"let previewFile of previewReadyFiles; let i = index\"\n >\n <a\n class=\"file-preview-link\"\n [ngClass]=\"{\n 'uploading-in-progress':\n uploadStatus === FileUploadStatus.InProgress,\n 'upload-failed': uploadStatus === FileUploadStatus.Failed\n }\"\n [href]=\"previewFile?.imageUrl\"\n target=\"_blank\"\n >\n <div class=\"file-preview-holder\">\n <img\n role=\"presentation\"\n [src]=\"previewFile?.imageUrl\"\n [alt]=\"previewFile?.file?.name\"\n />\n </div>\n <p class=\"file-name\" [title]=\"previewFile?.file?.name\">\n {{ previewFile?.file?.name }}\n </p>\n <p class=\"file-size\">{{ previewFile?.readableSize }}</p>\n </a>\n <div\n class=\"loading-container\"\n *ngIf=\"uploadStatus === FileUploadStatus.InProgress\"\n >\n <div class=\"uploading-spinner\"></div>\n </div>\n <div\n class=\"failed-icon-container\"\n *ngIf=\"uploadStatus === FileUploadStatus.Failed\"\n >\n <granite-icon\n class=\"error-icon\"\n [fontIcon]=\"errorIcon\"\n ></granite-icon>\n </div>\n <button\n graniteButton\n *ngIf=\"\n [\n FileUploadStatus.Completed,\n FileUploadStatus.NotStarted\n ].includes(uploadStatus)\n \"\n (click)=\"fileRemoveHandler(i)\"\n >\n {{ removeButtonText }}\n </button>\n </div>\n </ng-template>\n </ng-container>\n </div>\n </div>\n <div class=\"file-upload-footer\">\n <div class=\"footer-container\" *ngIf=\"previewReadyFiles.length > 0\">\n <button\n *ngIf=\"!autoUpload && uploadStatus === FileUploadStatus.NotStarted\"\n granitePrimaryButton\n (click)=\"uploadFiles()\"\n >\n {{ uploadButtonText }}\n </button>\n <ng-container *ngIf=\"uploadStatus === FileUploadStatus.Failed\">\n <button graniteButton (click)=\"cancelUpload()\">\n {{ cancelButtonText }}\n </button>\n <button\n class=\"retry-upload-button\"\n granitePrimaryButton\n (click)=\"retryUpload()\"\n >\n {{ retryButtonText }}\n </button>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: [":host{width:100%}.file-upload-wrapper{display:flex;flex-direction:column;background-color:var(--granite-color-background);box-shadow:var(--granite-shadow-s);height:100%;width:100%}.file-upload-wrapper .file-upload-title{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-medium);font-weight:var(--granite-font-weight-bold);line-height:var(--granite-line-height-base-rem);color:var(--granite-color-text-weak);margin:0;padding:var(--granite-spacing-8) calc(var(--granite-spacing-16) * .813)}.file-upload-wrapper .file-dropzone{display:flex;flex-direction:column;border-width:var(--granite-border-width-focus);border-style:dashed;border-color:var(--granite-color-background-selected);border-radius:var(--granite-radius-m);margin:var(--granite-spacing-8);height:100%}.file-upload-wrapper .file-dropzone.file-error{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;background-color:var(--granite-color-background-lobby-failure);border-color:var(--granite-color-state-error);transition:background .15s ease}.file-upload-wrapper .file-dropzone.file-error .drop-area-placeholder{margin:0}.file-upload-wrapper .file-dropzone.file-over{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;background-color:var(--granite-color-background-lobby-info);border-color:var(--granite-color-background-active);transition:background .15s ease}.file-upload-wrapper .file-dropzone.file-over .drop-area-placeholder{margin:0}.file-upload-wrapper .file-dropzone .file-input{opacity:0;position:absolute;width:0}.file-upload-wrapper .file-dropzone .file-upload-body{display:flex;align-items:center;justify-content:center;height:100%}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse{display:flex;flex-direction:column;gap:var(--granite-spacing-4);justify-content:center;align-items:center;padding:0 var(--granite-spacing-16)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-upload-icon{font-size:var(--granite-font-size-display-small);color:var(--granite-color-text)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection{display:flex;justify-content:space-between;align-items:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-upload-body-text{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;width:100%;margin-inline-end:var(--granite-spacing-4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button{display:flex;justify-content:space-between;align-items:center;color:var(--granite-color-text-link);padding-top:calc(var(--granite-spacing-24) / 4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button .browse-button-icon{font-size:var(--granite-font-size-body);color:var(--granite-color-text-link);margin-inline-end:var(--granite-spacing-4);padding:0}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button .browse-button-text{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:calc(var(--granite-line-height-flowing) / 2);margin-top:var(--granite-spacing-4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button:hover .browse-button-icon,.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button:hover .browse-button-text{color:var(--granite-color-text-inverse)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-upload-hint{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:18px;text-align:center;color:var(--granite-color-text-hint);margin:10px 0 0}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container{display:flex;flex-direction:column;align-items:center;width:100%;max-height:100%;padding:6px}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link{display:flex;flex-direction:column;align-items:center;width:100%;text-decoration:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed{opacity:.6;pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link:hover .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link:hover .file-size{text-decoration:underline}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder{width:80px;height:114px;background-color:var(--granite-color-background-variant)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder img{max-width:100%;max-height:100%;aspect-ratio:2/1;object-fit:cover;object-position:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-name{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:10px;color:var(--granite-color-text-link);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:6px 0 0;width:100%;text-align:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-size{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:10px;color:var(--granite-color-text-link);margin:0 0 14px}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .loading-container,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .failed-icon-container{position:absolute;transform:translateY(100%)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .loading-container .uploading-spinner,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .failed-icon-container .uploading-spinner{width:50px;height:50px;border-radius:50%;border:6px solid;border-color:var(--granite-color-background-page);border-right-color:var(--granite-color-background-active);animation:loading-keyframe 1s infinite linear}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .loading-container .error-icon,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .failed-icon-container .error-icon{color:var(--granite-color-state-error);font-size:35px;padding:0}.file-upload-wrapper .file-upload-footer{margin-inline:var(--granite-spacing-8);margin-bottom:var(--granite-spacing-8)}.file-upload-wrapper .file-upload-footer .footer-container{display:flex;justify-content:flex-end;align-items:center}.file-upload-wrapper .file-upload-footer .footer-container .retry-upload-button{margin-inline-start:var(--granite-spacing-8)}@keyframes loading-keyframe{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: GraniteButtonComponent, selector: "button[graniteButton],\n button[granitePrimaryButton],\n button[graniteFlatButton],\n button[graniteToolbarButton]\n ", inputs: ["disabled", "toggled"], exportAs: ["graniteButton"] }, { kind: "component", type: GraniteIconComponent, selector: "granite-icon", inputs: ["fontIcon"] }, { kind: "directive", type: GraniteFileDragAndDropDirective, selector: "[graniteFileDragAndDrop]", inputs: ["multiFileUploadEnabled", "accept", "currentFiles"], outputs: ["droppedFiles", "isFileOver", "fileUploadValidation"], exportAs: ["graniteFileDragAndDrop"] }] }); }
5129
+ }
5130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteFileUploadComponent, decorators: [{
5131
+ type: Component,
5132
+ args: [{ selector: 'granite-file-upload', template: "<div class=\"file-upload-wrapper\">\n <h2 class=\"file-upload-title\">{{ uploadTitle }}</h2>\n <div\n class=\"file-dropzone\"\n graniteFileDragAndDrop\n (droppedFiles)=\"onFilesDropHandler($event)\"\n (isFileOver)=\"onFileOverDropzone($event)\"\n (fileUploadValidation)=\"onFileDropError($event)\"\n [multiFileUploadEnabled]=\"supportMultiFileUpload\"\n [accept]=\"accept\"\n [currentFiles]=\"selectedFiles\"\n >\n <input\n class=\"file-input\"\n #fileDropRef\n type=\"file\"\n title=\"fileUpload\"\n (change)=\"fileBrowseHandler($event)\"\n [multiple]=\"supportMultiFileUpload\"\n [accept]=\"accept\"\n />\n <div class=\"file-upload-body\">\n <ng-template #dropPlaceholder>\n <p class=\"drop-area-placeholder\">\n {{ dropPlaceholderText }}\n </p>\n </ng-template>\n <ng-container\n *ngIf=\"!isFileOnDropzone && !fileError; else dropPlaceholder\"\n >\n <div\n class=\"file-upload-browse\"\n *ngIf=\"previewReadyFiles.length === 0; else filePreview\"\n >\n <granite-icon\n class=\"file-upload-icon\"\n [fontIcon]=\"uploadIcon\"\n ></granite-icon>\n <div class=\"file-selection\">\n <h2 class=\"file-upload-body-text\">{{ dropZoneText }}</h2>\n <button\n class=\"file-select-button\"\n graniteButton\n (click)=\"fileDropRef.click()\"\n >\n <granite-icon\n class=\"browse-button-icon\"\n [fontIcon]=\"browseIcon\"\n ></granite-icon>\n <div class=\"browse-button-text\">{{ browseButtonText }}</div>\n </button>\n </div>\n <p *ngIf=\"dropZoneHint\" class=\"file-upload-hint\">\n {{ dropZoneHint }}\n </p>\n </div>\n <ng-template #filePreview>\n <div\n class=\"file-preview-container\"\n *ngFor=\"let previewFile of previewReadyFiles; let i = index\"\n >\n <a\n class=\"file-preview-link\"\n [ngClass]=\"{\n 'uploading-in-progress':\n uploadStatus === FileUploadStatus.InProgress,\n 'upload-failed': uploadStatus === FileUploadStatus.Failed\n }\"\n [href]=\"previewFile?.imageUrl\"\n target=\"_blank\"\n >\n <div class=\"file-preview-holder\">\n <img\n role=\"presentation\"\n [src]=\"previewFile?.imageUrl\"\n [alt]=\"previewFile?.file?.name\"\n />\n </div>\n <p class=\"file-name\" [title]=\"previewFile?.file?.name\">\n {{ previewFile?.file?.name }}\n </p>\n <p class=\"file-size\">{{ previewFile?.readableSize }}</p>\n </a>\n <div\n class=\"loading-container\"\n *ngIf=\"uploadStatus === FileUploadStatus.InProgress\"\n >\n <div class=\"uploading-spinner\"></div>\n </div>\n <div\n class=\"failed-icon-container\"\n *ngIf=\"uploadStatus === FileUploadStatus.Failed\"\n >\n <granite-icon\n class=\"error-icon\"\n [fontIcon]=\"errorIcon\"\n ></granite-icon>\n </div>\n <button\n graniteButton\n *ngIf=\"\n [\n FileUploadStatus.Completed,\n FileUploadStatus.NotStarted\n ].includes(uploadStatus)\n \"\n (click)=\"fileRemoveHandler(i)\"\n >\n {{ removeButtonText }}\n </button>\n </div>\n </ng-template>\n </ng-container>\n </div>\n </div>\n <div class=\"file-upload-footer\">\n <div class=\"footer-container\" *ngIf=\"previewReadyFiles.length > 0\">\n <button\n *ngIf=\"!autoUpload && uploadStatus === FileUploadStatus.NotStarted\"\n granitePrimaryButton\n (click)=\"uploadFiles()\"\n >\n {{ uploadButtonText }}\n </button>\n <ng-container *ngIf=\"uploadStatus === FileUploadStatus.Failed\">\n <button graniteButton (click)=\"cancelUpload()\">\n {{ cancelButtonText }}\n </button>\n <button\n class=\"retry-upload-button\"\n granitePrimaryButton\n (click)=\"retryUpload()\"\n >\n {{ retryButtonText }}\n </button>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: [":host{width:100%}.file-upload-wrapper{display:flex;flex-direction:column;background-color:var(--granite-color-background);box-shadow:var(--granite-shadow-s);height:100%;width:100%}.file-upload-wrapper .file-upload-title{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-medium);font-weight:var(--granite-font-weight-bold);line-height:var(--granite-line-height-base-rem);color:var(--granite-color-text-weak);margin:0;padding:var(--granite-spacing-8) calc(var(--granite-spacing-16) * .813)}.file-upload-wrapper .file-dropzone{display:flex;flex-direction:column;border-width:var(--granite-border-width-focus);border-style:dashed;border-color:var(--granite-color-background-selected);border-radius:var(--granite-radius-m);margin:var(--granite-spacing-8);height:100%}.file-upload-wrapper .file-dropzone.file-error{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;background-color:var(--granite-color-background-lobby-failure);border-color:var(--granite-color-state-error);transition:background .15s ease}.file-upload-wrapper .file-dropzone.file-error .drop-area-placeholder{margin:0}.file-upload-wrapper .file-dropzone.file-over{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;background-color:var(--granite-color-background-lobby-info);border-color:var(--granite-color-background-active);transition:background .15s ease}.file-upload-wrapper .file-dropzone.file-over .drop-area-placeholder{margin:0}.file-upload-wrapper .file-dropzone .file-input{opacity:0;position:absolute;width:0}.file-upload-wrapper .file-dropzone .file-upload-body{display:flex;align-items:center;justify-content:center;height:100%}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse{display:flex;flex-direction:column;gap:var(--granite-spacing-4);justify-content:center;align-items:center;padding:0 var(--granite-spacing-16)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-upload-icon{font-size:var(--granite-font-size-display-small);color:var(--granite-color-text)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection{display:flex;justify-content:space-between;align-items:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-upload-body-text{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-flowing);color:var(--granite-color-text);text-align:center;width:100%;margin-inline-end:var(--granite-spacing-4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button{display:flex;justify-content:space-between;align-items:center;color:var(--granite-color-text-link);padding-top:calc(var(--granite-spacing-24) / 4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button .browse-button-icon{font-size:var(--granite-font-size-body);color:var(--granite-color-text-link);margin-inline-end:var(--granite-spacing-4);padding:0}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button .browse-button-text{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:calc(var(--granite-line-height-flowing) / 2);margin-top:var(--granite-spacing-4)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button:hover .browse-button-icon,.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-selection .file-select-button:hover .browse-button-text{color:var(--granite-color-text-inverse)}.file-upload-wrapper .file-dropzone .file-upload-body .file-upload-browse .file-upload-hint{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);line-height:18px;text-align:center;color:var(--granite-color-text-hint);margin:10px 0 0}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container{display:flex;flex-direction:column;align-items:center;width:100%;max-height:100%;padding:6px}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link{display:flex;flex-direction:column;align-items:center;width:100%;text-decoration:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.uploading-in-progress,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link.upload-failed{opacity:.6;pointer-events:none}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link:hover .file-name,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link:hover .file-size{text-decoration:underline}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder{width:80px;height:114px;background-color:var(--granite-color-background-variant)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-preview-holder img{max-width:100%;max-height:100%;aspect-ratio:2/1;object-fit:cover;object-position:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-name{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:10px;color:var(--granite-color-text-link);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:6px 0 0;width:100%;text-align:center}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .file-preview-link .file-size{font-family:var(--granite-font-family-default);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-regular);line-height:10px;color:var(--granite-color-text-link);margin:0 0 14px}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .loading-container,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .failed-icon-container{position:absolute;transform:translateY(100%)}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .loading-container .uploading-spinner,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .failed-icon-container .uploading-spinner{width:50px;height:50px;border-radius:50%;border:6px solid;border-color:var(--granite-color-background-page);border-right-color:var(--granite-color-background-active);animation:loading-keyframe 1s infinite linear}.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .loading-container .error-icon,.file-upload-wrapper .file-dropzone .file-upload-body .file-preview-container .failed-icon-container .error-icon{color:var(--granite-color-state-error);font-size:35px;padding:0}.file-upload-wrapper .file-upload-footer{margin-inline:var(--granite-spacing-8);margin-bottom:var(--granite-spacing-8)}.file-upload-wrapper .file-upload-footer .footer-container{display:flex;justify-content:flex-end;align-items:center}.file-upload-wrapper .file-upload-footer .footer-container .retry-upload-button{margin-inline-start:var(--granite-spacing-8)}@keyframes loading-keyframe{to{transform:rotate(360deg)}}\n"] }]
5133
+ }], propDecorators: { fileDropRef: [{
5134
+ type: ViewChild,
5135
+ args: ['fileDropRef', { read: ElementRef }]
5136
+ }], accept: [{
5137
+ type: Input
5138
+ }], uploadTitle: [{
5139
+ type: Input
5140
+ }], uploadIcon: [{
5141
+ type: Input
5142
+ }], browseIcon: [{
5143
+ type: Input
5144
+ }], errorIcon: [{
5145
+ type: Input
5146
+ }], dropZoneText: [{
5147
+ type: Input
5148
+ }], browseButtonText: [{
5149
+ type: Input
5150
+ }], dropPlaceholderText: [{
5151
+ type: Input
5152
+ }], dropZoneHint: [{
5153
+ type: Input
5154
+ }], removeButtonText: [{
5155
+ type: Input
5156
+ }], uploadButtonText: [{
5157
+ type: Input
5158
+ }], retryButtonText: [{
5159
+ type: Input
5160
+ }], cancelButtonText: [{
5161
+ type: Input
5162
+ }], browseOrDragFiles: [{
5163
+ type: Output
5164
+ }], removeFiles: [{
5165
+ type: Output
5166
+ }], filesUpload: [{
5167
+ type: Output
5168
+ }], fileUploadValidation: [{
5169
+ type: Output
5170
+ }], uploadStatus: [{
5171
+ type: Input
5172
+ }], autoUpload: [{
5173
+ type: Input
5174
+ }] } });
5175
+
5176
+ class GraniteFileUploadModule {
5177
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteFileUploadModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
5178
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.4", ngImport: i0, type: GraniteFileUploadModule, declarations: [GraniteFileUploadComponent, GraniteFileDragAndDropDirective], imports: [CommonModule, GraniteButtonModule, GraniteIconModule], exports: [GraniteFileUploadComponent] }); }
5179
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteFileUploadModule, imports: [CommonModule, GraniteButtonModule, GraniteIconModule] }); }
5180
+ }
5181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: GraniteFileUploadModule, decorators: [{
5182
+ type: NgModule,
5183
+ args: [{
5184
+ declarations: [GraniteFileUploadComponent, GraniteFileDragAndDropDirective],
5185
+ exports: [GraniteFileUploadComponent],
5186
+ imports: [CommonModule, GraniteButtonModule, GraniteIconModule],
5187
+ }]
5188
+ }] });
5189
+
4863
5190
  class GraniteCollapsibleConditionalBodyDirective {
4864
5191
  constructor() {
4865
5192
  this.template = inject(TemplateRef);
@@ -4957,5 +5284,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
4957
5284
  * Generated bundle index. Do not edit.
4958
5285
  */
4959
5286
 
4960
- export { ButtonSelectors, CONTACT_DEFAULT_STATUS, ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, ContactItemDefaultStatusComponent, GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, GraniteAnchorComponent, GraniteArrangeGridComponent, GraniteArrangeGridItemComponent, GraniteArrangeGridModule, GraniteArrangeGridOrientation, GraniteBadgeComponent, GraniteBadgeHarness, GraniteBadgeModule, GraniteButtonComponent, GraniteButtonModule, GraniteCardActionsComponent, GraniteCardAvatarComponent, GraniteCardBodyComponent, GraniteCardComponent, GraniteCardContentComponent, GraniteCardFooterComponent, GraniteCardHeaderComponent, GraniteCardHeaderSubTitleComponent, GraniteCardHeaderTitleComponent, GraniteCardListComponent, GraniteCardListModule, GraniteCheckboxComponent, GraniteCheckboxGroupComponent, GraniteCheckboxModule, GraniteChipComponent, GraniteChipInputDirective, GraniteChipListComponent, GraniteChipSelectionChangeEvent, GraniteChipsModule, GraniteCollapsibleConditionalBodyDirective, GraniteCollapsibleConditionalHeaderDirective, GraniteCollapsibleGroupComponent, GraniteCollapsibleGroupModule, GraniteContactItemComponent, GraniteContactItemTitleComponent, GraniteContactsComponent, GraniteContactsModule, GraniteContactsProfileComponent, GraniteContactsTriggerForDirective, GraniteCoreModule, GraniteCustomProfileDirective, GraniteCustomStatusDirective, GraniteDividerDirective, GraniteGridComponent, GraniteGridItemComponent, GraniteGridModule, GraniteHideOnOverflowDirective, GraniteIconComponent, GraniteIconModule, GraniteInputFieldComponent, GraniteInputFieldModule, GraniteLabelComponent, GraniteLabelModule, GraniteMenuComponent, GraniteMenuHarness, GraniteMenuItemComponent, GraniteMenuItemHarness, GraniteMenuModule, GraniteMenuTouchCloseComponent, GraniteMenuTouchTitleItemComponent, GraniteMenuTriggerForDirective, GraniteProgressBarComponent, GraniteProgressBarModule, GraniteRadioButtonComponent, GraniteRadioButtonModule, GraniteRadioGroupComponent, GraniteTitleDirective, GraniteTitlePipe, GraniteToggleSwitchComponent, GraniteToggleSwitchModule, PurePipesModule, deviceDesktop, deviceTouch, disabledMixin, graniteMenuDesktopAnimations, graniteMenuTouchAnimations };
5287
+ export { ButtonSelectors, CONTACT_DEFAULT_STATUS, ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, ContactItemDefaultStatusComponent, GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, GraniteAnchorComponent, GraniteArrangeGridComponent, GraniteArrangeGridItemComponent, GraniteArrangeGridModule, GraniteArrangeGridOrientation, GraniteBadgeComponent, GraniteBadgeHarness, GraniteBadgeModule, GraniteButtonComponent, GraniteButtonModule, GraniteCardActionsComponent, GraniteCardAvatarComponent, GraniteCardBodyComponent, GraniteCardComponent, GraniteCardContentComponent, GraniteCardFooterComponent, GraniteCardHeaderComponent, GraniteCardHeaderSubTitleComponent, GraniteCardHeaderTitleComponent, GraniteCardListComponent, GraniteCardListModule, GraniteCheckboxComponent, GraniteCheckboxGroupComponent, GraniteCheckboxModule, GraniteChipComponent, GraniteChipInputDirective, GraniteChipListComponent, GraniteChipSelectionChangeEvent, GraniteChipsModule, GraniteCollapsibleConditionalBodyDirective, GraniteCollapsibleConditionalHeaderDirective, GraniteCollapsibleGroupComponent, GraniteCollapsibleGroupModule, GraniteContactItemComponent, GraniteContactItemTitleComponent, GraniteContactsComponent, GraniteContactsModule, GraniteContactsProfileComponent, GraniteContactsTriggerForDirective, GraniteCoreModule, GraniteCustomProfileDirective, GraniteCustomStatusDirective, GraniteDividerDirective, GraniteFileUploadComponent, GraniteFileUploadModule, GraniteGridComponent, GraniteGridItemComponent, GraniteGridModule, GraniteHideOnOverflowDirective, GraniteIconComponent, GraniteIconModule, GraniteInputFieldComponent, GraniteInputFieldModule, GraniteLabelComponent, GraniteLabelModule, GraniteMenuComponent, GraniteMenuHarness, GraniteMenuItemComponent, GraniteMenuItemHarness, GraniteMenuModule, GraniteMenuTouchCloseComponent, GraniteMenuTouchTitleItemComponent, GraniteMenuTriggerForDirective, GraniteProgressBarComponent, GraniteProgressBarModule, GraniteRadioButtonComponent, GraniteRadioButtonModule, GraniteRadioGroupComponent, GraniteTitleDirective, GraniteTitlePipe, GraniteToggleSwitchComponent, GraniteToggleSwitchModule, PurePipesModule, deviceDesktop, deviceTouch, disabledMixin, graniteMenuDesktopAnimations, graniteMenuTouchAnimations };
4961
5288
  //# sourceMappingURL=ifsworld-granite-components.mjs.map