@unicef-polymer/etools-form-builder 2.0.0-rc.5 → 2.0.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.
- package/dist/form-attachments-popup/form-attachments-popup.tpl.js +1 -2
- package/dist/form-fields/abstract-field-base.class.js +5 -9
- package/dist/form-fields/index.d.ts +1 -0
- package/dist/form-fields/index.js +1 -0
- package/dist/form-fields/repeatable-fields/repeatable-number-field.js +2 -2
- package/dist/form-fields/repeatable-fields/repeatable-text-field.js +2 -2
- package/dist/form-fields/single-fields/boolean-field.js +2 -2
- package/dist/form-fields/single-fields/number-field.js +2 -2
- package/dist/form-fields/single-fields/text-field.js +2 -2
- package/dist/lib/styles/input-styles.js +47 -69
- package/package.json +10 -7
|
@@ -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
|
|
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"
|
|
@@ -24,6 +24,7 @@ export class AbstractFieldBaseClass extends LitElement {
|
|
|
24
24
|
set isReadonly(readonly) {
|
|
25
25
|
this._readonly = readonly;
|
|
26
26
|
this.setDefaultValue(readonly, this._defaultValue);
|
|
27
|
+
this.requestUpdate();
|
|
27
28
|
}
|
|
28
29
|
get isReadonly() {
|
|
29
30
|
return this._readonly;
|
|
@@ -121,22 +122,17 @@ export class AbstractFieldBaseClass extends LitElement {
|
|
|
121
122
|
color: var(--primary-text-color);
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
paper-input
|
|
125
|
-
paper-textarea
|
|
125
|
+
paper-input,
|
|
126
|
+
paper-textarea {
|
|
126
127
|
outline: none !important;
|
|
127
128
|
}
|
|
128
|
-
paper-input[required]
|
|
129
|
-
paper-textarea[required]
|
|
129
|
+
paper-input[required],
|
|
130
|
+
paper-textarea[required] {
|
|
130
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')
|
|
131
132
|
no-repeat 98% 14%/7px;
|
|
132
133
|
--paper-input-container-label_-_max-width: max-content;
|
|
133
134
|
--paper-input-container-label_-_padding-right: 15px;
|
|
134
135
|
}
|
|
135
|
-
paper-input[disabled].form-control,
|
|
136
|
-
paper-textarea[disabled].form-control {
|
|
137
|
-
--paper-input-container-underline_-_border-bottom: 1px solid rgba(0, 0, 0, 0.2) !important;
|
|
138
|
-
--paper-input-container-underline_-_border-color: rgba(0, 0, 0, 0.2) !important;
|
|
139
|
-
}
|
|
140
136
|
|
|
141
137
|
iron-icon[icon='close'] {
|
|
142
138
|
cursor: pointer;
|
|
@@ -2,6 +2,7 @@ export * from './single-fields/base-field';
|
|
|
2
2
|
export * from './single-fields/number-field';
|
|
3
3
|
export * from './single-fields/text-field';
|
|
4
4
|
export * from './single-fields/scale-field';
|
|
5
|
+
export * from './single-fields/boolean-field';
|
|
5
6
|
export * from './single-fields/attachment-field';
|
|
6
7
|
export * from './repeatable-fields/repeatable-base-field';
|
|
7
8
|
export * from './repeatable-fields/repeatable-text-field';
|
|
@@ -2,6 +2,7 @@ export * from './single-fields/base-field';
|
|
|
2
2
|
export * from './single-fields/number-field';
|
|
3
3
|
export * from './single-fields/text-field';
|
|
4
4
|
export * from './single-fields/scale-field';
|
|
5
|
+
export * from './single-fields/boolean-field';
|
|
5
6
|
export * from './single-fields/attachment-field';
|
|
6
7
|
export * from './repeatable-fields/repeatable-base-field';
|
|
7
8
|
export * from './repeatable-fields/repeatable-text-field';
|
|
@@ -18,7 +18,7 @@ let RepeatableNumberField = class RepeatableNumberField extends RepeatableBaseFi
|
|
|
18
18
|
return html `
|
|
19
19
|
${InputStyles}
|
|
20
20
|
<paper-input
|
|
21
|
-
class="
|
|
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="—"
|
|
27
27
|
?invalid="${this.errorMessage[index]}"
|
|
28
28
|
error-message="${this.errorMessage[index]}"
|
|
29
|
-
?
|
|
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
|
|
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
|
-
?
|
|
23
|
+
?readonly="${this.isReadonly}"
|
|
24
24
|
?invalid="${this.errorMessage[index]}"
|
|
25
25
|
error-message="${this.errorMessage[index]}"
|
|
26
26
|
>
|
|
@@ -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
|
|
16
|
+
class="no-padding-left"
|
|
17
17
|
?checked="${this.value}"
|
|
18
18
|
@iron-change="${(event) => this.valueChanged(event.currentTarget.checked)}"
|
|
19
|
-
?
|
|
19
|
+
?readonly="${this.isReadonly}"
|
|
20
20
|
>
|
|
21
21
|
</paper-toggle-button>
|
|
22
22
|
|
|
@@ -17,7 +17,7 @@ let NumberField = class NumberField extends BaseField {
|
|
|
17
17
|
return html `
|
|
18
18
|
${InputStyles}
|
|
19
19
|
<paper-input
|
|
20
|
-
class="
|
|
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="—"
|
|
27
27
|
?invalid="${this.errorMessage}"
|
|
28
28
|
error-message="${this.errorMessage}"
|
|
29
|
-
?
|
|
29
|
+
?readonly="${this.isReadonly}"
|
|
30
30
|
>
|
|
31
31
|
</paper-input>
|
|
32
32
|
`;
|
|
@@ -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
|
|
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="—"
|
|
24
|
-
?
|
|
24
|
+
?readonly="${this.isReadonly}"
|
|
25
25
|
?invalid="${this.errorMessage}"
|
|
26
26
|
error-message="${this.errorMessage}"
|
|
27
27
|
>
|
|
@@ -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
|
|
6
|
-
etools-dropdown-multi
|
|
7
|
-
paper-input
|
|
8
|
-
paper-textarea
|
|
9
|
-
paper-dropdown-menu
|
|
10
|
-
etools-currency-amount-input
|
|
11
|
-
datepicker-lite
|
|
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-
|
|
14
|
+
color: var(--gray-dark, rgba(0, 0, 0, 0.87));
|
|
15
15
|
box-sizing: border-box;
|
|
16
|
-
|
|
17
|
-
--
|
|
18
|
-
--
|
|
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
|
-
|
|
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
|
-
|
|
86
|
-
etools-dropdown
|
|
87
|
-
|
|
88
|
-
paper-
|
|
89
|
-
paper-
|
|
90
|
-
|
|
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
|
-
|
|
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
|
-
--
|
|
87
|
+
--esmm-select-cursor: initial;
|
|
103
88
|
}
|
|
104
89
|
|
|
105
|
-
etools-dropdown-multi[
|
|
106
|
-
etools-dropdown[
|
|
107
|
-
paper-textarea[
|
|
108
|
-
paper-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
126
|
-
|
|
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])
|
|
135
|
-
etools-dropdown-multi[required]:not([disabled])
|
|
136
|
-
etools-dropdown-multi[required].readonly-required
|
|
137
|
-
etools-dropdown.required:not([disabled])
|
|
138
|
-
etools-dropdown[required]:not([disabled])
|
|
139
|
-
etools-dropdown[required].readonly-required
|
|
140
|
-
paper-dropdown-menu.required:not([disabled])
|
|
141
|
-
paper-dropdown-menu[required]:not([disabled])
|
|
142
|
-
paper-dropdown-menu[required].readonly-required
|
|
143
|
-
paper-textarea.required:not([disabled])
|
|
144
|
-
paper-textarea[required]:not([disabled])
|
|
145
|
-
paper-textarea[required].readonly-required
|
|
146
|
-
paper-input.required:not([disabled])
|
|
147
|
-
paper-input[required].readonly-required
|
|
148
|
-
paper-input[required]:not([disabled])
|
|
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;
|
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.
|
|
4
|
+
"version": "2.0.1",
|
|
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.
|
|
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": "
|
|
32
|
-
"@unicef-polymer/etools-dropdown": "^3.7.
|
|
33
|
-
"@unicef-polymer/etools-upload": "^4.2.1
|
|
31
|
+
"@unicef-polymer/etools-dialog": "^6.0.1",
|
|
32
|
+
"@unicef-polymer/etools-dropdown": "^3.7.11",
|
|
33
|
+
"@unicef-polymer/etools-upload": "^4.2.1",
|
|
34
34
|
"@webcomponents/webcomponentsjs": "^2.6.0",
|
|
35
|
-
"lit-element": "^2.
|
|
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
|
}
|