@unicef-polymer/etools-form-builder 2.1.4 → 2.1.5

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.
Files changed (82) hide show
  1. package/dist/assets/translations.d.ts +6 -6
  2. package/dist/assets/translations.js +67 -67
  3. package/dist/form-attachments-popup/form-attachments-popup.d.ts +86 -86
  4. package/dist/form-attachments-popup/form-attachments-popup.helper.d.ts +8 -8
  5. package/dist/form-attachments-popup/form-attachments-popup.helper.js +14 -14
  6. package/dist/form-attachments-popup/form-attachments-popup.js +207 -207
  7. package/dist/form-attachments-popup/form-attachments-popup.tpl.d.ts +3 -3
  8. package/dist/form-attachments-popup/form-attachments-popup.tpl.js +11 -11
  9. package/dist/form-attachments-popup/index.d.ts +2 -2
  10. package/dist/form-attachments-popup/index.js +2 -2
  11. package/dist/form-fields/abstract-field-base.class.d.ts +33 -33
  12. package/dist/form-fields/abstract-field-base.class.js +98 -98
  13. package/dist/form-fields/field-renderer-component.d.ts +20 -20
  14. package/dist/form-fields/field-renderer-component.js +108 -108
  15. package/dist/form-fields/index.d.ts +12 -12
  16. package/dist/form-fields/index.js +12 -12
  17. package/dist/form-fields/repeatable-fields/repeatable-attachment-field.d.ts +17 -17
  18. package/dist/form-fields/repeatable-fields/repeatable-attachment-field.js +100 -100
  19. package/dist/form-fields/repeatable-fields/repeatable-base-field.d.ts +20 -20
  20. package/dist/form-fields/repeatable-fields/repeatable-base-field.js +102 -102
  21. package/dist/form-fields/repeatable-fields/repeatable-number-field.d.ts +10 -10
  22. package/dist/form-fields/repeatable-fields/repeatable-number-field.js +47 -47
  23. package/dist/form-fields/repeatable-fields/repeatable-scale-field.d.ts +15 -15
  24. package/dist/form-fields/repeatable-fields/repeatable-scale-field.js +49 -49
  25. package/dist/form-fields/repeatable-fields/repeatable-text-field.d.ts +8 -8
  26. package/dist/form-fields/repeatable-fields/repeatable-text-field.js +30 -30
  27. package/dist/form-fields/single-fields/attachment-field.d.ts +16 -16
  28. package/dist/form-fields/single-fields/attachment-field.js +85 -85
  29. package/dist/form-fields/single-fields/base-field.d.ts +11 -11
  30. package/dist/form-fields/single-fields/base-field.js +58 -58
  31. package/dist/form-fields/single-fields/boolean-field.d.ts +8 -8
  32. package/dist/form-fields/single-fields/boolean-field.js +29 -29
  33. package/dist/form-fields/single-fields/number-field.d.ts +10 -10
  34. package/dist/form-fields/single-fields/number-field.js +46 -46
  35. package/dist/form-fields/single-fields/scale-field.d.ts +18 -18
  36. package/dist/form-fields/single-fields/scale-field.js +52 -52
  37. package/dist/form-fields/single-fields/text-field.d.ts +8 -8
  38. package/dist/form-fields/single-fields/text-field.js +29 -29
  39. package/dist/form-groups/form-abstract-group.d.ts +65 -65
  40. package/dist/form-groups/form-abstract-group.js +255 -255
  41. package/dist/form-groups/form-card.d.ts +32 -32
  42. package/dist/form-groups/form-card.js +89 -89
  43. package/dist/form-groups/form-collapsed-card.d.ts +70 -70
  44. package/dist/form-groups/form-collapsed-card.js +225 -225
  45. package/dist/form-groups/index.d.ts +3 -3
  46. package/dist/form-groups/index.js +3 -3
  47. package/dist/index.d.ts +3 -3
  48. package/dist/index.js +3 -3
  49. package/dist/lib/additional-components/confirmation-dialog.d.ts +18 -18
  50. package/dist/lib/additional-components/confirmation-dialog.js +52 -52
  51. package/dist/lib/additional-components/etools-fb-card.d.ts +21 -21
  52. package/dist/lib/additional-components/etools-fb-card.js +99 -99
  53. package/dist/lib/styles/attachments.styles.d.ts +2 -2
  54. package/dist/lib/styles/attachments.styles.js +3 -3
  55. package/dist/lib/styles/card-styles.d.ts +2 -2
  56. package/dist/lib/styles/card-styles.js +3 -3
  57. package/dist/lib/styles/dialog.styles.d.ts +2 -2
  58. package/dist/lib/styles/dialog.styles.js +3 -3
  59. package/dist/lib/styles/elevation-styles.d.ts +9 -9
  60. package/dist/lib/styles/elevation-styles.js +10 -10
  61. package/dist/lib/styles/flex-layout-classes.d.ts +2 -2
  62. package/dist/lib/styles/flex-layout-classes.js +3 -3
  63. package/dist/lib/styles/form-builder-card.styles.d.ts +2 -2
  64. package/dist/lib/styles/form-builder-card.styles.js +3 -3
  65. package/dist/lib/styles/input-styles.d.ts +2 -2
  66. package/dist/lib/styles/input-styles.js +3 -3
  67. package/dist/lib/styles/page-layout-styles.d.ts +2 -2
  68. package/dist/lib/styles/page-layout-styles.js +3 -3
  69. package/dist/lib/styles/shared-styles.d.ts +2 -2
  70. package/dist/lib/styles/shared-styles.js +3 -3
  71. package/dist/lib/types/form-builder.interfaces.d.ts +83 -83
  72. package/dist/lib/types/form-builder.types.d.ts +59 -59
  73. package/dist/lib/types/global.types.d.ts +4 -4
  74. package/dist/lib/utils/dialog.d.ts +10 -10
  75. package/dist/lib/utils/dialog.js +21 -21
  76. package/dist/lib/utils/fire-custom-event.d.ts +1 -1
  77. package/dist/lib/utils/fire-custom-event.js +7 -7
  78. package/dist/lib/utils/translate.d.ts +1 -1
  79. package/dist/lib/utils/translate.js +9 -9
  80. package/dist/lib/utils/validations.helper.d.ts +26 -26
  81. package/dist/lib/utils/validations.helper.js +42 -42
  82. package/package.json +4 -4
@@ -1,184 +1,184 @@
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-dialog/etools-dialog';
8
- import '@unicef-polymer/etools-upload/etools-upload-multi';
9
- import '@unicef-polymer/etools-dropdown/etools-dropdown';
10
- import '@polymer/paper-button/paper-button';
11
- import '@polymer/iron-icons/iron-icons';
12
- import { css, customElement, LitElement, property, query } from 'lit-element';
13
- import { clone, equals } from 'ramda';
14
- import { template } from './form-attachments-popup.tpl';
15
- import { fireEvent } from '../lib/utils/fire-custom-event';
16
- import { SharedStyles } from '../lib/styles/shared-styles';
17
- import { AttachmentsStyles } from '../lib/styles/attachments.styles';
18
- import { AttachmentsHelper } from './form-attachments-popup.helper';
19
- import { deleteFileFromDexie } from '@unicef-polymer/etools-upload/offline/dexie-operations';
20
- import { getTranslation } from '../lib/utils/translate';
21
- let FormAttachmentsPopup = class FormAttachmentsPopup extends LitElement {
22
- constructor() {
23
- super();
24
- this.dialogOpened = true;
25
- this.saveBtnClicked = false;
26
- this.attachments = [];
27
- this.readonly = false;
28
- this.popupTitle = '';
29
- this.computedPath = [];
30
- this.errors = [];
31
- /**
32
- * Array of offline saved fileIds that was remove from popup.
33
- * We need to remove them from IDB but only after confirm button click
34
- */
35
- this.filesForRemove = [];
36
- this.originalAttachments = [];
37
- if (!AttachmentsHelper.isInitialized) {
38
- throw new Error('Please initialize attachments popup before use');
39
- }
40
- if (!this.language) {
41
- this.language = window.localStorage.defaultLanguage || 'en';
42
- }
43
- }
44
- set dialogData({ attachments, title, metadata, readonly, computedPath, errors }) {
45
- this.popupTitle = title;
46
- this.attachments = clone(attachments) || [];
47
- this.originalAttachments = clone(attachments) || [];
48
- this.metadata = clone(metadata);
49
- this.readonly = Boolean(readonly);
50
- this.computedPath = computedPath;
51
- this.errors = clone(errors) || [];
52
- }
53
- get uploadUrl() {
54
- return AttachmentsHelper.uploadUrl;
55
- }
56
- get jwtLocalStorageKey() {
57
- return AttachmentsHelper.jwtLocalStorageKey;
58
- }
59
- render() {
60
- return template.call(this);
61
- }
62
- /**
63
- * on Cancel button click
64
- * Remove offline saved attachments from IDB if they are missing in originalAttachments
65
- */
66
- onClose() {
67
- this.attachments.forEach(({ url, attachment }) => {
68
- const existsInOriginal = this.originalAttachments
69
- .map((item) => item.attachment || [])
70
- .includes(attachment);
71
- if (!existsInOriginal && !url) {
72
- deleteFileFromDexie(attachment);
73
- }
74
- });
75
- fireEvent(this, 'response', { confirmed: false });
76
- }
77
- async saveChanges() {
78
- let fileTypeNotSelected = false;
79
- this.attachments.forEach((attachment, index) => {
80
- if (!attachment.file_type) {
81
- fileTypeNotSelected = true;
82
- this.errors[index] = { file_type: ['This field is required'] };
83
- }
84
- else {
85
- this.errors[index] = [];
86
- }
87
- });
88
- this.requestUpdate();
89
- if (fileTypeNotSelected) {
90
- return;
91
- }
92
- if (this.filesForRemove.length) {
93
- for (const fileId of this.filesForRemove) {
94
- await deleteFileFromDexie(fileId);
95
- }
96
- }
97
- /**
98
- * Don't confirm popup if no changes was made
99
- */
100
- if (!equals(this.attachments, this.originalAttachments)) {
101
- fireEvent(this, 'response', { confirmed: true, attachments: this.attachments });
102
- }
103
- else {
104
- fireEvent(this, 'response', { confirmed: false });
105
- }
106
- }
107
- checkFileType(index) {
108
- var _a;
109
- return (_a = this.errors[index]) === null || _a === void 0 ? void 0 : _a.file_type;
110
- }
111
- retrieveErrorMessage(index) {
112
- return this.errors[index] && this.errors[index].file_type ? this.errors[index].file_type[0] : '';
113
- }
114
- downloadFile(attachment) {
115
- const url = attachment.url;
116
- this.link.href = url;
117
- this.link.click();
118
- window.URL.revokeObjectURL(url);
119
- }
120
- changeFileType(attachment, newType, index) {
121
- if (newType && attachment.file_type !== newType) {
122
- attachment.file_type = newType;
123
- this.errors[index] = [];
124
- this.requestUpdate();
125
- }
126
- }
127
- attachmentsUploaded({ success, error }) {
128
- const parsedAttachments = success
129
- .map((attachment) => {
130
- if (this.isUploadedAttachment(attachment)) {
131
- return {
132
- url: attachment.file_link,
133
- attachment: attachment.id,
134
- filename: attachment.filename,
135
- file_type: null
136
- };
137
- }
138
- else if (this.isOfflineSavedAttachment(attachment)) {
139
- return {
140
- attachment: attachment.id,
141
- filename: attachment.filename,
142
- composedPath: this.computedPath,
143
- file_type: null
144
- };
145
- }
146
- else {
147
- console.warn('Missing fields in parsed attachment');
148
- return null;
149
- }
150
- })
151
- .filter((attachment) => Boolean(attachment));
152
- this.attachments = [...this.attachments, ...parsedAttachments];
153
- if (error && error.length) {
154
- console.error(error);
155
- fireEvent(this, 'toast', { text: getTranslation(this.language, 'UPLOAD_ATTACHMENTS_FAILED') });
156
- }
157
- }
158
- deleteAttachment(index) {
159
- const [attachment] = this.attachments.splice(index, 1);
160
- if (!attachment.hasOwnProperty('url')) {
161
- /**
162
- * prepare attachment for remove from IDB after Popup confirm
163
- */
164
- this.filesForRemove.push(attachment.attachment);
165
- }
166
- this.attachments = [...this.attachments];
167
- }
168
- isUploadedAttachment(attachment) {
169
- return (attachment.hasOwnProperty('filename') &&
170
- attachment.hasOwnProperty('id') &&
171
- attachment.hasOwnProperty('file_link') &&
172
- !attachment.hasOwnProperty('unsynced'));
173
- }
174
- isOfflineSavedAttachment(attachment) {
175
- return (attachment.hasOwnProperty('filename') && attachment.hasOwnProperty('id') && attachment.hasOwnProperty('unsynced'));
176
- }
177
- static get styles() {
178
- // language=CSS
179
- return [
180
- SharedStyles,
181
- AttachmentsStyles,
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-dialog/etools-dialog';
8
+ import '@unicef-polymer/etools-upload/etools-upload-multi';
9
+ import '@unicef-polymer/etools-dropdown/etools-dropdown';
10
+ import '@polymer/paper-button/paper-button';
11
+ import '@polymer/iron-icons/iron-icons';
12
+ import { css, customElement, LitElement, property, query } from 'lit-element';
13
+ import { clone, equals } from 'ramda';
14
+ import { template } from './form-attachments-popup.tpl';
15
+ import { fireEvent } from '../lib/utils/fire-custom-event';
16
+ import { SharedStyles } from '../lib/styles/shared-styles';
17
+ import { AttachmentsStyles } from '../lib/styles/attachments.styles';
18
+ import { AttachmentsHelper } from './form-attachments-popup.helper';
19
+ import { deleteFileFromDexie } from '@unicef-polymer/etools-upload/offline/dexie-operations';
20
+ import { getTranslation } from '../lib/utils/translate';
21
+ let FormAttachmentsPopup = class FormAttachmentsPopup extends LitElement {
22
+ constructor() {
23
+ super();
24
+ this.dialogOpened = true;
25
+ this.saveBtnClicked = false;
26
+ this.attachments = [];
27
+ this.readonly = false;
28
+ this.popupTitle = '';
29
+ this.computedPath = [];
30
+ this.errors = [];
31
+ /**
32
+ * Array of offline saved fileIds that was remove from popup.
33
+ * We need to remove them from IDB but only after confirm button click
34
+ */
35
+ this.filesForRemove = [];
36
+ this.originalAttachments = [];
37
+ if (!AttachmentsHelper.isInitialized) {
38
+ throw new Error('Please initialize attachments popup before use');
39
+ }
40
+ if (!this.language) {
41
+ this.language = window.localStorage.defaultLanguage || 'en';
42
+ }
43
+ }
44
+ set dialogData({ attachments, title, metadata, readonly, computedPath, errors }) {
45
+ this.popupTitle = title;
46
+ this.attachments = clone(attachments) || [];
47
+ this.originalAttachments = clone(attachments) || [];
48
+ this.metadata = clone(metadata);
49
+ this.readonly = Boolean(readonly);
50
+ this.computedPath = computedPath;
51
+ this.errors = clone(errors) || [];
52
+ }
53
+ get uploadUrl() {
54
+ return AttachmentsHelper.uploadUrl;
55
+ }
56
+ get jwtLocalStorageKey() {
57
+ return AttachmentsHelper.jwtLocalStorageKey;
58
+ }
59
+ render() {
60
+ return template.call(this);
61
+ }
62
+ /**
63
+ * on Cancel button click
64
+ * Remove offline saved attachments from IDB if they are missing in originalAttachments
65
+ */
66
+ onClose() {
67
+ this.attachments.forEach(({ url, attachment }) => {
68
+ const existsInOriginal = this.originalAttachments
69
+ .map((item) => item.attachment || [])
70
+ .includes(attachment);
71
+ if (!existsInOriginal && !url) {
72
+ deleteFileFromDexie(attachment);
73
+ }
74
+ });
75
+ fireEvent(this, 'response', { confirmed: false });
76
+ }
77
+ async saveChanges() {
78
+ let fileTypeNotSelected = false;
79
+ this.attachments.forEach((attachment, index) => {
80
+ if (!attachment.file_type) {
81
+ fileTypeNotSelected = true;
82
+ this.errors[index] = { file_type: ['This field is required'] };
83
+ }
84
+ else {
85
+ this.errors[index] = [];
86
+ }
87
+ });
88
+ this.requestUpdate();
89
+ if (fileTypeNotSelected) {
90
+ return;
91
+ }
92
+ if (this.filesForRemove.length) {
93
+ for (const fileId of this.filesForRemove) {
94
+ await deleteFileFromDexie(fileId);
95
+ }
96
+ }
97
+ /**
98
+ * Don't confirm popup if no changes was made
99
+ */
100
+ if (!equals(this.attachments, this.originalAttachments)) {
101
+ fireEvent(this, 'response', { confirmed: true, attachments: this.attachments });
102
+ }
103
+ else {
104
+ fireEvent(this, 'response', { confirmed: false });
105
+ }
106
+ }
107
+ checkFileType(index) {
108
+ var _a;
109
+ return (_a = this.errors[index]) === null || _a === void 0 ? void 0 : _a.file_type;
110
+ }
111
+ retrieveErrorMessage(index) {
112
+ return this.errors[index] && this.errors[index].file_type ? this.errors[index].file_type[0] : '';
113
+ }
114
+ downloadFile(attachment) {
115
+ const url = attachment.url;
116
+ this.link.href = url;
117
+ this.link.click();
118
+ window.URL.revokeObjectURL(url);
119
+ }
120
+ changeFileType(attachment, newType, index) {
121
+ if (newType && attachment.file_type !== newType) {
122
+ attachment.file_type = newType;
123
+ this.errors[index] = [];
124
+ this.requestUpdate();
125
+ }
126
+ }
127
+ attachmentsUploaded({ success, error }) {
128
+ const parsedAttachments = success
129
+ .map((attachment) => {
130
+ if (this.isUploadedAttachment(attachment)) {
131
+ return {
132
+ url: attachment.file_link,
133
+ attachment: attachment.id,
134
+ filename: attachment.filename,
135
+ file_type: null
136
+ };
137
+ }
138
+ else if (this.isOfflineSavedAttachment(attachment)) {
139
+ return {
140
+ attachment: attachment.id,
141
+ filename: attachment.filename,
142
+ composedPath: this.computedPath,
143
+ file_type: null
144
+ };
145
+ }
146
+ else {
147
+ console.warn('Missing fields in parsed attachment');
148
+ return null;
149
+ }
150
+ })
151
+ .filter((attachment) => Boolean(attachment));
152
+ this.attachments = [...this.attachments, ...parsedAttachments];
153
+ if (error && error.length) {
154
+ console.error(error);
155
+ fireEvent(this, 'toast', { text: getTranslation(this.language, 'UPLOAD_ATTACHMENTS_FAILED') });
156
+ }
157
+ }
158
+ deleteAttachment(index) {
159
+ const [attachment] = this.attachments.splice(index, 1);
160
+ if (!attachment.hasOwnProperty('url')) {
161
+ /**
162
+ * prepare attachment for remove from IDB after Popup confirm
163
+ */
164
+ this.filesForRemove.push(attachment.attachment);
165
+ }
166
+ this.attachments = [...this.attachments];
167
+ }
168
+ isUploadedAttachment(attachment) {
169
+ return (attachment.hasOwnProperty('filename') &&
170
+ attachment.hasOwnProperty('id') &&
171
+ attachment.hasOwnProperty('file_link') &&
172
+ !attachment.hasOwnProperty('unsynced'));
173
+ }
174
+ isOfflineSavedAttachment(attachment) {
175
+ return (attachment.hasOwnProperty('filename') && attachment.hasOwnProperty('id') && attachment.hasOwnProperty('unsynced'));
176
+ }
177
+ static get styles() {
178
+ // language=CSS
179
+ return [
180
+ SharedStyles,
181
+ AttachmentsStyles,
182
182
  css `
183
183
  .file-selector__type-dropdown {
184
184
  flex-basis: 25%;
@@ -227,29 +227,29 @@ let FormAttachmentsPopup = class FormAttachmentsPopup extends LitElement {
227
227
  padding-bottom: 10px;
228
228
  }
229
229
  }
230
- `
231
- ];
232
- }
233
- };
234
- __decorate([
235
- property()
236
- ], FormAttachmentsPopup.prototype, "dialogOpened", void 0);
237
- __decorate([
238
- property()
239
- ], FormAttachmentsPopup.prototype, "saveBtnClicked", void 0);
240
- __decorate([
241
- property()
242
- ], FormAttachmentsPopup.prototype, "attachments", void 0);
243
- __decorate([
244
- property()
245
- ], FormAttachmentsPopup.prototype, "metadata", void 0);
246
- __decorate([
247
- property()
248
- ], FormAttachmentsPopup.prototype, "language", void 0);
249
- __decorate([
250
- query('#link')
251
- ], FormAttachmentsPopup.prototype, "link", void 0);
252
- FormAttachmentsPopup = __decorate([
253
- customElement('form-attachments-popup')
254
- ], FormAttachmentsPopup);
255
- export { FormAttachmentsPopup };
230
+ `
231
+ ];
232
+ }
233
+ };
234
+ __decorate([
235
+ property()
236
+ ], FormAttachmentsPopup.prototype, "dialogOpened", void 0);
237
+ __decorate([
238
+ property()
239
+ ], FormAttachmentsPopup.prototype, "saveBtnClicked", void 0);
240
+ __decorate([
241
+ property()
242
+ ], FormAttachmentsPopup.prototype, "attachments", void 0);
243
+ __decorate([
244
+ property()
245
+ ], FormAttachmentsPopup.prototype, "metadata", void 0);
246
+ __decorate([
247
+ property()
248
+ ], FormAttachmentsPopup.prototype, "language", void 0);
249
+ __decorate([
250
+ query('#link')
251
+ ], FormAttachmentsPopup.prototype, "link", void 0);
252
+ FormAttachmentsPopup = __decorate([
253
+ customElement('form-attachments-popup')
254
+ ], FormAttachmentsPopup);
255
+ export { FormAttachmentsPopup };
@@ -1,3 +1,3 @@
1
- import { FormAttachmentsPopup } from './form-attachments-popup';
2
- import { TemplateResult } from 'lit-html';
3
- export declare function template(this: FormAttachmentsPopup): TemplateResult;
1
+ import { FormAttachmentsPopup } from './form-attachments-popup';
2
+ import { TemplateResult } from 'lit-html';
3
+ export declare function template(this: FormAttachmentsPopup): TemplateResult;
@@ -1,9 +1,9 @@
1
- import { html } from 'lit-html';
2
- import { InputStyles } from '../lib/styles/input-styles';
3
- import { DialogStyles } from '../lib/styles/dialog.styles';
4
- import { getTranslation } from '../lib/utils/translate';
5
- export function template() {
6
- var _a;
1
+ import { html } from 'lit-html';
2
+ import { InputStyles } from '../lib/styles/input-styles';
3
+ import { DialogStyles } from '../lib/styles/dialog.styles';
4
+ import { getTranslation } from '../lib/utils/translate';
5
+ export function template() {
6
+ var _a;
7
7
  return html `
8
8
  ${InputStyles} ${DialogStyles}
9
9
  <etools-dialog
@@ -23,8 +23,8 @@ export function template() {
23
23
  <a id="link" target="_blank" hidden></a>
24
24
 
25
25
  <div class="popup-container">
26
- ${(_a = this.attachments) === null || _a === void 0 ? void 0 : _a.map((attachment, index) => {
27
- var _a, _b;
26
+ ${(_a = this.attachments) === null || _a === void 0 ? void 0 : _a.map((attachment, index) => {
27
+ var _a, _b;
28
28
  return html `
29
29
  <div class="file-selector-container with-type-dropdown">
30
30
  <!-- Type select Dropdown -->
@@ -72,7 +72,7 @@ export function template() {
72
72
  ${getTranslation(this.language, 'DELETE')}
73
73
  </paper-button>
74
74
  </div>
75
- `;
75
+ `;
76
76
  })}
77
77
 
78
78
  <!-- Upload button -->
@@ -87,5 +87,5 @@ export function template() {
87
87
  </etools-upload-multi>
88
88
  </div>
89
89
  </etools-dialog>
90
- `;
91
- }
90
+ `;
91
+ }
@@ -1,2 +1,2 @@
1
- export * from './form-attachments-popup';
2
- export * from './form-attachments-popup.helper';
1
+ export * from './form-attachments-popup';
2
+ export * from './form-attachments-popup.helper';
@@ -1,2 +1,2 @@
1
- export * from './form-attachments-popup';
2
- export * from './form-attachments-popup.helper';
1
+ export * from './form-attachments-popup';
2
+ export * from './form-attachments-popup.helper';
@@ -1,33 +1,33 @@
1
- import { CSSResultArray, LitElement, TemplateResult } from 'lit-element';
2
- import { FieldValidator } from '../lib/utils/validations.helper';
3
- /**
4
- * Class that contains common properties and methods for single and repeatable fields
5
- */
6
- export declare abstract class AbstractFieldBaseClass<T> extends LitElement {
7
- questionText: string;
8
- language: string;
9
- set isReadonly(readonly: boolean);
10
- get isReadonly(): boolean;
11
- required: boolean;
12
- placeholder: string;
13
- value: T | null;
14
- validators: FieldValidator[];
15
- touched: boolean;
16
- set defaultValue(value: any);
17
- private _defaultValue;
18
- private _readonly;
19
- constructor();
20
- connectedCallback(): void;
21
- disconnectedCallback(): void;
22
- handleLanguageChange(e: CustomEvent): void;
23
- protected render(): TemplateResult;
24
- protected questionTemplate(): TemplateResult;
25
- protected metaValidation(value: unknown): string | null;
26
- private setDefaultValue;
27
- protected abstract valueChanged(...args: any): void;
28
- protected abstract customValidation(value: unknown): string | null;
29
- protected abstract controlTemplate(...args: any): TemplateResult;
30
- protected abstract setValue(value: T): void;
31
- protected abstract validateField(value: T): void;
32
- static get styles(): CSSResultArray;
33
- }
1
+ import { CSSResultArray, LitElement, TemplateResult } from 'lit-element';
2
+ import { FieldValidator } from '../lib/utils/validations.helper';
3
+ /**
4
+ * Class that contains common properties and methods for single and repeatable fields
5
+ */
6
+ export declare abstract class AbstractFieldBaseClass<T> extends LitElement {
7
+ questionText: string;
8
+ language: string;
9
+ set isReadonly(readonly: boolean);
10
+ get isReadonly(): boolean;
11
+ required: boolean;
12
+ placeholder: string;
13
+ value: T | null;
14
+ validators: FieldValidator[];
15
+ touched: boolean;
16
+ set defaultValue(value: any);
17
+ private _defaultValue;
18
+ private _readonly;
19
+ constructor();
20
+ connectedCallback(): void;
21
+ disconnectedCallback(): void;
22
+ handleLanguageChange(e: CustomEvent): void;
23
+ protected render(): TemplateResult;
24
+ protected questionTemplate(): TemplateResult;
25
+ protected metaValidation(value: unknown): string | null;
26
+ private setDefaultValue;
27
+ protected abstract valueChanged(...args: any): void;
28
+ protected abstract customValidation(value: unknown): string | null;
29
+ protected abstract controlTemplate(...args: any): TemplateResult;
30
+ protected abstract setValue(value: T): void;
31
+ protected abstract validateField(value: T): void;
32
+ static get styles(): CSSResultArray;
33
+ }