@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.
package/index.d.ts CHANGED
@@ -72,6 +72,8 @@ export * from './lib/card-list/card/card-avatar.component';
72
72
  export * from './lib/card-list/card/card-content/card-header-title.component';
73
73
  export * from './lib/card-list/card/card-content/card-header-subtitle.component';
74
74
  export * from './lib/card-list/card/card-content/card-footer.component';
75
+ export * from './lib/file-upload/file-upload.module';
76
+ export * from './lib/file-upload/file-upload.component';
75
77
  export * from './lib/collapsible-group/collapsible-group.module';
76
78
  export * from './lib/collapsible-group/collapsible-group.component';
77
79
  export * from './lib/collapsible-group/collapsible-group-body.directive';
@@ -0,0 +1,18 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { FileUploadError } from '../file-upload.constants';
3
+ import * as i0 from "@angular/core";
4
+ export declare class GraniteFileDragAndDropDirective {
5
+ fileOver: boolean;
6
+ fileBrowseError: boolean;
7
+ multiFileUploadEnabled: boolean;
8
+ accept: string;
9
+ currentFiles: File[];
10
+ droppedFiles: EventEmitter<File[]>;
11
+ isFileOver: EventEmitter<boolean>;
12
+ fileUploadValidation: EventEmitter<FileUploadError>;
13
+ onDragOver(event: DragEvent): void;
14
+ onDragLeave(event: DragEvent): void;
15
+ onDrop(event: DragEvent): void;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteFileDragAndDropDirective, never>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GraniteFileDragAndDropDirective, "[graniteFileDragAndDrop]", ["graniteFileDragAndDrop"], { "multiFileUploadEnabled": { "alias": "multiFileUploadEnabled"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "currentFiles": { "alias": "currentFiles"; "required": false; }; }, { "droppedFiles": "droppedFiles"; "isFileOver": "isFileOver"; "fileUploadValidation": "fileUploadValidation"; }, never, never, false, never>;
18
+ }
@@ -0,0 +1,48 @@
1
+ import { ElementRef, EventEmitter } from '@angular/core';
2
+ import { FileUploadError, FileUploadStatus, SelectedFile } from './file-upload.constants';
3
+ import * as i0 from "@angular/core";
4
+ export declare class GraniteFileUploadComponent {
5
+ fileDropRef: ElementRef<HTMLInputElement>;
6
+ accept: string;
7
+ uploadTitle: string;
8
+ uploadIcon: string;
9
+ browseIcon: string;
10
+ errorIcon: string;
11
+ dropZoneText: string;
12
+ browseButtonText: string;
13
+ dropPlaceholderText: string;
14
+ dropZoneHint: string;
15
+ removeButtonText: string;
16
+ uploadButtonText: string;
17
+ retryButtonText: string;
18
+ cancelButtonText: string;
19
+ browseOrDragFiles: EventEmitter<SelectedFile[]>;
20
+ removeFiles: EventEmitter<SelectedFile[]>;
21
+ filesUpload: EventEmitter<void>;
22
+ fileUploadValidation: EventEmitter<FileUploadError>;
23
+ selectedFiles: File[];
24
+ previewReadyFiles: SelectedFile[];
25
+ isFileOnDropzone: boolean;
26
+ FileUploadStatus: typeof FileUploadStatus;
27
+ fileError: boolean;
28
+ fileDropErrorType: string;
29
+ supportMultiFileUpload: boolean;
30
+ protected _uploadStatus: FileUploadStatus;
31
+ get uploadStatus(): FileUploadStatus;
32
+ set uploadStatus(status: FileUploadStatus);
33
+ protected _autoUpload: boolean;
34
+ get autoUpload(): boolean;
35
+ set autoUpload(value: boolean);
36
+ fileBrowseHandler(event: Event): void;
37
+ fileRemoveHandler(index: number): void;
38
+ onFilesDropHandler(files: File[]): void;
39
+ onFileOverDropzone(isFileOver: boolean): void;
40
+ onFileDropError(validation: FileUploadError): void;
41
+ prepareSelectedFiles(files: File[]): SelectedFile[];
42
+ uploadFiles(): void;
43
+ retryUpload(): void;
44
+ cancelUpload(): void;
45
+ formatBytesToReadableSize(bytes: number, decimals: number): string;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteFileUploadComponent, never>;
47
+ static ɵcmp: i0.ɵɵComponentDeclaration<GraniteFileUploadComponent, "granite-file-upload", never, { "accept": { "alias": "accept"; "required": false; }; "uploadTitle": { "alias": "uploadTitle"; "required": false; }; "uploadIcon": { "alias": "uploadIcon"; "required": false; }; "browseIcon": { "alias": "browseIcon"; "required": false; }; "errorIcon": { "alias": "errorIcon"; "required": false; }; "dropZoneText": { "alias": "dropZoneText"; "required": false; }; "browseButtonText": { "alias": "browseButtonText"; "required": false; }; "dropPlaceholderText": { "alias": "dropPlaceholderText"; "required": false; }; "dropZoneHint": { "alias": "dropZoneHint"; "required": false; }; "removeButtonText": { "alias": "removeButtonText"; "required": false; }; "uploadButtonText": { "alias": "uploadButtonText"; "required": false; }; "retryButtonText": { "alias": "retryButtonText"; "required": false; }; "cancelButtonText": { "alias": "cancelButtonText"; "required": false; }; "uploadStatus": { "alias": "uploadStatus"; "required": false; }; "autoUpload": { "alias": "autoUpload"; "required": false; }; }, { "browseOrDragFiles": "browseOrDragFiles"; "removeFiles": "removeFiles"; "filesUpload": "filesUpload"; "fileUploadValidation": "fileUploadValidation"; }, never, never, false, never>;
48
+ }
@@ -0,0 +1,35 @@
1
+ export interface SelectedFile {
2
+ file: File;
3
+ readableSize?: string;
4
+ imageUrl?: string;
5
+ }
6
+ export interface FileUploadError {
7
+ isError: boolean;
8
+ type: FilUploadErrorTypes;
9
+ }
10
+ export declare const fileSizes: string[];
11
+ export declare enum FileUploadStatus {
12
+ NotStarted = "NotStarted",
13
+ InProgress = "InProgress",
14
+ Completed = "Completed",
15
+ Failed = "Failed",
16
+ Cancelled = "Cancelled"
17
+ }
18
+ export declare enum FilUploadErrorTypes {
19
+ ExtensionNotSupported = "ExtensionNotSupported",
20
+ MultipleFilesNotSupported = "MultipleFilesNotSupported"
21
+ }
22
+ export declare const DEFAULT_MULTI_FILE_SUPPORT = false;
23
+ export declare const DEFAULT_ACCEPT_TYPE: string;
24
+ export declare const DEFAULT_UPLOAD_TITLE: string;
25
+ export declare const DEFAULT_UPLOAD_ICON: string;
26
+ export declare const DEFAULT_FILE_BROWSE_BUTTON_ICON: string;
27
+ export declare const DEFAULT_UPLOAD_FAILURE_ICON: string;
28
+ export declare const DEFAULT_DROPZONE_TEXT: string;
29
+ export declare const DEFAULT_BROWSE_BUTTON_TEXT: string;
30
+ export declare const DEFAULT_DROP_PLACEHOLDER_TEXT: string;
31
+ export declare const DEFAULT_DROPZONE_HINT: string;
32
+ export declare const DEFAULT_REMOVE_BUTTON_TEXT: string;
33
+ export declare const DEFAULT_UPLOAD_BUTTON_TEXT: string;
34
+ export declare const DEFAULT_RETRY_BUTTON_TEXT: string;
35
+ export declare const DEFAULT_CANCEL_BUTTON_TEXT: string;
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./file-upload.component";
3
+ import * as i2 from "./directives/file-drag-and-drop.directive";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "../button/button.module";
6
+ import * as i5 from "../icon/icon.module";
7
+ export declare class GraniteFileUploadModule {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteFileUploadModule, never>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<GraniteFileUploadModule, [typeof i1.GraniteFileUploadComponent, typeof i2.GraniteFileDragAndDropDirective], [typeof i3.CommonModule, typeof i4.GraniteButtonModule, typeof i5.GraniteIconModule], [typeof i1.GraniteFileUploadComponent]>;
10
+ static ɵinj: i0.ɵɵInjectorDeclaration<GraniteFileUploadModule>;
11
+ }
@@ -0,0 +1 @@
1
+ export declare function validFileTypes<T>(mimeTypesStringToCheck: string, files: T[]): boolean;
@@ -1,4 +1,4 @@
1
- import { AfterContentInit, ElementRef, OnChanges, OnDestroy, SimpleChanges, ViewContainerRef } from '@angular/core';
1
+ import { AfterContentInit, ChangeDetectorRef, ElementRef, OnChanges, OnDestroy, SimpleChanges, ViewContainerRef } from '@angular/core';
2
2
  import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';
3
3
  import { Directionality } from '@angular/cdk/bidi';
4
4
  import { Overlay } from '@angular/cdk/overlay';
@@ -15,6 +15,7 @@ export declare class GraniteMenuTriggerForDirective implements AfterContentInit,
15
15
  private _overlay;
16
16
  private _element;
17
17
  private _viewContainerRef;
18
+ private _changeDetectionRef;
18
19
  /** If this is a _submenu_ trigger, it will have a parent menu */
19
20
  private _parentMenu;
20
21
  /** Client input device information */
@@ -35,7 +36,7 @@ export declare class GraniteMenuTriggerForDirective implements AfterContentInit,
35
36
  menu: _MenuBaseComponent;
36
37
  openOnClick?: boolean;
37
38
  /** Whether the associated menu is open */
38
- _isMenuOpen: boolean;
39
+ isMenuOpened: boolean;
39
40
  private openedBy;
40
41
  private _hoverSubscription;
41
42
  private _menuCloseSubscription;
@@ -53,7 +54,7 @@ export declare class GraniteMenuTriggerForDirective implements AfterContentInit,
53
54
  private _touchLockedX;
54
55
  private _touchMaxX;
55
56
  private _touchTouchingElement;
56
- constructor(_overlay: Overlay, _element: ElementRef<HTMLElement>, _viewContainerRef: ViewContainerRef,
57
+ constructor(_overlay: Overlay, _element: ElementRef<HTMLElement>, _viewContainerRef: ViewContainerRef, _changeDetectionRef: ChangeDetectorRef,
57
58
  /** If this is a _submenu_ trigger, it will have a parent menu */
58
59
  _parentMenu: _MenuBaseComponent,
59
60
  /** Client input device information */
@@ -186,6 +187,6 @@ export declare class GraniteMenuTriggerForDirective implements AfterContentInit,
186
187
  * @param end Value to which current value is compared
187
188
  */
188
189
  private easeOutExpo;
189
- static ɵfac: i0.ɵɵFactoryDeclaration<GraniteMenuTriggerForDirective, [null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; self: true; }, { optional: true; }, null, null]>;
190
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteMenuTriggerForDirective, [null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; self: true; }, { optional: true; }, null, null]>;
190
191
  static ɵdir: i0.ɵɵDirectiveDeclaration<GraniteMenuTriggerForDirective, "[graniteMenuTriggerFor]", ["graniteMenuTriggerFor"], { "menu": { "alias": "graniteMenuTriggerFor"; "required": false; }; "openOnClick": { "alias": "openOnClick"; "required": false; }; }, {}, never, never, false, never>;
191
192
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ifsworld/granite-components",
3
- "version": "12.1.1",
3
+ "version": "12.2.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@angular/cdk": ">=17.3.4",
@@ -35,17 +35,17 @@
35
35
  "esm": "./esm2022/date-picker/ifsworld-granite-components-date-picker.mjs",
36
36
  "default": "./fesm2022/ifsworld-granite-components-date-picker.mjs"
37
37
  },
38
- "./table": {
39
- "types": "./table/index.d.ts",
40
- "esm2022": "./esm2022/table/ifsworld-granite-components-table.mjs",
41
- "esm": "./esm2022/table/ifsworld-granite-components-table.mjs",
42
- "default": "./fesm2022/ifsworld-granite-components-table.mjs"
43
- },
44
38
  "./tooltip": {
45
39
  "types": "./tooltip/index.d.ts",
46
40
  "esm2022": "./esm2022/tooltip/ifsworld-granite-components-tooltip.mjs",
47
41
  "esm": "./esm2022/tooltip/ifsworld-granite-components-tooltip.mjs",
48
42
  "default": "./fesm2022/ifsworld-granite-components-tooltip.mjs"
43
+ },
44
+ "./table": {
45
+ "types": "./table/index.d.ts",
46
+ "esm2022": "./esm2022/table/ifsworld-granite-components-table.mjs",
47
+ "esm": "./esm2022/table/ifsworld-granite-components-table.mjs",
48
+ "default": "./fesm2022/ifsworld-granite-components-table.mjs"
49
49
  }
50
50
  },
51
51
  "sideEffects": false