@unicef-polymer/etools-form-builder 3.0.0-rc.9 → 3.1.0

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 (39) hide show
  1. package/LICENSE +674 -674
  2. package/README.md +1 -1
  3. package/dist/assets/translations.js +70 -2
  4. package/dist/form-attachments-popup/form-attachments-popup.d.ts +4 -0
  5. package/dist/form-attachments-popup/form-attachments-popup.js +156 -53
  6. package/dist/form-fields/abstract-field-base.class.d.ts +1 -0
  7. package/dist/form-fields/abstract-field-base.class.js +106 -116
  8. package/dist/form-fields/field-renderer-component.d.ts +7 -3
  9. package/dist/form-fields/field-renderer-component.js +185 -154
  10. package/dist/form-fields/repeatable-fields/repeatable-attachment-field.js +112 -112
  11. package/dist/form-fields/repeatable-fields/repeatable-base-field.js +22 -22
  12. package/dist/form-fields/repeatable-fields/repeatable-number-field.js +19 -21
  13. package/dist/form-fields/repeatable-fields/repeatable-scale-field.js +57 -59
  14. package/dist/form-fields/repeatable-fields/repeatable-text-field.js +19 -24
  15. package/dist/form-fields/single-fields/attachment-field.js +13 -13
  16. package/dist/form-fields/single-fields/boolean-field.js +16 -21
  17. package/dist/form-fields/single-fields/number-field.js +21 -23
  18. package/dist/form-fields/single-fields/scale-field.js +58 -60
  19. package/dist/form-fields/single-fields/text-field.js +24 -25
  20. package/dist/form-groups/form-abstract-group.d.ts +2 -1
  21. package/dist/form-groups/form-abstract-group.js +129 -127
  22. package/dist/form-groups/form-card.js +30 -24
  23. package/dist/form-groups/form-collapsed-card.js +34 -34
  24. package/dist/lib/additional-components/confirmation-dialog.js +21 -21
  25. package/dist/lib/additional-components/etools-fb-card.js +136 -135
  26. package/dist/lib/styles/attachments.styles.js +61 -66
  27. package/dist/lib/styles/card-styles.js +147 -151
  28. package/dist/lib/styles/dialog.styles.js +83 -83
  29. package/dist/lib/styles/elevation-styles.d.ts +2 -2
  30. package/dist/lib/styles/elevation-styles.js +35 -35
  31. package/dist/lib/styles/flex-layout-classes.js +316 -316
  32. package/dist/lib/styles/form-builder-card.styles.js +53 -46
  33. package/dist/lib/styles/page-layout-styles.js +198 -198
  34. package/dist/lib/styles/shared-styles.js +61 -67
  35. package/package.json +55 -55
  36. package/dist/form-attachments-popup/form-attachments-popup.tpl.d.ts +0 -7
  37. package/dist/form-attachments-popup/form-attachments-popup.tpl.js +0 -102
  38. package/dist/lib/styles/input-styles.d.ts +0 -2
  39. package/dist/lib/styles/input-styles.js +0 -143
@@ -1,154 +1,150 @@
1
1
  import { css } from 'lit';
2
2
  // language=CSS
3
- export const CardStyles = css `
4
- .card-title-box {
5
- position: relative;
6
- display: flex;
7
- align-items: center;
8
- min-height: 60px;
9
- padding: 0 10px 0 25px;
10
- }
11
-
12
- .card-title-box.with-bottom-line {
13
- border-bottom: 1px solid #9c9c9c;
14
- }
15
-
16
- .card-title-box .card-title {
17
- flex: auto;
18
- overflow: hidden;
19
- white-space: nowrap;
20
- text-overflow: ellipsis;
21
- font-size: 18px;
22
- }
23
-
24
- .card-title-box .card-title.counter {
25
- font-size: 20px;
26
- font-weight: 500;
27
- }
28
-
29
- .card-title-box .buttons-container {
30
- position: relative;
31
- display: flex;
32
- align-items: center;
33
- height: 100%;
34
- }
35
-
36
- .panel-button {
37
- opacity: 0.45;
38
- transition: 0.15s;
39
- }
40
-
41
- .panel-button:hover {
42
- opacity: 0.57;
43
- }
44
-
45
- .card-content {
46
- padding: 0 10px;
47
- }
48
-
49
- .editable-row {
50
- position: relative;
51
- }
52
-
53
- .editable-row .hover-block {
54
- display: none;
55
- position: absolute;
56
- top: 0;
57
- right: 0;
58
- bottom: 0;
59
- line-height: 48px;
60
- background-color: #eeeeee;
61
- z-index: 100;
62
- }
63
-
64
- .editable-row .hover-block paper-icon-button {
65
- color: rgba(0, 0, 0, 0.54);
66
- padding-left: 5px;
67
- }
68
-
69
- .editable-row:hover > .hover-block {
70
- display: block;
71
- cursor: pointer;
72
- }
73
-
74
- .col-data {
75
- height: auto;
76
- min-height: 47px;
77
- display: flex;
78
- align-items: center;
79
- min-width: 0;
80
- overflow: hidden;
81
- margin-right: 5px;
82
- }
83
-
84
- .col-data:last-child {
85
- margin-right: 0;
86
- }
87
-
88
- .col-data.edited-col {
89
- cursor: pointer;
90
- }
91
-
92
- .col-data .two-line-truncate {
93
- height: 38px;
94
- overflow: hidden;
95
- }
96
-
97
- .col-data.truncated,
98
- .col-data .truncate {
99
- flex-wrap: nowrap;
100
- overflow: hidden;
101
- text-overflow: ellipsis;
102
- white-space: nowrap;
103
- }
104
-
105
- .col-data .flexible-text {
106
- display: block;
107
- margin: 4px 0;
108
- }
109
-
110
- .row-details-content {
111
- font-size: 12px;
112
- padding-right: 100px;
113
- }
114
-
115
- .row-details-content .rdc-title {
116
- display: inline-block;
117
- color: var(--list-secondary-text-color, #757575);
118
- font-weight: bold;
119
- margin-bottom: 5px;
120
- }
121
-
122
- etools-data-table-row {
123
- --list-divider-color: #e0e0e0;
124
- --list-icon-color: rgba(0, 0, 0, 0.54);
125
- }
126
-
127
- etools-data-table-header {
128
- --list-divider-color: 1px solid rgba(244, 243, 242, 0.26);
129
- --list-bg-color: #f2eee8;
130
- border-bottom: 1px solid rgba(0, 0, 0, 0.26);
131
- }
132
-
133
- .card-container {
134
- padding: 0;
135
- }
136
-
137
- .remove-title {
138
- padding: 16px 25px 15px;
139
- font-size: 17px;
140
- color: rgba(0, 0, 0, 0.87);
141
- font-weight: 500;
142
- line-height: 28px;
143
- }
144
-
145
- paper-textarea {
146
- overflow: hidden;
147
- }
148
-
149
- a.link-cell {
150
- font-weight: 500;
151
- text-decoration: none;
152
- color: var(--primary-color);
153
- }
3
+ export const CardStyles = css `
4
+ .card-title-box {
5
+ position: relative;
6
+ display: flex;
7
+ align-items: center;
8
+ min-height: 60px;
9
+ padding: 0 10px 0 25px;
10
+ }
11
+
12
+ .card-title-box.with-bottom-line {
13
+ border-bottom: 1px solid #9c9c9c;
14
+ }
15
+
16
+ .card-title-box .card-title {
17
+ flex: auto;
18
+ overflow: hidden;
19
+ white-space: nowrap;
20
+ text-overflow: ellipsis;
21
+ font-size: var(--etools-font-size-18, 18px);
22
+ }
23
+
24
+ .card-title-box .card-title.counter {
25
+ font-size: var(--etools-font-size-20, 20px);
26
+ font-weight: 500;
27
+ }
28
+
29
+ .card-title-box .buttons-container {
30
+ position: relative;
31
+ display: flex;
32
+ align-items: center;
33
+ height: 100%;
34
+ }
35
+
36
+ .panel-button {
37
+ opacity: 0.45;
38
+ transition: 0.15s;
39
+ }
40
+
41
+ .panel-button:hover {
42
+ opacity: 0.57;
43
+ }
44
+
45
+ .card-content {
46
+ padding: 0 10px;
47
+ }
48
+
49
+ .editable-row {
50
+ position: relative;
51
+ }
52
+
53
+ .editable-row .hover-block {
54
+ display: none;
55
+ position: absolute;
56
+ top: 0;
57
+ right: 0;
58
+ bottom: 0;
59
+ line-height: 48px;
60
+ background-color: #eeeeee;
61
+ z-index: 100;
62
+ }
63
+
64
+ .editable-row .hover-block etools-icon-button {
65
+ color: rgba(0, 0, 0, 0.54);
66
+ padding-left: 5px;
67
+ }
68
+
69
+ .editable-row:hover > .hover-block {
70
+ display: block;
71
+ cursor: pointer;
72
+ }
73
+
74
+ .col-data {
75
+ height: auto;
76
+ min-height: 47px;
77
+ display: flex;
78
+ align-items: center;
79
+ min-width: 0;
80
+ overflow: hidden;
81
+ margin-right: 5px;
82
+ }
83
+
84
+ .col-data:last-child {
85
+ margin-right: 0;
86
+ }
87
+
88
+ .col-data.edited-col {
89
+ cursor: pointer;
90
+ }
91
+
92
+ .col-data .two-line-truncate {
93
+ height: 38px;
94
+ overflow: hidden;
95
+ }
96
+
97
+ .col-data.truncated,
98
+ .col-data .truncate {
99
+ flex-wrap: nowrap;
100
+ overflow: hidden;
101
+ text-overflow: ellipsis;
102
+ white-space: nowrap;
103
+ }
104
+
105
+ .col-data .flexible-text {
106
+ display: block;
107
+ margin: 4px 0;
108
+ }
109
+
110
+ .row-details-content {
111
+ font-size: var(--etools-font-size-12, 12px);
112
+ padding-right: 100px;
113
+ }
114
+
115
+ .row-details-content .rdc-title {
116
+ display: inline-block;
117
+ color: var(--list-secondary-text-color, #757575);
118
+ font-weight: bold;
119
+ margin-bottom: 5px;
120
+ }
121
+
122
+ etools-data-table-row {
123
+ --list-divider-color: #e0e0e0;
124
+ --list-icon-color: rgba(0, 0, 0, 0.54);
125
+ }
126
+
127
+ etools-data-table-header {
128
+ --list-divider-color: 1px solid rgba(244, 243, 242, 0.26);
129
+ --list-bg-color: #f2eee8;
130
+ border-bottom: 1px solid rgba(0, 0, 0, 0.26);
131
+ }
132
+
133
+ .card-container {
134
+ padding: 0;
135
+ }
136
+
137
+ .remove-title {
138
+ padding: 16px 25px 15px;
139
+ font-size: var(--etools-font-size-16, 16px);
140
+ color: rgba(0, 0, 0, 0.87);
141
+ font-weight: 500;
142
+ line-height: 28px;
143
+ }
144
+
145
+ a.link-cell {
146
+ font-weight: 500;
147
+ text-decoration: none;
148
+ color: var(--primary-color);
149
+ }
154
150
  `;
@@ -1,86 +1,86 @@
1
1
  import { html } from 'lit';
2
2
  // language=HTML
3
- export const DialogStyles = html `
4
- <style>
5
- #form-attachments-dialog etools-dialog etools-loading {
6
- font-size: 14px;
7
- }
8
-
9
- #form-attachments-dialog etools-dialog[no-padding] {
10
- --etools-dialog-scrollable: {
11
- padding-top: 0 !important;
12
- }
13
- }
14
-
15
- #form-attachments-dialog etools-dialog {
16
- --etools-dialog-primary-color: var(--primary-color);
17
- --sl-color-primary-500: var(--primary-color);
18
- --etools-dialog-content: {
19
- min-height: 80px;
20
- padding-bottom: 8px !important;
21
- padding-top: 0px !important;
22
- }
23
- }
24
-
25
- #form-attachments-dialog etools-dialog::part(ed-scrollable) {
26
- margin-top: 0;
27
- padding-top: 12px !important;
28
- }
29
-
30
- #form-attachments-dialog etools-dialog::part(ecp-header-title) {
31
- padding: 8px 45px 8px 24px;
32
- }
33
-
34
- #form-attachments-dialog etools-dialog::part(ed-button-styles) {
35
- margin-top: 0;
36
- }
37
-
38
- #form-attachments-dialog etools-dialog > etools-loading {
39
- margin-bottom: -56px;
40
- }
41
-
42
- #form-attachments-dialog etools-content-panel {
43
- position: relative;
44
- }
45
-
46
- #form-attachments-dialog etools-content-panel::part(ecp-header-title) {
47
- font-weight: 500;
48
- line-height: 48px;
49
- padding: 0 30px;
50
- }
51
-
52
- #form-attachments-dialog etools-content-panel::part(ecp-toggle-btn) {
53
- position: absolute;
54
- top: 3px;
55
- left: 13px;
56
- width: 45px;
57
- height: 45px;
58
- }
59
-
60
- #form-attachments-dialog etools-dialog .container {
61
- padding: 14px;
62
- }
63
-
64
- #form-attachments-dialog etools-dialog .content {
65
- padding: 0 14px;
66
- }
67
-
68
- #form-attachments-dialog etools-dialog {
69
- --etools-dialog-confirmation-content: {
70
- min-height: 0;
71
- margin-top: 0;
72
- margin-right: 0;
73
- }
74
-
75
- --etools-dialog-content: {
76
- width: 100%;
77
- max-width: 100% !important;
78
-
79
- overflow-x: hidden;
80
- overflow-y: auto;
81
- display: block;
82
- margin-top: 0;
83
- }
84
- }
85
- </style>
3
+ export const DialogStyles = html `
4
+ <style>
5
+ #form-attachments-dialog etools-dialog etools-loading {
6
+ font-size: var(--etools-font-size-14, 14px);
7
+ }
8
+
9
+ #form-attachments-dialog etools-dialog[no-padding] {
10
+ --etools-dialog-scrollable: {
11
+ padding-top: 0 !important;
12
+ }
13
+ }
14
+
15
+ #form-attachments-dialog etools-dialog {
16
+ --etools-dialog-primary-color: var(--primary-color);
17
+ --sl-color-primary-500: var(--primary-color);
18
+ --etools-dialog-content: {
19
+ min-height: 80px;
20
+ padding-bottom: 8px !important;
21
+ padding-top: 0px !important;
22
+ }
23
+ }
24
+
25
+ #form-attachments-dialog etools-dialog::part(ed-scrollable) {
26
+ margin-top: 0;
27
+ padding-top: 12px !important;
28
+ }
29
+
30
+ #form-attachments-dialog etools-dialog::part(ecp-header-title) {
31
+ padding: 8px 45px 8px 24px;
32
+ }
33
+
34
+ #form-attachments-dialog etools-dialog::part(ed-button-styles) {
35
+ margin-top: 0;
36
+ }
37
+
38
+ #form-attachments-dialog etools-dialog > etools-loading {
39
+ margin-bottom: -56px;
40
+ }
41
+
42
+ #form-attachments-dialog etools-content-panel {
43
+ position: relative;
44
+ }
45
+
46
+ #form-attachments-dialog etools-content-panel::part(ecp-header-title) {
47
+ font-weight: 500;
48
+ line-height: 48px;
49
+ padding: 0 30px;
50
+ }
51
+
52
+ #form-attachments-dialog etools-content-panel::part(ecp-toggle-btn) {
53
+ position: absolute;
54
+ top: 3px;
55
+ left: 13px;
56
+ width: 45px;
57
+ height: 45px;
58
+ }
59
+
60
+ #form-attachments-dialog etools-dialog .container {
61
+ padding: 14px;
62
+ }
63
+
64
+ #form-attachments-dialog etools-dialog .content {
65
+ padding: 0 14px;
66
+ }
67
+
68
+ #form-attachments-dialog etools-dialog {
69
+ --etools-dialog-confirmation-content: {
70
+ min-height: 0;
71
+ margin-top: 0;
72
+ margin-right: 0;
73
+ }
74
+
75
+ --etools-dialog-content: {
76
+ width: 100%;
77
+ max-width: 100% !important;
78
+
79
+ overflow-x: hidden;
80
+ overflow-y: auto;
81
+ display: block;
82
+ margin-top: 0;
83
+ }
84
+ }
85
+ </style>
86
86
  `;
@@ -1,9 +1,9 @@
1
1
  import { CSSResult } from 'lit';
2
2
  /**
3
- * LitElement css version for used paper-material-styles
3
+ * LitElement css version for used material-styles
4
4
  * TODO:
5
5
  * - use only in new litElements
6
6
  * - add more elevations if needed
7
- * - replace all paper-material-styles with this css module
7
+ * - replace all material-styles with this css module
8
8
  */
9
9
  export declare const elevationStyles: CSSResult;
@@ -1,43 +1,43 @@
1
1
  import { css } from 'lit';
2
2
  /**
3
- * LitElement css version for used paper-material-styles
3
+ * LitElement css version for used material-styles
4
4
  * TODO:
5
5
  * - use only in new litElements
6
6
  * - add more elevations if needed
7
- * - replace all paper-material-styles with this css module
7
+ * - replace all material-styles with this css module
8
8
  */
9
9
  // language=CSS
10
- export const elevationStyles = css `
11
- .elevation,
12
- :host(.elevation) {
13
- display: block;
14
- position: relative;
15
- }
16
-
17
- .elevation[elevation='1'],
18
- :host(.elevation[elevation='1']) {
19
- box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
20
- }
21
-
22
- .elevation[elevation='2'],
23
- :host(.elevation[elevation='2']) {
24
- box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
25
- }
26
-
27
- .elevation[elevation='3'],
28
- :host(.elevation[elevation='3']) {
29
- box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.4);
30
- }
31
-
32
- .elevation[elevation='4'],
33
- :host(.elevation[elevation='4']) {
34
- box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12),
35
- 0 5px 5px -3px rgba(0, 0, 0, 0.4);
36
- }
37
-
38
- .elevation[elevation='5'],
39
- :host(.elevation[elevation='5']) {
40
- box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12),
41
- 0 8px 10px -5px rgba(0, 0, 0, 0.4);
42
- }
10
+ export const elevationStyles = css `
11
+ .elevation,
12
+ :host(.elevation) {
13
+ display: block;
14
+ position: relative;
15
+ }
16
+
17
+ .elevation[elevation='1'],
18
+ :host(.elevation[elevation='1']) {
19
+ box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
20
+ }
21
+
22
+ .elevation[elevation='2'],
23
+ :host(.elevation[elevation='2']) {
24
+ box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
25
+ }
26
+
27
+ .elevation[elevation='3'],
28
+ :host(.elevation[elevation='3']) {
29
+ box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.4);
30
+ }
31
+
32
+ .elevation[elevation='4'],
33
+ :host(.elevation[elevation='4']) {
34
+ box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12),
35
+ 0 5px 5px -3px rgba(0, 0, 0, 0.4);
36
+ }
37
+
38
+ .elevation[elevation='5'],
39
+ :host(.elevation[elevation='5']) {
40
+ box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12),
41
+ 0 8px 10px -5px rgba(0, 0, 0, 0.4);
42
+ }
43
43
  `;