@progressive-development/pd-forms 0.2.7 → 0.2.8

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.2.7",
6
+ "version": "0.2.8",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  import { html, css } from 'lit';
13
13
  import { msg } from '@lit/localize';
14
14
 
15
- import { INPUT_TYPE_RANGE } from './PdBaseUiInput.js';
15
+ import { INPUT_TYPE_RANGE, INPUT_TYPE_SELECT } from './PdBaseUiInput.js';
16
16
 
17
17
  import { PdBaseUI } from './PdBaseUi.js';
18
18
 
@@ -114,7 +114,7 @@ export class PdFormContainer extends PdBaseUI {
114
114
  reqEl.forEach(el => {
115
115
  const tmpEl = el;
116
116
  if (!el.value || el.value === "" || el.value === "false" ||
117
- (el._inputType === INPUT_TYPE_RANGE && el.value === '0')) {
117
+ (el._inputType === INPUT_TYPE_RANGE && el.value === '0') || (el._inputType === INPUT_TYPE_SELECT && el.value === 'UNDEF')) {
118
118
  const erMsg = el.requiredMsg || msg('Eingabe erforderlich',{desc: '#pd.form.field.required#'});
119
119
  if (!e.detail.singleElement || e.detail.singleElement === el) {
120
120
  tmpEl.errorMsg = erMsg;
package/src/PdInput.js CHANGED
@@ -85,7 +85,7 @@ export class PdInput extends PdBaseInputElement {
85
85
  return html`
86
86
  ${this._renderLabel(inputId)}
87
87
  <div class="input ${this.errorMsg.length > 0 ? 'error' : ''}">
88
- ${this.icon ? html`<pd-icon icon="${this.icon}" @click="${this._iconClicked}"></pd-icon>` : ''}
88
+ ${this.icon ? html`<pd-icon icon="${this.icon}" activeIcon @click="${this._iconClicked}"></pd-icon>` : ''}
89
89
  <input
90
90
  id="${inputId}"
91
91
  name="${this.name || this.valueName || this.autoCompleteName}"
@@ -37,7 +37,7 @@ export const SharedInputFieldStyles = css`
37
37
  }
38
38
 
39
39
  :host([icon-left]) .input > input {
40
- padding-left: calc((var(--pd-input-field-height, 2rem) * 0.85) + 5px);
40
+ padding-left: calc(var(--pd-input-field-height, 2rem) + 5px);
41
41
  }
42
42
 
43
43
  :host([icon-right]) .input pd-icon {
@@ -46,7 +46,7 @@ export const SharedInputFieldStyles = css`
46
46
  }
47
47
 
48
48
  :host([icon-right]) .input > input {
49
- padding-right: calc((var(--pd-input-field-height, 2rem) * 0.85) + 5px);
49
+ padding-right: calc(var(--pd-input-field-height, 2rem) + 5px);
50
50
  }
51
51
 
52
52
  /* relative hack => see comment above in .input class, do it only for icon fiels relative for the moment*/
@@ -60,10 +60,10 @@ export const SharedInputFieldStyles = css`
60
60
  pd-icon {
61
61
  display: none;
62
62
  position: absolute;
63
- top: 5px;
64
- --pd-icon-size: calc(var(--pd-input-field-height, 2rem) * 0.85);
65
- --pd-icon-fill-color: var(--squi-input-icon-fill-color, currentcolor);
66
- --pd-icon-stroke-color: var(--squi-input-icon-stroke-color, none);
63
+ --pd-icon-size: var(--pd-input-icon-size, calc(var(--pd-input-field-height, 2rem) * 0.9));
64
+ --pd-icon-col-active: var(--pd-input-icon-color, #edf7fd);
65
+ --pd-icon-stroke-col-active: var(--pd-input-icon-stroke-color, var(--pd-default-color));
66
+ top: 2px;
67
67
  }
68
68
 
69
69
  pd-icon:hover {
@@ -1,6 +1,6 @@
1
1
  import { html } from 'lit';
2
2
  import '../../pd-input.js';
3
- import { ICON_CAMERA } from '@progressive-development/pd-icon/src/PdIcon.js';
3
+ import { ICON_CAMERA, ICON_DATE } from '@progressive-development/pd-icon/src/PdIcon.js';
4
4
 
5
5
  export default {
6
6
  title: 'PdForms/Input',
@@ -99,7 +99,7 @@ function Template({
99
99
  id="testRightTextId"
100
100
  text-right
101
101
  icon-right
102
- icon="${ICON_CAMERA}"
102
+ icon="${ICON_DATE}"
103
103
  value="Right Text"
104
104
  ></pd-input>
105
105
 
@@ -108,7 +108,7 @@ function Template({
108
108
  icon-right
109
109
  id="testIconId"
110
110
  value="Input value"
111
- icon="${ICON_CAMERA}"
111
+ icon="${ICON_DATE}"
112
112
  ></pd-input>
113
113
 
114
114
  <h3>Big Input with left Icon</h3>
@@ -117,7 +117,7 @@ function Template({
117
117
  icon-left
118
118
  id="testIcon2Id"
119
119
  value="Input value"
120
- icon="${ICON_CAMERA}"
120
+ icon="${ICON_DATE}"
121
121
  ></pd-input>
122
122
 
123
123
  <h3>Input with max lenth and size</h3>