@unicef-polymer/etools-form-builder 3.1.0 → 3.1.1

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