@unicef-polymer/etools-form-builder 3.2.2 → 3.2.4
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.js +135 -135
- package/dist/form-fields/abstract-field-base.class.js +100 -100
- package/dist/form-fields/field-renderer-component.js +198 -166
- package/dist/form-fields/index.d.ts +2 -0
- package/dist/form-fields/index.js +2 -0
- package/dist/form-fields/repeatable-fields/repeatable-attachment-field.js +111 -111
- package/dist/form-fields/repeatable-fields/repeatable-base-field.js +22 -22
- package/dist/form-fields/repeatable-fields/repeatable-choice-field.d.ts +15 -0
- package/dist/form-fields/repeatable-fields/repeatable-choice-field.js +123 -0
- package/dist/form-fields/repeatable-fields/repeatable-number-field.js +19 -19
- package/dist/form-fields/repeatable-fields/repeatable-scale-field.js +57 -57
- package/dist/form-fields/repeatable-fields/repeatable-text-field.js +19 -19
- package/dist/form-fields/single-fields/attachment-field.js +13 -13
- package/dist/form-fields/single-fields/boolean-field.js +16 -16
- package/dist/form-fields/single-fields/choice-field.d.ts +17 -0
- package/dist/form-fields/single-fields/choice-field.js +121 -0
- package/dist/form-fields/single-fields/number-field.js +20 -20
- package/dist/form-fields/single-fields/scale-field.js +58 -58
- package/dist/form-fields/single-fields/text-field.js +30 -30
- package/dist/form-groups/form-abstract-group.d.ts +2 -1
- package/dist/form-groups/form-abstract-group.js +130 -129
- package/dist/form-groups/form-card.js +30 -30
- package/dist/form-groups/form-collapsed-card.js +34 -34
- package/dist/lib/additional-components/confirmation-dialog.js +20 -20
- package/dist/lib/additional-components/etools-fb-card.js +144 -144
- package/dist/lib/styles/attachments.styles.js +61 -61
- package/dist/lib/styles/card-styles.js +147 -147
- package/dist/lib/styles/dialog.styles.js +83 -83
- package/dist/lib/styles/elevation-styles.js +46 -46
- package/dist/lib/styles/flex-layout-classes.js +316 -316
- package/dist/lib/styles/form-builder-card.styles.js +53 -53
- package/dist/lib/styles/page-layout-styles.js +198 -198
- package/dist/lib/styles/shared-styles.js +61 -61
- package/dist/lib/types/form-builder.types.d.ts +1 -1
- package/dist/rich-editor/rich-action.js +34 -34
- package/dist/rich-editor/rich-text.d.ts +1 -0
- package/dist/rich-editor/rich-text.js +163 -65
- package/dist/rich-editor/rich-toolbar.js +125 -125
- package/dist/rich-editor/rich-viewer.js +21 -21
- package/package.json +52 -51
|
@@ -14,108 +14,108 @@ let EtoolsFbCard = class EtoolsFbCard extends LitElement {
|
|
|
14
14
|
elevationStyles,
|
|
15
15
|
CardStyles,
|
|
16
16
|
FlexLayoutClasses,
|
|
17
|
-
css `
|
|
18
|
-
:host {
|
|
19
|
-
display: block;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
etools-icon {
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
margin: 6px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.card-container {
|
|
28
|
-
background-color: var(--primary-background-color);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.card-title-box[is-collapsible] {
|
|
32
|
-
padding-left: 17px;
|
|
33
|
-
padding-right: 25px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.card-content {
|
|
37
|
-
padding: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.card-buttons {
|
|
41
|
-
padding: 12px 24px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.save-button {
|
|
45
|
-
--sl-color-primary-500: var(--primary-color);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.edit-button,
|
|
49
|
-
etools-icon[name='create'] {
|
|
50
|
-
color: var(--gray-mid);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.edit-button[edit] {
|
|
54
|
-
color: var(--primary-color);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.flex-header {
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
padding-top: auto;
|
|
61
|
-
flex-wrap: nowrap;
|
|
62
|
-
}
|
|
63
|
-
.flex-header__collapse {
|
|
64
|
-
flex-basis: auto;
|
|
65
|
-
}
|
|
66
|
-
.flex-header__title {
|
|
67
|
-
font-size: var(--etools-font-size-18, 18px);
|
|
68
|
-
flex-basis: auto;
|
|
69
|
-
flex-grow: 1;
|
|
70
|
-
overflow: hidden;
|
|
71
|
-
white-space: nowrap;
|
|
72
|
-
text-overflow: ellipsis;
|
|
73
|
-
}
|
|
74
|
-
.flex-header__actions {
|
|
75
|
-
order: 1;
|
|
76
|
-
width: auto;
|
|
77
|
-
display: flex;
|
|
78
|
-
flex-basis: auto;
|
|
79
|
-
}
|
|
80
|
-
.flex-header__postfix {
|
|
81
|
-
order: 3;
|
|
82
|
-
}
|
|
83
|
-
.flex-header__edit {
|
|
84
|
-
order: 2;
|
|
85
|
-
}
|
|
86
|
-
@media (max-width: 380px) {
|
|
87
|
-
.card-title-box[is-collapsible] {
|
|
88
|
-
padding-left: 0;
|
|
89
|
-
padding-right: 0;
|
|
90
|
-
}
|
|
91
|
-
.flex-header {
|
|
92
|
-
align-items: baseline;
|
|
93
|
-
padding-top: 10px;
|
|
94
|
-
flex-wrap: wrap;
|
|
95
|
-
}
|
|
96
|
-
.flex-header__collapse {
|
|
97
|
-
flex-basis: 20%;
|
|
98
|
-
}
|
|
99
|
-
.flex-header__title {
|
|
100
|
-
flex-basis: 60%;
|
|
101
|
-
overflow: unset;
|
|
102
|
-
white-space: unset;
|
|
103
|
-
text-overflow: unset;
|
|
104
|
-
}
|
|
105
|
-
.flex-header__actions {
|
|
106
|
-
order: 2;
|
|
107
|
-
width: 100%;
|
|
108
|
-
border-top: 1px solid lightgrey;
|
|
109
|
-
justify-content: flex-end;
|
|
110
|
-
}
|
|
111
|
-
.flex-header__postfix {
|
|
112
|
-
order: 3;
|
|
113
|
-
}
|
|
114
|
-
.flex-header__edit {
|
|
115
|
-
order: 1;
|
|
116
|
-
flex-basis: 12%;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
17
|
+
css `
|
|
18
|
+
:host {
|
|
19
|
+
display: block;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
etools-icon {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
margin: 6px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.card-container {
|
|
28
|
+
background-color: var(--primary-background-color);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.card-title-box[is-collapsible] {
|
|
32
|
+
padding-left: 17px;
|
|
33
|
+
padding-right: 25px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.card-content {
|
|
37
|
+
padding: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.card-buttons {
|
|
41
|
+
padding: 12px 24px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.save-button {
|
|
45
|
+
--sl-color-primary-500: var(--primary-color);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.edit-button,
|
|
49
|
+
etools-icon[name='create'] {
|
|
50
|
+
color: var(--gray-mid);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.edit-button[edit] {
|
|
54
|
+
color: var(--primary-color);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.flex-header {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
padding-top: auto;
|
|
61
|
+
flex-wrap: nowrap;
|
|
62
|
+
}
|
|
63
|
+
.flex-header__collapse {
|
|
64
|
+
flex-basis: auto;
|
|
65
|
+
}
|
|
66
|
+
.flex-header__title {
|
|
67
|
+
font-size: var(--etools-font-size-18, 18px);
|
|
68
|
+
flex-basis: auto;
|
|
69
|
+
flex-grow: 1;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
text-overflow: ellipsis;
|
|
73
|
+
}
|
|
74
|
+
.flex-header__actions {
|
|
75
|
+
order: 1;
|
|
76
|
+
width: auto;
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-basis: auto;
|
|
79
|
+
}
|
|
80
|
+
.flex-header__postfix {
|
|
81
|
+
order: 3;
|
|
82
|
+
}
|
|
83
|
+
.flex-header__edit {
|
|
84
|
+
order: 2;
|
|
85
|
+
}
|
|
86
|
+
@media (max-width: 380px) {
|
|
87
|
+
.card-title-box[is-collapsible] {
|
|
88
|
+
padding-left: 0;
|
|
89
|
+
padding-right: 0;
|
|
90
|
+
}
|
|
91
|
+
.flex-header {
|
|
92
|
+
align-items: baseline;
|
|
93
|
+
padding-top: 10px;
|
|
94
|
+
flex-wrap: wrap;
|
|
95
|
+
}
|
|
96
|
+
.flex-header__collapse {
|
|
97
|
+
flex-basis: 20%;
|
|
98
|
+
}
|
|
99
|
+
.flex-header__title {
|
|
100
|
+
flex-basis: 60%;
|
|
101
|
+
overflow: unset;
|
|
102
|
+
white-space: unset;
|
|
103
|
+
text-overflow: unset;
|
|
104
|
+
}
|
|
105
|
+
.flex-header__actions {
|
|
106
|
+
order: 2;
|
|
107
|
+
width: 100%;
|
|
108
|
+
border-top: 1px solid lightgrey;
|
|
109
|
+
justify-content: flex-end;
|
|
110
|
+
}
|
|
111
|
+
.flex-header__postfix {
|
|
112
|
+
order: 3;
|
|
113
|
+
}
|
|
114
|
+
.flex-header__edit {
|
|
115
|
+
order: 1;
|
|
116
|
+
flex-basis: 12%;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
119
|
`
|
|
120
120
|
];
|
|
121
121
|
}
|
|
@@ -162,54 +162,54 @@ let EtoolsFbCard = class EtoolsFbCard extends LitElement {
|
|
|
162
162
|
}
|
|
163
163
|
// language=HTML
|
|
164
164
|
render() {
|
|
165
|
-
return html `
|
|
166
|
-
<div class="elevation card-container" elevation="1">
|
|
167
|
-
<header class="card-title-box with-bottom-line flex-header" ?is-collapsible="${this.isCollapsible}">
|
|
165
|
+
return html `
|
|
166
|
+
<div class="elevation card-container" elevation="1">
|
|
167
|
+
<header class="card-title-box with-bottom-line flex-header" ?is-collapsible="${this.isCollapsible}">
|
|
168
168
|
${this.isCollapsible
|
|
169
|
-
? html `
|
|
170
|
-
<etools-icon
|
|
171
|
-
name="${this.collapsed ? 'expand-more' : 'expand-less'}"
|
|
172
|
-
@click="${() => this.toggleCollapse()}"
|
|
173
|
-
>
|
|
174
|
-
</etools-icon>
|
|
169
|
+
? html `
|
|
170
|
+
<etools-icon
|
|
171
|
+
name="${this.collapsed ? 'expand-more' : 'expand-less'}"
|
|
172
|
+
@click="${() => this.toggleCollapse()}"
|
|
173
|
+
>
|
|
174
|
+
</etools-icon>
|
|
175
175
|
`
|
|
176
|
-
: ''}
|
|
177
|
-
<div class="flex-header__title">${this.cardTitle}</div>
|
|
178
|
-
<div class="flex-header__actions"><slot name="actions"></slot></div>
|
|
179
|
-
<div class="layout horizontal center flex-header__edit">
|
|
176
|
+
: ''}
|
|
177
|
+
<div class="flex-header__title">${this.cardTitle}</div>
|
|
178
|
+
<div class="flex-header__actions"><slot name="actions"></slot></div>
|
|
179
|
+
<div class="layout horizontal center flex-header__edit">
|
|
180
180
|
${this.isEditable
|
|
181
|
-
? html `
|
|
182
|
-
<etools-icon
|
|
183
|
-
slot="trigger"
|
|
184
|
-
?hidden="${this.hideEditButton}"
|
|
185
|
-
@click="${() => this.startEdit()}"
|
|
186
|
-
name="create"
|
|
187
|
-
></etools-icon>
|
|
181
|
+
? html `
|
|
182
|
+
<etools-icon
|
|
183
|
+
slot="trigger"
|
|
184
|
+
?hidden="${this.hideEditButton}"
|
|
185
|
+
@click="${() => this.startEdit()}"
|
|
186
|
+
name="create"
|
|
187
|
+
></etools-icon>
|
|
188
188
|
`
|
|
189
|
-
: ''}
|
|
190
|
-
</div>
|
|
191
|
-
<div class="flex-header__postfix"><slot name="postfix"></slot></div>
|
|
192
|
-
</header>
|
|
193
|
-
<etools-collapse ?opened="${!this.collapsed}">
|
|
194
|
-
<section class="card-content-block">
|
|
195
|
-
<slot name="content"></slot>
|
|
196
|
-
|
|
189
|
+
: ''}
|
|
190
|
+
</div>
|
|
191
|
+
<div class="flex-header__postfix"><slot name="postfix"></slot></div>
|
|
192
|
+
</header>
|
|
193
|
+
<etools-collapse ?opened="${!this.collapsed}">
|
|
194
|
+
<section class="card-content-block">
|
|
195
|
+
<slot name="content"></slot>
|
|
196
|
+
|
|
197
197
|
${this.isEditable && this.edit
|
|
198
|
-
? html `
|
|
199
|
-
<div class="layout horizontal end-justified card-buttons">
|
|
200
|
-
<etools-button variant="text" class="neutral" @click="${this.cancel}">
|
|
201
|
-
${getTranslation(this.language, 'CANCEL')}
|
|
202
|
-
</etools-button>
|
|
203
|
-
|
|
204
|
-
<etools-button variant="primary" class="save-button" @click="${this.save}">
|
|
205
|
-
${getTranslation(this.language, 'SAVE')}
|
|
206
|
-
</etools-button>
|
|
207
|
-
</div>
|
|
198
|
+
? html `
|
|
199
|
+
<div class="layout horizontal end-justified card-buttons">
|
|
200
|
+
<etools-button variant="text" class="neutral" @click="${this.cancel}">
|
|
201
|
+
${getTranslation(this.language, 'CANCEL')}
|
|
202
|
+
</etools-button>
|
|
203
|
+
|
|
204
|
+
<etools-button variant="primary" class="save-button" @click="${this.save}">
|
|
205
|
+
${getTranslation(this.language, 'SAVE')}
|
|
206
|
+
</etools-button>
|
|
207
|
+
</div>
|
|
208
208
|
`
|
|
209
|
-
: ''}
|
|
210
|
-
</section>
|
|
211
|
-
</etools-collapse>
|
|
212
|
-
</div>
|
|
209
|
+
: ''}
|
|
210
|
+
</section>
|
|
211
|
+
</etools-collapse>
|
|
212
|
+
</div>
|
|
213
213
|
`;
|
|
214
214
|
}
|
|
215
215
|
};
|
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
2
|
// language=CSS
|
|
3
|
-
export const AttachmentsStyles = css `
|
|
4
|
-
.file-selector-container {
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-flow: row;
|
|
7
|
-
align-items: center;
|
|
8
|
-
padding: 8px 0;
|
|
9
|
-
}
|
|
10
|
-
.filename-container {
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
border-bottom: 1px solid var(--secondary-text-color, rgba(0, 0, 0, 0.54));
|
|
14
|
-
margin: 0 14px 0 0;
|
|
15
|
-
min-width: 145px;
|
|
16
|
-
overflow-wrap: break-word;
|
|
17
|
-
font-size: var(--etools-font-size-16, 16px);
|
|
18
|
-
}
|
|
19
|
-
:host([is-readonly]) .filename-container {
|
|
20
|
-
border-bottom-color: transparent;
|
|
21
|
-
}
|
|
22
|
-
.filename {
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
text-overflow: ellipsis;
|
|
25
|
-
white-space: nowrap;
|
|
26
|
-
}
|
|
27
|
-
.file-icon {
|
|
28
|
-
width: 24px;
|
|
29
|
-
flex: none;
|
|
30
|
-
color: var(--secondary-text-color, rgba(0, 0, 0, 0.54));
|
|
31
|
-
}
|
|
32
|
-
.upload-button,
|
|
33
|
-
.download-button {
|
|
34
|
-
color: var(--primary-color);
|
|
35
|
-
min-width: 130px;
|
|
36
|
-
}
|
|
37
|
-
.change-button {
|
|
38
|
-
color: var(--secondary-text-color, rgba(0, 0, 0, 0.54));
|
|
39
|
-
}
|
|
40
|
-
etools-icon {
|
|
41
|
-
margin-right: 8px;
|
|
42
|
-
}
|
|
43
|
-
.file-selector-container.with-type-dropdown {
|
|
44
|
-
padding: 0;
|
|
45
|
-
}
|
|
46
|
-
.file-selector-container.with-type-dropdown etools-dropdown.type-dropdown {
|
|
47
|
-
flex: none;
|
|
48
|
-
width: 209px;
|
|
49
|
-
}
|
|
50
|
-
.file-selector-container.with-type-dropdown .filename-container {
|
|
51
|
-
height: 32px;
|
|
52
|
-
box-sizing: border-box;
|
|
53
|
-
margin: 22px 8px;
|
|
54
|
-
border-bottom: 1px solid var(--gray-20);
|
|
55
|
-
}
|
|
56
|
-
.file-selector-container.with-type-dropdown .delete-button,
|
|
57
|
-
.file-selector-container.with-type-dropdown .download-button {
|
|
58
|
-
margin-top: 15px;
|
|
59
|
-
}
|
|
60
|
-
etools-upload-multi.with-padding {
|
|
61
|
-
padding: 12px 9px 12px 0;
|
|
62
|
-
box-sizing: border-box;
|
|
63
|
-
}
|
|
3
|
+
export const AttachmentsStyles = css `
|
|
4
|
+
.file-selector-container {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-flow: row;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: 8px 0;
|
|
9
|
+
}
|
|
10
|
+
.filename-container {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
border-bottom: 1px solid var(--secondary-text-color, rgba(0, 0, 0, 0.54));
|
|
14
|
+
margin: 0 14px 0 0;
|
|
15
|
+
min-width: 145px;
|
|
16
|
+
overflow-wrap: break-word;
|
|
17
|
+
font-size: var(--etools-font-size-16, 16px);
|
|
18
|
+
}
|
|
19
|
+
:host([is-readonly]) .filename-container {
|
|
20
|
+
border-bottom-color: transparent;
|
|
21
|
+
}
|
|
22
|
+
.filename {
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
}
|
|
27
|
+
.file-icon {
|
|
28
|
+
width: 24px;
|
|
29
|
+
flex: none;
|
|
30
|
+
color: var(--secondary-text-color, rgba(0, 0, 0, 0.54));
|
|
31
|
+
}
|
|
32
|
+
.upload-button,
|
|
33
|
+
.download-button {
|
|
34
|
+
color: var(--primary-color);
|
|
35
|
+
min-width: 130px;
|
|
36
|
+
}
|
|
37
|
+
.change-button {
|
|
38
|
+
color: var(--secondary-text-color, rgba(0, 0, 0, 0.54));
|
|
39
|
+
}
|
|
40
|
+
etools-icon {
|
|
41
|
+
margin-right: 8px;
|
|
42
|
+
}
|
|
43
|
+
.file-selector-container.with-type-dropdown {
|
|
44
|
+
padding: 0;
|
|
45
|
+
}
|
|
46
|
+
.file-selector-container.with-type-dropdown etools-dropdown.type-dropdown {
|
|
47
|
+
flex: none;
|
|
48
|
+
width: 209px;
|
|
49
|
+
}
|
|
50
|
+
.file-selector-container.with-type-dropdown .filename-container {
|
|
51
|
+
height: 32px;
|
|
52
|
+
box-sizing: border-box;
|
|
53
|
+
margin: 22px 8px;
|
|
54
|
+
border-bottom: 1px solid var(--gray-20);
|
|
55
|
+
}
|
|
56
|
+
.file-selector-container.with-type-dropdown .delete-button,
|
|
57
|
+
.file-selector-container.with-type-dropdown .download-button {
|
|
58
|
+
margin-top: 15px;
|
|
59
|
+
}
|
|
60
|
+
etools-upload-multi.with-padding {
|
|
61
|
+
padding: 12px 9px 12px 0;
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
}
|
|
64
64
|
`;
|