@progressive-development/pd-forms 0.0.60 → 0.0.61
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/package.json +2 -2
- package/src/PdBaseInputElement.js +95 -0
- package/src/PdBaseUi.js +23 -4
- package/src/PdBaseUiInput.js +137 -6
- package/src/PdButton.js +78 -75
- package/src/PdCheckbox.js +175 -212
- package/src/PdFormContainer.js +41 -34
- package/src/PdFormRow.js +19 -16
- package/src/PdInput.js +41 -137
- package/src/PdInputArea.js +37 -134
- package/src/PdRadioGroup.js +32 -65
- package/src/PdRange.js +0 -2
- package/src/PdSelect.js +36 -190
- package/src/shared-global-styles.js +38 -0
- package/src/shared-input-field-styles.js +147 -0
- package/src/shared-input-styles.js +28 -191
- package/stories/01_index.stories.js +25 -69
- package/stories/checkbox.stories.js +40 -5
- package/stories/form-container.stories.js +18 -4
- package/stories/input.stories.js +23 -15
- package/stories/radio-group.stories.js +30 -21
- package/stories/select.stories.js +34 -22
- package/pd-button-goup.js +0 -3
- package/pd-label-value.js +0 -3
- package/src/PdButtonGroup.js +0 -54
- package/src/PdLabelValue.js +0 -75
- package/stories/label-value.stories.js +0 -32
|
@@ -5,154 +5,44 @@
|
|
|
5
5
|
|
|
6
6
|
import { css } from 'lit';
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Shared styles for all input elements:
|
|
10
|
+
* Used from pd-input, pd-select, pd-input-area, pd-range, pd-checkbox and pd-radio-group.
|
|
11
|
+
*/
|
|
8
12
|
export const SharedInputStyles = css`
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/* define color layout for elements depending on customizables vals:
|
|
17
|
-
squi-primary-color, squi-secondary-color, squi-text-color, squi-highlight-color,
|
|
18
|
-
squi-border-radius, squi-error-color, squi-error-background-color, squi-display-font, squi-font-size
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/* Border for input Elements Select, Input, Input Area */
|
|
22
|
-
--my-border-color: var(--squi-primary-color, #177e89);
|
|
23
|
-
--my-border-color-focus: var(--squi-primary-color, #177e89);
|
|
24
|
-
--my-border-color-hover: var(--squi-highlight-color, #ffc857);
|
|
25
|
-
--my-border-radius: var(--squi-border-radius, 0rem);
|
|
26
|
-
|
|
27
|
-
/* Background color input Elements Select, Input, Input Area */
|
|
28
|
-
--my-primary-color: var(--squi-primary-color, #177e89);
|
|
29
|
-
--my-background-color: var(--squi-secondary-color, #fefefe);
|
|
30
|
-
--my-lighter-background-color: var(--squi-lighter-color, #8caed8a1);
|
|
31
|
-
--my-darker-background-color: var(--squi-darker-color, #012e649f);
|
|
32
|
-
--my-background-gradient-color: var(--squi-third-color, #8caed8a1);
|
|
33
|
-
--my-error-background-color: var(--squi-error-background-color, #ffe8e8);
|
|
34
|
-
|
|
35
|
-
/* Error colors for Elements Select, Input, Input Area */
|
|
36
|
-
--my-error-color: var(--squi-error-color, #cc2029);
|
|
37
|
-
|
|
38
|
-
/* Text color input Elements Select, Input, Input Area */
|
|
39
|
-
--my-text-color: var(--squi-text-color, #000000);
|
|
40
|
-
--my-label-color: var(--squi-text-lable-color, #58585a);
|
|
41
|
-
--my-input-placeholder-color: var(--squi-input-placeholder-color:#474747);
|
|
42
|
-
|
|
43
|
-
--my-font-family: var(--squi-display-font, 'Montserrat');
|
|
44
|
-
--my-font-size: var(--squi-font-size, 1rem);
|
|
45
|
-
|
|
46
|
-
--my-input-height: var(--squi-input-height, 2.4rem);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/* Describe input div (with icon) around input/select/area element */
|
|
50
|
-
.input {
|
|
51
|
-
display: inline-block;
|
|
52
|
-
/*position: relative; Prüfen: Wenn das an ist, felder über scroll-menu?*/
|
|
53
|
-
/* pd-icon smaller than input */
|
|
54
|
-
--pd-icon-computed-size: calc(var(--my-input-height) * 0.75); /* calc */
|
|
55
|
-
|
|
56
|
-
/* Hack um eine Form Row (input mit Button => Booking) zu bekommen*/
|
|
57
|
-
padding-top: var(--squi-input-padding, 0.5rem);
|
|
58
|
-
}
|
|
59
|
-
.input.error {
|
|
60
|
-
color: var(--my-error-color);
|
|
61
|
-
}
|
|
62
|
-
/* squi icon depends on input styles to fit inside */
|
|
63
|
-
pd-icon {
|
|
64
|
-
display: none;
|
|
65
|
-
position: absolute;
|
|
66
|
-
--pd-icon-height: var(--pd-icon-computed-size, 2rem);
|
|
67
|
-
--pd-icon-width: var(--pd-icon-computed-size, 2rem);
|
|
68
|
-
--pd-icon-fill-color: var(--squi-input-icon-fill-color, currentcolor);
|
|
69
|
-
--pd-icon-stroke-color: var(--squi-input-icon-stroke-color, none);
|
|
70
|
-
}
|
|
71
|
-
pd-icon:hover {
|
|
72
|
-
cursor: pointer;
|
|
73
|
-
}
|
|
74
|
-
/* Display icon if it's positioned */
|
|
75
|
-
:host([icon-right]) .input pd-icon {
|
|
76
|
-
display: inline-block;
|
|
77
|
-
right: 0;
|
|
78
|
-
}
|
|
79
|
-
:host([icon-left]) .input pd-icon {
|
|
80
|
-
display: inline-block;
|
|
81
|
-
left: 0;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* Padding space for pd-icon => Noch input spezifisch? */
|
|
85
|
-
:host([icon-right]) > input {
|
|
86
|
-
padding-right: var(--my-input-height);
|
|
87
|
-
}
|
|
88
|
-
:host([icon-left]) > input {
|
|
89
|
-
padding-left: var(--my-input-height);
|
|
90
|
-
}
|
|
91
|
-
/* Text direction */
|
|
92
|
-
:host([text-right]) > input {
|
|
93
|
-
text-align: right;
|
|
94
|
-
}
|
|
95
|
-
:host([text-left]) > input {
|
|
96
|
-
text-align: left;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/* Label for input, select, area */
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Label used for input, select, input-area, range and radio-group.
|
|
16
|
+
* Not used in button, button-group, checkbox (may have a label...?), form-row, form-container
|
|
17
|
+
*/
|
|
100
18
|
label {
|
|
101
19
|
display: block;
|
|
102
|
-
padding: var(--pd-
|
|
103
|
-
color: var(--
|
|
104
|
-
text-align: left;
|
|
105
|
-
font-size: 0.
|
|
106
|
-
|
|
107
|
-
font-family: var(--pd-input-lable-font);
|
|
20
|
+
padding: var(--pd-input-label-padding, 0);
|
|
21
|
+
color: var(--pd-input-lable-col, #58585a);
|
|
22
|
+
text-align: var(--pd-input-label-align, left);
|
|
23
|
+
font-size: var(--pd-input-lable-font-size, 0.8rem);
|
|
24
|
+
font-family: var(--pd-input-lable-font-family);
|
|
108
25
|
}
|
|
109
26
|
|
|
110
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Error box for input elements. Used for checkbox, radio-group, input, input-area, select, range
|
|
29
|
+
*/
|
|
111
30
|
.error-box {
|
|
112
|
-
color: var(--my-error-color);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/* Error Msg Div for input, select, area */
|
|
116
|
-
.error-msg {
|
|
117
|
-
background: var(--my-error-background-color);
|
|
118
|
-
border: 1px solid var(--my-error-color);
|
|
119
|
-
border-radius: var(--my-border-radius);
|
|
120
|
-
padding: 0.25rem 0 0.25rem 0.5rem;
|
|
121
|
-
white-space: nowrap;
|
|
122
31
|
display: block;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
/*
|
|
129
|
-
* Descrive size, style for input, area and select element
|
|
130
|
-
* not use iput here => because of own select css...
|
|
131
|
-
*/
|
|
132
|
-
.input-style {
|
|
133
|
-
width: var(--squi-input-width, 250px);
|
|
134
|
-
padding: var(--squi-input-padding, 0.5rem);
|
|
135
|
-
|
|
136
|
-
background-color: var(--my-background-color);
|
|
137
|
-
/*opacity: 80%;*/
|
|
138
|
-
color: var(--my-text-color);
|
|
139
|
-
/*font-size: var(--squi-input-font-size, calc(var(--squi-input-height) / 1.8));*/
|
|
140
|
-
font-size: var(--my-font-size);
|
|
141
|
-
font-family: var(--my-font-family);
|
|
142
|
-
|
|
143
|
-
/* ToDo Border Angaben? (ganz, nur bottom, und variablen dazu) Hier für Contact us fest eingebunden...*/
|
|
144
|
-
border: 1px solid #cacaca;
|
|
145
|
-
box-shadow: inset 0 1px 2px rgba(50, 48, 49, 0.1);
|
|
146
|
-
border-bottom: 2px solid var(--my-border-color);
|
|
147
|
-
border-radius: var(--my-border-radius);
|
|
32
|
+
color: var(--pd-default-error-color);
|
|
33
|
+
background: var(--pd-error-bg-col, #ffe8e8);
|
|
34
|
+
border: 1px solid var(--pd-default-error-color);
|
|
35
|
+
border-radius: var(--pd-border-radius, 0);
|
|
36
|
+
max-width: var(--pd-input-field-width);
|
|
148
37
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
height: var(--my-input-height);
|
|
38
|
+
.error-box p {
|
|
39
|
+
margin: 0;
|
|
40
|
+
padding: 0.25rem 0.25rem 0.25rem 0.5rem;
|
|
41
|
+
font-size: .8rem;
|
|
154
42
|
}
|
|
155
43
|
|
|
44
|
+
/* gradient noch aufräumen */
|
|
45
|
+
|
|
156
46
|
.gradient {
|
|
157
47
|
background: linear-gradient(
|
|
158
48
|
to bottom,
|
|
@@ -161,24 +51,6 @@ export const SharedInputStyles = css`
|
|
|
161
51
|
);
|
|
162
52
|
}
|
|
163
53
|
|
|
164
|
-
/* Hover for input, area, select */
|
|
165
|
-
.input-style:hover {
|
|
166
|
-
border-color: var(--my-border-color-hover);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/* Fokus for input, area => select with own css.? */
|
|
170
|
-
.input-style:focus {
|
|
171
|
-
border: var(--my-border-color-focus) 3px solid;
|
|
172
|
-
outline: 0;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/* error element style for input, area => select has own css.? */
|
|
176
|
-
.error .input-style {
|
|
177
|
-
border: 1px solid var(--my-error-color);
|
|
178
|
-
color: var(--my-error-color);
|
|
179
|
-
background-color: var(--my-error-background-color);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
54
|
.error .gradient {
|
|
183
55
|
background: linear-gradient(
|
|
184
56
|
to bottom,
|
|
@@ -187,43 +59,8 @@ export const SharedInputStyles = css`
|
|
|
187
59
|
);
|
|
188
60
|
}
|
|
189
61
|
|
|
190
|
-
/* Error Focus for input, area, select */
|
|
191
|
-
.error .input-style:focus {
|
|
192
|
-
border: 2px solid var(--my-error-color);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/*
|
|
196
|
-
* Disabled style for input, select, area
|
|
197
|
-
*/
|
|
198
|
-
/* Disabled for input, area => select with own css.? */
|
|
199
|
-
.input-style[disabled] {
|
|
200
|
-
/* TODO: Angaben nach oben ziehen */
|
|
201
|
-
--squi-input-placeholder-color: rgba(
|
|
202
|
-
var(--raw-game-color-light-lighter),
|
|
203
|
-
1
|
|
204
|
-
);
|
|
205
|
-
border-color: #aaa;
|
|
206
|
-
color: var(--raw-game-color-light-lightest, #7a7777);
|
|
207
|
-
background-color: #d3d2d2;
|
|
208
|
-
text-shadow: 2px 2px 3px var(--raw-game-color-dark-darker, #999);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
62
|
.gradient[disabled] {
|
|
212
63
|
background: linear-gradient(to bottom, #ebebeb 0%, #999 100%);
|
|
213
64
|
}
|
|
214
65
|
|
|
215
|
-
.input-style[disabled]:hover {
|
|
216
|
-
border-color: #6e6c6c;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
/* Placeholder color */
|
|
220
|
-
::placeholder {
|
|
221
|
-
color: var(--squi-input-placeholder-color, #474747);
|
|
222
|
-
}
|
|
223
|
-
:-ms-input-placeholder {
|
|
224
|
-
color: var(--squi-input-placeholder-color, #474747);
|
|
225
|
-
}
|
|
226
|
-
::-ms-input-placeholder {
|
|
227
|
-
color: var(--squi-input-placeholder-color, #474747);
|
|
228
|
-
}
|
|
229
66
|
`;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
|
|
3
3
|
import '../pd-button.js';
|
|
4
|
-
import '../pd-button-goup.js';
|
|
5
4
|
import '../pd-checkbox.js';
|
|
6
5
|
import '../pd-input.js';
|
|
7
6
|
import '../pd-input-area.js';
|
|
@@ -75,7 +74,7 @@ function Template({
|
|
|
75
74
|
style += `--squi-font-size:${fontSize};`;
|
|
76
75
|
}
|
|
77
76
|
if (inputHeigth) {
|
|
78
|
-
style += `--
|
|
77
|
+
style += `--pd-input-field-height:${inputHeigth};`;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
return html`
|
|
@@ -85,20 +84,17 @@ return html`
|
|
|
85
84
|
>
|
|
86
85
|
<pd-select
|
|
87
86
|
id="testId1"
|
|
88
|
-
?gradient="${gradient}"
|
|
89
|
-
style="${style}"
|
|
87
|
+
?gradient="${gradient}"
|
|
90
88
|
label="Select Label"
|
|
91
89
|
></pd-select>
|
|
92
90
|
<pd-input
|
|
93
91
|
id="testId1"
|
|
94
|
-
?gradient="${gradient}"
|
|
95
|
-
style="${style}"
|
|
92
|
+
?gradient="${gradient}"
|
|
96
93
|
label="Input Label"
|
|
97
94
|
></pd-input>
|
|
98
95
|
<pd-input-area
|
|
99
96
|
id="testId2"
|
|
100
|
-
?gradient="${gradient}"
|
|
101
|
-
style="${style}"
|
|
97
|
+
?gradient="${gradient}"
|
|
102
98
|
label="Input Area Label"
|
|
103
99
|
></pd-input-area>
|
|
104
100
|
</div>
|
|
@@ -109,21 +105,18 @@ return html`
|
|
|
109
105
|
<pd-select
|
|
110
106
|
id="testId1"
|
|
111
107
|
?gradient="${gradient}"
|
|
112
|
-
.values="${selectVals}"
|
|
113
|
-
style="${style}"
|
|
108
|
+
.values="${selectVals}"
|
|
114
109
|
label="Select Label"
|
|
115
110
|
></pd-select>
|
|
116
111
|
<pd-input
|
|
117
112
|
id="testId1"
|
|
118
|
-
?gradient="${gradient}"
|
|
119
|
-
style="${style}"
|
|
113
|
+
?gradient="${gradient}"
|
|
120
114
|
label="Input Label"
|
|
121
115
|
value="My Value"
|
|
122
116
|
></pd-input>
|
|
123
117
|
<pd-input-area
|
|
124
118
|
id="testId2"
|
|
125
|
-
?gradient="${gradient}"
|
|
126
|
-
style="${style}"
|
|
119
|
+
?gradient="${gradient}"
|
|
127
120
|
label="Input Area Label"
|
|
128
121
|
value="My Value Area Text and ..."
|
|
129
122
|
></pd-input-area>
|
|
@@ -135,25 +128,19 @@ return html`
|
|
|
135
128
|
<pd-select
|
|
136
129
|
id="testId1"
|
|
137
130
|
.values="${selectVals}"
|
|
138
|
-
?gradient="${gradient}"
|
|
139
|
-
|
|
140
|
-
label="Select Label"
|
|
141
|
-
errorMsg="Fehler 1"
|
|
131
|
+
?gradient="${gradient}"
|
|
132
|
+
label="Select Label"
|
|
142
133
|
></pd-select>
|
|
143
134
|
<pd-input
|
|
144
135
|
id="testId1"
|
|
145
|
-
style="${style}"
|
|
146
136
|
?gradient="${gradient}"
|
|
147
137
|
label="Input Label"
|
|
148
|
-
value="My Value"
|
|
149
|
-
errorMsg="Fehler 2"
|
|
138
|
+
value="My Value"
|
|
150
139
|
></pd-input>
|
|
151
140
|
<pd-input-area
|
|
152
|
-
id="testId2"
|
|
153
|
-
style="${style}"
|
|
141
|
+
id="testId2"
|
|
154
142
|
?gradient="${gradient}"
|
|
155
|
-
label="Input Area Label"
|
|
156
|
-
errorMsg="Fehler 3"
|
|
143
|
+
label="Input Area Label"
|
|
157
144
|
value="My Value Area Text and ..."
|
|
158
145
|
></pd-input-area>
|
|
159
146
|
</div>
|
|
@@ -164,22 +151,19 @@ return html`
|
|
|
164
151
|
<pd-select
|
|
165
152
|
id="testId1"
|
|
166
153
|
.values="${selectVals}"
|
|
167
|
-
?gradient="${gradient}"
|
|
168
|
-
style="${style}"
|
|
154
|
+
?gradient="${gradient}"
|
|
169
155
|
?disabled="${true}"
|
|
170
156
|
label="Select Label"
|
|
171
157
|
></pd-select>
|
|
172
158
|
<pd-input
|
|
173
|
-
id="testId1"
|
|
174
|
-
style="${style}"
|
|
159
|
+
id="testId1"
|
|
175
160
|
?gradient="${gradient}"
|
|
176
161
|
label="Input Label"
|
|
177
162
|
?disabled="${true}"
|
|
178
163
|
value="My Value"
|
|
179
164
|
></pd-input>
|
|
180
165
|
<pd-input-area
|
|
181
|
-
id="testId2"
|
|
182
|
-
style="${style}"
|
|
166
|
+
id="testId2"
|
|
183
167
|
?gradient="${gradient}"
|
|
184
168
|
label="Input Area Label"
|
|
185
169
|
?disabled="${true}"
|
|
@@ -193,21 +177,18 @@ return html`
|
|
|
193
177
|
<pd-select
|
|
194
178
|
id="testId1"
|
|
195
179
|
.values="${selectVals}"
|
|
196
|
-
?gradient="${gradient}"
|
|
197
|
-
style="${style}"
|
|
180
|
+
?gradient="${gradient}"
|
|
198
181
|
?disabled="${true}"
|
|
199
182
|
label="Select ohne Placeholder"
|
|
200
183
|
></pd-select>
|
|
201
184
|
<pd-input
|
|
202
|
-
id="testId1"
|
|
203
|
-
style="${style}"
|
|
185
|
+
id="testId1"
|
|
204
186
|
?gradient="${gradient}"
|
|
205
187
|
label="Input Label"
|
|
206
188
|
placeHolder="Placeholder Text"
|
|
207
189
|
></pd-input>
|
|
208
190
|
<pd-input-area
|
|
209
|
-
id="testId2"
|
|
210
|
-
style="${style}"
|
|
191
|
+
id="testId2"
|
|
211
192
|
?gradient="${gradient}"
|
|
212
193
|
label="Input Area Label"
|
|
213
194
|
placeHolder="Placeholder Text"
|
|
@@ -252,51 +233,26 @@ return html`
|
|
|
252
233
|
|
|
253
234
|
<h3>Buttons</h3>
|
|
254
235
|
<pd-button
|
|
255
|
-
?gradient="${gradient}"
|
|
256
|
-
|
|
257
|
-
text="Primary"
|
|
236
|
+
?gradient="${gradient}"
|
|
237
|
+
text="Primary Button"
|
|
258
238
|
?primary="${true}"
|
|
259
239
|
></pd-button>
|
|
260
240
|
<pd-button
|
|
261
|
-
?gradient="${gradient}"
|
|
262
|
-
|
|
263
|
-
text="Normal"
|
|
241
|
+
?gradient="${gradient}"
|
|
242
|
+
text="Secondary Button"
|
|
264
243
|
></pd-button>
|
|
265
244
|
<pd-button
|
|
266
|
-
?gradient="${gradient}"
|
|
267
|
-
style="${style}"
|
|
245
|
+
?gradient="${gradient}"
|
|
268
246
|
?disabled="${true}"
|
|
269
|
-
text="Disabled"
|
|
247
|
+
text="Disabled Button"
|
|
270
248
|
></pd-button>
|
|
271
249
|
<pd-button
|
|
272
|
-
?gradient="${gradient}"
|
|
273
|
-
style="${style}"
|
|
250
|
+
?gradient="${gradient}"
|
|
274
251
|
text="Primary Disabled"
|
|
275
252
|
?disabled="${true}"
|
|
276
253
|
?primary="${true}"
|
|
277
254
|
></pd-button>
|
|
278
255
|
|
|
279
|
-
<h3>Button Group</h3>
|
|
280
|
-
<pd-button-group
|
|
281
|
-
@button-click="${e => alert('Button click:', e)}"
|
|
282
|
-
.buttons="${[
|
|
283
|
-
{ text: 'Button 1' },
|
|
284
|
-
{ text: 'Button 2' },
|
|
285
|
-
{ text: 'Button 3' },
|
|
286
|
-
{ text: 'Button 4' },
|
|
287
|
-
]}"
|
|
288
|
-
>
|
|
289
|
-
</pd-button-group>
|
|
290
|
-
|
|
291
|
-
<pd-button-group
|
|
292
|
-
.buttons="${[
|
|
293
|
-
{ text: 'Button 1' },
|
|
294
|
-
{ text: 'Button 2', visibility: 'hidden' },
|
|
295
|
-
{ text: 'Button 3' },
|
|
296
|
-
{ text: 'Button 4' },
|
|
297
|
-
]}"
|
|
298
|
-
>
|
|
299
|
-
</pd-button-group>
|
|
300
256
|
`;
|
|
301
257
|
}
|
|
302
258
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
2
|
import '../pd-checkbox.js';
|
|
3
|
+
import '../pd-form-container.js';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
title: 'PdForms/Checkbox',
|
|
@@ -14,14 +15,48 @@ export default {
|
|
|
14
15
|
function Template({ errorMsg }) {
|
|
15
16
|
return html`
|
|
16
17
|
<h3>Checkbox selected</h3>
|
|
17
|
-
<pd-checkbox
|
|
18
|
-
|
|
19
|
-
>
|
|
18
|
+
<pd-checkbox valueName="Test1" value="true">
|
|
19
|
+
Label zur Checkbox
|
|
20
|
+
</pd-checkbox>
|
|
20
21
|
|
|
21
22
|
<h3>Checkbox unselected</h3>
|
|
22
|
-
<pd-checkbox
|
|
23
|
-
|
|
23
|
+
<pd-checkbox valueName="Test2" value="false">
|
|
24
|
+
Label zur Checkbox
|
|
25
|
+
</pd-checkbox>
|
|
26
|
+
|
|
27
|
+
<h3>Checkbox readonly</h3>
|
|
28
|
+
<pd-checkbox valueName="Test3" value="false" readonly>
|
|
29
|
+
Label zur Checkbox
|
|
30
|
+
</pd-checkbox>
|
|
31
|
+
<pd-checkbox valueName="Test4" value="true" readonly>
|
|
32
|
+
Label zur Checkbox
|
|
33
|
+
</pd-checkbox>
|
|
34
|
+
|
|
35
|
+
<h3>Checkbox disabled</h3>
|
|
36
|
+
<pd-checkbox valueName="Test5" value="false" disabled>
|
|
37
|
+
Label zur Checkbox
|
|
38
|
+
</pd-checkbox>
|
|
39
|
+
<pd-checkbox valueName="Test6" value="true" disabled>
|
|
40
|
+
Label zur Checkbox
|
|
41
|
+
</pd-checkbox>
|
|
42
|
+
|
|
43
|
+
<h3>Checkbox required</h3>
|
|
44
|
+
<pd-form-container id="testCheckboxContainerId">
|
|
45
|
+
<pd-checkbox valueName="Test7" required>
|
|
46
|
+
Label zur Checkbox
|
|
47
|
+
</pd-checkbox>
|
|
48
|
+
</pd-form-container>
|
|
49
|
+
|
|
50
|
+
<h2>Test Validation</h2>
|
|
51
|
+
<button
|
|
52
|
+
@click="${() => {
|
|
53
|
+
document.getElementById('testCheckboxContainerId').dispatchEvent(
|
|
54
|
+
new CustomEvent("validate-form", {detail: {errorMap: new Map()}})
|
|
55
|
+
);
|
|
56
|
+
}}"
|
|
24
57
|
>
|
|
58
|
+
Test Validate
|
|
59
|
+
</button>
|
|
25
60
|
`;
|
|
26
61
|
}
|
|
27
62
|
|
|
@@ -12,13 +12,13 @@ export default {
|
|
|
12
12
|
function Template() {
|
|
13
13
|
return html`
|
|
14
14
|
<h3>Mit Forms</h3>
|
|
15
|
-
<pd-form-container id="testFormContainerId"
|
|
15
|
+
<pd-form-container id="testFormContainerId" requiredFieldInfo>
|
|
16
16
|
<pd-form-row>
|
|
17
|
-
<pd-input class="quarter2" id="test1Id" label="Label 1" required></pd-input>
|
|
17
|
+
<pd-input class="quarter2" id="test1Id" label="Label 1" required autoCompleteName="email"></pd-input>
|
|
18
18
|
<pd-input class="quarter2" id="test2Id" label="Label 2" required></pd-input>
|
|
19
19
|
</pd-form-row>
|
|
20
20
|
<pd-form-row>
|
|
21
|
-
<pd-input class="quarter4" id="test3Id" label="Label 3"></pd-input>
|
|
21
|
+
<pd-input class="quarter4" id="test3Id" label="Label 3" required></pd-input>
|
|
22
22
|
</pd-form-row>
|
|
23
23
|
<pd-form-row>
|
|
24
24
|
<pd-input class="quarter3" id="test4Id" label="Label 4"></pd-input>
|
|
@@ -33,15 +33,29 @@ function Template() {
|
|
|
33
33
|
<pd-input class="quarter3" id="test9Id" label="Label 5"></pd-input>
|
|
34
34
|
<pd-input class="quarter1" id="test10Id" label="Label 6"></pd-input>
|
|
35
35
|
</pd-form-row>
|
|
36
|
+
<pd-form-row>
|
|
37
|
+
<pd-input-area class="quarter3-area" id="test19Id" label="Label Area" required></pd-input-area>
|
|
38
|
+
<pd-input-area class="quarter1-area" id="test20Id" label="Label Area" required
|
|
39
|
+
requiredMsg="Das ist eine richtig lange Fehlermeldung. Diese kann per Parameter für spezielle Felder wie die AGB Checkbox gesetzt werden.">
|
|
40
|
+
</pd-input-area>
|
|
41
|
+
</pd-form-row>
|
|
36
42
|
<pd-form-row>
|
|
37
43
|
<pd-input class="quarter1" id="test11Id" label="Label 5"></pd-input>
|
|
38
44
|
<pd-input class="quarter3" id="test12Id" label="Label 6"></pd-input>
|
|
39
|
-
</pd-form-row>
|
|
45
|
+
</pd-form-row>
|
|
40
46
|
<pd-form-row>
|
|
41
47
|
<pd-input class="quarter1" id="test13Id" label="Label 5"></pd-input>
|
|
42
48
|
<pd-input class="quarter1" id="test14Id" label="Label 5"></pd-input>
|
|
43
49
|
<pd-input class="quarter2" id="test15Id" label="Label 6"></pd-input>
|
|
44
50
|
</pd-form-row>
|
|
51
|
+
<pd-form-row>
|
|
52
|
+
<pd-input-area class="quarter4-area" id="test16Id" label="Label Area" required></pd-input-area>
|
|
53
|
+
</pd-form-row>
|
|
54
|
+
<pd-form-row>
|
|
55
|
+
<pd-input-area class="quarter2-area" id="test17Id" label="Label Area" required></pd-input-area>
|
|
56
|
+
<pd-input-area class="quarter2-area" id="test18Id" label="Label Area" required
|
|
57
|
+
requiredMsg="Das ist eine richtig lange Fehlermeldung. Diese kann per Parameter für spezielle Felder wie die AGB Checkbox gesetzt werden."></pd-input-area>
|
|
58
|
+
</pd-form-row>
|
|
45
59
|
</pd-form-container>
|
|
46
60
|
|
|
47
61
|
<h2>Test Validation</h2>
|
package/stories/input.stories.js
CHANGED
|
@@ -63,38 +63,34 @@ function Template({
|
|
|
63
63
|
<h3>Default Input with place holder</h3>
|
|
64
64
|
<pd-input
|
|
65
65
|
id="test2Id"
|
|
66
|
-
placeHolder="Placeholder Text"
|
|
67
|
-
style="${style}"
|
|
66
|
+
placeHolder="Placeholder Text"
|
|
68
67
|
></pd-input>
|
|
69
68
|
|
|
70
69
|
<h3>Default Input with value</h3>
|
|
71
70
|
<pd-input
|
|
72
71
|
id="test3Id"
|
|
73
|
-
value="My input value"
|
|
74
|
-
style="${style}"
|
|
72
|
+
value="My input value"
|
|
75
73
|
></pd-input>
|
|
76
74
|
|
|
77
75
|
<h3>Input with value - Error</h3>
|
|
78
76
|
<pd-input
|
|
79
77
|
id="test4Id"
|
|
80
78
|
value="My input value"
|
|
81
|
-
errorMsg="Fehler aufgetreten"
|
|
82
|
-
style="${style}"
|
|
79
|
+
errorMsg="Fehler aufgetreten"
|
|
83
80
|
></pd-input>
|
|
84
81
|
|
|
85
82
|
<h3>Input with max lenth and size</h3>
|
|
86
83
|
<pd-input
|
|
87
84
|
id="test5Id"
|
|
88
85
|
maxlength="4"
|
|
89
|
-
style="${
|
|
86
|
+
style="${`--pd-input-field-width: 80px;`}"
|
|
90
87
|
></pd-input>
|
|
91
88
|
|
|
92
89
|
<h3>Input with place holder and label</h3>
|
|
93
90
|
<pd-input
|
|
94
91
|
id="test6Id"
|
|
95
92
|
label="Input Label 1"
|
|
96
|
-
placeHolder="Placeholder Text"
|
|
97
|
-
style="${style}"
|
|
93
|
+
placeHolder="Placeholder Text"
|
|
98
94
|
></pd-input>
|
|
99
95
|
|
|
100
96
|
<h3>Input with place holder and label - disabled</h3>
|
|
@@ -102,8 +98,7 @@ function Template({
|
|
|
102
98
|
id="test7Id"
|
|
103
99
|
label="Input Label 1"
|
|
104
100
|
placeHolder="Placeholder Text"
|
|
105
|
-
|
|
106
|
-
style="${style}"
|
|
101
|
+
disabled
|
|
107
102
|
></pd-input>
|
|
108
103
|
|
|
109
104
|
<h3>Input with value and label - disabled</h3>
|
|
@@ -111,8 +106,23 @@ function Template({
|
|
|
111
106
|
id="test8Id"
|
|
112
107
|
label="Input Label 1"
|
|
113
108
|
value="My Value"
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
disabled
|
|
110
|
+
></pd-input>
|
|
111
|
+
|
|
112
|
+
<h3>Input with place holder and label - readonly</h3>
|
|
113
|
+
<pd-input
|
|
114
|
+
id="test7Id"
|
|
115
|
+
label="Input Label 1"
|
|
116
|
+
placeHolder="Placeholder Text"
|
|
117
|
+
readonly
|
|
118
|
+
></pd-input>
|
|
119
|
+
|
|
120
|
+
<h3>Input with value and label - readonly</h3>
|
|
121
|
+
<pd-input
|
|
122
|
+
id="test8Id"
|
|
123
|
+
label="Input Label 1"
|
|
124
|
+
value="My Value"
|
|
125
|
+
readonly
|
|
116
126
|
></pd-input>
|
|
117
127
|
|
|
118
128
|
<h3>Input with value and label - error</h3>
|
|
@@ -120,8 +130,6 @@ function Template({
|
|
|
120
130
|
id="test4Id"
|
|
121
131
|
label="Test Label"
|
|
122
132
|
value="My input value"
|
|
123
|
-
errorMsg="Fehler aufgetreten"
|
|
124
|
-
style="${style}"
|
|
125
133
|
></pd-input>
|
|
126
134
|
`;
|
|
127
135
|
}
|