@unicef-polymer/etools-form-builder 2.1.0 → 2.1.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.d.ts +6 -0
- package/dist/assets/translations.js +67 -0
- package/dist/form-attachments-popup/form-attachments-popup.d.ts +86 -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 +255 -248
- package/dist/form-attachments-popup/form-attachments-popup.tpl.d.ts +3 -3
- package/dist/form-attachments-popup/form-attachments-popup.tpl.js +91 -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 +33 -28
- package/dist/form-fields/abstract-field-base.class.js +194 -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 +209 -208
- package/dist/form-fields/repeatable-fields/repeatable-base-field.d.ts +20 -20
- package/dist/form-fields/repeatable-fields/repeatable-base-field.js +124 -123
- package/dist/form-fields/repeatable-fields/repeatable-number-field.d.ts +10 -10
- package/dist/form-fields/repeatable-fields/repeatable-number-field.js +67 -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 +98 -97
- package/dist/form-fields/single-fields/base-field.d.ts +11 -11
- package/dist/form-fields/single-fields/base-field.js +58 -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 +67 -66
- package/dist/form-fields/single-fields/scale-field.d.ts +18 -18
- package/dist/form-fields/single-fields/scale-field.js +108 -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 +65 -60
- package/dist/form-groups/form-abstract-group.js +375 -353
- package/dist/form-groups/form-card.d.ts +32 -32
- package/dist/form-groups/form-card.js +113 -108
- package/dist/form-groups/form-collapsed-card.d.ts +70 -70
- package/dist/form-groups/form-collapsed-card.js +254 -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 +18 -16
- package/dist/lib/additional-components/confirmation-dialog.js +72 -65
- package/dist/lib/additional-components/etools-fb-card.d.ts +21 -16
- package/dist/lib/additional-components/etools-fb-card.js +238 -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/translate.d.ts +1 -0
- package/dist/lib/utils/translate.js +9 -0
- package/dist/lib/utils/validations.helper.d.ts +26 -26
- package/dist/lib/utils/validations.helper.js +42 -35
- package/package.json +56 -56
|
@@ -1,208 +1,209 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import '@unicef-polymer/etools-upload/etools-upload';
|
|
8
|
-
import { RepeatableBaseField } from './repeatable-base-field';
|
|
9
|
-
import { AttachmentsHelper } from '../../form-attachments-popup';
|
|
10
|
-
import { html, css, customElement } from 'lit-element';
|
|
11
|
-
import { fireEvent } from '../../lib/utils/fire-custom-event';
|
|
12
|
-
import { SharedStyles } from '../../lib/styles/shared-styles';
|
|
13
|
-
import { AttachmentsStyles } from '../../lib/styles/attachments.styles';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<div class="question
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
link
|
|
118
|
-
link.
|
|
119
|
-
link.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
attachment.hasOwnProperty('
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
padding-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import '@unicef-polymer/etools-upload/etools-upload';
|
|
8
|
+
import { RepeatableBaseField } from './repeatable-base-field';
|
|
9
|
+
import { AttachmentsHelper } from '../../form-attachments-popup';
|
|
10
|
+
import { html, css, customElement } from 'lit-element';
|
|
11
|
+
import { fireEvent } from '../../lib/utils/fire-custom-event';
|
|
12
|
+
import { SharedStyles } from '../../lib/styles/shared-styles';
|
|
13
|
+
import { AttachmentsStyles } from '../../lib/styles/attachments.styles';
|
|
14
|
+
import { getTranslation } from '../../lib/utils/translate';
|
|
15
|
+
let RepeatableAttachmentField = class RepeatableAttachmentField extends RepeatableBaseField {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.computedPath = [];
|
|
19
|
+
}
|
|
20
|
+
get uploadUrl() {
|
|
21
|
+
return AttachmentsHelper.uploadUrl;
|
|
22
|
+
}
|
|
23
|
+
get jwtLocalStorageKey() {
|
|
24
|
+
return AttachmentsHelper.jwtLocalStorageKey;
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
var _a;
|
|
28
|
+
const values = this.getValues();
|
|
29
|
+
return html `
|
|
30
|
+
<div class="finding-container">
|
|
31
|
+
<div class="question layout start"><slot>${this.questionTemplate()}</slot></div>
|
|
32
|
+
<div class="question-control layout vertical center-justified start">
|
|
33
|
+
${values.map((value, index) => value
|
|
34
|
+
? html `
|
|
35
|
+
<div class="layout horizontal file-container">
|
|
36
|
+
<!-- File name component -->
|
|
37
|
+
<div class="filename-container file-selector__filename">
|
|
38
|
+
<iron-icon class="file-icon" icon="attachment"></iron-icon>
|
|
39
|
+
<span class="filename" title="${value.filename}">${value.filename}</span>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<!-- Download Button -->
|
|
43
|
+
<paper-button
|
|
44
|
+
?hidden="${!value.url}"
|
|
45
|
+
class="download-button file-selector__download"
|
|
46
|
+
@tap="${() => this.downloadFile(value)}"
|
|
47
|
+
>
|
|
48
|
+
<iron-icon icon="cloud-download" class="dw-icon"></iron-icon>
|
|
49
|
+
${getTranslation(this.language, 'DOWNLOAD')}
|
|
50
|
+
</paper-button>
|
|
51
|
+
|
|
52
|
+
<!-- Delete Button -->
|
|
53
|
+
<paper-button
|
|
54
|
+
class="delete-button file-selector__delete"
|
|
55
|
+
?hidden="${this.isReadonly}"
|
|
56
|
+
@tap="${() => this.removeControl(index)}"
|
|
57
|
+
>
|
|
58
|
+
${getTranslation(this.language, 'DELETE')}
|
|
59
|
+
</paper-button>
|
|
60
|
+
</div>
|
|
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>
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
78
|
+
controlTemplate() {
|
|
79
|
+
return html ``;
|
|
80
|
+
}
|
|
81
|
+
customValidation() {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
attachmentsUploaded({ success, error }) {
|
|
85
|
+
success === null || success === void 0 ? void 0 : success.forEach((file, index) => {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
const newIndex = ((_b = Number((_a = this.editedValues) === null || _a === void 0 ? void 0 : _a.length)) !== null && _b !== void 0 ? _b : 0) + index;
|
|
88
|
+
if (this.isUploadedAttachment(file)) {
|
|
89
|
+
this.valueChanged({
|
|
90
|
+
url: file.file_link,
|
|
91
|
+
attachment: file.id,
|
|
92
|
+
filename: file.filename,
|
|
93
|
+
file_type: null
|
|
94
|
+
}, newIndex);
|
|
95
|
+
}
|
|
96
|
+
else if (this.isOfflineSavedAttachment(file)) {
|
|
97
|
+
this.valueChanged({
|
|
98
|
+
attachment: file.id,
|
|
99
|
+
filename: file.filename,
|
|
100
|
+
composedPath: [],
|
|
101
|
+
file_type: null
|
|
102
|
+
}, newIndex);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
console.warn('Missing fields in parsed attachment');
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
if (error && error.length) {
|
|
109
|
+
console.error(error);
|
|
110
|
+
fireEvent(this, 'toast', { text: 'Can not upload attachments. Please try again later' });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
downloadFile(attachment) {
|
|
114
|
+
if (!(attachment === null || attachment === void 0 ? void 0 : attachment.url)) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const link = document.createElement('a');
|
|
118
|
+
link.target = '_blank';
|
|
119
|
+
link.href = attachment.url;
|
|
120
|
+
link.click();
|
|
121
|
+
window.URL.revokeObjectURL(attachment.url);
|
|
122
|
+
}
|
|
123
|
+
isUploadedAttachment(attachment) {
|
|
124
|
+
return (attachment.hasOwnProperty('filename') &&
|
|
125
|
+
attachment.hasOwnProperty('id') &&
|
|
126
|
+
attachment.hasOwnProperty('file_link') &&
|
|
127
|
+
!attachment.hasOwnProperty('unsynced'));
|
|
128
|
+
}
|
|
129
|
+
isOfflineSavedAttachment(attachment) {
|
|
130
|
+
return (attachment.hasOwnProperty('filename') && attachment.hasOwnProperty('id') && attachment.hasOwnProperty('unsynced'));
|
|
131
|
+
}
|
|
132
|
+
static get styles() {
|
|
133
|
+
// language=CSS
|
|
134
|
+
return [
|
|
135
|
+
...RepeatableBaseField.styles,
|
|
136
|
+
SharedStyles,
|
|
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
|
+
}
|
|
202
|
+
`
|
|
203
|
+
];
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
RepeatableAttachmentField = __decorate([
|
|
207
|
+
customElement('repeatable-attachments-field')
|
|
208
|
+
], RepeatableAttachmentField);
|
|
209
|
+
export { RepeatableAttachmentField };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { CSSResultArray, TemplateResult } from 'lit-element';
|
|
2
|
-
import { AbstractFieldBaseClass } from '../abstract-field-base.class';
|
|
3
|
-
export declare abstract class RepeatableBaseField<T> extends AbstractFieldBaseClass<T[]> {
|
|
4
|
-
set errorMessage(messages: (string | null)[]);
|
|
5
|
-
get errorMessage(): (string | null)[];
|
|
6
|
-
protected _errorMessage: (string | null)[];
|
|
7
|
-
protected editedValues: (T | null)[] | null;
|
|
8
|
-
protected render(): TemplateResult;
|
|
9
|
-
protected questionTemplate(): TemplateResult;
|
|
10
|
-
protected valueChanged(newValue: T, index: number): void;
|
|
11
|
-
protected setValue(value: (T | null)[]): void;
|
|
12
|
-
protected validateField(value: T[]): void;
|
|
13
|
-
protected validateField(value: T, index: number): void;
|
|
14
|
-
protected addNewField(): void;
|
|
15
|
-
protected removeControl(index: number): void;
|
|
16
|
-
protected getValues(): (T | null)[];
|
|
17
|
-
private isArrayData;
|
|
18
|
-
protected abstract controlTemplate(value: T | null, index: number): TemplateResult;
|
|
19
|
-
static get styles(): CSSResultArray;
|
|
20
|
-
}
|
|
1
|
+
import { CSSResultArray, TemplateResult } from 'lit-element';
|
|
2
|
+
import { AbstractFieldBaseClass } from '../abstract-field-base.class';
|
|
3
|
+
export declare abstract class RepeatableBaseField<T> extends AbstractFieldBaseClass<T[]> {
|
|
4
|
+
set errorMessage(messages: (string | null)[]);
|
|
5
|
+
get errorMessage(): (string | null)[];
|
|
6
|
+
protected _errorMessage: (string | null)[];
|
|
7
|
+
protected editedValues: (T | null)[] | null;
|
|
8
|
+
protected render(): TemplateResult;
|
|
9
|
+
protected questionTemplate(): TemplateResult;
|
|
10
|
+
protected valueChanged(newValue: T, index: number): void;
|
|
11
|
+
protected setValue(value: (T | null)[]): void;
|
|
12
|
+
protected validateField(value: T[]): void;
|
|
13
|
+
protected validateField(value: T, index: number): void;
|
|
14
|
+
protected addNewField(): void;
|
|
15
|
+
protected removeControl(index: number): void;
|
|
16
|
+
protected getValues(): (T | null)[];
|
|
17
|
+
private isArrayData;
|
|
18
|
+
protected abstract controlTemplate(value: T | null, index: number): TemplateResult;
|
|
19
|
+
static get styles(): CSSResultArray;
|
|
20
|
+
}
|