@unicef-polymer/etools-form-builder 2.1.0 → 2.1.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.
- package/LICENSE +674 -674
- package/README.md +1 -1
- package/dist/form-attachments-popup/form-attachments-popup.d.ts +85 -85
- package/dist/form-attachments-popup/form-attachments-popup.helper.d.ts +8 -8
- package/dist/form-attachments-popup/form-attachments-popup.helper.js +14 -14
- package/dist/form-attachments-popup/form-attachments-popup.js +248 -248
- package/dist/form-attachments-popup/form-attachments-popup.tpl.d.ts +3 -3
- package/dist/form-attachments-popup/form-attachments-popup.tpl.js +89 -89
- package/dist/form-attachments-popup/index.d.ts +2 -2
- package/dist/form-attachments-popup/index.js +2 -2
- package/dist/form-fields/abstract-field-base.class.d.ts +28 -28
- package/dist/form-fields/abstract-field-base.class.js +176 -176
- package/dist/form-fields/field-renderer-component.d.ts +20 -20
- package/dist/form-fields/field-renderer-component.js +249 -249
- package/dist/form-fields/index.d.ts +12 -12
- package/dist/form-fields/index.js +12 -12
- package/dist/form-fields/repeatable-fields/repeatable-attachment-field.d.ts +17 -17
- package/dist/form-fields/repeatable-fields/repeatable-attachment-field.js +208 -208
- package/dist/form-fields/repeatable-fields/repeatable-base-field.d.ts +20 -20
- package/dist/form-fields/repeatable-fields/repeatable-base-field.js +123 -123
- package/dist/form-fields/repeatable-fields/repeatable-number-field.d.ts +10 -10
- package/dist/form-fields/repeatable-fields/repeatable-number-field.js +66 -66
- package/dist/form-fields/repeatable-fields/repeatable-scale-field.d.ts +15 -15
- package/dist/form-fields/repeatable-fields/repeatable-scale-field.js +108 -108
- package/dist/form-fields/repeatable-fields/repeatable-text-field.d.ts +8 -8
- package/dist/form-fields/repeatable-fields/repeatable-text-field.js +53 -53
- package/dist/form-fields/single-fields/attachment-field.d.ts +16 -16
- package/dist/form-fields/single-fields/attachment-field.js +97 -97
- package/dist/form-fields/single-fields/base-field.d.ts +11 -11
- package/dist/form-fields/single-fields/base-field.js +57 -57
- package/dist/form-fields/single-fields/boolean-field.d.ts +8 -8
- package/dist/form-fields/single-fields/boolean-field.js +49 -49
- package/dist/form-fields/single-fields/number-field.d.ts +10 -10
- package/dist/form-fields/single-fields/number-field.js +66 -66
- package/dist/form-fields/single-fields/scale-field.d.ts +18 -18
- package/dist/form-fields/single-fields/scale-field.js +107 -107
- package/dist/form-fields/single-fields/text-field.d.ts +8 -8
- package/dist/form-fields/single-fields/text-field.js +54 -54
- package/dist/form-groups/form-abstract-group.d.ts +60 -60
- package/dist/form-groups/form-abstract-group.js +353 -353
- package/dist/form-groups/form-card.d.ts +32 -32
- package/dist/form-groups/form-card.js +108 -108
- package/dist/form-groups/form-collapsed-card.d.ts +70 -70
- package/dist/form-groups/form-collapsed-card.js +253 -253
- package/dist/form-groups/index.d.ts +3 -3
- package/dist/form-groups/index.js +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/lib/additional-components/confirmation-dialog.d.ts +16 -16
- package/dist/lib/additional-components/confirmation-dialog.js +65 -65
- package/dist/lib/additional-components/etools-fb-card.d.ts +16 -16
- package/dist/lib/additional-components/etools-fb-card.js +215 -215
- package/dist/lib/styles/attachments.styles.d.ts +2 -2
- package/dist/lib/styles/attachments.styles.js +72 -72
- package/dist/lib/styles/card-styles.d.ts +2 -2
- package/dist/lib/styles/card-styles.js +154 -154
- package/dist/lib/styles/dialog.styles.d.ts +2 -2
- package/dist/lib/styles/dialog.styles.js +85 -85
- package/dist/lib/styles/elevation-styles.d.ts +9 -9
- package/dist/lib/styles/elevation-styles.js +43 -43
- package/dist/lib/styles/flex-layout-classes.d.ts +2 -2
- package/dist/lib/styles/flex-layout-classes.js +319 -319
- package/dist/lib/styles/form-builder-card.styles.d.ts +2 -2
- package/dist/lib/styles/form-builder-card.styles.js +49 -49
- package/dist/lib/styles/input-styles.d.ts +2 -2
- package/dist/lib/styles/input-styles.js +138 -138
- package/dist/lib/styles/page-layout-styles.d.ts +2 -2
- package/dist/lib/styles/page-layout-styles.js +201 -201
- package/dist/lib/styles/shared-styles.d.ts +2 -2
- package/dist/lib/styles/shared-styles.js +70 -70
- package/dist/lib/types/form-builder.interfaces.d.ts +83 -83
- package/dist/lib/types/form-builder.interfaces.js +0 -0
- package/dist/lib/types/form-builder.types.d.ts +59 -59
- package/dist/lib/types/form-builder.types.js +0 -0
- package/dist/lib/types/global.types.d.ts +4 -4
- package/dist/lib/types/global.types.js +0 -0
- package/dist/lib/utils/dialog.d.ts +10 -10
- package/dist/lib/utils/dialog.js +21 -21
- package/dist/lib/utils/fire-custom-event.d.ts +1 -1
- package/dist/lib/utils/fire-custom-event.js +7 -7
- package/dist/lib/utils/validations.helper.d.ts +26 -26
- package/dist/lib/utils/validations.helper.js +35 -35
- package/package.json +56 -56
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# Etools FM Form Builder Components
|
|
1
|
+
# Etools FM Form Builder Components
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import '@unicef-polymer/etools-dialog/etools-dialog';
|
|
2
|
-
import '@unicef-polymer/etools-upload/etools-upload-multi';
|
|
3
|
-
import '@unicef-polymer/etools-dropdown/etools-dropdown';
|
|
4
|
-
import '@polymer/paper-button/paper-button';
|
|
5
|
-
import '@polymer/iron-icons/iron-icons';
|
|
6
|
-
import { CSSResultArray, LitElement, TemplateResult } from 'lit-element';
|
|
7
|
-
import { GenericObject } from '../lib/types/global.types';
|
|
8
|
-
import { BlueprintMetadata } from '../lib/types/form-builder.types';
|
|
9
|
-
export declare type FormBuilderAttachmentsPopupData = {
|
|
10
|
-
attachments: StoredAttachment[];
|
|
11
|
-
metadata: BlueprintMetadata;
|
|
12
|
-
title: string;
|
|
13
|
-
readonly?: boolean;
|
|
14
|
-
computedPath: string[];
|
|
15
|
-
errors: GenericObject[];
|
|
16
|
-
};
|
|
17
|
-
export declare type StoredAttachment = {
|
|
18
|
-
attachment: string | number;
|
|
19
|
-
filename: string;
|
|
20
|
-
file_type: number | null;
|
|
21
|
-
url?: string;
|
|
22
|
-
composedPath?: string[];
|
|
23
|
-
};
|
|
24
|
-
export declare type UploadedAttachment = {
|
|
25
|
-
id: number;
|
|
26
|
-
object_link: string;
|
|
27
|
-
file_type: string;
|
|
28
|
-
file_link: string;
|
|
29
|
-
filename: string;
|
|
30
|
-
uploaded_by: string;
|
|
31
|
-
created: string;
|
|
32
|
-
attachment: number;
|
|
33
|
-
};
|
|
34
|
-
export declare type OfflineSavedAttachment = {
|
|
35
|
-
id: string;
|
|
36
|
-
filetype: string;
|
|
37
|
-
filename: string;
|
|
38
|
-
extraInfo: string[];
|
|
39
|
-
unsynced: boolean;
|
|
40
|
-
};
|
|
41
|
-
export declare type UploadFinishedDetails = {
|
|
42
|
-
success: (UploadedAttachment | OfflineSavedAttachment)[];
|
|
43
|
-
error: any[];
|
|
44
|
-
};
|
|
45
|
-
export declare type SingleUploadFinishedDetails = {
|
|
46
|
-
success: UploadedAttachment | OfflineSavedAttachment;
|
|
47
|
-
error: any[];
|
|
48
|
-
};
|
|
49
|
-
export declare class FormAttachmentsPopup extends LitElement {
|
|
50
|
-
dialogOpened: boolean;
|
|
51
|
-
saveBtnClicked: boolean;
|
|
52
|
-
attachments: StoredAttachment[];
|
|
53
|
-
metadata: BlueprintMetadata;
|
|
54
|
-
link: HTMLLinkElement;
|
|
55
|
-
readonly: boolean;
|
|
56
|
-
popupTitle: string;
|
|
57
|
-
computedPath: string[];
|
|
58
|
-
errors: GenericObject;
|
|
59
|
-
/**
|
|
60
|
-
* Array of offline saved fileIds that was remove from popup.
|
|
61
|
-
* We need to remove them from IDB but only after confirm button click
|
|
62
|
-
*/
|
|
63
|
-
private filesForRemove;
|
|
64
|
-
private originalAttachments;
|
|
65
|
-
set dialogData({ attachments, title, metadata, readonly, computedPath, errors }: FormBuilderAttachmentsPopupData);
|
|
66
|
-
get uploadUrl(): string;
|
|
67
|
-
get jwtLocalStorageKey(): string;
|
|
68
|
-
constructor();
|
|
69
|
-
render(): TemplateResult | void;
|
|
70
|
-
/**
|
|
71
|
-
* on Cancel button click
|
|
72
|
-
* Remove offline saved attachments from IDB if they are missing in originalAttachments
|
|
73
|
-
*/
|
|
74
|
-
onClose(): void;
|
|
75
|
-
saveChanges(): Promise<void>;
|
|
76
|
-
checkFileType(index: number): boolean;
|
|
77
|
-
retrieveErrorMessage(index: number): string;
|
|
78
|
-
protected downloadFile(attachment: GenericObject): void;
|
|
79
|
-
protected changeFileType(attachment: GenericObject, newType: number | null, index: number): void;
|
|
80
|
-
protected attachmentsUploaded({ success, error }: UploadFinishedDetails): void;
|
|
81
|
-
protected deleteAttachment(index: number): void;
|
|
82
|
-
private isUploadedAttachment;
|
|
83
|
-
private isOfflineSavedAttachment;
|
|
84
|
-
static get styles(): CSSResultArray;
|
|
85
|
-
}
|
|
1
|
+
import '@unicef-polymer/etools-dialog/etools-dialog';
|
|
2
|
+
import '@unicef-polymer/etools-upload/etools-upload-multi';
|
|
3
|
+
import '@unicef-polymer/etools-dropdown/etools-dropdown';
|
|
4
|
+
import '@polymer/paper-button/paper-button';
|
|
5
|
+
import '@polymer/iron-icons/iron-icons';
|
|
6
|
+
import { CSSResultArray, LitElement, TemplateResult } from 'lit-element';
|
|
7
|
+
import { GenericObject } from '../lib/types/global.types';
|
|
8
|
+
import { BlueprintMetadata } from '../lib/types/form-builder.types';
|
|
9
|
+
export declare type FormBuilderAttachmentsPopupData = {
|
|
10
|
+
attachments: StoredAttachment[];
|
|
11
|
+
metadata: BlueprintMetadata;
|
|
12
|
+
title: string;
|
|
13
|
+
readonly?: boolean;
|
|
14
|
+
computedPath: string[];
|
|
15
|
+
errors: GenericObject[];
|
|
16
|
+
};
|
|
17
|
+
export declare type StoredAttachment = {
|
|
18
|
+
attachment: string | number;
|
|
19
|
+
filename: string;
|
|
20
|
+
file_type: number | null;
|
|
21
|
+
url?: string;
|
|
22
|
+
composedPath?: string[];
|
|
23
|
+
};
|
|
24
|
+
export declare type UploadedAttachment = {
|
|
25
|
+
id: number;
|
|
26
|
+
object_link: string;
|
|
27
|
+
file_type: string;
|
|
28
|
+
file_link: string;
|
|
29
|
+
filename: string;
|
|
30
|
+
uploaded_by: string;
|
|
31
|
+
created: string;
|
|
32
|
+
attachment: number;
|
|
33
|
+
};
|
|
34
|
+
export declare type OfflineSavedAttachment = {
|
|
35
|
+
id: string;
|
|
36
|
+
filetype: string;
|
|
37
|
+
filename: string;
|
|
38
|
+
extraInfo: string[];
|
|
39
|
+
unsynced: boolean;
|
|
40
|
+
};
|
|
41
|
+
export declare type UploadFinishedDetails = {
|
|
42
|
+
success: (UploadedAttachment | OfflineSavedAttachment)[];
|
|
43
|
+
error: any[];
|
|
44
|
+
};
|
|
45
|
+
export declare type SingleUploadFinishedDetails = {
|
|
46
|
+
success: UploadedAttachment | OfflineSavedAttachment;
|
|
47
|
+
error: any[];
|
|
48
|
+
};
|
|
49
|
+
export declare class FormAttachmentsPopup extends LitElement {
|
|
50
|
+
dialogOpened: boolean;
|
|
51
|
+
saveBtnClicked: boolean;
|
|
52
|
+
attachments: StoredAttachment[];
|
|
53
|
+
metadata: BlueprintMetadata;
|
|
54
|
+
link: HTMLLinkElement;
|
|
55
|
+
readonly: boolean;
|
|
56
|
+
popupTitle: string;
|
|
57
|
+
computedPath: string[];
|
|
58
|
+
errors: GenericObject;
|
|
59
|
+
/**
|
|
60
|
+
* Array of offline saved fileIds that was remove from popup.
|
|
61
|
+
* We need to remove them from IDB but only after confirm button click
|
|
62
|
+
*/
|
|
63
|
+
private filesForRemove;
|
|
64
|
+
private originalAttachments;
|
|
65
|
+
set dialogData({ attachments, title, metadata, readonly, computedPath, errors }: FormBuilderAttachmentsPopupData);
|
|
66
|
+
get uploadUrl(): string;
|
|
67
|
+
get jwtLocalStorageKey(): string;
|
|
68
|
+
constructor();
|
|
69
|
+
render(): TemplateResult | void;
|
|
70
|
+
/**
|
|
71
|
+
* on Cancel button click
|
|
72
|
+
* Remove offline saved attachments from IDB if they are missing in originalAttachments
|
|
73
|
+
*/
|
|
74
|
+
onClose(): void;
|
|
75
|
+
saveChanges(): Promise<void>;
|
|
76
|
+
checkFileType(index: number): boolean;
|
|
77
|
+
retrieveErrorMessage(index: number): string;
|
|
78
|
+
protected downloadFile(attachment: GenericObject): void;
|
|
79
|
+
protected changeFileType(attachment: GenericObject, newType: number | null, index: number): void;
|
|
80
|
+
protected attachmentsUploaded({ success, error }: UploadFinishedDetails): void;
|
|
81
|
+
protected deleteAttachment(index: number): void;
|
|
82
|
+
private isUploadedAttachment;
|
|
83
|
+
private isOfflineSavedAttachment;
|
|
84
|
+
static get styles(): CSSResultArray;
|
|
85
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare class FormAttachmentsPopupHelper {
|
|
2
|
-
get isInitialized(): boolean;
|
|
3
|
-
uploadUrl: string | null;
|
|
4
|
-
jwtLocalStorageKey?: string;
|
|
5
|
-
initialize(uploadUrl: string, jwtLocalStorageKey?: string): void;
|
|
6
|
-
}
|
|
7
|
-
declare const AttachmentsHelper: FormAttachmentsPopupHelper;
|
|
8
|
-
export { AttachmentsHelper };
|
|
1
|
+
export declare class FormAttachmentsPopupHelper {
|
|
2
|
+
get isInitialized(): boolean;
|
|
3
|
+
uploadUrl: string | null;
|
|
4
|
+
jwtLocalStorageKey?: string;
|
|
5
|
+
initialize(uploadUrl: string, jwtLocalStorageKey?: string): void;
|
|
6
|
+
}
|
|
7
|
+
declare const AttachmentsHelper: FormAttachmentsPopupHelper;
|
|
8
|
+
export { AttachmentsHelper };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export class FormAttachmentsPopupHelper {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.uploadUrl = null;
|
|
4
|
-
}
|
|
5
|
-
get isInitialized() {
|
|
6
|
-
return Boolean(this.uploadUrl);
|
|
7
|
-
}
|
|
8
|
-
initialize(uploadUrl, jwtLocalStorageKey) {
|
|
9
|
-
this.uploadUrl = uploadUrl;
|
|
10
|
-
this.jwtLocalStorageKey = jwtLocalStorageKey;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
const AttachmentsHelper = new FormAttachmentsPopupHelper();
|
|
14
|
-
export { AttachmentsHelper };
|
|
1
|
+
export class FormAttachmentsPopupHelper {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.uploadUrl = null;
|
|
4
|
+
}
|
|
5
|
+
get isInitialized() {
|
|
6
|
+
return Boolean(this.uploadUrl);
|
|
7
|
+
}
|
|
8
|
+
initialize(uploadUrl, jwtLocalStorageKey) {
|
|
9
|
+
this.uploadUrl = uploadUrl;
|
|
10
|
+
this.jwtLocalStorageKey = jwtLocalStorageKey;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const AttachmentsHelper = new FormAttachmentsPopupHelper();
|
|
14
|
+
export { AttachmentsHelper };
|