@ifsworld/granite-components 12.1.2 → 12.3.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.
Files changed (27) hide show
  1. package/esm2022/index.mjs +4 -1
  2. package/esm2022/lib/file-upload/directives/file-drag-and-drop.directive.mjs +102 -0
  3. package/esm2022/lib/file-upload/file-upload.component.mjs +168 -0
  4. package/esm2022/lib/file-upload/file-upload.constants.mjs +39 -0
  5. package/esm2022/lib/file-upload/file-upload.module.mjs +21 -0
  6. package/esm2022/lib/file-upload/file-upload.utils.mjs +13 -0
  7. package/esm2022/lib/progress-bar/progress-bar-legend/progress-bar-legend.component.mjs +19 -0
  8. package/esm2022/lib/progress-bar/progress-bar-legend-base.mjs +20 -0
  9. package/esm2022/lib/progress-bar/progress-bar-legend-trigger-for.directive.mjs +191 -0
  10. package/esm2022/lib/progress-bar/progress-bar.component.mjs +18 -3
  11. package/esm2022/lib/progress-bar/progress-bar.model.mjs +2 -0
  12. package/esm2022/lib/progress-bar/progress-bar.module.mjs +29 -5
  13. package/fesm2022/ifsworld-granite-components.mjs +590 -23
  14. package/fesm2022/ifsworld-granite-components.mjs.map +1 -1
  15. package/index.d.ts +3 -0
  16. package/lib/file-upload/directives/file-drag-and-drop.directive.d.ts +18 -0
  17. package/lib/file-upload/file-upload.component.d.ts +48 -0
  18. package/lib/file-upload/file-upload.constants.d.ts +35 -0
  19. package/lib/file-upload/file-upload.module.d.ts +11 -0
  20. package/lib/file-upload/file-upload.utils.d.ts +1 -0
  21. package/lib/progress-bar/progress-bar-legend/progress-bar-legend.component.d.ts +8 -0
  22. package/lib/progress-bar/progress-bar-legend-base.d.ts +17 -0
  23. package/lib/progress-bar/progress-bar-legend-trigger-for.directive.d.ts +41 -0
  24. package/lib/progress-bar/progress-bar.component.d.ts +5 -8
  25. package/lib/progress-bar/progress-bar.model.d.ts +11 -0
  26. package/lib/progress-bar/progress-bar.module.d.ts +8 -4
  27. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -50,6 +50,7 @@ export * from './lib/contacts/custom-profile.directive';
50
50
  export * from './lib/contacts/contacts-types/contacts.component.public-types';
51
51
  export * from './lib/progress-bar/progress-bar.module';
52
52
  export * from './lib/progress-bar/progress-bar.component';
53
+ export * from './lib/progress-bar/progress-bar.model';
53
54
  export * from './lib/core/client-environment';
54
55
  export * from './lib/core/core.module';
55
56
  export * from './lib/core/devices/client-output-touch.directive';
@@ -72,6 +73,8 @@ export * from './lib/card-list/card/card-avatar.component';
72
73
  export * from './lib/card-list/card/card-content/card-header-title.component';
73
74
  export * from './lib/card-list/card/card-content/card-header-subtitle.component';
74
75
  export * from './lib/card-list/card/card-content/card-footer.component';
76
+ export * from './lib/file-upload/file-upload.module';
77
+ export * from './lib/file-upload/file-upload.component';
75
78
  export * from './lib/collapsible-group/collapsible-group.module';
76
79
  export * from './lib/collapsible-group/collapsible-group.component';
77
80
  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;
@@ -0,0 +1,8 @@
1
+ import { LegendBaseComponent } from '../progress-bar-legend-base';
2
+ import { GraniteProgressLegendInterface } from '../progress-bar.model';
3
+ import * as i0 from "@angular/core";
4
+ export declare class GraniteProgressBarLegendComponent extends LegendBaseComponent {
5
+ legendItems: GraniteProgressLegendInterface[];
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteProgressBarLegendComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<GraniteProgressBarLegendComponent, "granite-progress-bar-legend", never, { "legendItems": { "alias": "legendItems"; "required": false; }; }, {}, never, never, false, never>;
8
+ }
@@ -0,0 +1,17 @@
1
+ import { Direction } from '@angular/cdk/bidi';
2
+ import { TemplateRef } from '@angular/core';
3
+ import { ClientInputInterface, ClientOutputInterface } from '../core/client-environment';
4
+ import * as i0 from "@angular/core";
5
+ export type PositionX = 'before' | 'after';
6
+ export type PositionY = 'above' | 'below';
7
+ export declare class LegendBaseComponent {
8
+ templateRef: TemplateRef<any>;
9
+ xPosition: PositionX;
10
+ yPosition: PositionY;
11
+ direction: Direction;
12
+ readonly panelId: string;
13
+ clientInput: ClientInputInterface;
14
+ clientOutput: ClientOutputInterface;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<LegendBaseComponent, never>;
16
+ static ɵdir: i0.ɵɵDirectiveDeclaration<LegendBaseComponent, never, never, {}, {}, never, never, false, never>;
17
+ }
@@ -0,0 +1,41 @@
1
+ import { ElementRef, OnDestroy, ViewContainerRef } from '@angular/core';
2
+ import { Overlay, OverlayOutsideClickDispatcher } from '@angular/cdk/overlay';
3
+ import { ClientInputInterface, ClientOutputInterface } from '../core/client-environment';
4
+ import { Directionality } from '@angular/cdk/bidi';
5
+ import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y';
6
+ import { GraniteProgressBarLegendComponent } from './progress-bar-legend/progress-bar-legend.component';
7
+ import * as i0 from "@angular/core";
8
+ export declare class GraniteProgressBarLegendTriggerForDirective implements OnDestroy {
9
+ private _overlay;
10
+ private _element;
11
+ private _viewContainerRef;
12
+ private _outsideClickDispatcher;
13
+ /** Client input device information */
14
+ _clientInput: ClientInputInterface;
15
+ /** Client output device information */
16
+ _clientOutput: ClientOutputInterface;
17
+ private _dir;
18
+ private _focusMonitor;
19
+ legend: GraniteProgressBarLegendComponent;
20
+ _isLegendOpen: boolean;
21
+ private _portal;
22
+ private _overlayRef;
23
+ constructor(_overlay: Overlay, _element: ElementRef<HTMLElement>, _viewContainerRef: ViewContainerRef, _outsideClickDispatcher: OverlayOutsideClickDispatcher,
24
+ /** Client input device information */
25
+ _clientInput: ClientInputInterface,
26
+ /** Client output device information */
27
+ _clientOutput: ClientOutputInterface, _dir: Directionality, _focusMonitor: FocusMonitor);
28
+ ngOnDestroy(): void;
29
+ openLegend(): void;
30
+ toggleLegend(): void;
31
+ closeLegend(): void;
32
+ _handleKeydown(event: KeyboardEvent): void;
33
+ _handleClick(): void;
34
+ _restoreFocus(origin?: FocusOrigin, options?: FocusOptions): void;
35
+ private _desktopPositionStrategy;
36
+ private _setPosition;
37
+ private _positionStrategy;
38
+ private _touchPositionStrategy;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<GraniteProgressBarLegendTriggerForDirective, [null, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, null]>;
40
+ static ɵdir: i0.ɵɵDirectiveDeclaration<GraniteProgressBarLegendTriggerForDirective, "[graniteProgressBarLegendTriggerFor]", never, { "legend": { "alias": "graniteProgressBarLegendTriggerFor"; "required": false; }; }, {}, never, never, false, never>;
41
+ }
@@ -1,13 +1,16 @@
1
1
  import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import { GraniteProgressInterface, GraniteProgressLegendInterface } from './progress-bar.model';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class GraniteProgressBarComponent implements OnChanges {
4
5
  progressBarData: GraniteProgressInterface[];
5
6
  showLabel: boolean;
7
+ showLegend: boolean;
6
8
  DEFAULT_TOTAL: number;
7
9
  DEFAULT_BACKGROUND: string;
8
10
  DEFAULT_STACK_COLOR: string;
9
11
  DEFAULT_COLOR: string;
10
12
  total: number;
13
+ legendItems: GraniteProgressLegendInterface[];
11
14
  getBackgroundColor(): string;
12
15
  getFontColor(color: string): string;
13
16
  getStackColor(color: string): string;
@@ -16,14 +19,8 @@ export declare class GraniteProgressBarComponent implements OnChanges {
16
19
  getStringOfWidth(width: number): string;
17
20
  checkStackTotal(): void;
18
21
  getStackTotal(): number;
22
+ setLegendItems(): void;
19
23
  ngOnChanges(changes: SimpleChanges): void;
20
24
  static ɵfac: i0.ɵɵFactoryDeclaration<GraniteProgressBarComponent, never>;
21
- static ɵcmp: i0.ɵɵComponentDeclaration<GraniteProgressBarComponent, "granite-progress-bar", ["graniteProgressBar"], { "progressBarData": { "alias": "progressBarData"; "required": false; }; "showLabel": { "alias": "showLabel"; "required": false; }; }, {}, never, never, false, never>;
22
- }
23
- export interface GraniteProgressInterface {
24
- value: number;
25
- label?: string;
26
- valueLabel?: string;
27
- backgroundColor?: string;
28
- foregroundColor?: string;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<GraniteProgressBarComponent, "granite-progress-bar", ["graniteProgressBar"], { "progressBarData": { "alias": "progressBarData"; "required": false; }; "showLabel": { "alias": "showLabel"; "required": false; }; "showLegend": { "alias": "showLegend"; "required": false; }; }, {}, never, never, false, never>;
29
26
  }
@@ -0,0 +1,11 @@
1
+ export interface GraniteProgressInterface {
2
+ value: number;
3
+ label?: string;
4
+ valueLabel?: string;
5
+ backgroundColor?: string;
6
+ foregroundColor?: string;
7
+ }
8
+ export interface GraniteProgressLegendInterface {
9
+ label: string;
10
+ backgroundColor: string;
11
+ }
@@ -1,10 +1,14 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./progress-bar.component";
3
- import * as i2 from "@angular/common";
4
- import * as i3 from "../core/core.module";
5
- import * as i4 from "@ifsworld/granite-components/tooltip";
3
+ import * as i2 from "./progress-bar-legend/progress-bar-legend.component";
4
+ import * as i3 from "./progress-bar-legend-trigger-for.directive";
5
+ import * as i4 from "@angular/common";
6
+ import * as i5 from "../core/core.module";
7
+ import * as i6 from "@ifsworld/granite-components/tooltip";
8
+ import * as i7 from "../icon/icon.module";
9
+ import * as i8 from "../button/button.module";
6
10
  export declare class GraniteProgressBarModule {
7
11
  static ɵfac: i0.ɵɵFactoryDeclaration<GraniteProgressBarModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<GraniteProgressBarModule, [typeof i1.GraniteProgressBarComponent], [typeof i2.CommonModule, typeof i3.GraniteCoreModule, typeof i4.GraniteTooltipModule], [typeof i1.GraniteProgressBarComponent]>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<GraniteProgressBarModule, [typeof i1.GraniteProgressBarComponent, typeof i2.GraniteProgressBarLegendComponent, typeof i3.GraniteProgressBarLegendTriggerForDirective], [typeof i4.CommonModule, typeof i5.GraniteCoreModule, typeof i6.GraniteTooltipModule, typeof i7.GraniteIconModule, typeof i8.GraniteButtonModule], [typeof i1.GraniteProgressBarComponent]>;
9
13
  static ɵinj: i0.ɵɵInjectorDeclaration<GraniteProgressBarModule>;
10
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ifsworld/granite-components",
3
- "version": "12.1.2",
3
+ "version": "12.3.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@angular/cdk": ">=17.3.4",