@progressive-development/pd-forms 0.0.21 → 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 CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent pd-forms following open-wc recommendations",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "author": "PD Progressive Development",
6
- "version": "0.0.21",
6
+ "version": "0.0.23",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
@@ -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._defaultRequiredChar : ''}</label>
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"
@@ -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}Input"
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}"