@unicef-polymer/etools-form-builder 2.1.8 → 3.0.0-rc.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/assets/translations.d.ts +6 -6
- package/dist/assets/translations.js +67 -67
- package/dist/form-attachments-popup/form-attachments-popup.d.ts +84 -86
- 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 +249 -255
- package/dist/form-attachments-popup/form-attachments-popup.tpl.d.ts +7 -3
- package/dist/form-attachments-popup/form-attachments-popup.tpl.js +102 -91
- 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 +33 -33
- package/dist/form-fields/abstract-field-base.class.js +209 -213
- package/dist/form-fields/field-renderer-component.d.ts +20 -20
- package/dist/form-fields/field-renderer-component.js +251 -255
- 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 +19 -17
- package/dist/form-fields/repeatable-fields/repeatable-attachment-field.js +212 -209
- package/dist/form-fields/repeatable-fields/repeatable-base-field.d.ts +21 -20
- package/dist/form-fields/repeatable-fields/repeatable-base-field.js +121 -124
- package/dist/form-fields/repeatable-fields/repeatable-number-field.d.ts +10 -10
- package/dist/form-fields/repeatable-fields/repeatable-number-field.js +63 -67
- package/dist/form-fields/repeatable-fields/repeatable-scale-field.d.ts +15 -15
- package/dist/form-fields/repeatable-fields/repeatable-scale-field.js +106 -108
- package/dist/form-fields/repeatable-fields/repeatable-text-field.d.ts +8 -8
- package/dist/form-fields/repeatable-fields/repeatable-text-field.js +49 -53
- package/dist/form-fields/single-fields/attachment-field.d.ts +16 -16
- package/dist/form-fields/single-fields/attachment-field.js +94 -98
- package/dist/form-fields/single-fields/base-field.d.ts +11 -11
- package/dist/form-fields/single-fields/base-field.js +53 -58
- package/dist/form-fields/single-fields/boolean-field.d.ts +8 -8
- package/dist/form-fields/single-fields/boolean-field.js +45 -49
- package/dist/form-fields/single-fields/number-field.d.ts +10 -10
- package/dist/form-fields/single-fields/number-field.js +63 -67
- package/dist/form-fields/single-fields/scale-field.d.ts +18 -18
- package/dist/form-fields/single-fields/scale-field.js +109 -108
- package/dist/form-fields/single-fields/text-field.d.ts +8 -8
- package/dist/form-fields/single-fields/text-field.js +49 -54
- package/dist/form-groups/form-abstract-group.d.ts +71 -71
- package/dist/form-groups/form-abstract-group.js +396 -398
- package/dist/form-groups/form-card.d.ts +35 -32
- package/dist/form-groups/form-card.js +115 -113
- package/dist/form-groups/form-collapsed-card.d.ts +72 -71
- package/dist/form-groups/form-collapsed-card.js +261 -259
- 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 +18 -18
- package/dist/lib/additional-components/confirmation-dialog.js +68 -72
- package/dist/lib/additional-components/etools-fb-card.d.ts +21 -21
- package/dist/lib/additional-components/etools-fb-card.js +242 -239
- 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 +1 -0
- package/dist/lib/types/form-builder.types.d.ts +59 -59
- package/dist/lib/types/form-builder.types.js +1 -0
- package/dist/lib/types/global.types.d.ts +4 -4
- package/dist/lib/types/global.types.js +1 -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/translate.d.ts +1 -1
- package/dist/lib/utils/translate.js +9 -9
- package/dist/lib/utils/validations.helper.d.ts +26 -26
- package/dist/lib/utils/validations.helper.js +42 -42
- package/package.json +51 -56
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { CSSResultArray, TemplateResult } from 'lit
|
|
2
|
-
import { BaseField } from './base-field';
|
|
3
|
-
import '@polymer/
|
|
4
|
-
export declare class TextField extends BaseField<string> {
|
|
5
|
-
protected controlTemplate(): TemplateResult;
|
|
6
|
-
protected customValidation(): string | null;
|
|
7
|
-
static get styles(): CSSResultArray;
|
|
8
|
-
}
|
|
1
|
+
import { CSSResultArray, TemplateResult } from 'lit';
|
|
2
|
+
import { BaseField } from './base-field';
|
|
3
|
+
import '@unicef-polymer/etools-unicef/src/etools-input/etools-textarea';
|
|
4
|
+
export declare class TextField extends BaseField<string> {
|
|
5
|
+
protected controlTemplate(): TemplateResult;
|
|
6
|
+
protected customValidation(): string | null;
|
|
7
|
+
static get styles(): CSSResultArray;
|
|
8
|
+
}
|
|
@@ -1,54 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
TextField = __decorate([
|
|
52
|
-
customElement('text-field')
|
|
53
|
-
], TextField);
|
|
54
|
-
export { TextField };
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { css, html } from 'lit';
|
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
import { BaseField } from './base-field';
|
|
5
|
+
import '@unicef-polymer/etools-unicef/src/etools-input/etools-textarea';
|
|
6
|
+
import { InputStyles } from '../../lib/styles/input-styles';
|
|
7
|
+
let TextField = class TextField extends BaseField {
|
|
8
|
+
controlTemplate() {
|
|
9
|
+
return html `
|
|
10
|
+
${InputStyles}
|
|
11
|
+
<etools-textarea
|
|
12
|
+
id="otherInfo"
|
|
13
|
+
class="no-padding-left"
|
|
14
|
+
no-label-float
|
|
15
|
+
placeholder="${this.isReadonly ? '—' : this.placeholder}"
|
|
16
|
+
.value="${this.value}"
|
|
17
|
+
@value-changed="${({ detail }) => this.valueChanged(detail.value)}"
|
|
18
|
+
@focus="${() => (this.touched = true)}"
|
|
19
|
+
?readonly="${this.isReadonly}"
|
|
20
|
+
?invalid="${this.errorMessage}"
|
|
21
|
+
error-message="${this.errorMessage}"
|
|
22
|
+
>
|
|
23
|
+
</etools-textarea>
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
customValidation() {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
static get styles() {
|
|
30
|
+
// language=CSS
|
|
31
|
+
return [
|
|
32
|
+
...BaseField.styles,
|
|
33
|
+
css `
|
|
34
|
+
:host(.wide) etools-textarea {
|
|
35
|
+
padding-left: 0;
|
|
36
|
+
}
|
|
37
|
+
@media (max-width: 380px) {
|
|
38
|
+
.no-padding-left {
|
|
39
|
+
padding-left: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
TextField = __decorate([
|
|
47
|
+
customElement('text-field')
|
|
48
|
+
], TextField);
|
|
49
|
+
export { TextField };
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { LitElement, TemplateResult
|
|
2
|
-
import '../form-fields/single-fields/text-field';
|
|
3
|
-
import '../form-fields/single-fields/number-field';
|
|
4
|
-
import '../form-fields/single-fields/scale-field';
|
|
5
|
-
import '@
|
|
6
|
-
import { IFormBuilderAbstractGroup } from '../lib/types/form-builder.interfaces';
|
|
7
|
-
import { BlueprintField, BlueprintGroup, BlueprintMetadata, Information } from '../lib/types/form-builder.types';
|
|
8
|
-
import { GenericObject } from '../lib/types/global.types';
|
|
9
|
-
export declare enum FieldTypes {
|
|
10
|
-
FILE_TYPE = "file",
|
|
11
|
-
TEXT_TYPE = "text",
|
|
12
|
-
NUMBER_TYPE = "number",
|
|
13
|
-
BOOL_TYPE = "bool",
|
|
14
|
-
SCALE_TYPE = "likert_scale",
|
|
15
|
-
NUMBER_INTEGER_TYPE = "number-integer",
|
|
16
|
-
NUMBER_FLOAT_TYPE = "number-float"
|
|
17
|
-
}
|
|
18
|
-
export declare enum StructureTypes {
|
|
19
|
-
WIDE = "wide",
|
|
20
|
-
ADDITIONAL = "additional",
|
|
21
|
-
CARD = "card",
|
|
22
|
-
ABSTRACT = "abstract",
|
|
23
|
-
COLLAPSED = "collapse",
|
|
24
|
-
ATTACHMENTS_BUTTON = "floating_attachments"
|
|
25
|
-
}
|
|
26
|
-
export declare class FormAbstractGroup extends LitElement implements IFormBuilderAbstractGroup {
|
|
27
|
-
groupStructure: BlueprintGroup;
|
|
28
|
-
metadata: BlueprintMetadata;
|
|
29
|
-
parentGroupName: string;
|
|
30
|
-
collapsed: boolean;
|
|
31
|
-
language: string;
|
|
32
|
-
readonly: boolean;
|
|
33
|
-
protected _errors: GenericObject;
|
|
34
|
-
protected _value: GenericObject;
|
|
35
|
-
computedPath: string[];
|
|
36
|
-
/**
|
|
37
|
-
* Make value property immutable
|
|
38
|
-
* @param value
|
|
39
|
-
*/
|
|
40
|
-
set value(value: GenericObject);
|
|
41
|
-
get value(): GenericObject;
|
|
42
|
-
/**
|
|
43
|
-
* Setter for handling error.
|
|
44
|
-
* Normally we wouldn't have errors as string or string[] for FormGroups.
|
|
45
|
-
* In cases they appear - show toast with error text and reset it.
|
|
46
|
-
* Otherwise it will be impossible to clear that error from field elements
|
|
47
|
-
* @param errors
|
|
48
|
-
*/
|
|
49
|
-
set errors(errors: GenericObject | string[] | null);
|
|
50
|
-
constructor();
|
|
51
|
-
connectedCallback(): void;
|
|
52
|
-
disconnectedCallback(): void;
|
|
53
|
-
countCollapsePanels(groupStructure: BlueprintGroup | BlueprintField | Information, res: {
|
|
54
|
-
count: number;
|
|
55
|
-
}): {
|
|
56
|
-
count: number;
|
|
57
|
-
};
|
|
58
|
-
handleLanguageChange(e: CustomEvent): void;
|
|
59
|
-
render(): TemplateResult;
|
|
60
|
-
renderChild(child: BlueprintGroup | BlueprintField | Information): TemplateResult | TemplateResult[];
|
|
61
|
-
renderField(blueprintField: BlueprintField): TemplateResult;
|
|
62
|
-
renderInformation(information: Information): TemplateResult;
|
|
63
|
-
renderGroup(groupStructure: BlueprintGroup): TemplateResult | TemplateResult[];
|
|
64
|
-
getGroupTemplate(groupStructure: BlueprintGroup, index?: number): TemplateResult;
|
|
65
|
-
valueChanged(event: CustomEvent, name: string, index?: number): void;
|
|
66
|
-
errorChanged(event: CustomEvent, name: string, index?: number): void;
|
|
67
|
-
addGroup(name: string): void;
|
|
68
|
-
removeGroup(group: BlueprintGroup, index?: number): void;
|
|
69
|
-
protected getErrorMessage(fieldName: string): string | null;
|
|
70
|
-
static get styles(): CSSResultArray;
|
|
71
|
-
}
|
|
1
|
+
import { CSSResultArray, LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import '../form-fields/single-fields/text-field';
|
|
3
|
+
import '../form-fields/single-fields/number-field';
|
|
4
|
+
import '../form-fields/single-fields/scale-field';
|
|
5
|
+
import '@shoelace-style/shoelace/dist/components/button/button.js';
|
|
6
|
+
import { IFormBuilderAbstractGroup } from '../lib/types/form-builder.interfaces';
|
|
7
|
+
import { BlueprintField, BlueprintGroup, BlueprintMetadata, Information } from '../lib/types/form-builder.types';
|
|
8
|
+
import { GenericObject } from '../lib/types/global.types';
|
|
9
|
+
export declare enum FieldTypes {
|
|
10
|
+
FILE_TYPE = "file",
|
|
11
|
+
TEXT_TYPE = "text",
|
|
12
|
+
NUMBER_TYPE = "number",
|
|
13
|
+
BOOL_TYPE = "bool",
|
|
14
|
+
SCALE_TYPE = "likert_scale",
|
|
15
|
+
NUMBER_INTEGER_TYPE = "number-integer",
|
|
16
|
+
NUMBER_FLOAT_TYPE = "number-float"
|
|
17
|
+
}
|
|
18
|
+
export declare enum StructureTypes {
|
|
19
|
+
WIDE = "wide",
|
|
20
|
+
ADDITIONAL = "additional",
|
|
21
|
+
CARD = "card",
|
|
22
|
+
ABSTRACT = "abstract",
|
|
23
|
+
COLLAPSED = "collapse",
|
|
24
|
+
ATTACHMENTS_BUTTON = "floating_attachments"
|
|
25
|
+
}
|
|
26
|
+
export declare class FormAbstractGroup extends LitElement implements IFormBuilderAbstractGroup {
|
|
27
|
+
groupStructure: BlueprintGroup;
|
|
28
|
+
metadata: BlueprintMetadata;
|
|
29
|
+
parentGroupName: string;
|
|
30
|
+
collapsed: boolean;
|
|
31
|
+
language: string;
|
|
32
|
+
readonly: boolean;
|
|
33
|
+
protected _errors: GenericObject;
|
|
34
|
+
protected _value: GenericObject;
|
|
35
|
+
computedPath: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Make value property immutable
|
|
38
|
+
* @param value
|
|
39
|
+
*/
|
|
40
|
+
set value(value: GenericObject);
|
|
41
|
+
get value(): GenericObject;
|
|
42
|
+
/**
|
|
43
|
+
* Setter for handling error.
|
|
44
|
+
* Normally we wouldn't have errors as string or string[] for FormGroups.
|
|
45
|
+
* In cases they appear - show toast with error text and reset it.
|
|
46
|
+
* Otherwise it will be impossible to clear that error from field elements
|
|
47
|
+
* @param errors
|
|
48
|
+
*/
|
|
49
|
+
set errors(errors: GenericObject | string[] | null);
|
|
50
|
+
constructor();
|
|
51
|
+
connectedCallback(): void;
|
|
52
|
+
disconnectedCallback(): void;
|
|
53
|
+
countCollapsePanels(groupStructure: BlueprintGroup | BlueprintField | Information, res: {
|
|
54
|
+
count: number;
|
|
55
|
+
}): {
|
|
56
|
+
count: number;
|
|
57
|
+
};
|
|
58
|
+
handleLanguageChange(e: CustomEvent): void;
|
|
59
|
+
render(): TemplateResult;
|
|
60
|
+
renderChild(child: BlueprintGroup | BlueprintField | Information): TemplateResult | TemplateResult[];
|
|
61
|
+
renderField(blueprintField: BlueprintField): TemplateResult;
|
|
62
|
+
renderInformation(information: Information): TemplateResult;
|
|
63
|
+
renderGroup(groupStructure: BlueprintGroup): TemplateResult | TemplateResult[];
|
|
64
|
+
getGroupTemplate(groupStructure: BlueprintGroup, index?: number): TemplateResult;
|
|
65
|
+
valueChanged(event: CustomEvent, name: string, index?: number): void;
|
|
66
|
+
errorChanged(event: CustomEvent, name: string, index?: number): void;
|
|
67
|
+
addGroup(name: string): void;
|
|
68
|
+
removeGroup(group: BlueprintGroup, index?: number): void;
|
|
69
|
+
protected getErrorMessage(fieldName: string): string | null;
|
|
70
|
+
static get styles(): CSSResultArray;
|
|
71
|
+
}
|