@unicef-polymer/etools-form-builder 3.1.1 → 3.1.3
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.d.ts +1 -0
- package/dist/form-fields/abstract-field-base.class.js +104 -101
- package/dist/form-fields/field-renderer-component.d.ts +1 -1
- package/dist/form-fields/field-renderer-component.js +168 -166
- 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-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/number-field.js +20 -20
- package/dist/form-fields/single-fields/scale-field.js +58 -58
- package/dist/form-fields/single-fields/text-field.d.ts +4 -1
- package/dist/form-fields/single-fields/text-field.js +54 -26
- 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 +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/rich-editor/rich-action.d.ts +19 -0
- package/dist/rich-editor/rich-action.js +105 -0
- package/dist/rich-editor/rich-text.d.ts +12 -0
- package/dist/rich-editor/rich-text.js +125 -0
- package/dist/rich-editor/rich-toolbar.d.ts +14 -0
- package/dist/rich-editor/rich-toolbar.js +194 -0
- package/dist/rich-editor/rich-viewer.d.ts +11 -0
- package/dist/rich-editor/rich-viewer.js +78 -0
- package/package.json +51 -52
|
@@ -23,103 +23,105 @@ let FieldRendererComponent = class FieldRendererComponent extends LitElement {
|
|
|
23
23
|
return this.renderField(this.field);
|
|
24
24
|
}
|
|
25
25
|
renderField(blueprintField) {
|
|
26
|
-
const
|
|
26
|
+
const isAdditionalField = blueprintField.styling.includes(StructureTypes.ADDITIONAL);
|
|
27
|
+
const additionalClass = isAdditionalField
|
|
27
28
|
? `additional-field ${blueprintField.name} `
|
|
28
29
|
: `${blueprintField.name} `;
|
|
29
30
|
const wideClass = blueprintField.styling.includes(StructureTypes.WIDE) ? 'wide-field-container ' : '';
|
|
30
31
|
const mandatoryClass = blueprintField.styling.includes(StructureTypes.MANDATORY_WARNING)
|
|
31
32
|
? 'mandatory_warning '
|
|
32
33
|
: '';
|
|
33
|
-
return html `
|
|
34
|
-
<div class="${`${additionalClass}${wideClass}${mandatoryClass}finding-container`}">
|
|
34
|
+
return html `
|
|
35
|
+
<div class="${`${additionalClass}${wideClass}${mandatoryClass}finding-container`}">
|
|
35
36
|
${blueprintField.repeatable
|
|
36
37
|
? this.renderRepeatableField(blueprintField, !!mandatoryClass)
|
|
37
|
-
: this.renderStandardField(blueprintField, !!mandatoryClass)}
|
|
38
|
-
</div>
|
|
38
|
+
: this.renderStandardField(blueprintField, !!mandatoryClass, isAdditionalField)}
|
|
39
|
+
</div>
|
|
39
40
|
`;
|
|
40
41
|
}
|
|
41
|
-
renderStandardField({ input_type, label, help_text, required, placeholder, styling, name }, isMandatory = false) {
|
|
42
|
+
renderStandardField({ input_type, label, help_text, required, placeholder, styling, name }, isMandatory = false, isAdditionalField = false) {
|
|
42
43
|
var _a, _b, _c, _d;
|
|
43
44
|
const isWide = styling.includes(StructureTypes.WIDE);
|
|
44
45
|
switch (input_type) {
|
|
45
46
|
case FieldTypes.TEXT_TYPE:
|
|
46
|
-
return html `
|
|
47
|
-
<text-field
|
|
48
|
-
class="${isWide ? 'wide' : ''}"
|
|
49
|
-
?is-readonly="${this.readonly}"
|
|
50
|
-
?required="${required}"
|
|
51
|
-
.placeholder="${placeholder}"
|
|
52
|
-
.name="${name}"
|
|
53
|
-
.value="${this.value}"
|
|
54
|
-
.validators="${this.validations}"
|
|
55
|
-
.errorMessage="${this.errorMessage}"
|
|
56
|
-
.defaultValue="${(_a = this.field) === null || _a === void 0 ? void 0 : _a.default_value}"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
return html `
|
|
48
|
+
<text-field
|
|
49
|
+
class="${isWide ? 'wide' : ''}"
|
|
50
|
+
?is-readonly="${this.readonly}"
|
|
51
|
+
?required="${required}"
|
|
52
|
+
.placeholder="${placeholder}"
|
|
53
|
+
.name="${name}"
|
|
54
|
+
.value="${this.value}"
|
|
55
|
+
.validators="${this.validations}"
|
|
56
|
+
.errorMessage="${this.errorMessage}"
|
|
57
|
+
.defaultValue="${(_a = this.field) === null || _a === void 0 ? void 0 : _a.default_value}"
|
|
58
|
+
.showRichEditor="${isAdditionalField}"
|
|
59
|
+
>
|
|
60
|
+
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
61
|
+
</text-field>
|
|
60
62
|
`;
|
|
61
63
|
case FieldTypes.NUMBER_TYPE:
|
|
62
64
|
case FieldTypes.NUMBER_FLOAT_TYPE:
|
|
63
65
|
case FieldTypes.NUMBER_INTEGER_TYPE:
|
|
64
|
-
return html `
|
|
65
|
-
<number-field
|
|
66
|
-
?is-readonly="${this.readonly}"
|
|
67
|
-
?required="${required}"
|
|
68
|
-
.placeholder="${placeholder}"
|
|
69
|
-
.value="${this.value}"
|
|
70
|
-
.name="${name}"
|
|
71
|
-
.validators="${this.validations}"
|
|
72
|
-
.errorMessage="${this.errorMessage}"
|
|
73
|
-
.isInteger="${Boolean(input_type === FieldTypes.NUMBER_INTEGER_TYPE)}"
|
|
74
|
-
.defaultValue="${(_b = this.field) === null || _b === void 0 ? void 0 : _b.default_value}"
|
|
75
|
-
>
|
|
76
|
-
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
77
|
-
</number-field>
|
|
66
|
+
return html `
|
|
67
|
+
<number-field
|
|
68
|
+
?is-readonly="${this.readonly}"
|
|
69
|
+
?required="${required}"
|
|
70
|
+
.placeholder="${placeholder}"
|
|
71
|
+
.value="${this.value}"
|
|
72
|
+
.name="${name}"
|
|
73
|
+
.validators="${this.validations}"
|
|
74
|
+
.errorMessage="${this.errorMessage}"
|
|
75
|
+
.isInteger="${Boolean(input_type === FieldTypes.NUMBER_INTEGER_TYPE)}"
|
|
76
|
+
.defaultValue="${(_b = this.field) === null || _b === void 0 ? void 0 : _b.default_value}"
|
|
77
|
+
>
|
|
78
|
+
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
79
|
+
</number-field>
|
|
78
80
|
`;
|
|
79
81
|
case FieldTypes.BOOL_TYPE:
|
|
80
|
-
return html `
|
|
81
|
-
<boolean-field
|
|
82
|
-
?is-readonly="${this.readonly}"
|
|
83
|
-
?required="${required}"
|
|
84
|
-
.value="${this.value}"
|
|
85
|
-
.name="${name}"
|
|
86
|
-
.validators="${this.validations}"
|
|
87
|
-
.errorMessage="${this.errorMessage}"
|
|
88
|
-
.defaultValue="${(_c = this.field) === null || _c === void 0 ? void 0 : _c.default_value}"
|
|
89
|
-
>
|
|
90
|
-
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
91
|
-
</boolean-field>
|
|
82
|
+
return html `
|
|
83
|
+
<boolean-field
|
|
84
|
+
?is-readonly="${this.readonly}"
|
|
85
|
+
?required="${required}"
|
|
86
|
+
.value="${this.value}"
|
|
87
|
+
.name="${name}"
|
|
88
|
+
.validators="${this.validations}"
|
|
89
|
+
.errorMessage="${this.errorMessage}"
|
|
90
|
+
.defaultValue="${(_c = this.field) === null || _c === void 0 ? void 0 : _c.default_value}"
|
|
91
|
+
>
|
|
92
|
+
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
93
|
+
</boolean-field>
|
|
92
94
|
`;
|
|
93
95
|
case FieldTypes.SCALE_TYPE:
|
|
94
|
-
return html `
|
|
95
|
-
<scale-field
|
|
96
|
-
.options="${this.options}"
|
|
97
|
-
?is-readonly="${this.readonly}"
|
|
98
|
-
?required="${required}"
|
|
99
|
-
.placeholder="${placeholder}"
|
|
100
|
-
.value="${this.value}"
|
|
101
|
-
.name="${name}"
|
|
102
|
-
.validators="${this.validations}"
|
|
103
|
-
.errorMessage="${this.errorMessage}"
|
|
104
|
-
.defaultValue="${(_d = this.field) === null || _d === void 0 ? void 0 : _d.default_value}"
|
|
105
|
-
>
|
|
106
|
-
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
107
|
-
</scale-field>
|
|
96
|
+
return html `
|
|
97
|
+
<scale-field
|
|
98
|
+
.options="${this.options}"
|
|
99
|
+
?is-readonly="${this.readonly}"
|
|
100
|
+
?required="${required}"
|
|
101
|
+
.placeholder="${placeholder}"
|
|
102
|
+
.value="${this.value}"
|
|
103
|
+
.name="${name}"
|
|
104
|
+
.validators="${this.validations}"
|
|
105
|
+
.errorMessage="${this.errorMessage}"
|
|
106
|
+
.defaultValue="${(_d = this.field) === null || _d === void 0 ? void 0 : _d.default_value}"
|
|
107
|
+
>
|
|
108
|
+
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
109
|
+
</scale-field>
|
|
108
110
|
`;
|
|
109
111
|
case FieldTypes.FILE_TYPE:
|
|
110
|
-
return html `
|
|
111
|
-
<attachments-field
|
|
112
|
-
?is-readonly="${this.readonly}"
|
|
113
|
-
?required="${required}"
|
|
114
|
-
.placeholder="${placeholder}"
|
|
115
|
-
.value="${this.value}"
|
|
116
|
-
.name="${name}"
|
|
117
|
-
.validators="${this.validations}"
|
|
118
|
-
.errorMessage="${this.errorMessage}"
|
|
119
|
-
.computedPath="${this.computedPath}"
|
|
120
|
-
>
|
|
121
|
-
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
122
|
-
</attachments-field>
|
|
112
|
+
return html `
|
|
113
|
+
<attachments-field
|
|
114
|
+
?is-readonly="${this.readonly}"
|
|
115
|
+
?required="${required}"
|
|
116
|
+
.placeholder="${placeholder}"
|
|
117
|
+
.value="${this.value}"
|
|
118
|
+
.name="${name}"
|
|
119
|
+
.validators="${this.validations}"
|
|
120
|
+
.errorMessage="${this.errorMessage}"
|
|
121
|
+
.computedPath="${this.computedPath}"
|
|
122
|
+
>
|
|
123
|
+
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
124
|
+
</attachments-field>
|
|
123
125
|
`;
|
|
124
126
|
default:
|
|
125
127
|
console.warn(`FormBuilderGroup: Unknown field type: ${input_type}`);
|
|
@@ -128,8 +130,8 @@ let FieldRendererComponent = class FieldRendererComponent extends LitElement {
|
|
|
128
130
|
}
|
|
129
131
|
renderTooltip(isMandatory) {
|
|
130
132
|
return isMandatory
|
|
131
|
-
? html ` <sl-tooltip placement="top" content="${getTranslation(this.language, 'PLEASE_ANSWER')}">
|
|
132
|
-
<etools-icon id="users-icon" name="info-outline"></etools-icon>
|
|
133
|
+
? html ` <sl-tooltip placement="top" content="${getTranslation(this.language, 'PLEASE_ANSWER')}">
|
|
134
|
+
<etools-icon id="users-icon" name="info-outline"></etools-icon>
|
|
133
135
|
</sl-tooltip>`
|
|
134
136
|
: ``;
|
|
135
137
|
}
|
|
@@ -138,67 +140,67 @@ let FieldRendererComponent = class FieldRendererComponent extends LitElement {
|
|
|
138
140
|
const isWide = styling.includes(StructureTypes.WIDE);
|
|
139
141
|
switch (input_type) {
|
|
140
142
|
case FieldTypes.TEXT_TYPE:
|
|
141
|
-
return html `
|
|
142
|
-
<repeatable-text-field
|
|
143
|
-
class="${isWide ? 'wide' : ''}"
|
|
144
|
-
?is-readonly="${this.readonly}"
|
|
145
|
-
?required="${required}"
|
|
146
|
-
.placeholder="${placeholder}"
|
|
147
|
-
.value="${this.value}"
|
|
148
|
-
.validators="${this.validations}"
|
|
149
|
-
.errorMessage="${this.errorMessage}"
|
|
150
|
-
.defaultValue="${(_a = this.field) === null || _a === void 0 ? void 0 : _a.default_value}"
|
|
151
|
-
>
|
|
152
|
-
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
153
|
-
</repeatable-text-field>
|
|
143
|
+
return html `
|
|
144
|
+
<repeatable-text-field
|
|
145
|
+
class="${isWide ? 'wide' : ''}"
|
|
146
|
+
?is-readonly="${this.readonly}"
|
|
147
|
+
?required="${required}"
|
|
148
|
+
.placeholder="${placeholder}"
|
|
149
|
+
.value="${this.value}"
|
|
150
|
+
.validators="${this.validations}"
|
|
151
|
+
.errorMessage="${this.errorMessage}"
|
|
152
|
+
.defaultValue="${(_a = this.field) === null || _a === void 0 ? void 0 : _a.default_value}"
|
|
153
|
+
>
|
|
154
|
+
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
155
|
+
</repeatable-text-field>
|
|
154
156
|
`;
|
|
155
157
|
case FieldTypes.NUMBER_TYPE:
|
|
156
158
|
case FieldTypes.NUMBER_FLOAT_TYPE:
|
|
157
159
|
case FieldTypes.NUMBER_INTEGER_TYPE:
|
|
158
|
-
return html `
|
|
159
|
-
<repeatable-number-field
|
|
160
|
-
class="${isWide ? 'wide' : ''}"
|
|
161
|
-
?is-readonly="${this.readonly}"
|
|
162
|
-
?required="${required}"
|
|
163
|
-
.placeholder="${placeholder}"
|
|
164
|
-
.value="${this.value}"
|
|
165
|
-
.validators="${this.validations}"
|
|
166
|
-
.errorMessage="${this.errorMessage}"
|
|
167
|
-
.isInteger="${Boolean(input_type === FieldTypes.NUMBER_INTEGER_TYPE)}"
|
|
168
|
-
.defaultValue="${(_b = this.field) === null || _b === void 0 ? void 0 : _b.default_value}"
|
|
169
|
-
>
|
|
170
|
-
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
171
|
-
</repeatable-number-field>
|
|
160
|
+
return html `
|
|
161
|
+
<repeatable-number-field
|
|
162
|
+
class="${isWide ? 'wide' : ''}"
|
|
163
|
+
?is-readonly="${this.readonly}"
|
|
164
|
+
?required="${required}"
|
|
165
|
+
.placeholder="${placeholder}"
|
|
166
|
+
.value="${this.value}"
|
|
167
|
+
.validators="${this.validations}"
|
|
168
|
+
.errorMessage="${this.errorMessage}"
|
|
169
|
+
.isInteger="${Boolean(input_type === FieldTypes.NUMBER_INTEGER_TYPE)}"
|
|
170
|
+
.defaultValue="${(_b = this.field) === null || _b === void 0 ? void 0 : _b.default_value}"
|
|
171
|
+
>
|
|
172
|
+
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
173
|
+
</repeatable-number-field>
|
|
172
174
|
`;
|
|
173
175
|
case FieldTypes.SCALE_TYPE:
|
|
174
|
-
return html `
|
|
175
|
-
<repeatable-scale-field
|
|
176
|
-
class="${isWide ? 'wide' : ''}"
|
|
177
|
-
.options="${this.options}"
|
|
178
|
-
?is-readonly="${this.readonly}"
|
|
179
|
-
?required="${required}"
|
|
180
|
-
.placeholder="${placeholder}"
|
|
181
|
-
.value="${this.value}"
|
|
182
|
-
.validators="${this.validations}"
|
|
183
|
-
.errorMessage="${this.errorMessage}"
|
|
184
|
-
.defaultValue="${(_c = this.field) === null || _c === void 0 ? void 0 : _c.default_value}"
|
|
185
|
-
>
|
|
186
|
-
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
187
|
-
</repeatable-scale-field>
|
|
176
|
+
return html `
|
|
177
|
+
<repeatable-scale-field
|
|
178
|
+
class="${isWide ? 'wide' : ''}"
|
|
179
|
+
.options="${this.options}"
|
|
180
|
+
?is-readonly="${this.readonly}"
|
|
181
|
+
?required="${required}"
|
|
182
|
+
.placeholder="${placeholder}"
|
|
183
|
+
.value="${this.value}"
|
|
184
|
+
.validators="${this.validations}"
|
|
185
|
+
.errorMessage="${this.errorMessage}"
|
|
186
|
+
.defaultValue="${(_c = this.field) === null || _c === void 0 ? void 0 : _c.default_value}"
|
|
187
|
+
>
|
|
188
|
+
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
189
|
+
</repeatable-scale-field>
|
|
188
190
|
`;
|
|
189
191
|
case FieldTypes.FILE_TYPE:
|
|
190
|
-
return html `
|
|
191
|
-
<repeatable-attachments-field
|
|
192
|
-
?is-readonly="${this.readonly}"
|
|
193
|
-
?required="${required}"
|
|
194
|
-
.placeholder="${placeholder}"
|
|
195
|
-
.value="${this.value}"
|
|
196
|
-
.validators="${this.validations}"
|
|
197
|
-
.errorMessage="${this.errorMessage}"
|
|
198
|
-
.computedPath="${this.computedPath}"
|
|
199
|
-
>
|
|
200
|
-
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
201
|
-
</repeatable-attachments-field>
|
|
192
|
+
return html `
|
|
193
|
+
<repeatable-attachments-field
|
|
194
|
+
?is-readonly="${this.readonly}"
|
|
195
|
+
?required="${required}"
|
|
196
|
+
.placeholder="${placeholder}"
|
|
197
|
+
.value="${this.value}"
|
|
198
|
+
.validators="${this.validations}"
|
|
199
|
+
.errorMessage="${this.errorMessage}"
|
|
200
|
+
.computedPath="${this.computedPath}"
|
|
201
|
+
>
|
|
202
|
+
${this.renderFieldLabel(label, help_text, isMandatory)}
|
|
203
|
+
</repeatable-attachments-field>
|
|
202
204
|
`;
|
|
203
205
|
default:
|
|
204
206
|
console.warn(`FormBuilderGroup: Unknown field type: ${input_type}`);
|
|
@@ -206,11 +208,11 @@ let FieldRendererComponent = class FieldRendererComponent extends LitElement {
|
|
|
206
208
|
}
|
|
207
209
|
}
|
|
208
210
|
renderFieldLabel(label, helperText, isMandatory = false) {
|
|
209
|
-
return html `
|
|
210
|
-
<div class="layout vertical question-container">
|
|
211
|
-
<div class="question-text">${this.renderTooltip(isMandatory)}${label}</div>
|
|
212
|
-
<div class="question-details">${helperText}</div>
|
|
213
|
-
</div>
|
|
211
|
+
return html `
|
|
212
|
+
<div class="layout vertical question-container">
|
|
213
|
+
<div class="question-text">${this.renderTooltip(isMandatory)}${label}</div>
|
|
214
|
+
<div class="question-details">${helperText}</div>
|
|
215
|
+
</div>
|
|
214
216
|
`;
|
|
215
217
|
}
|
|
216
218
|
static get styles() {
|
|
@@ -218,39 +220,39 @@ let FieldRendererComponent = class FieldRendererComponent extends LitElement {
|
|
|
218
220
|
return [
|
|
219
221
|
FlexLayoutClasses,
|
|
220
222
|
FormBuilderCardStyles,
|
|
221
|
-
css `
|
|
222
|
-
.additional-field {
|
|
223
|
-
padding-top: 15px;
|
|
224
|
-
padding-bottom: 20px;
|
|
225
|
-
background-color: var(--secondary-background-color);
|
|
226
|
-
}
|
|
227
|
-
.wide-field-container {
|
|
228
|
-
padding-bottom: 10px;
|
|
229
|
-
}
|
|
230
|
-
.wide-field-container .question-container {
|
|
231
|
-
min-height: 0;
|
|
232
|
-
padding: 7px 0 0;
|
|
233
|
-
}
|
|
234
|
-
.wide-field-container .question-text {
|
|
235
|
-
color: var(--secondary-text-color);
|
|
236
|
-
font-weight: 400;
|
|
237
|
-
}
|
|
238
|
-
.mandatory_warning etools-icon {
|
|
239
|
-
--etools-icon-fill-color: #f59e0b !important;
|
|
240
|
-
}
|
|
241
|
-
:host(:not([readonly])) {
|
|
242
|
-
.overall {
|
|
243
|
-
background-color: #ffffff;
|
|
244
|
-
border-style: inset;
|
|
245
|
-
border-width: 0 1px 1px 1px;
|
|
246
|
-
border-color: var(--dark-divider-color);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
@media print {
|
|
250
|
-
:host {
|
|
251
|
-
break-inside: avoid;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
223
|
+
css `
|
|
224
|
+
.additional-field {
|
|
225
|
+
padding-top: 15px;
|
|
226
|
+
padding-bottom: 20px;
|
|
227
|
+
background-color: var(--secondary-background-color);
|
|
228
|
+
}
|
|
229
|
+
.wide-field-container {
|
|
230
|
+
padding-bottom: 10px;
|
|
231
|
+
}
|
|
232
|
+
.wide-field-container .question-container {
|
|
233
|
+
min-height: 0;
|
|
234
|
+
padding: 7px 0 0;
|
|
235
|
+
}
|
|
236
|
+
.wide-field-container .question-text {
|
|
237
|
+
color: var(--secondary-text-color);
|
|
238
|
+
font-weight: 400;
|
|
239
|
+
}
|
|
240
|
+
.mandatory_warning etools-icon {
|
|
241
|
+
--etools-icon-fill-color: #f59e0b !important;
|
|
242
|
+
}
|
|
243
|
+
:host(:not([readonly])) {
|
|
244
|
+
.overall {
|
|
245
|
+
background-color: #ffffff;
|
|
246
|
+
border-style: inset;
|
|
247
|
+
border-width: 0 1px 1px 1px;
|
|
248
|
+
border-color: var(--dark-divider-color);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
@media print {
|
|
252
|
+
:host {
|
|
253
|
+
break-inside: avoid;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
254
256
|
`
|
|
255
257
|
];
|
|
256
258
|
}
|
|
@@ -24,55 +24,55 @@ let RepeatableAttachmentField = class RepeatableAttachmentField extends Repeatab
|
|
|
24
24
|
render() {
|
|
25
25
|
var _a;
|
|
26
26
|
const values = this.getValues();
|
|
27
|
-
return html `
|
|
28
|
-
<div class="finding-container">
|
|
29
|
-
<div class="question layout start"><slot>${this.questionTemplate()}</slot></div>
|
|
30
|
-
<div class="question-control layout vertical center-justified start">
|
|
27
|
+
return html `
|
|
28
|
+
<div class="finding-container">
|
|
29
|
+
<div class="question layout start"><slot>${this.questionTemplate()}</slot></div>
|
|
30
|
+
<div class="question-control layout vertical center-justified start">
|
|
31
31
|
${values.map((value, index) => value
|
|
32
|
-
? html `
|
|
33
|
-
<div class="layout horizontal file-container">
|
|
34
|
-
<!-- File name component -->
|
|
35
|
-
<div class="filename-container file-selector__filename">
|
|
36
|
-
<etools-icon class="file-icon" name="attachment"></etools-icon>
|
|
37
|
-
<span class="filename" title="${value.filename}">${value.filename}</span>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<!-- Download Button -->
|
|
41
|
-
<etools-button
|
|
42
|
-
class="neutral download-button file-selector__download"
|
|
43
|
-
variant="text"
|
|
44
|
-
?hidden="${!value.url}"
|
|
45
|
-
@click="${() => this.downloadFile(value)}"
|
|
46
|
-
>
|
|
47
|
-
<etools-icon name="cloud-download" class="dw-icon" slot="prefix"></etools-icon>
|
|
48
|
-
${getTranslation(this.language, 'DOWNLOAD')}
|
|
49
|
-
</etools-button>
|
|
50
|
-
|
|
51
|
-
<!-- Delete Button -->
|
|
52
|
-
<etools-button
|
|
53
|
-
variant="danger"
|
|
54
|
-
class="file-selector__delete"
|
|
55
|
-
?hidden="${this.isReadonly}"
|
|
56
|
-
@click="${() => this.removeControl(index)}"
|
|
57
|
-
>
|
|
58
|
-
${getTranslation(this.language, 'DELETE')}
|
|
59
|
-
</etools-button>
|
|
60
|
-
</div>
|
|
32
|
+
? html `
|
|
33
|
+
<div class="layout horizontal file-container">
|
|
34
|
+
<!-- File name component -->
|
|
35
|
+
<div class="filename-container file-selector__filename">
|
|
36
|
+
<etools-icon class="file-icon" name="attachment"></etools-icon>
|
|
37
|
+
<span class="filename" title="${value.filename}">${value.filename}</span>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<!-- Download Button -->
|
|
41
|
+
<etools-button
|
|
42
|
+
class="neutral download-button file-selector__download"
|
|
43
|
+
variant="text"
|
|
44
|
+
?hidden="${!value.url}"
|
|
45
|
+
@click="${() => this.downloadFile(value)}"
|
|
46
|
+
>
|
|
47
|
+
<etools-icon name="cloud-download" class="dw-icon" slot="prefix"></etools-icon>
|
|
48
|
+
${getTranslation(this.language, 'DOWNLOAD')}
|
|
49
|
+
</etools-button>
|
|
50
|
+
|
|
51
|
+
<!-- Delete Button -->
|
|
52
|
+
<etools-button
|
|
53
|
+
variant="danger"
|
|
54
|
+
class="file-selector__delete"
|
|
55
|
+
?hidden="${this.isReadonly}"
|
|
56
|
+
@click="${() => this.removeControl(index)}"
|
|
57
|
+
>
|
|
58
|
+
${getTranslation(this.language, 'DELETE')}
|
|
59
|
+
</etools-button>
|
|
60
|
+
</div>
|
|
61
61
|
`
|
|
62
|
-
: '')}
|
|
63
|
-
<!-- Upload button -->
|
|
64
|
-
<etools-upload-multi
|
|
65
|
-
class="with-padding"
|
|
66
|
-
activate-offline
|
|
67
|
-
?hidden="${this.isReadonly}"
|
|
68
|
-
@upload-finished="${({ detail }) => this.attachmentsUploaded(detail)}"
|
|
69
|
-
.endpointInfo="${{ endpoint: this.uploadUrl, extraInfo: { composedPath: this.computedPath } }}"
|
|
70
|
-
.jwtLocalStorageKey="${this.jwtLocalStorageKey}"
|
|
71
|
-
>
|
|
72
|
-
</etools-upload-multi>
|
|
73
|
-
<div ?hidden="${!this.isReadonly || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length)}">—</div>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
62
|
+
: '')}
|
|
63
|
+
<!-- Upload button -->
|
|
64
|
+
<etools-upload-multi
|
|
65
|
+
class="with-padding"
|
|
66
|
+
activate-offline
|
|
67
|
+
?hidden="${this.isReadonly}"
|
|
68
|
+
@upload-finished="${({ detail }) => this.attachmentsUploaded(detail)}"
|
|
69
|
+
.endpointInfo="${{ endpoint: this.uploadUrl, extraInfo: { composedPath: this.computedPath } }}"
|
|
70
|
+
.jwtLocalStorageKey="${this.jwtLocalStorageKey}"
|
|
71
|
+
>
|
|
72
|
+
</etools-upload-multi>
|
|
73
|
+
<div ?hidden="${!this.isReadonly || ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length)}">—</div>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
76
|
`;
|
|
77
77
|
}
|
|
78
78
|
controlTemplate() {
|
|
@@ -135,70 +135,70 @@ let RepeatableAttachmentField = class RepeatableAttachmentField extends Repeatab
|
|
|
135
135
|
...RepeatableBaseField.styles,
|
|
136
136
|
SharedStyles,
|
|
137
137
|
AttachmentsStyles,
|
|
138
|
-
css `
|
|
139
|
-
.file-selector__type-dropdown {
|
|
140
|
-
flex-basis: 25%;
|
|
141
|
-
padding-left: 8px;
|
|
142
|
-
padding-right: 8px;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.file-selector__filename {
|
|
146
|
-
flex-basis: 35%;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.file-selector__download {
|
|
150
|
-
flex-basis: 10%;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.file-selector__delete {
|
|
154
|
-
flex-basis: 10%;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.file-selector-container.with-type-dropdown {
|
|
158
|
-
flex-wrap: nowrap;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.popup-container {
|
|
162
|
-
padding: 12px 12px 0;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.file-container {
|
|
166
|
-
padding: 8px 0;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
@media (max-width: 380px) {
|
|
170
|
-
.file-selector-container.with-type-dropdown {
|
|
171
|
-
justify-content: center;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.file-selector-container.with-type-dropdown etools-dropdown.type-dropdown {
|
|
175
|
-
flex-basis: 90%;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.file-selector__filename {
|
|
179
|
-
flex-basis: 90%;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.file-selector__download {
|
|
183
|
-
flex-basis: 5%;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.file-selector__delete {
|
|
187
|
-
flex-basis: 5%;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
@media (max-width: 600px) {
|
|
192
|
-
etools-dropdown {
|
|
193
|
-
padding: 0;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.file-selector-container.with-type-dropdown {
|
|
197
|
-
border-bottom: 1px solid lightgrey;
|
|
198
|
-
flex-wrap: wrap;
|
|
199
|
-
padding-bottom: 10px;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
138
|
+
css `
|
|
139
|
+
.file-selector__type-dropdown {
|
|
140
|
+
flex-basis: 25%;
|
|
141
|
+
padding-left: 8px;
|
|
142
|
+
padding-right: 8px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.file-selector__filename {
|
|
146
|
+
flex-basis: 35%;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.file-selector__download {
|
|
150
|
+
flex-basis: 10%;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.file-selector__delete {
|
|
154
|
+
flex-basis: 10%;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.file-selector-container.with-type-dropdown {
|
|
158
|
+
flex-wrap: nowrap;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.popup-container {
|
|
162
|
+
padding: 12px 12px 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.file-container {
|
|
166
|
+
padding: 8px 0;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@media (max-width: 380px) {
|
|
170
|
+
.file-selector-container.with-type-dropdown {
|
|
171
|
+
justify-content: center;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.file-selector-container.with-type-dropdown etools-dropdown.type-dropdown {
|
|
175
|
+
flex-basis: 90%;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.file-selector__filename {
|
|
179
|
+
flex-basis: 90%;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.file-selector__download {
|
|
183
|
+
flex-basis: 5%;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.file-selector__delete {
|
|
187
|
+
flex-basis: 5%;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
@media (max-width: 600px) {
|
|
192
|
+
etools-dropdown {
|
|
193
|
+
padding: 0;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.file-selector-container.with-type-dropdown {
|
|
197
|
+
border-bottom: 1px solid lightgrey;
|
|
198
|
+
flex-wrap: wrap;
|
|
199
|
+
padding-bottom: 10px;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
202
|
`
|
|
203
203
|
];
|
|
204
204
|
}
|