@acrodata/gui 2.1.3 → 2.2.1

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,23 +1,26 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
+ import { GuiControl } from '../interface';
2
3
  import * as i0 from "@angular/core";
4
+ export interface FileUploadResponseBody {
5
+ bytes: number;
6
+ mime: string;
7
+ url: string;
8
+ }
3
9
  export declare class GuiFileUploaderConfig {
4
- private http;
10
+ protected http: HttpClient;
5
11
  constructor(http: HttpClient);
6
12
  /**
7
13
  * The file upload URL
8
14
  */
9
15
  url: string;
10
- /**
11
- * The file upload params
12
- */
13
- params: any;
14
16
  /**
15
17
  * The File upload API
16
18
  *
17
- * @param file file data
18
- * @returns
19
+ * @param formData The FormData with file binary
20
+ * @param config The custom upload config that passed from component input
21
+ * @returns The uploaded file url stream
19
22
  */
20
- upload(file: FormData): import("rxjs").Observable<import("@angular/common/http").HttpEvent<any>>;
23
+ upload(formData: FormData, config: Partial<GuiControl>): import("rxjs").Observable<string | null>;
21
24
  static ɵfac: i0.ɵɵFactoryDeclaration<GuiFileUploaderConfig, never>;
22
25
  static ɵprov: i0.ɵɵInjectableDeclaration<GuiFileUploaderConfig>;
23
26
  }
@@ -21,7 +21,7 @@ export declare class GuiFileUploader implements ControlValueAccessor, OnChanges
21
21
  accept: string;
22
22
  fileChange: EventEmitter<string>;
23
23
  url: string;
24
- file: FileUploadContent;
24
+ fileUpload: FileUploadContent;
25
25
  private onChange;
26
26
  private onTouched;
27
27
  constructor(fileUploaderCfg: GuiFileUploaderConfig, cdr: ChangeDetectorRef, iconsRegistry: GuiIconsRegistry);
@@ -30,7 +30,7 @@ export declare class GuiFileUploader implements ControlValueAccessor, OnChanges
30
30
  registerOnChange(fn: (value: string) => void): void;
31
31
  registerOnTouched(fn: () => void): void;
32
32
  setDisabledState(isDisabled: boolean): void;
33
- upload(file: FileUploadContent): void;
33
+ upload(fileUpload: FileUploadContent): void;
34
34
  onUrlChange(e: Event): void;
35
35
  onFileChange(e: Event): void;
36
36
  onBlur(): void;
package/interface.d.ts CHANGED
@@ -35,6 +35,7 @@ export interface GuiField {
35
35
  addable?: boolean;
36
36
  mode?: GuiFillMode | GuiSliderMode | GuiTabsMode;
37
37
  rows?: number;
38
+ accept?: string;
38
39
  }
39
40
  export type GuiFields = Record<string, GuiField>;
40
41
  export interface GuiFieldOption {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acrodata/gui",
3
- "version": "2.1.3",
3
+ "version": "2.2.1",
4
4
  "description": "JSON powered GUI for configurable panels.",
5
5
  "publishConfig": {
6
6
  "access": "public"