@datarailsshared/datarailsshared 1.6.310 → 1.6.312
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/datarailsshared-datarailsshared-1.6.312.tgz +0 -0
- package/esm2022/lib/dr-chip/dr-chip.component.mjs +26 -10
- package/esm2022/lib/dr-file-upload/directives/drag-drop.directive.mjs +63 -0
- package/esm2022/lib/dr-file-upload/dr-file-upload-item/dr-file-upload-item.component.mjs +168 -0
- package/esm2022/lib/dr-file-upload/dr-file-upload.component.mjs +512 -0
- package/esm2022/lib/dr-file-upload/index.mjs +6 -0
- package/esm2022/lib/dr-file-upload/models/file-upload.models.mjs +2 -0
- package/esm2022/lib/dr-file-upload/services/file-upload-validation.service.mjs +76 -0
- package/esm2022/lib/dr-file-upload/templates/dr-file-upload-image-template/dr-file-upload-image-template.component.mjs +135 -0
- package/esm2022/lib/dr-progress-bar/dr-progress-bar.component.mjs +39 -8
- package/esm2022/local-api.mjs +2 -1
- package/fesm2022/datarailsshared-datarailsshared.mjs +1233 -256
- package/fesm2022/datarailsshared-datarailsshared.mjs.map +1 -1
- package/lib/dr-chip/dr-chip.component.d.ts +8 -5
- package/lib/dr-file-upload/directives/drag-drop.directive.d.ts +12 -0
- package/lib/dr-file-upload/dr-file-upload-item/dr-file-upload-item.component.d.ts +18 -0
- package/lib/dr-file-upload/dr-file-upload.component.d.ts +66 -0
- package/lib/dr-file-upload/index.d.ts +5 -0
- package/lib/dr-file-upload/models/file-upload.models.d.ts +13 -0
- package/lib/dr-file-upload/services/file-upload-validation.service.d.ts +16 -0
- package/lib/dr-file-upload/templates/dr-file-upload-image-template/dr-file-upload-image-template.component.d.ts +22 -0
- package/lib/dr-progress-bar/dr-progress-bar.component.d.ts +13 -4
- package/local-api.d.ts +1 -0
- package/package.json +1 -1
- package/datarailsshared-datarailsshared-1.6.310.tgz +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class DrChipComponent {
|
|
4
|
-
label
|
|
5
|
-
icon
|
|
6
|
-
removable
|
|
7
|
-
|
|
4
|
+
label?: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
removable?: boolean;
|
|
7
|
+
removeAriaLabel: string;
|
|
8
|
+
readonly remove: EventEmitter<void>;
|
|
9
|
+
onRemove(event: Event): void;
|
|
8
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<DrChipComponent, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DrChipComponent, "dr-chip", never, { "label": { "alias": "label"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; }, { "remove": "remove"; }, never, ["*"], true, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DrChipComponent, "dr-chip", never, { "label": { "alias": "label"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "removeAriaLabel": { "alias": "removeAriaLabel"; "required": false; }; }, { "remove": "remove"; }, never, ["*"], true, never>;
|
|
12
|
+
static ngAcceptInputType_removable: unknown;
|
|
10
13
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DrDragDropDirective {
|
|
4
|
+
readonly fileDrop: EventEmitter<FileList>;
|
|
5
|
+
readonly dragStateChange: EventEmitter<boolean>;
|
|
6
|
+
isDragover: boolean;
|
|
7
|
+
onDragOver(event: DragEvent): void;
|
|
8
|
+
onDragLeave(event: DragEvent): void;
|
|
9
|
+
onDrop(event: DragEvent): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DrDragDropDirective, never>;
|
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DrDragDropDirective, "[drDragDrop]", never, {}, { "fileDrop": "fileDrop"; "dragStateChange": "dragStateChange"; }, never, never, true, never>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { FileUploadItem } from '../models/file-upload.models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class DrFileUploadItemComponent {
|
|
5
|
+
item: FileUploadItem;
|
|
6
|
+
removable: boolean;
|
|
7
|
+
compact: boolean;
|
|
8
|
+
readonly remove: EventEmitter<void>;
|
|
9
|
+
get statusText(): string;
|
|
10
|
+
get statusAriaText(): string;
|
|
11
|
+
get withRemoveButton(): boolean;
|
|
12
|
+
get withActions(): boolean;
|
|
13
|
+
onRemoveClick(): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DrFileUploadItemComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DrFileUploadItemComponent, "dr-file-upload-item", never, { "item": { "alias": "item"; "required": true; }; "removable": { "alias": "removable"; "required": false; }; "compact": { "alias": "compact"; "required": false; }; }, { "remove": "remove"; }, never, never, true, never>;
|
|
16
|
+
static ngAcceptInputType_removable: unknown;
|
|
17
|
+
static ngAcceptInputType_compact: unknown;
|
|
18
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, EventEmitter, TemplateRef } from '@angular/core';
|
|
2
|
+
import { FileUploadVariant, FileUploadItem, FileUploadTemplate } from './models/file-upload.models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class DrFileUploadComponent implements AfterViewInit {
|
|
5
|
+
private readonly cdr;
|
|
6
|
+
private readonly validationService;
|
|
7
|
+
variant: FileUploadVariant;
|
|
8
|
+
accept: string;
|
|
9
|
+
/**
|
|
10
|
+
* Specifies the maximum allowed file size for uploads, in megabytes (MB).
|
|
11
|
+
*/
|
|
12
|
+
maxFileSize?: number;
|
|
13
|
+
maxFiles: number;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
validateFormats: boolean;
|
|
16
|
+
dropzoneText: string;
|
|
17
|
+
dropzoneSubtext?: string;
|
|
18
|
+
errorMessage?: string;
|
|
19
|
+
customAriaLabel?: string;
|
|
20
|
+
set files(value: FileUploadItem[]);
|
|
21
|
+
get files(): FileUploadItem[];
|
|
22
|
+
readonly filesChange: EventEmitter<FileUploadItem[]>;
|
|
23
|
+
readonly fileRemove: EventEmitter<File>;
|
|
24
|
+
readonly validationError: EventEmitter<{
|
|
25
|
+
type: 'format' | 'size' | 'limit';
|
|
26
|
+
fileName?: string;
|
|
27
|
+
message: string;
|
|
28
|
+
}>;
|
|
29
|
+
private _files;
|
|
30
|
+
invalidFormatError?: string;
|
|
31
|
+
invalidSizeError?: string;
|
|
32
|
+
overLimitError?: string;
|
|
33
|
+
dropzoneTemplate?: TemplateRef<unknown>;
|
|
34
|
+
fileItemTemplate?: TemplateRef<unknown>;
|
|
35
|
+
browseButtonTemplate?: TemplateRef<unknown>;
|
|
36
|
+
uploadTemplate?: FileUploadTemplate;
|
|
37
|
+
fileInput: ElementRef<HTMLInputElement>;
|
|
38
|
+
isDragover: boolean;
|
|
39
|
+
ngAfterViewInit(): void;
|
|
40
|
+
get isDisabled(): boolean;
|
|
41
|
+
get hasDragover(): boolean;
|
|
42
|
+
get hasFiles(): boolean;
|
|
43
|
+
get isSingle(): boolean;
|
|
44
|
+
get isMultiple(): boolean;
|
|
45
|
+
get computedDropzoneSubtext(): string;
|
|
46
|
+
get validationErrorMessage(): string | undefined;
|
|
47
|
+
get showDropzone(): boolean;
|
|
48
|
+
get uploadedFiles(): FileUploadItem[];
|
|
49
|
+
get failedFilesCount(): number;
|
|
50
|
+
get hasPartialSuccess(): boolean;
|
|
51
|
+
get ariaLabel(): string;
|
|
52
|
+
get dropzoneAriaLabel(): string;
|
|
53
|
+
get acceptDescription(): string;
|
|
54
|
+
trackByFile(_index: number, item: FileUploadItem): string;
|
|
55
|
+
onDragStateChange(isDragover: boolean): void;
|
|
56
|
+
onFileDrop(fileList: FileList): void;
|
|
57
|
+
onBrowseClick(): void;
|
|
58
|
+
onFileInputChange(event: Event): void;
|
|
59
|
+
onFileRemove(item: FileUploadItem): void;
|
|
60
|
+
private handleFiles;
|
|
61
|
+
private clearValidationErrors;
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DrFileUploadComponent, never>;
|
|
63
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DrFileUploadComponent, "dr-file-upload", never, { "variant": { "alias": "variant"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; }; "maxFiles": { "alias": "maxFiles"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "validateFormats": { "alias": "validateFormats"; "required": false; }; "dropzoneText": { "alias": "dropzoneText"; "required": false; }; "dropzoneSubtext": { "alias": "dropzoneSubtext"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "customAriaLabel": { "alias": "aria-label"; "required": false; }; "files": { "alias": "files"; "required": false; }; }, { "filesChange": "filesChange"; "fileRemove": "fileRemove"; "validationError": "validationError"; }, ["dropzoneTemplate", "fileItemTemplate", "browseButtonTemplate", "uploadTemplate"], never, true, never>;
|
|
64
|
+
static ngAcceptInputType_disabled: unknown;
|
|
65
|
+
static ngAcceptInputType_validateFormats: unknown;
|
|
66
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './dr-file-upload.component';
|
|
2
|
+
export * from './dr-file-upload-item/dr-file-upload-item.component';
|
|
3
|
+
export * from './models/file-upload.models';
|
|
4
|
+
export * from './templates/dr-file-upload-image-template/dr-file-upload-image-template.component';
|
|
5
|
+
export * from './services/file-upload-validation.service';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
export type FileUploadVariant = 'single' | 'multiple';
|
|
3
|
+
export type FileUploadItemStatus = 'idle' | 'pending' | 'uploading' | 'success' | 'error';
|
|
4
|
+
export interface FileUploadItem {
|
|
5
|
+
file: File;
|
|
6
|
+
progress: number;
|
|
7
|
+
status: FileUploadItemStatus;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FileUploadTemplate {
|
|
11
|
+
dropzoneTemplate?: TemplateRef<unknown>;
|
|
12
|
+
fileItemTemplate?: TemplateRef<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FileUploadValidationService {
|
|
3
|
+
filterByFormat(files: File[], accept: string): {
|
|
4
|
+
valid: File[];
|
|
5
|
+
invalidFileName?: string;
|
|
6
|
+
};
|
|
7
|
+
filterBySize(files: File[], maxFileSizeMB: number): {
|
|
8
|
+
valid: File[];
|
|
9
|
+
oversizedFileName?: string;
|
|
10
|
+
};
|
|
11
|
+
getAcceptedExtensions(accept: string): string[];
|
|
12
|
+
getAcceptedMimes(accept: string): string[];
|
|
13
|
+
private isFileFormatValid;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FileUploadValidationService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FileUploadValidationService>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, TemplateRef } from '@angular/core';
|
|
2
|
+
import { FileUploadTemplate } from '../../models/file-upload.models';
|
|
3
|
+
import { ICropImageData } from '../../../image-cropper/dr-image-cropper.types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class DrFileUploadImageTemplateComponent implements FileUploadTemplate, OnDestroy {
|
|
6
|
+
title: string;
|
|
7
|
+
useImageCropper: boolean;
|
|
8
|
+
cropperSize?: number;
|
|
9
|
+
originalImageFile?: File | null;
|
|
10
|
+
imgUrl?: string;
|
|
11
|
+
readonly imageCropped: EventEmitter<ICropImageData>;
|
|
12
|
+
dropzoneTemplate: TemplateRef<unknown>;
|
|
13
|
+
fileItemTemplate: TemplateRef<unknown>;
|
|
14
|
+
private imageUrlCache;
|
|
15
|
+
private createdUrls;
|
|
16
|
+
ngOnDestroy(): void;
|
|
17
|
+
onCropChanged(data: ICropImageData): void;
|
|
18
|
+
getImageUrl(file: File): string;
|
|
19
|
+
revokeImageUrl(file: File): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DrFileUploadImageTemplateComponent, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DrFileUploadImageTemplateComponent, "dr-file-upload-image-template", never, { "title": { "alias": "title"; "required": false; }; "useImageCropper": { "alias": "useImageCropper"; "required": false; }; "cropperSize": { "alias": "cropperSize"; "required": false; }; "originalImageFile": { "alias": "originalImageFile"; "required": false; }; "imgUrl": { "alias": "imgUrl"; "required": false; }; }, { "imageCropped": "imageCropped"; }, never, never, true, never>;
|
|
22
|
+
}
|
|
@@ -2,14 +2,23 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
export type TProgressBarTheme = 'light' | 'dark';
|
|
3
3
|
export declare class DrProgressBarComponent {
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Progress value from 0 to 100
|
|
6
6
|
*/
|
|
7
|
-
progress
|
|
7
|
+
progress?: number;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Option to hide value label
|
|
10
10
|
*/
|
|
11
11
|
showValue: boolean;
|
|
12
12
|
theme: TProgressBarTheme;
|
|
13
|
+
/**
|
|
14
|
+
* Custom accessible label for screen readers
|
|
15
|
+
*/
|
|
16
|
+
customAriaLabel?: string;
|
|
17
|
+
readonly role = "progressbar";
|
|
18
|
+
readonly ariaValueMin = 0;
|
|
19
|
+
readonly ariaValueMax = 100;
|
|
20
|
+
get ariaValueNow(): number;
|
|
21
|
+
get ariaLabel(): string;
|
|
13
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<DrProgressBarComponent, never>;
|
|
14
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DrProgressBarComponent, "dr-progress-bar", never, { "progress": { "alias": "progress"; "required":
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DrProgressBarComponent, "dr-progress-bar", never, { "progress": { "alias": "progress"; "required": false; }; "showValue": { "alias": "showValue"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "customAriaLabel": { "alias": "aria-label"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
15
24
|
}
|
package/local-api.d.ts
CHANGED
package/package.json
CHANGED
|
Binary file
|