@unicef-polymer/etools-form-builder 2.0.0-rc.6 → 2.0.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 (83) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/dist/form-attachments-popup/form-attachments-popup.d.ts +0 -0
  4. package/dist/form-attachments-popup/form-attachments-popup.helper.d.ts +0 -0
  5. package/dist/form-attachments-popup/form-attachments-popup.helper.js +0 -0
  6. package/dist/form-attachments-popup/form-attachments-popup.js +0 -0
  7. package/dist/form-attachments-popup/form-attachments-popup.tpl.d.ts +0 -0
  8. package/dist/form-attachments-popup/form-attachments-popup.tpl.js +1 -2
  9. package/dist/form-attachments-popup/index.d.ts +0 -0
  10. package/dist/form-attachments-popup/index.js +0 -0
  11. package/dist/form-fields/abstract-field-base.class.d.ts +0 -0
  12. package/dist/form-fields/abstract-field-base.class.js +4 -9
  13. package/dist/form-fields/field-renderer-component.d.ts +0 -0
  14. package/dist/form-fields/field-renderer-component.js +0 -0
  15. package/dist/form-fields/index.d.ts +0 -0
  16. package/dist/form-fields/index.js +0 -0
  17. package/dist/form-fields/repeatable-fields/repeatable-attachment-field.d.ts +0 -0
  18. package/dist/form-fields/repeatable-fields/repeatable-attachment-field.js +0 -0
  19. package/dist/form-fields/repeatable-fields/repeatable-base-field.d.ts +0 -0
  20. package/dist/form-fields/repeatable-fields/repeatable-base-field.js +0 -0
  21. package/dist/form-fields/repeatable-fields/repeatable-number-field.d.ts +0 -0
  22. package/dist/form-fields/repeatable-fields/repeatable-number-field.js +2 -2
  23. package/dist/form-fields/repeatable-fields/repeatable-scale-field.d.ts +0 -0
  24. package/dist/form-fields/repeatable-fields/repeatable-scale-field.js +0 -0
  25. package/dist/form-fields/repeatable-fields/repeatable-text-field.d.ts +0 -0
  26. package/dist/form-fields/repeatable-fields/repeatable-text-field.js +2 -2
  27. package/dist/form-fields/single-fields/attachment-field.d.ts +0 -0
  28. package/dist/form-fields/single-fields/attachment-field.js +0 -0
  29. package/dist/form-fields/single-fields/base-field.d.ts +0 -0
  30. package/dist/form-fields/single-fields/base-field.js +0 -0
  31. package/dist/form-fields/single-fields/boolean-field.d.ts +0 -0
  32. package/dist/form-fields/single-fields/boolean-field.js +2 -2
  33. package/dist/form-fields/single-fields/number-field.d.ts +0 -0
  34. package/dist/form-fields/single-fields/number-field.js +2 -2
  35. package/dist/form-fields/single-fields/scale-field.d.ts +0 -0
  36. package/dist/form-fields/single-fields/scale-field.js +0 -0
  37. package/dist/form-fields/single-fields/text-field.d.ts +0 -0
  38. package/dist/form-fields/single-fields/text-field.js +2 -2
  39. package/dist/form-groups/form-abstract-group.d.ts +0 -0
  40. package/dist/form-groups/form-abstract-group.js +0 -0
  41. package/dist/form-groups/form-card.d.ts +0 -0
  42. package/dist/form-groups/form-card.js +0 -0
  43. package/dist/form-groups/form-collapsed-card.d.ts +0 -0
  44. package/dist/form-groups/form-collapsed-card.js +0 -0
  45. package/dist/form-groups/index.d.ts +0 -0
  46. package/dist/form-groups/index.js +0 -0
  47. package/dist/index.d.ts +0 -0
  48. package/dist/index.js +0 -0
  49. package/dist/lib/additional-components/confirmation-dialog.d.ts +0 -0
  50. package/dist/lib/additional-components/confirmation-dialog.js +0 -0
  51. package/dist/lib/additional-components/etools-fb-card.d.ts +0 -0
  52. package/dist/lib/additional-components/etools-fb-card.js +0 -0
  53. package/dist/lib/styles/attachments.styles.d.ts +0 -0
  54. package/dist/lib/styles/attachments.styles.js +0 -0
  55. package/dist/lib/styles/card-styles.d.ts +0 -0
  56. package/dist/lib/styles/card-styles.js +0 -0
  57. package/dist/lib/styles/dialog.styles.d.ts +0 -0
  58. package/dist/lib/styles/dialog.styles.js +0 -0
  59. package/dist/lib/styles/elevation-styles.d.ts +0 -0
  60. package/dist/lib/styles/elevation-styles.js +0 -0
  61. package/dist/lib/styles/flex-layout-classes.d.ts +0 -0
  62. package/dist/lib/styles/flex-layout-classes.js +0 -0
  63. package/dist/lib/styles/form-builder-card.styles.d.ts +0 -0
  64. package/dist/lib/styles/form-builder-card.styles.js +0 -0
  65. package/dist/lib/styles/input-styles.d.ts +0 -0
  66. package/dist/lib/styles/input-styles.js +47 -69
  67. package/dist/lib/styles/page-layout-styles.d.ts +0 -0
  68. package/dist/lib/styles/page-layout-styles.js +0 -0
  69. package/dist/lib/styles/shared-styles.d.ts +0 -0
  70. package/dist/lib/styles/shared-styles.js +0 -0
  71. package/dist/lib/types/form-builder.interfaces.d.ts +0 -0
  72. package/dist/lib/types/form-builder.interfaces.js +0 -0
  73. package/dist/lib/types/form-builder.types.d.ts +0 -0
  74. package/dist/lib/types/form-builder.types.js +0 -0
  75. package/dist/lib/types/global.types.d.ts +0 -0
  76. package/dist/lib/types/global.types.js +0 -0
  77. package/dist/lib/utils/dialog.d.ts +0 -0
  78. package/dist/lib/utils/dialog.js +0 -0
  79. package/dist/lib/utils/fire-custom-event.d.ts +0 -0
  80. package/dist/lib/utils/fire-custom-event.js +0 -0
  81. package/dist/lib/utils/validations.helper.d.ts +0 -0
  82. package/dist/lib/utils/validations.helper.js +0 -0
  83. package/package.json +10 -7
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
@@ -27,7 +27,7 @@ export function template() {
27
27
  <div class="file-selector-container with-type-dropdown">
28
28
  <!-- Type select Dropdown -->
29
29
  <etools-dropdown
30
- class="type-dropdown disabled-as-readonly file-selector__type-dropdown"
30
+ class="type-dropdown file-selector__type-dropdown"
31
31
  .selected="${attachment.file_type}"
32
32
  @etools-selected-item-changed="${({ detail }) => { var _a; return this.changeFileType(attachment, (_a = detail.selectedItem) === null || _a === void 0 ? void 0 : _a.value, index); }}"
33
33
  trigger-value-change-event
@@ -35,7 +35,6 @@ export function template() {
35
35
  placeholder="Select Document Type"
36
36
  required
37
37
  ?readonly="${this.readonly}"
38
- ?disabled="${this.readonly}"
39
38
  hide-search
40
39
  .options="${(_b = (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.options.target_attachments_file_types) === null || _b === void 0 ? void 0 : _b.values}"
41
40
  option-label="label"
File without changes
File without changes
File without changes
@@ -122,22 +122,17 @@ export class AbstractFieldBaseClass extends LitElement {
122
122
  color: var(--primary-text-color);
123
123
  }
124
124
 
125
- paper-input.form-control,
126
- paper-textarea.form-control {
125
+ paper-input,
126
+ paper-textarea {
127
127
  outline: none !important;
128
128
  }
129
- paper-input[required].form-control,
130
- paper-textarea[required].form-control {
129
+ paper-input[required],
130
+ paper-textarea[required] {
131
131
  --paper-input-container-label_-_background: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221235%22%20height%3D%221175%22%3E%3Cpath%20fill%3D%22%23de0000%22%20d%3D%22M0%2C449h1235l-999%2C726%20382-1175%20382%2C1175z%22%2F%3E%3C%2Fsvg%3E')
132
132
  no-repeat 98% 14%/7px;
133
133
  --paper-input-container-label_-_max-width: max-content;
134
134
  --paper-input-container-label_-_padding-right: 15px;
135
135
  }
136
- paper-input[disabled].form-control,
137
- paper-textarea[disabled].form-control {
138
- --paper-input-container-underline_-_border-bottom: 1px solid rgba(0, 0, 0, 0.2) !important;
139
- --paper-input-container-underline_-_border-color: rgba(0, 0, 0, 0.2) !important;
140
- }
141
136
 
142
137
  iron-icon[icon='close'] {
143
138
  cursor: pointer;
File without changes
File without changes
File without changes
File without changes
@@ -18,7 +18,7 @@ let RepeatableNumberField = class RepeatableNumberField extends RepeatableBaseFi
18
18
  return html `
19
19
  ${InputStyles}
20
20
  <paper-input
21
- class="without-border no-padding-left form-control"
21
+ class="no-padding-left"
22
22
  no-label-float
23
23
  placeholder="${this.isReadonly ? '—' : this.placeholder}"
24
24
  .value="${value}"
@@ -26,7 +26,7 @@ let RepeatableNumberField = class RepeatableNumberField extends RepeatableBaseFi
26
26
  placeholder="&#8212;"
27
27
  ?invalid="${this.errorMessage[index]}"
28
28
  error-message="${this.errorMessage[index]}"
29
- ?disabled="${this.isReadonly}"
29
+ ?readonly="${this.isReadonly}"
30
30
  >
31
31
  </paper-input>
32
32
  `;
@@ -15,12 +15,12 @@ let RepeatableTextField = class RepeatableTextField extends RepeatableBaseField
15
15
  ${InputStyles}
16
16
  <paper-textarea
17
17
  id="textarea"
18
- class="no-padding-left form-control"
18
+ class="no-padding-left"
19
19
  no-label-float
20
20
  placeholder="${this.isReadonly ? '—' : this.placeholder}"
21
21
  .value="${value}"
22
22
  @value-changed="${({ detail }) => this.valueChanged(detail.value, index)}"
23
- ?disabled="${this.isReadonly}"
23
+ ?readonly="${this.isReadonly}"
24
24
  ?invalid="${this.errorMessage[index]}"
25
25
  error-message="${this.errorMessage[index]}"
26
26
  >
File without changes
File without changes
File without changes
@@ -13,10 +13,10 @@ let BooleanField = class BooleanField extends BaseField {
13
13
  return html `
14
14
  ${InputStyles}
15
15
  <paper-toggle-button
16
- class="no-padding-left form-control"
16
+ class="no-padding-left"
17
17
  ?checked="${this.value}"
18
18
  @iron-change="${(event) => this.valueChanged(event.currentTarget.checked)}"
19
- ?disabled="${this.isReadonly}"
19
+ ?readonly="${this.isReadonly}"
20
20
  >
21
21
  </paper-toggle-button>
22
22
 
File without changes
@@ -17,7 +17,7 @@ let NumberField = class NumberField extends BaseField {
17
17
  return html `
18
18
  ${InputStyles}
19
19
  <paper-input
20
- class="without-border no-padding-left form-control"
20
+ class="no-padding-left"
21
21
  no-label-float
22
22
  placeholder="${this.isReadonly ? '—' : this.placeholder}"
23
23
  .value="${this.value}"
@@ -26,7 +26,7 @@ let NumberField = class NumberField extends BaseField {
26
26
  placeholder="&#8212;"
27
27
  ?invalid="${this.errorMessage}"
28
28
  error-message="${this.errorMessage}"
29
- ?disabled="${this.isReadonly}"
29
+ ?readonly="${this.isReadonly}"
30
30
  >
31
31
  </paper-input>
32
32
  `;
File without changes
File without changes
File without changes
@@ -14,14 +14,14 @@ let TextField = class TextField extends BaseField {
14
14
  ${InputStyles}
15
15
  <paper-textarea
16
16
  id="textarea"
17
- class="no-padding-left form-control"
17
+ class="no-padding-left"
18
18
  no-label-float
19
19
  placeholder="${this.isReadonly ? '—' : this.placeholder}"
20
20
  .value="${this.value}"
21
21
  @value-changed="${({ detail }) => this.valueChanged(detail.value)}"
22
22
  @focus="${() => (this.touched = true)}"
23
23
  placeholder="&#8212;"
24
- ?disabled="${this.isReadonly}"
24
+ ?readonly="${this.isReadonly}"
25
25
  ?invalid="${this.errorMessage}"
26
26
  error-message="${this.errorMessage}"
27
27
  >
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/index.d.ts CHANGED
File without changes
package/dist/index.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -2,35 +2,30 @@ import { html } from 'lit-element';
2
2
  // language=HTML
3
3
  export const InputStyles = html `
4
4
  <style>
5
- etools-dropdown.form-control,
6
- etools-dropdown-multi.form-control,
7
- paper-input.form-control,
8
- paper-textarea.form-control,
9
- paper-dropdown-menu.form-control,
10
- etools-currency-amount-input.form-control,
11
- datepicker-lite.form-control {
5
+ etools-dropdown,
6
+ etools-dropdown-multi,
7
+ paper-input,
8
+ paper-textarea,
9
+ paper-dropdown-menu,
10
+ etools-currency-amount-input,
11
+ datepicker-lite {
12
12
  outline: none !important;
13
13
  padding: 0 12px;
14
- color: var(--gray-mid, rgba(0, 0, 0, 0.54));
14
+ color: var(--gray-dark, rgba(0, 0, 0, 0.87));
15
15
  box-sizing: border-box;
16
- --esmm-placeholder-color: var(--gray-20, rgba(0, 0, 0, 0.2));
17
- --esmm-multi-placeholder-color: var(--gray-20, rgba(0, 0, 0, 0.2));
18
- --paper-input-container-color: rgba(0, 0, 0, 0.2);
16
+
17
+ --paper-input-container-input-color: var(--gray-dark, rgba(0, 0, 0, 0.87));
18
+ --esmm-placeholder-color: var(--gray-dark, rgba(0, 0, 0, 0.87));
19
+ --esmm-multi-placeholder-color: var(--gray-dark, rgba(0, 0, 0, 0.87));
20
+
19
21
  --paper-input-container-focus-color: var(--primary-color, #0099ff);
20
- --paper-input-container-input: {
21
- font-size: 16px;
22
- color: var(--gray-dark, rgba(0, 0, 0, 0.87));
23
- }
22
+
24
23
  --paper-input-container-label: {
25
24
  color: var(--gray-50, rgba(0, 0, 0, 0.5));
26
25
  }
27
26
 
28
27
  --paper-input-container-invalid-color: var(--module-error, #ea4022);
29
28
 
30
- --paper-input-container-disabled: {
31
- color: var(--gray-light, rgba(0, 0, 0, 0.38));
32
- opacity: 1;
33
- }
34
29
  --paper-input-char-counter: {
35
30
  color: var(--gray-light, rgba(0, 0, 0, 0.38));
36
31
  }
@@ -56,9 +51,6 @@ export const InputStyles = html `
56
51
  width: 100%;
57
52
  font-size: 12px;
58
53
  }
59
- --paper-input-container-underline: {
60
- border-color: rgba(0, 0, 0, 0.2) !important;
61
- }
62
54
 
63
55
  --paper-input-container-shared-input-style: {
64
56
  font-size: 16px;
@@ -74,44 +66,35 @@ export const InputStyles = html `
74
66
  overflow: hidden;
75
67
  }
76
68
 
77
- --iron-autogrow-textarea-placeholder: {
78
- color: var(--gray-20, rgba(0, 0, 0, 0.2)) !important;
79
- }
80
69
  --iron-autogrow-textarea: {
81
70
  padding: 0;
82
71
  }
83
72
  }
84
73
 
85
- paper-input-container.form-control,
86
- etools-dropdown-multi[disabled].disabled-as-readonly.form-control,
87
- etools-dropdown[disabled].disabled-as-readonly.form-control,
88
- paper-textarea[disabled].disabled-as-readonly.form-control,
89
- paper-dropdown-menu[disabled].disabled-as-readonly.form-control,
90
- paper-input[disabled].disabled-as-readonly.form-control,
91
- datepicker-lite[disabled].disabled-as-readonly.form-control {
74
+ etools-dropdown-multi[disabled],
75
+ etools-dropdown[disabled],
76
+ paper-textarea[disabled],
77
+ paper-dropdown-menu[disabled],
78
+ paper-input[disabled],
79
+ datepicker-lite[disabled] {
92
80
  --paper-input-container: {
93
81
  opacity: 1 !important;
94
82
  }
95
- --paper-input-container-underline: {
96
- border-bottom: none !important;
97
- display: none !important;
98
- }
83
+
99
84
  --paper-input-container-underline-focus: {
100
85
  display: none;
101
86
  }
102
- --paper-input-container-color: rgba(0, 0, 0, 0.2) !important;
87
+ --esmm-select-cursor: initial;
103
88
  }
104
89
 
105
- etools-dropdown-multi[disabled].without-border.form-control,
106
- etools-dropdown[disabled].without-border.form-control,
107
- paper-textarea[disabled].without-border.form-control,
108
- paper-input[disabled].without-border.form-control,
109
- datepicker-lite[disabled].without-border.form-control {
110
- --paper-input-container-label: {
111
- color: var(--gray-50, rgba(0, 0, 0, 0.5)) !important;
112
- }
113
- --esmm-placeholder-color: rgba(0, 0, 0, 0.16) !important;
114
- --esmm-multi-placeholder-color: rgba(0, 0, 0, 0.16) !important;
90
+ etools-dropdown-multi[readonly],
91
+ etools-dropdown[readonly],
92
+ paper-textarea[readonly],
93
+ paper-dropdown-menu[readonly],
94
+ paper-input[readonly],
95
+ datepicker-lite[readonly] {
96
+ --paper-input-container-underline_-_display: none;
97
+ --paper-input-container-underline-focus_-_display: none;
115
98
  --paper-input-container: {
116
99
  opacity: 1 !important;
117
100
  }
@@ -122,30 +105,25 @@ export const InputStyles = html `
122
105
  --paper-input-container-underline-focus: {
123
106
  display: none;
124
107
  }
125
- --paper-input-container-underline-disabled: {
126
- display: none;
127
- }
128
- --iron-autogrow-textarea-placeholder: {
129
- color: var(--gray-mid-dark, rgba(0, 0, 0, 0.7)) !important;
130
- }
131
- --paper-input-container-color: var(--gray-mid-dark, rgba(0, 0, 0, 0.7));
108
+
109
+ --esmm-select-cursor: initial;
132
110
  }
133
111
 
134
- etools-dropdown-multi.required:not([disabled]).form-control,
135
- etools-dropdown-multi[required]:not([disabled]).form-control,
136
- etools-dropdown-multi[required].readonly-required.form-control,
137
- etools-dropdown.required:not([disabled]).form-control,
138
- etools-dropdown[required]:not([disabled]).form-control,
139
- etools-dropdown[required].readonly-required.form-control,
140
- paper-dropdown-menu.required:not([disabled]).form-control,
141
- paper-dropdown-menu[required]:not([disabled]).form-control,
142
- paper-dropdown-menu[required].readonly-required.form-control,
143
- paper-textarea.required:not([disabled]).form-control,
144
- paper-textarea[required]:not([disabled]).form-control,
145
- paper-textarea[required].readonly-required.form-control,
146
- paper-input.required:not([disabled]).form-control,
147
- paper-input[required].readonly-required.form-control,
148
- paper-input[required]:not([disabled]).form-control {
112
+ etools-dropdown-multi.required:not([disabled]),
113
+ etools-dropdown-multi[required]:not([disabled]),
114
+ etools-dropdown-multi[required].readonly-required,
115
+ etools-dropdown.required:not([disabled]),
116
+ etools-dropdown[required]:not([disabled]),
117
+ etools-dropdown[required].readonly-required,
118
+ paper-dropdown-menu.required:not([disabled]),
119
+ paper-dropdown-menu[required]:not([disabled]),
120
+ paper-dropdown-menu[required].readonly-required,
121
+ paper-textarea.required:not([disabled]),
122
+ paper-textarea[required]:not([disabled]),
123
+ paper-textarea[required].readonly-required,
124
+ paper-input.required:not([disabled]),
125
+ paper-input[required].readonly-required,
126
+ paper-input[required]:not([disabled]) {
149
127
  --paper-input-container-label: {
150
128
  background: url('data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221235%22%20height%3D%221175%22%3E%3Cpath%20fill%3D%22%23de0000%22%20d%3D%22M0%2C449h1235l-999%2C726%20382-1175%20382%2C1175z%22%2F%3E%3C%2Fsvg%3E')
151
129
  no-repeat 98% 14%/7px;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unicef-polymer/etools-form-builder",
3
3
  "description": "Etools FM Form Builder components",
4
- "version": "2.0.0-rc.6",
4
+ "version": "2.0.0",
5
5
  "contributors": [
6
6
  "eTools Team"
7
7
  ],
@@ -22,17 +22,17 @@
22
22
  "@polymer/iron-collapse": "^3.0.1",
23
23
  "@polymer/iron-icons": "^3.0.1",
24
24
  "@polymer/paper-button": "^3.0.1",
25
- "@polymer/paper-input": "^3.0.2",
25
+ "@polymer/paper-input": "^3.2.1",
26
26
  "@polymer/paper-radio-button": "^3.0.1",
27
27
  "@polymer/paper-radio-group": "^3.0.1",
28
28
  "@polymer/paper-toast": "^3.0.1",
29
29
  "@polymer/paper-toggle-button": "^3.0.1",
30
30
  "@types/ramda": "^0.26.43",
31
- "@unicef-polymer/etools-dialog": "5.0.0-rc.2",
32
- "@unicef-polymer/etools-dropdown": "^3.7.6",
33
- "@unicef-polymer/etools-upload": "^4.2.1-rc.3",
31
+ "@unicef-polymer/etools-dialog": "^6.0.1",
32
+ "@unicef-polymer/etools-dropdown": "^3.7.10",
33
+ "@unicef-polymer/etools-upload": "^4.2.1",
34
34
  "@webcomponents/webcomponentsjs": "^2.6.0",
35
- "lit-element": "^2.4.0",
35
+ "lit-element": "^2.5.1",
36
36
  "lit-translate": "^1.2.1",
37
37
  "ramda": "^0.27.1",
38
38
  "web-animations-js": "^2.3.2"
@@ -48,6 +48,9 @@
48
48
  "eslint-plugin-prettier": "^3.1.3",
49
49
  "minimist": ">=0.2.1",
50
50
  "prettier": "~2.2.0",
51
- "typescript": "^3.9.7"
51
+ "typescript": "^3.9.7",
52
+ "lodash": ">=4.17.21",
53
+ "ansi-regex": ">=5.0.1",
54
+ "glob-parent": ">=5.1.2"
52
55
  }
53
56
  }