@progressive-development/pd-forms 0.1.27 → 0.1.28
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 +1 -1
- package/src/PdFormContainer.js +1 -1
- package/src/PdRange.js +43 -16
package/package.json
CHANGED
package/src/PdFormContainer.js
CHANGED
|
@@ -88,7 +88,7 @@ export class PdFormContainer extends PdBaseUI {
|
|
|
88
88
|
return html`
|
|
89
89
|
<form>
|
|
90
90
|
<slot></slot>
|
|
91
|
-
${this.requiredFieldInfo ? html`
|
|
91
|
+
${this.requiredFieldInfo || this.commonError ? html`
|
|
92
92
|
<div class="validation-info-container">
|
|
93
93
|
<p class="validation-info ${(this._requiredFieldsValid && (!this.commonError || this.commonError === "")) ? 'filled' : 'unfilled'}">
|
|
94
94
|
${this.commonError || (this._requiredFieldsValid ? msg('* Pflichtfelder ausgefüllt',{desc: '#pd.form.required.valid#'})
|
package/src/PdRange.js
CHANGED
|
@@ -29,24 +29,24 @@ export class PdRange extends PdBaseUIInput {
|
|
|
29
29
|
static get styles() {
|
|
30
30
|
return [
|
|
31
31
|
PdBaseUIInput.styles,
|
|
32
|
-
css`
|
|
32
|
+
css`
|
|
33
33
|
|
|
34
|
-
/* Link:
|
|
35
|
-
* css styling: - https://css-tricks.com/styling-cross-browser-compatible-range-inputs-css/
|
|
34
|
+
/* Link:
|
|
35
|
+
* css styling: - https://css-tricks.com/styling-cross-browser-compatible-range-inputs-css/
|
|
36
36
|
* no-empty-default - https://stackoverflow.com/questions/40302515/is-there-a-way-to-set-default-value-of-range-input-to-be-empty
|
|
37
37
|
* => Könnte ich vlt. mit dummy element lösen => Kein Wert => Dummy wird angezeigt => Bei Klick wird Wert gesetzt und PdRange angezeigt. Oder doch Vorschlag aus StackOverflow => -1 als default Wert => Kein gesetzer Wert
|
|
38
38
|
* Style Ticks/Lables: - https://stackoverflow.com/questions/26612700/ticks-for-type-range-html-input
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
/****************************************************
|
|
42
|
-
* Style for SLIDER *
|
|
42
|
+
* Style for SLIDER *
|
|
43
43
|
****************************************************/
|
|
44
44
|
|
|
45
45
|
:host([disabled]) {
|
|
46
46
|
--pd-range-bg-col: grey;
|
|
47
|
-
--pd-range-thumb-col: lightgrey;
|
|
47
|
+
--pd-range-thumb-col: lightgrey;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
input[type=range] {
|
|
51
51
|
-webkit-appearance: none; /* Hides the slider so that custom slider can be made */
|
|
52
52
|
width: var(--pd-input-field-width, 250px); /* Specific width is required for Firefox. */
|
|
@@ -61,9 +61,9 @@ export class PdRange extends PdBaseUIInput {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
input[type=range]:focus {
|
|
64
|
-
/* Removes the blue border.
|
|
64
|
+
/* Removes the blue border.
|
|
65
65
|
* You should probably do some kind of focus styling for accessibility reasons though. */
|
|
66
|
-
outline: none;
|
|
66
|
+
outline: none;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/****************************************************
|
|
@@ -71,7 +71,7 @@ export class PdRange extends PdBaseUIInput {
|
|
|
71
71
|
* Check: Possible to extract common definitions? *
|
|
72
72
|
* => Note that while we’re repeating code here, *
|
|
73
73
|
* that’s necessary as you can’t comma-separate *
|
|
74
|
-
* these type of selectors. Browsers will drop *
|
|
74
|
+
* these type of selectors. Browsers will drop *
|
|
75
75
|
* the entire selector if it doesn’t understand *
|
|
76
76
|
* a part of it. *
|
|
77
77
|
****************************************************/
|
|
@@ -81,7 +81,7 @@ export class PdRange extends PdBaseUIInput {
|
|
|
81
81
|
*/
|
|
82
82
|
input[type=range]::-webkit-slider-thumb {
|
|
83
83
|
/* Hide the standard thumb element */
|
|
84
|
-
-webkit-appearance: none;
|
|
84
|
+
-webkit-appearance: none;
|
|
85
85
|
/*margin-top: -14px; /* You need to specify a margin in Chrome, but in Firefox and IE it is automatic */
|
|
86
86
|
margin-top: -6px; /* squi.cards value */
|
|
87
87
|
|
|
@@ -137,7 +137,7 @@ export class PdRange extends PdBaseUIInput {
|
|
|
137
137
|
height: 8.4px;
|
|
138
138
|
cursor: pointer;
|
|
139
139
|
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
|
|
140
|
-
background: var(--pd-range-track-col, var(--pd-default-light-col));
|
|
140
|
+
background: var(--pd-range-track-col, var(--pd-default-light-col));
|
|
141
141
|
border: 0.2px solid #010101;
|
|
142
142
|
|
|
143
143
|
border-radius: 0.75rem;
|
|
@@ -172,7 +172,7 @@ export class PdRange extends PdBaseUIInput {
|
|
|
172
172
|
cursor: pointer;
|
|
173
173
|
|
|
174
174
|
/* Hides the slider so custom styles can be added */
|
|
175
|
-
background: transparent;
|
|
175
|
+
background: transparent;
|
|
176
176
|
border-color: transparent;
|
|
177
177
|
color: transparent;
|
|
178
178
|
|
|
@@ -180,7 +180,7 @@ export class PdRange extends PdBaseUIInput {
|
|
|
180
180
|
}
|
|
181
181
|
input[type=range]::-ms-fill-lower {
|
|
182
182
|
background: var(--pd-range-track-col, var(--pd-default-light-col));
|
|
183
|
-
border: 0.2px solid #010101;
|
|
183
|
+
border: 0.2px solid #010101;
|
|
184
184
|
border-radius: 0.75rem;
|
|
185
185
|
box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
|
|
186
186
|
}
|
|
@@ -196,6 +196,25 @@ export class PdRange extends PdBaseUIInput {
|
|
|
196
196
|
input[type=range]:focus::-ms-fill-upper {
|
|
197
197
|
background: #367ebd;
|
|
198
198
|
}
|
|
199
|
+
|
|
200
|
+
/*
|
|
201
|
+
Der Style für ticks ist noch temporär, Bereinigung unf Anpassung.
|
|
202
|
+
TODO: Fest derzeit 5 Elemente
|
|
203
|
+
*/
|
|
204
|
+
.ticks {
|
|
205
|
+
display: flex;
|
|
206
|
+
justify-content: space-between;
|
|
207
|
+
padding: 10px 30px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.tick {
|
|
211
|
+
line-height: 5px;
|
|
212
|
+
height: 5px;
|
|
213
|
+
margin-top: -12px;
|
|
214
|
+
font-size: 8pt;
|
|
215
|
+
font-weight: bolder;
|
|
216
|
+
}
|
|
217
|
+
|
|
199
218
|
`
|
|
200
219
|
];
|
|
201
220
|
}
|
|
@@ -206,7 +225,7 @@ export class PdRange extends PdBaseUIInput {
|
|
|
206
225
|
return html`
|
|
207
226
|
${this._renderLabel(inputId, this.optionValueMapper[this.value] || this.value)}
|
|
208
227
|
<div class="input-range ${classMap({ error: this.errorMsg.length > 0 })}">
|
|
209
|
-
<input
|
|
228
|
+
<input
|
|
210
229
|
id="${inputId}"
|
|
211
230
|
name="${this.name || this.valueName}"
|
|
212
231
|
class="input-range-style ${this.gradient ? 'gradient' : ''}"
|
|
@@ -217,7 +236,15 @@ export class PdRange extends PdBaseUIInput {
|
|
|
217
236
|
min="${this.min}" max="${this.max}" step="1"
|
|
218
237
|
@change="${this._onChange}"
|
|
219
238
|
@input="${this._onChange}"
|
|
220
|
-
|
|
239
|
+
>
|
|
240
|
+
<div class="ticks">
|
|
241
|
+
<span class="tick">|</span>
|
|
242
|
+
<span class="tick">|</span>
|
|
243
|
+
<span class="tick">|</span>
|
|
244
|
+
<span class="tick">|</span>
|
|
245
|
+
<span class="tick">|</span>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
221
248
|
</div>
|
|
222
249
|
${this._renderErrorMsg()}
|
|
223
250
|
`;
|
|
@@ -232,4 +259,4 @@ export class PdRange extends PdBaseUIInput {
|
|
|
232
259
|
this._handleChangedValue(this._input.value, e, false);
|
|
233
260
|
}
|
|
234
261
|
|
|
235
|
-
}
|
|
262
|
+
}
|