@unicef-polymer/etools-form-builder 4.0.0 → 4.0.2
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.js +8 -0
- 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.d.ts +4 -3
- package/dist/form-fields/field-renderer-component.js +209 -195
- 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.js +63 -63
- 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.js +65 -65
- 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.js +129 -129
- package/dist/form-groups/form-card.js +30 -30
- package/dist/form-groups/form-collapsed-card.js +40 -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 -0
- package/dist/rich-editor/rich-action.js +34 -34
- package/dist/rich-editor/rich-text.js +64 -64
- package/dist/rich-editor/rich-toolbar.js +125 -125
- package/dist/rich-editor/rich-viewer.js +21 -21
- package/package.json +53 -53
|
@@ -112,8 +112,8 @@ let FormAbstractGroup = class FormAbstractGroup extends LitElement {
|
|
|
112
112
|
if (!this.groupStructure || !this.metadata) {
|
|
113
113
|
return html ``;
|
|
114
114
|
}
|
|
115
|
-
return html `
|
|
116
|
-
${this.groupStructure.children.map((child) => this.renderChild(child))}
|
|
115
|
+
return html `
|
|
116
|
+
${this.groupStructure.children.map((child) => this.renderChild(child))}
|
|
117
117
|
`;
|
|
118
118
|
}
|
|
119
119
|
renderChild(child) {
|
|
@@ -132,19 +132,19 @@ let FormAbstractGroup = class FormAbstractGroup extends LitElement {
|
|
|
132
132
|
}
|
|
133
133
|
renderField(blueprintField) {
|
|
134
134
|
var _a;
|
|
135
|
-
return html `
|
|
136
|
-
<field-renderer
|
|
137
|
-
.field="${blueprintField}"
|
|
138
|
-
.language="${this.language}"
|
|
139
|
-
?readonly="${live(this.isReadonly())}"
|
|
140
|
-
.value="${this.value && this.value[blueprintField.name]}"
|
|
141
|
-
.validations="${blueprintField.validations.map((validation) => this.metadata.validations[validation])}"
|
|
142
|
-
.errorMessage="${this.getErrorMessage(blueprintField.name)}"
|
|
143
|
-
.options="${((_a = this.metadata.options[blueprintField.options_key || '']) === null || _a === void 0 ? void 0 : _a.values) || []}"
|
|
144
|
-
.computedPath="${this.computedPath.concat(this.groupStructure.name === 'root' ? [blueprintField.name] : [this.groupStructure.name, blueprintField.name])}"
|
|
145
|
-
@value-changed="${(event) => this.valueChanged(event, blueprintField.name)}"
|
|
146
|
-
@error-changed="${(event) => this.errorChanged(event, blueprintField.name)}"
|
|
147
|
-
></field-renderer>
|
|
135
|
+
return html `
|
|
136
|
+
<field-renderer
|
|
137
|
+
.field="${blueprintField}"
|
|
138
|
+
.language="${this.language}"
|
|
139
|
+
?readonly="${live(this.isReadonly())}"
|
|
140
|
+
.value="${this.value && this.value[blueprintField.name]}"
|
|
141
|
+
.validations="${blueprintField.validations.map((validation) => this.metadata.validations[validation])}"
|
|
142
|
+
.errorMessage="${this.getErrorMessage(blueprintField.name)}"
|
|
143
|
+
.options="${((_a = this.metadata.options[blueprintField.options_key || '']) === null || _a === void 0 ? void 0 : _a.values) || []}"
|
|
144
|
+
.computedPath="${this.computedPath.concat(this.groupStructure.name === 'root' ? [blueprintField.name] : [this.groupStructure.name, blueprintField.name])}"
|
|
145
|
+
@value-changed="${(event) => this.valueChanged(event, blueprintField.name)}"
|
|
146
|
+
@error-changed="${(event) => this.errorChanged(event, blueprintField.name)}"
|
|
147
|
+
></field-renderer>
|
|
148
148
|
`;
|
|
149
149
|
}
|
|
150
150
|
renderInformation(information) {
|
|
@@ -155,18 +155,18 @@ let FormAbstractGroup = class FormAbstractGroup extends LitElement {
|
|
|
155
155
|
return this.getGroupTemplate(groupStructure);
|
|
156
156
|
}
|
|
157
157
|
const value = (this.value && this.value[groupStructure.name]) || [{}];
|
|
158
|
-
return html `
|
|
159
|
-
${value.map((_, index) => this.getGroupTemplate(groupStructure, index))}
|
|
160
|
-
<etools-button
|
|
161
|
-
variant="primary"
|
|
162
|
-
class="add-group save-button"
|
|
163
|
-
@click="${() => this.addGroup(groupStructure.name)}"
|
|
164
|
-
>
|
|
165
|
-
${getTranslation(this.language, 'ADD')}
|
|
158
|
+
return html `
|
|
159
|
+
${value.map((_, index) => this.getGroupTemplate(groupStructure, index))}
|
|
160
|
+
<etools-button
|
|
161
|
+
variant="primary"
|
|
162
|
+
class="add-group save-button"
|
|
163
|
+
@click="${() => this.addGroup(groupStructure.name)}"
|
|
164
|
+
>
|
|
165
|
+
${getTranslation(this.language, 'ADD')}
|
|
166
166
|
${!groupStructure.title || groupStructure.title.length > 15
|
|
167
167
|
? getTranslation(this.language, 'GROUP')
|
|
168
|
-
: groupStructure.title}
|
|
169
|
-
</etools-button>
|
|
168
|
+
: groupStructure.title}
|
|
169
|
+
</etools-button>
|
|
170
170
|
`;
|
|
171
171
|
}
|
|
172
172
|
getGroupTemplate(groupStructure, index) {
|
|
@@ -182,52 +182,52 @@ let FormAbstractGroup = class FormAbstractGroup extends LitElement {
|
|
|
182
182
|
errors = errors && errors[index];
|
|
183
183
|
}
|
|
184
184
|
if (isAbstract) {
|
|
185
|
-
return html `
|
|
186
|
-
<form-abstract-group
|
|
187
|
-
.groupStructure="${groupStructure}"
|
|
188
|
-
.value="${value}"
|
|
189
|
-
.metadata="${this.metadata}"
|
|
190
|
-
.parentGroupName="${this.groupStructure.name}"
|
|
191
|
-
.collapsed="${this.collapsed}"
|
|
192
|
-
.computedPath="${this.computedPath.concat(this.groupStructure.name === 'root' ? [] : [this.groupStructure.name])}"
|
|
193
|
-
.readonly="${this.isReadonly()}"
|
|
194
|
-
.errors="${errors || null}"
|
|
195
|
-
@value-changed="${(event) => this.valueChanged(event, groupStructure.name, index)}"
|
|
196
|
-
@error-changed="${(event) => this.errorChanged(event, groupStructure.name, index)}"
|
|
197
|
-
></form-abstract-group>
|
|
185
|
+
return html `
|
|
186
|
+
<form-abstract-group
|
|
187
|
+
.groupStructure="${groupStructure}"
|
|
188
|
+
.value="${value}"
|
|
189
|
+
.metadata="${this.metadata}"
|
|
190
|
+
.parentGroupName="${this.groupStructure.name}"
|
|
191
|
+
.collapsed="${this.collapsed}"
|
|
192
|
+
.computedPath="${this.computedPath.concat(this.groupStructure.name === 'root' ? [] : [this.groupStructure.name])}"
|
|
193
|
+
.readonly="${this.isReadonly()}"
|
|
194
|
+
.errors="${errors || null}"
|
|
195
|
+
@value-changed="${(event) => this.valueChanged(event, groupStructure.name, index)}"
|
|
196
|
+
@error-changed="${(event) => this.errorChanged(event, groupStructure.name, index)}"
|
|
197
|
+
></form-abstract-group>
|
|
198
198
|
`;
|
|
199
199
|
}
|
|
200
200
|
else if (isCard && isCollapsed) {
|
|
201
|
-
return html `
|
|
202
|
-
<form-collapsed-card
|
|
203
|
-
.groupStructure="${groupStructure}"
|
|
204
|
-
.value="${value}"
|
|
205
|
-
.metadata="${this.metadata}"
|
|
206
|
-
.parentGroupName="${this.groupStructure.name}"
|
|
207
|
-
.collapsed="${this.collapsed}"
|
|
208
|
-
.computedPath="${this.computedPath.concat(this.groupStructure.name === 'root' ? [] : [this.groupStructure.name])}"
|
|
209
|
-
.readonly="${this.isReadonly()}"
|
|
210
|
-
.errors="${errors || null}"
|
|
211
|
-
@remove-group="${() => this.removeGroup(groupStructure, index)}"
|
|
212
|
-
@value-changed="${(event) => this.valueChanged(event, groupStructure.name, index)}"
|
|
213
|
-
@error-changed="${(event) => this.errorChanged(event, groupStructure.name, index)}"
|
|
214
|
-
></form-collapsed-card>
|
|
201
|
+
return html `
|
|
202
|
+
<form-collapsed-card
|
|
203
|
+
.groupStructure="${groupStructure}"
|
|
204
|
+
.value="${value}"
|
|
205
|
+
.metadata="${this.metadata}"
|
|
206
|
+
.parentGroupName="${this.groupStructure.name}"
|
|
207
|
+
.collapsed="${this.collapsed}"
|
|
208
|
+
.computedPath="${this.computedPath.concat(this.groupStructure.name === 'root' ? [] : [this.groupStructure.name])}"
|
|
209
|
+
.readonly="${this.isReadonly()}"
|
|
210
|
+
.errors="${errors || null}"
|
|
211
|
+
@remove-group="${() => this.removeGroup(groupStructure, index)}"
|
|
212
|
+
@value-changed="${(event) => this.valueChanged(event, groupStructure.name, index)}"
|
|
213
|
+
@error-changed="${(event) => this.errorChanged(event, groupStructure.name, index)}"
|
|
214
|
+
></form-collapsed-card>
|
|
215
215
|
`;
|
|
216
216
|
}
|
|
217
217
|
else if (isCard) {
|
|
218
|
-
return html `
|
|
219
|
-
<form-card
|
|
220
|
-
.groupStructure="${groupStructure}"
|
|
221
|
-
.value="${value}"
|
|
222
|
-
.metadata="${this.metadata}"
|
|
223
|
-
.parentGroupName="${this.groupStructure.name}"
|
|
224
|
-
.computedPath="${this.computedPath.concat(this.groupStructure.name === 'root' ? [] : [this.groupStructure.name])}"
|
|
225
|
-
.readonly="${this.isReadonly()}"
|
|
226
|
-
.errors="${errors || null}"
|
|
227
|
-
@remove-group="${() => this.removeGroup(groupStructure, index)}"
|
|
228
|
-
@value-changed="${(event) => this.valueChanged(event, groupStructure.name, index)}"
|
|
229
|
-
@error-changed="${(event) => this.errorChanged(event, groupStructure.name, index)}"
|
|
230
|
-
></form-card>
|
|
218
|
+
return html `
|
|
219
|
+
<form-card
|
|
220
|
+
.groupStructure="${groupStructure}"
|
|
221
|
+
.value="${value}"
|
|
222
|
+
.metadata="${this.metadata}"
|
|
223
|
+
.parentGroupName="${this.groupStructure.name}"
|
|
224
|
+
.computedPath="${this.computedPath.concat(this.groupStructure.name === 'root' ? [] : [this.groupStructure.name])}"
|
|
225
|
+
.readonly="${this.isReadonly()}"
|
|
226
|
+
.errors="${errors || null}"
|
|
227
|
+
@remove-group="${() => this.removeGroup(groupStructure, index)}"
|
|
228
|
+
@value-changed="${(event) => this.valueChanged(event, groupStructure.name, index)}"
|
|
229
|
+
@error-changed="${(event) => this.errorChanged(event, groupStructure.name, index)}"
|
|
230
|
+
></form-card>
|
|
231
231
|
`;
|
|
232
232
|
}
|
|
233
233
|
else {
|
|
@@ -308,70 +308,70 @@ let FormAbstractGroup = class FormAbstractGroup extends LitElement {
|
|
|
308
308
|
CardStyles,
|
|
309
309
|
FlexLayoutClasses,
|
|
310
310
|
FormBuilderCardStyles,
|
|
311
|
-
css `
|
|
312
|
-
:host {
|
|
313
|
-
display: flex;
|
|
314
|
-
flex-direction: column;
|
|
315
|
-
}
|
|
316
|
-
.add-group {
|
|
317
|
-
align-self: flex-end;
|
|
318
|
-
margin-right: 23px;
|
|
319
|
-
margin-top: 20px;
|
|
320
|
-
box-shadow:
|
|
321
|
-
0 4px 5px 0 rgba(0, 0, 0, 0.14),
|
|
322
|
-
0 1px 10px 0 rgba(0, 0, 0, 0.12),
|
|
323
|
-
0 2px 4px -1px rgba(0, 0, 0, 0.4);
|
|
324
|
-
}
|
|
325
|
-
.card-header {
|
|
326
|
-
display: flex;
|
|
327
|
-
align-items: center;
|
|
328
|
-
justify-content: space-between;
|
|
329
|
-
}
|
|
330
|
-
.card-header .remove-group {
|
|
331
|
-
display: flex;
|
|
332
|
-
align-items: center;
|
|
333
|
-
justify-content: flex-end;
|
|
334
|
-
padding: 0 10px 8px;
|
|
335
|
-
cursor: pointer;
|
|
336
|
-
width: min-content;
|
|
337
|
-
white-space: nowrap;
|
|
338
|
-
}
|
|
339
|
-
.card-header .title {
|
|
340
|
-
padding: 0 24px 8px;
|
|
341
|
-
font-size: var(--etools-font-size-18, 18px);
|
|
342
|
-
font-weight: bold;
|
|
343
|
-
}
|
|
344
|
-
.save-button {
|
|
345
|
-
margin-top: 8px;
|
|
346
|
-
color: var(--primary-background-color);
|
|
347
|
-
background-color: var(--primary-color);
|
|
348
|
-
}
|
|
349
|
-
.information-source {
|
|
350
|
-
padding: 0.5% 2% 0.5% 1%;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.additional-field {
|
|
354
|
-
padding-top: 15px;
|
|
355
|
-
padding-bottom: 20px;
|
|
356
|
-
background-color: var(--secondary-background-color);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.actions-container {
|
|
360
|
-
padding: 0 25px 5px 45px;
|
|
361
|
-
box-sizing: border-box;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.card-container.form-card {
|
|
365
|
-
padding: 12px 0 15px;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
.attachments-warning {
|
|
369
|
-
color: red;
|
|
370
|
-
}
|
|
371
|
-
etools-icon-button[name='close'] {
|
|
372
|
-
cursor: pointer;
|
|
373
|
-
color: var(--primary-text-color);
|
|
374
|
-
}
|
|
311
|
+
css `
|
|
312
|
+
:host {
|
|
313
|
+
display: flex;
|
|
314
|
+
flex-direction: column;
|
|
315
|
+
}
|
|
316
|
+
.add-group {
|
|
317
|
+
align-self: flex-end;
|
|
318
|
+
margin-right: 23px;
|
|
319
|
+
margin-top: 20px;
|
|
320
|
+
box-shadow:
|
|
321
|
+
0 4px 5px 0 rgba(0, 0, 0, 0.14),
|
|
322
|
+
0 1px 10px 0 rgba(0, 0, 0, 0.12),
|
|
323
|
+
0 2px 4px -1px rgba(0, 0, 0, 0.4);
|
|
324
|
+
}
|
|
325
|
+
.card-header {
|
|
326
|
+
display: flex;
|
|
327
|
+
align-items: center;
|
|
328
|
+
justify-content: space-between;
|
|
329
|
+
}
|
|
330
|
+
.card-header .remove-group {
|
|
331
|
+
display: flex;
|
|
332
|
+
align-items: center;
|
|
333
|
+
justify-content: flex-end;
|
|
334
|
+
padding: 0 10px 8px;
|
|
335
|
+
cursor: pointer;
|
|
336
|
+
width: min-content;
|
|
337
|
+
white-space: nowrap;
|
|
338
|
+
}
|
|
339
|
+
.card-header .title {
|
|
340
|
+
padding: 0 24px 8px;
|
|
341
|
+
font-size: var(--etools-font-size-18, 18px);
|
|
342
|
+
font-weight: bold;
|
|
343
|
+
}
|
|
344
|
+
.save-button {
|
|
345
|
+
margin-top: 8px;
|
|
346
|
+
color: var(--primary-background-color);
|
|
347
|
+
background-color: var(--primary-color);
|
|
348
|
+
}
|
|
349
|
+
.information-source {
|
|
350
|
+
padding: 0.5% 2% 0.5% 1%;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.additional-field {
|
|
354
|
+
padding-top: 15px;
|
|
355
|
+
padding-bottom: 20px;
|
|
356
|
+
background-color: var(--secondary-background-color);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.actions-container {
|
|
360
|
+
padding: 0 25px 5px 45px;
|
|
361
|
+
box-sizing: border-box;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.card-container.form-card {
|
|
365
|
+
padding: 12px 0 15px;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.attachments-warning {
|
|
369
|
+
color: red;
|
|
370
|
+
}
|
|
371
|
+
etools-icon-button[name='close'] {
|
|
372
|
+
cursor: pointer;
|
|
373
|
+
color: var(--primary-text-color);
|
|
374
|
+
}
|
|
375
375
|
`
|
|
376
376
|
];
|
|
377
377
|
}
|
|
@@ -47,38 +47,38 @@ let FormCard = class FormCard extends FormAbstractGroup {
|
|
|
47
47
|
return [SharedStyles, pageLayoutStyles, elevationStyles, CardStyles, FlexLayoutClasses, FormBuilderCardStyles];
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
return html `
|
|
51
|
-
<style>
|
|
52
|
-
.card-buttons {
|
|
53
|
-
padding: 12px 24px;
|
|
54
|
-
padding-top: 0;
|
|
55
|
-
}
|
|
56
|
-
</style>
|
|
57
|
-
<section class="elevation page-content card-container form-card" elevation="1">
|
|
58
|
-
<div class="card-header">
|
|
59
|
-
<div class="title">${this.groupStructure.title}</div>
|
|
60
|
-
<div
|
|
61
|
-
class="remove-group"
|
|
62
|
-
?hidden="${!this.groupStructure.repeatable}"
|
|
63
|
-
@click="${() => this.confirmRemove(this.groupStructure.title || getTranslation(this.language, 'THIS_GROUP'))}"
|
|
64
|
-
>
|
|
65
|
-
Remove
|
|
50
|
+
return html `
|
|
51
|
+
<style>
|
|
52
|
+
.card-buttons {
|
|
53
|
+
padding: 12px 24px;
|
|
54
|
+
padding-top: 0;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
57
|
+
<section class="elevation page-content card-container form-card" elevation="1">
|
|
58
|
+
<div class="card-header">
|
|
59
|
+
<div class="title">${this.groupStructure.title}</div>
|
|
60
|
+
<div
|
|
61
|
+
class="remove-group"
|
|
62
|
+
?hidden="${!this.groupStructure.repeatable}"
|
|
63
|
+
@click="${() => this.confirmRemove(this.groupStructure.title || getTranslation(this.language, 'THIS_GROUP'))}"
|
|
64
|
+
>
|
|
65
|
+
Remove
|
|
66
66
|
${!this.groupStructure.title || this.groupStructure.title.length > 15
|
|
67
67
|
? getTranslation(this.language, 'GROUP')
|
|
68
|
-
: this.groupStructure.title}
|
|
69
|
-
<etools-icon-button class="attachments-warning" name="delete"></etools-icon-button>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
${super.render()}
|
|
73
|
-
|
|
74
|
-
<etools-collapse ?opened="${this.showSaveButton}">
|
|
75
|
-
<div class="layout horizontal end-justified card-buttons actions-container">
|
|
76
|
-
<etools-button variant="primary" @click="${this.saveChanges}">
|
|
77
|
-
${getTranslation(this.language, 'SAVE')}
|
|
78
|
-
</etools-button>
|
|
79
|
-
</div>
|
|
80
|
-
</etools-collapse>
|
|
81
|
-
</section>
|
|
68
|
+
: this.groupStructure.title}
|
|
69
|
+
<etools-icon-button class="attachments-warning" name="delete"></etools-icon-button>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
${super.render()}
|
|
73
|
+
|
|
74
|
+
<etools-collapse ?opened="${this.showSaveButton}">
|
|
75
|
+
<div class="layout horizontal end-justified card-buttons actions-container">
|
|
76
|
+
<etools-button variant="primary" @click="${this.saveChanges}">
|
|
77
|
+
${getTranslation(this.language, 'SAVE')}
|
|
78
|
+
</etools-button>
|
|
79
|
+
</div>
|
|
80
|
+
</etools-collapse>
|
|
81
|
+
</section>
|
|
82
82
|
`;
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
@@ -12,6 +12,8 @@ import '@unicef-polymer/etools-unicef/src/etools-icon-button/etools-icon-button'
|
|
|
12
12
|
const PARTNER_KEY = 'partner';
|
|
13
13
|
const OUTPUT_KEY = 'output';
|
|
14
14
|
const INTERVENTION_KEY = 'intervention';
|
|
15
|
+
const GPD_KEY = 'gpd';
|
|
16
|
+
const EWP_ACTIVITY_KEY = 'ewp_activity';
|
|
15
17
|
let FormCollapsedCard = class FormCollapsedCard extends FormAbstractGroup {
|
|
16
18
|
constructor() {
|
|
17
19
|
super(...arguments);
|
|
@@ -73,31 +75,31 @@ let FormCollapsedCard = class FormCollapsedCard extends FormAbstractGroup {
|
|
|
73
75
|
* and adds etools-card as container wrapper
|
|
74
76
|
*/
|
|
75
77
|
render() {
|
|
76
|
-
return html `
|
|
77
|
-
<section class="elevation page-content card-container" elevation="1">
|
|
78
|
-
<etools-fb-card
|
|
79
|
-
card-title="${this.retrieveTitle(this.parentGroupName) + this.groupStructure.title}"
|
|
80
|
-
is-collapsible
|
|
81
|
-
?is-editable="${!this.readonly}"
|
|
82
|
-
?edit="${this.isEditMode}"
|
|
83
|
-
.collapsed="${this.collapsed}"
|
|
84
|
-
@start-edit="${() => this.startEdit()}"
|
|
85
|
-
@save="${() => this.saveChanges()}"
|
|
86
|
-
@cancel="${() => this.cancelEdit()}"
|
|
87
|
-
>
|
|
88
|
-
<!-- Open Attachments popup button -->
|
|
89
|
-
<div slot="actions" class="layout horizontal center">${this.getAdditionalButtons()}</div>
|
|
90
|
-
<div slot="postfix" class="layout horizontal center" ?hidden="${!this.groupStructure.repeatable}">
|
|
91
|
-
<etools-icon-button
|
|
92
|
-
class="attachments-warning"
|
|
93
|
-
name="close"
|
|
94
|
-
@click="${() => this.confirmRemove(this.groupStructure.title || getTranslation(this.language, 'THIS_GROUP'))}"
|
|
95
|
-
>
|
|
96
|
-
</etools-icon-button>
|
|
97
|
-
</div>
|
|
98
|
-
<div slot="content">${this.renderGroupChildren()}</div>
|
|
99
|
-
</etools-fb-card>
|
|
100
|
-
</section>
|
|
78
|
+
return html `
|
|
79
|
+
<section class="elevation page-content card-container" elevation="1">
|
|
80
|
+
<etools-fb-card
|
|
81
|
+
card-title="${this.retrieveTitle(this.parentGroupName) + ': ' + this.groupStructure.title}"
|
|
82
|
+
is-collapsible
|
|
83
|
+
?is-editable="${!this.readonly}"
|
|
84
|
+
?edit="${this.isEditMode}"
|
|
85
|
+
.collapsed="${this.collapsed}"
|
|
86
|
+
@start-edit="${() => this.startEdit()}"
|
|
87
|
+
@save="${() => this.saveChanges()}"
|
|
88
|
+
@cancel="${() => this.cancelEdit()}"
|
|
89
|
+
>
|
|
90
|
+
<!-- Open Attachments popup button -->
|
|
91
|
+
<div slot="actions" class="layout horizontal center">${this.getAdditionalButtons()}</div>
|
|
92
|
+
<div slot="postfix" class="layout horizontal center" ?hidden="${!this.groupStructure.repeatable}">
|
|
93
|
+
<etools-icon-button
|
|
94
|
+
class="attachments-warning"
|
|
95
|
+
name="close"
|
|
96
|
+
@click="${() => this.confirmRemove(this.groupStructure.title || getTranslation(this.language, 'THIS_GROUP'))}"
|
|
97
|
+
>
|
|
98
|
+
</etools-icon-button>
|
|
99
|
+
</div>
|
|
100
|
+
<div slot="content">${this.renderGroupChildren()}</div>
|
|
101
|
+
</etools-fb-card>
|
|
102
|
+
</section>
|
|
101
103
|
`;
|
|
102
104
|
}
|
|
103
105
|
/**
|
|
@@ -119,15 +121,15 @@ let FormCollapsedCard = class FormCollapsedCard extends FormAbstractGroup {
|
|
|
119
121
|
!this.groupStructure.children.some(({ styling }) => styling.includes(StructureTypes.ATTACHMENTS_BUTTON));
|
|
120
122
|
return hideAttachmentsButton
|
|
121
123
|
? html ``
|
|
122
|
-
: html `
|
|
123
|
-
<etools-icon id="attachments-warning" name="warning" ?hidden="${!this._errors.attachments}"></etools-icon>
|
|
124
|
-
<etools-button id="primary" variant="text" class="primary" @click="${this.openAttachmentsPopup}">
|
|
125
|
-
<etools-icon
|
|
126
|
-
slot="prefix"
|
|
127
|
-
name="${((_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.attachments) === null || _d === void 0 ? void 0 : _d.length) ? 'file-download' : 'file-upload'}"
|
|
128
|
-
></etools-icon>
|
|
129
|
-
${this.getAttachmentsBtnText((_f = (_e = this.value) === null || _e === void 0 ? void 0 : _e.attachments) === null || _f === void 0 ? void 0 : _f.length)}
|
|
130
|
-
</etools-button>
|
|
124
|
+
: html `
|
|
125
|
+
<etools-icon id="attachments-warning" name="warning" ?hidden="${!this._errors.attachments}"></etools-icon>
|
|
126
|
+
<etools-button id="primary" variant="text" class="primary" @click="${this.openAttachmentsPopup}">
|
|
127
|
+
<etools-icon
|
|
128
|
+
slot="prefix"
|
|
129
|
+
name="${((_d = (_c = this.value) === null || _c === void 0 ? void 0 : _c.attachments) === null || _d === void 0 ? void 0 : _d.length) ? 'file-download' : 'file-upload'}"
|
|
130
|
+
></etools-icon>
|
|
131
|
+
${this.getAttachmentsBtnText((_f = (_e = this.value) === null || _e === void 0 ? void 0 : _e.attachments) === null || _f === void 0 ? void 0 : _f.length)}
|
|
132
|
+
</etools-button>
|
|
131
133
|
`;
|
|
132
134
|
}
|
|
133
135
|
retrieveTitle(target) {
|
|
@@ -138,6 +140,10 @@ let FormCollapsedCard = class FormCollapsedCard extends FormAbstractGroup {
|
|
|
138
140
|
return `${getTranslation(this.language, 'CP_OUTPUT')}`;
|
|
139
141
|
case INTERVENTION_KEY:
|
|
140
142
|
return `${getTranslation(this.language, 'PD_SPD')}`;
|
|
143
|
+
case EWP_ACTIVITY_KEY:
|
|
144
|
+
return `${getTranslation(this.language, 'EWP_ACTIVITY')}`;
|
|
145
|
+
case GPD_KEY:
|
|
146
|
+
return `${getTranslation(this.language, 'GPD')}`;
|
|
141
147
|
default:
|
|
142
148
|
return '';
|
|
143
149
|
}
|
|
@@ -21,22 +21,22 @@ let ConfirmationDialog = class ConfirmationDialog extends LitElement {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return html `
|
|
25
|
-
<etools-dialog
|
|
26
|
-
id="confirmation-dialog"
|
|
27
|
-
size="md"
|
|
28
|
-
no-padding
|
|
29
|
-
keep-dialog-open
|
|
30
|
-
?hide-confirm-btn="${this.hideConfirmBtn}"
|
|
31
|
-
cancel-btn-text="${getTranslation(this.language, this.hideConfirmBtn ? 'OK' : 'CANCEL')}"
|
|
32
|
-
?opened="${this.dialogOpened}"
|
|
33
|
-
theme="confirmation"
|
|
34
|
-
dialog-title="${this.dialogTitle}"
|
|
35
|
-
@close="${this.onClose}"
|
|
36
|
-
@confirm-btn-clicked="${() => this.confirm()}"
|
|
37
|
-
>
|
|
38
|
-
<div class="confirmation-message">${this.text}</div>
|
|
39
|
-
</etools-dialog>
|
|
24
|
+
return html `
|
|
25
|
+
<etools-dialog
|
|
26
|
+
id="confirmation-dialog"
|
|
27
|
+
size="md"
|
|
28
|
+
no-padding
|
|
29
|
+
keep-dialog-open
|
|
30
|
+
?hide-confirm-btn="${this.hideConfirmBtn}"
|
|
31
|
+
cancel-btn-text="${getTranslation(this.language, this.hideConfirmBtn ? 'OK' : 'CANCEL')}"
|
|
32
|
+
?opened="${this.dialogOpened}"
|
|
33
|
+
theme="confirmation"
|
|
34
|
+
dialog-title="${this.dialogTitle}"
|
|
35
|
+
@close="${this.onClose}"
|
|
36
|
+
@confirm-btn-clicked="${() => this.confirm()}"
|
|
37
|
+
>
|
|
38
|
+
<div class="confirmation-message">${this.text}</div>
|
|
39
|
+
</etools-dialog>
|
|
40
40
|
`;
|
|
41
41
|
}
|
|
42
42
|
onClose() {
|
|
@@ -48,10 +48,10 @@ let ConfirmationDialog = class ConfirmationDialog extends LitElement {
|
|
|
48
48
|
static get styles() {
|
|
49
49
|
// language=CSS
|
|
50
50
|
return [
|
|
51
|
-
css `
|
|
52
|
-
.confirmation-message {
|
|
53
|
-
padding-left: 24px;
|
|
54
|
-
}
|
|
51
|
+
css `
|
|
52
|
+
.confirmation-message {
|
|
53
|
+
padding-left: 24px;
|
|
54
|
+
}
|
|
55
55
|
`
|
|
56
56
|
];
|
|
57
57
|
}
|