valtech-components 2.0.941 → 2.0.942
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/esm2022/lib/components/organisms/attachment-uploader/attachment-uploader.component.mjs +6 -3
- package/esm2022/lib/components/organisms/attachment-uploader/types.mjs +1 -1
- package/esm2022/lib/components/organisms/form/form.component.mjs +51 -6
- package/esm2022/lib/components/types.mjs +2 -1
- package/esm2022/lib/version.mjs +2 -2
- package/fesm2022/valtech-components.mjs +56 -8
- package/fesm2022/valtech-components.mjs.map +1 -1
- package/lib/components/organisms/attachment-uploader/types.d.ts +2 -0
- package/lib/components/organisms/form/form.component.d.ts +10 -0
- package/lib/components/types.d.ts +4 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -11,4 +11,6 @@ export interface AttachmentUploaderMetadata {
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
/** Compress images before upload (default: true). PDFs are never compressed. */
|
|
13
13
|
compressImages?: boolean;
|
|
14
|
+
/** Upload function. If omitted, falls back to FeedbackService.uploadAttachment. */
|
|
15
|
+
uploadFn?: (file: File) => Promise<string>;
|
|
14
16
|
}
|
|
@@ -2,6 +2,7 @@ import { DoCheck, ElementRef, EventEmitter, OnChanges, OnInit, SimpleChanges } f
|
|
|
2
2
|
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
|
|
3
3
|
import { TextareaInputMetadata } from '../../molecules/textarea-input/types';
|
|
4
4
|
import { UsernameInputMetadata } from '../../molecules/username-input/types';
|
|
5
|
+
import { AttachmentItem } from '../attachment-uploader/types';
|
|
5
6
|
import { ButtonMetadata, FormMetadata, FormSubmit, InputMetadata, InputType } from '../../types';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
export declare class FormComponent implements OnInit, OnChanges, DoCheck {
|
|
@@ -16,6 +17,12 @@ export declare class FormComponent implements OnInit, OnChanges, DoCheck {
|
|
|
16
17
|
}>;
|
|
17
18
|
form: FormGroup;
|
|
18
19
|
types: typeof InputType;
|
|
20
|
+
states: {
|
|
21
|
+
ENABLED: "ENABLED";
|
|
22
|
+
DISABLED: "DISABLED";
|
|
23
|
+
WORKING: "WORKING";
|
|
24
|
+
ERROR: "ERROR";
|
|
25
|
+
};
|
|
19
26
|
private subscriptions;
|
|
20
27
|
private actionsCache;
|
|
21
28
|
private fieldPropMemo;
|
|
@@ -23,6 +30,8 @@ export declare class FormComponent implements OnInit, OnChanges, DoCheck {
|
|
|
23
30
|
private textareaPropMemo;
|
|
24
31
|
private selectPropMemo;
|
|
25
32
|
private previousState;
|
|
33
|
+
private previousUploadingCount;
|
|
34
|
+
private uploadingFields;
|
|
26
35
|
constructor(fb: FormBuilder, elementRef: ElementRef);
|
|
27
36
|
ngOnInit(): void;
|
|
28
37
|
ngOnChanges(changes: SimpleChanges): void;
|
|
@@ -38,6 +47,7 @@ export declare class FormComponent implements OnInit, OnChanges, DoCheck {
|
|
|
38
47
|
ngOnDestroy(): void;
|
|
39
48
|
trackSelectChanges(fieldName: string): void;
|
|
40
49
|
submitHandler(token?: string): Promise<void>;
|
|
50
|
+
onAttachmentChange(fieldName: string, items: AttachmentItem[]): void;
|
|
41
51
|
getControl(field: string): FormControl;
|
|
42
52
|
getFieldProp(field: InputMetadata): InputMetadata;
|
|
43
53
|
/**
|
|
@@ -62,7 +62,8 @@ export declare enum InputType {
|
|
|
62
62
|
PHONE = 20,
|
|
63
63
|
CURRENCY = 21,
|
|
64
64
|
CHECKBOX_RADIO = 22,
|
|
65
|
-
HANDLE = 23
|
|
65
|
+
HANDLE = 23,
|
|
66
|
+
ATTACHMENT = 24
|
|
66
67
|
}
|
|
67
68
|
/**
|
|
68
69
|
* Option for select, radio, etc. inputs.
|
|
@@ -158,6 +159,8 @@ export type InputMetadata = {
|
|
|
158
159
|
autoFocus?: boolean;
|
|
159
160
|
/** Custom input styles (only for PIN_CODE type) */
|
|
160
161
|
inputStyles?: Record<string, string>;
|
|
162
|
+
/** Upload function (only for ATTACHMENT type). Receives a File, must resolve to the uploaded URL. */
|
|
163
|
+
uploadFn?: (file: File) => Promise<string>;
|
|
161
164
|
};
|
|
162
165
|
/**
|
|
163
166
|
* A section in a form, grouping multiple fields.
|
package/lib/version.d.ts
CHANGED