@progressive-development/pd-forms 0.0.22 → 0.0.23
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/PdBaseUiInput.js +3 -0
- package/src/PdInput.js +1 -3
- package/src/PdRadioGroup.js +5 -1
- package/src/PdSelect.js +3 -3
package/package.json
CHANGED
package/src/PdBaseUiInput.js
CHANGED
|
@@ -20,6 +20,7 @@ export class PdBaseUIInput extends PdBaseUI {
|
|
|
20
20
|
readonly: { type: Boolean }, // readonly flag for element
|
|
21
21
|
required: { type: Boolean }, // required flag for element
|
|
22
22
|
valueName: { type: String },
|
|
23
|
+
defaultRequiredChar: { type: String },
|
|
23
24
|
defaultValue: { type: String }, // default value for input element (used for reset) TODO: Das hier ggf. automatisch mit erstem gesetzten Wert füllen?
|
|
24
25
|
label: { type: String }, // label text for input
|
|
25
26
|
value: {type: String}, // current value (set from outside) TODO: Typ (Object, Number, Txt, Bool...)
|
|
@@ -41,6 +42,8 @@ export class PdBaseUIInput extends PdBaseUI {
|
|
|
41
42
|
this._inputType = -1;
|
|
42
43
|
this._input = {};
|
|
43
44
|
this.valueName = '';
|
|
45
|
+
|
|
46
|
+
this.defaultRequiredChar = '*';
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
// Test: Clear input with value => Dann in BasisKlasse und alle leiten von Basis UI Element ab
|
package/src/PdInput.js
CHANGED
|
@@ -104,13 +104,11 @@ export class PdInput extends PdBaseUIInput {
|
|
|
104
104
|
this.icon = 'toggleCollapse';
|
|
105
105
|
this.secret = false;
|
|
106
106
|
this.key = '';
|
|
107
|
-
|
|
108
|
-
this._defaultRequiredChar = '*';
|
|
109
107
|
}
|
|
110
108
|
|
|
111
109
|
render() {
|
|
112
110
|
return html`
|
|
113
|
-
<label for="${this.id}Input">${this.label}${this.required ? this.
|
|
111
|
+
<label for="${this.id}Input">${this.label}${this.required ? this.defaultRequiredChar : ''}</label>
|
|
114
112
|
<div class="input ${classMap({ error: this.errorMsg.length > 0 })}">
|
|
115
113
|
<pd-icon
|
|
116
114
|
icon="toggleCollapse"
|
package/src/PdRadioGroup.js
CHANGED
|
@@ -39,6 +39,8 @@ export class PdRadioGroup extends LitElement {
|
|
|
39
39
|
static get properties() {
|
|
40
40
|
return {
|
|
41
41
|
label: {type: String},
|
|
42
|
+
required: {type: Boolean},
|
|
43
|
+
defaultRequiredChar: { type: String },
|
|
42
44
|
valueName: { type: String },
|
|
43
45
|
errorMsg: {type: String} // errorMsg (could set fronm outside for busines validation, internal validation=> todo)
|
|
44
46
|
};
|
|
@@ -49,6 +51,8 @@ export class PdRadioGroup extends LitElement {
|
|
|
49
51
|
this.label = '';
|
|
50
52
|
this.valueName = '';
|
|
51
53
|
this.errorMsg = '';
|
|
54
|
+
|
|
55
|
+
this.defaultRequiredChar = '*';
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
get value() {
|
|
@@ -87,7 +91,7 @@ export class PdRadioGroup extends LitElement {
|
|
|
87
91
|
|
|
88
92
|
render() {
|
|
89
93
|
return html`
|
|
90
|
-
<label>${this.label}</label>
|
|
94
|
+
<label>${this.label}${this.required ? this.defaultRequiredChar : ''}</label>
|
|
91
95
|
<div class="group-style input ${classMap({'error': this.errorMsg.length > 0})}">
|
|
92
96
|
<slot></slot>
|
|
93
97
|
</div>
|
package/src/PdSelect.js
CHANGED
|
@@ -199,15 +199,15 @@ export class PdSelect extends PdBaseUIInput {
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
render() {
|
|
202
|
-
return html`
|
|
203
|
-
<label for="${this.id}Select">${this.label}</label>
|
|
202
|
+
return html`
|
|
203
|
+
<label for="${this.id}Select">${this.label}${this.required ? this._defaultRequiredChar : ''}</label>
|
|
204
204
|
<div class="input ${classMap({ error: this.errorMsg.length > 0 })}">
|
|
205
205
|
<pd-icon
|
|
206
206
|
icon="toggleCollapse"
|
|
207
207
|
@click="${this._onIconClick}"
|
|
208
208
|
></pd-icon>
|
|
209
209
|
<select
|
|
210
|
-
id="${this.id}
|
|
210
|
+
id="${this.id}Select"
|
|
211
211
|
class="select-css input-style ${this.gradient ? 'gradient' : ''}"
|
|
212
212
|
?disabled="${this.disabled}"
|
|
213
213
|
@change="${this._onChange}"
|