@unicef-polymer/etools-form-builder 3.2.2 → 3.2.4

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 (42) 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 +100 -100
  5. package/dist/form-fields/field-renderer-component.js +198 -166
  6. package/dist/form-fields/index.d.ts +2 -0
  7. package/dist/form-fields/index.js +2 -0
  8. package/dist/form-fields/repeatable-fields/repeatable-attachment-field.js +111 -111
  9. package/dist/form-fields/repeatable-fields/repeatable-base-field.js +22 -22
  10. package/dist/form-fields/repeatable-fields/repeatable-choice-field.d.ts +15 -0
  11. package/dist/form-fields/repeatable-fields/repeatable-choice-field.js +123 -0
  12. package/dist/form-fields/repeatable-fields/repeatable-number-field.js +19 -19
  13. package/dist/form-fields/repeatable-fields/repeatable-scale-field.js +57 -57
  14. package/dist/form-fields/repeatable-fields/repeatable-text-field.js +19 -19
  15. package/dist/form-fields/single-fields/attachment-field.js +13 -13
  16. package/dist/form-fields/single-fields/boolean-field.js +16 -16
  17. package/dist/form-fields/single-fields/choice-field.d.ts +17 -0
  18. package/dist/form-fields/single-fields/choice-field.js +121 -0
  19. package/dist/form-fields/single-fields/number-field.js +20 -20
  20. package/dist/form-fields/single-fields/scale-field.js +58 -58
  21. package/dist/form-fields/single-fields/text-field.js +30 -30
  22. package/dist/form-groups/form-abstract-group.d.ts +2 -1
  23. package/dist/form-groups/form-abstract-group.js +130 -129
  24. package/dist/form-groups/form-card.js +30 -30
  25. package/dist/form-groups/form-collapsed-card.js +34 -34
  26. package/dist/lib/additional-components/confirmation-dialog.js +20 -20
  27. package/dist/lib/additional-components/etools-fb-card.js +144 -144
  28. package/dist/lib/styles/attachments.styles.js +61 -61
  29. package/dist/lib/styles/card-styles.js +147 -147
  30. package/dist/lib/styles/dialog.styles.js +83 -83
  31. package/dist/lib/styles/elevation-styles.js +46 -46
  32. package/dist/lib/styles/flex-layout-classes.js +316 -316
  33. package/dist/lib/styles/form-builder-card.styles.js +53 -53
  34. package/dist/lib/styles/page-layout-styles.js +198 -198
  35. package/dist/lib/styles/shared-styles.js +61 -61
  36. package/dist/lib/types/form-builder.types.d.ts +1 -1
  37. package/dist/rich-editor/rich-action.js +34 -34
  38. package/dist/rich-editor/rich-text.d.ts +1 -0
  39. package/dist/rich-editor/rich-text.js +163 -65
  40. package/dist/rich-editor/rich-toolbar.js +125 -125
  41. package/dist/rich-editor/rich-viewer.js +21 -21
  42. package/package.json +52 -51
@@ -1,150 +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: 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
- }
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
+ }
150
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: 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>
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
  `;
@@ -7,50 +7,50 @@ import { css } from 'lit';
7
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:
20
- 0 2px 2px 0 rgba(0, 0, 0, 0.14),
21
- 0 1px 5px 0 rgba(0, 0, 0, 0.12),
22
- 0 3px 1px -2px rgba(0, 0, 0, 0.2);
23
- }
24
-
25
- .elevation[elevation='2'],
26
- :host(.elevation[elevation='2']) {
27
- box-shadow:
28
- 0 4px 5px 0 rgba(0, 0, 0, 0.14),
29
- 0 1px 10px 0 rgba(0, 0, 0, 0.12),
30
- 0 2px 4px -1px rgba(0, 0, 0, 0.4);
31
- }
32
-
33
- .elevation[elevation='3'],
34
- :host(.elevation[elevation='3']) {
35
- box-shadow:
36
- 0 6px 10px 0 rgba(0, 0, 0, 0.14),
37
- 0 1px 18px 0 rgba(0, 0, 0, 0.12),
38
- 0 3px 5px -1px rgba(0, 0, 0, 0.4);
39
- }
40
-
41
- .elevation[elevation='4'],
42
- :host(.elevation[elevation='4']) {
43
- box-shadow:
44
- 0 8px 10px 1px rgba(0, 0, 0, 0.14),
45
- 0 3px 14px 2px rgba(0, 0, 0, 0.12),
46
- 0 5px 5px -3px rgba(0, 0, 0, 0.4);
47
- }
48
-
49
- .elevation[elevation='5'],
50
- :host(.elevation[elevation='5']) {
51
- box-shadow:
52
- 0 16px 24px 2px rgba(0, 0, 0, 0.14),
53
- 0 6px 30px 5px rgba(0, 0, 0, 0.12),
54
- 0 8px 10px -5px rgba(0, 0, 0, 0.4);
55
- }
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:
20
+ 0 2px 2px 0 rgba(0, 0, 0, 0.14),
21
+ 0 1px 5px 0 rgba(0, 0, 0, 0.12),
22
+ 0 3px 1px -2px rgba(0, 0, 0, 0.2);
23
+ }
24
+
25
+ .elevation[elevation='2'],
26
+ :host(.elevation[elevation='2']) {
27
+ box-shadow:
28
+ 0 4px 5px 0 rgba(0, 0, 0, 0.14),
29
+ 0 1px 10px 0 rgba(0, 0, 0, 0.12),
30
+ 0 2px 4px -1px rgba(0, 0, 0, 0.4);
31
+ }
32
+
33
+ .elevation[elevation='3'],
34
+ :host(.elevation[elevation='3']) {
35
+ box-shadow:
36
+ 0 6px 10px 0 rgba(0, 0, 0, 0.14),
37
+ 0 1px 18px 0 rgba(0, 0, 0, 0.12),
38
+ 0 3px 5px -1px rgba(0, 0, 0, 0.4);
39
+ }
40
+
41
+ .elevation[elevation='4'],
42
+ :host(.elevation[elevation='4']) {
43
+ box-shadow:
44
+ 0 8px 10px 1px rgba(0, 0, 0, 0.14),
45
+ 0 3px 14px 2px rgba(0, 0, 0, 0.12),
46
+ 0 5px 5px -3px rgba(0, 0, 0, 0.4);
47
+ }
48
+
49
+ .elevation[elevation='5'],
50
+ :host(.elevation[elevation='5']) {
51
+ box-shadow:
52
+ 0 16px 24px 2px rgba(0, 0, 0, 0.14),
53
+ 0 6px 30px 5px rgba(0, 0, 0, 0.12),
54
+ 0 8px 10px -5px rgba(0, 0, 0, 0.4);
55
+ }
56
56
  `;