@progressive-development/pd-forms 0.0.17 → 0.0.19

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.17",
6
+ "version": "0.0.19",
7
7
  "main": "index.js",
8
8
  "module": "index.js",
9
9
  "scripts": {
@@ -17,22 +17,22 @@
17
17
  "storybook:build": "npm run analyze -- --exclude dist && build-storybook"
18
18
  },
19
19
  "dependencies": {
20
- "@progressive-development/pd-icon": "0.0.8",
21
- "lit": "^2.0.0-rc.4",
22
- "@lit-labs/motion": "^1.0.0-rc.2"
20
+ "@lit-labs/motion": "^1.0.1",
21
+ "@progressive-development/pd-icon": "^0.0.9",
22
+ "lit": "^2.0.2"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@custom-elements-manifest/analyzer": "^0.4.17",
26
26
  "@open-wc/eslint-config": "^4.3.0",
27
- "@open-wc/testing": "next",
28
- "@web/dev-server": "^0.1.22",
27
+ "@open-wc/testing": "^3.0.0-next.5",
28
+ "@web/dev-server": "^0.1.28",
29
29
  "@web/dev-server-storybook": "next",
30
- "@web/test-runner": "^0.13.17",
30
+ "@web/test-runner": "^0.13.21",
31
31
  "eslint": "^7.32.0",
32
32
  "eslint-config-prettier": "^8.3.0",
33
33
  "husky": "^4.3.8",
34
34
  "lint-staged": "^10.5.4",
35
- "prettier": "^2.4.0"
35
+ "prettier": "^2.4.1"
36
36
  },
37
37
  "customElements": "custom-elements.json",
38
38
  "eslintConfig": {
@@ -18,7 +18,8 @@ export class PdBaseUIInput extends PdBaseUI {
18
18
  gradient: { type: Boolean }, // true for gradient background
19
19
  disabled: { type: Boolean }, // disabled flag for element
20
20
  readonly: { type: Boolean }, // readonly flag for element
21
- valueName: { type: String },
21
+ required: { type: Boolean }, // required flag for element
22
+ valueName: { type: String },
22
23
  defaultValue: { type: String }, // default value for input element (used for reset) TODO: Das hier ggf. automatisch mit erstem gesetzten Wert füllen?
23
24
  label: { type: String }, // label text for input
24
25
  value: {type: String}, // current value (set from outside) TODO: Typ (Object, Number, Txt, Bool...)
package/src/PdCheckbox.js CHANGED
@@ -3,6 +3,9 @@
3
3
  * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
4
4
  */
5
5
 
6
+
7
+ Änderungen an den Klassen aus node_modules übernommen, nicht deployed und verwendet => offen
8
+
6
9
  import { html, css } from "lit";
7
10
  import { classMap } from 'lit/directives/class-map.js';
8
11
 
@@ -37,9 +40,11 @@ export class PdCheckbox extends PdBaseUIInput {
37
40
  css`
38
41
  :host {
39
42
 
40
- --my-icon-fill: var(--app-primary-color, #177E89);
41
- --my-icon-active-fill: var(--app-primary-color, #177E89);
42
- --my-icon-bg-color: var(--app-primary-color, #fefefe) ;
43
+ /*
44
+ --my-icon-fill: var(--pd-app-light-background, #fefefe);
45
+ --my-icon-active-fill: var(--pd-app-primary-color, #067394);
46
+ --my-icon-inactive-fill: var(--pd-app-primary-color, darkgrey);
47
+
43
48
  --my-icon-bg-active-color: var(--app-primary-color, #fefefe);
44
49
 
45
50
  --my-bg-color: var(--squi-bg-color, #177E89);
@@ -47,14 +52,14 @@ export class PdCheckbox extends PdBaseUIInput {
47
52
 
48
53
  --my-font: var(--squi-font-2, Montserrat);
49
54
 
50
- /* ref copy from shared styles...*/
55
+ ref copy from shared styles...*
51
56
  --my-error-color: var(--squi-error-color, #d6242d);
52
57
  --my-error-background-color: var(--squi-error-background-color, #f6d4d4a1);
53
58
  --my-border-radius: var(--squi-border-radius, 0rem);
54
59
 
55
60
 
56
61
 
57
- /* TODO vars used in pd-icon */
62
+ * TODO vars used in pd-icon *
58
63
  --squi-checkbox-checked-color: var(--my-primary);
59
64
  --squi-checkbox-unchecked-color: var(--my-ligth);
60
65
  --squi-checkbox-bg: var(--my-dark);
@@ -63,20 +68,25 @@ export class PdCheckbox extends PdBaseUIInput {
63
68
 
64
69
  --squi-checkbox-label-disabled-color: var(--app-copy-color, #303030);
65
70
 
66
- /* Checkbox pd-icon */
67
- --pd-icon-fill: var(--my-icon-bg-color);
68
- --pd-icon-bg: var(--my-icon-fill);
71
+ * Checkbox pd-icon
72
+ --pd-icon-fill: red;
73
+ --pd-icon-bg: red;
69
74
  --pd-icon-fill-active: var(--my-icon-bg-active-color);
70
75
  --pd-icon-bg-active: var(--my-icon-active-fill);
76
+ */
77
+
78
+ --pd-icon-fill-active: var(--pd-app-primary-col, #067394);
79
+ --pd-icon-fill: var(--pd-checkbox-inactive-col, darkgrey);
80
+ --pd-icon-bg: var(--pd-checkbox-bg-col, #fefefe);
71
81
 
72
82
  display: inline-block;
73
83
  font-size: .8rem;
74
84
  }
75
85
  /* Switch pd-icon */
76
86
  :host([isSwitch]) {
87
+ --pd-icon-fill-active: var(--my-icon-active-fill);
77
88
  --pd-icon-fill: var(--my-icon-fill);
78
- --pd-icon-bg: var(--my-icon-bg-color);
79
- --pd-icon-fill-active: var(--my-icon-active-fill);
89
+ --pd-icon-bg: var(--my-icon-bg-color);
80
90
  --pd-icon-bg-active: var(--my-icon-bg-active-color);
81
91
  }
82
92
  div {
@@ -145,10 +155,12 @@ export class PdCheckbox extends PdBaseUIInput {
145
155
  min-width: 2rem;
146
156
  background: none;
147
157
 
158
+ /* Prüfen TODO
148
159
  --pd-icon-bg: transparent;
149
160
  --pd-icon-fill: var(--card-dark-red);
150
161
  --pd-icon-fill-hover: var(--pd-icon-fill);
151
162
  --pd-icon-fill-active: var(--card-medium-green);
163
+ */
152
164
  }
153
165
  .readonly .isChecked.switch-paddle pd-icon {
154
166
  transform: translate3d(0, 0, 0);
package/src/PdInput.js CHANGED
@@ -104,11 +104,13 @@ export class PdInput extends PdBaseUIInput {
104
104
  this.icon = 'toggleCollapse';
105
105
  this.secret = false;
106
106
  this.key = '';
107
+
108
+ this._defaultRequiredChar = '*';
107
109
  }
108
110
 
109
111
  render() {
110
112
  return html`
111
- <label for="${this.id}Input">${this.label}</label>
113
+ <label for="${this.id}Input">${this.label}${this.required ? this._defaultRequiredChar : ''}</label>
112
114
  <div class="input ${classMap({ error: this.errorMsg.length > 0 })}">
113
115
  <pd-icon
114
116
  icon="toggleCollapse"
@@ -0,0 +1,23 @@
1
+ import { html } from 'lit';
2
+ import '../pd-form-row.js';
3
+
4
+ export default {
5
+ title: 'PdForms/Form Row',
6
+ component: 'pd-form-row',
7
+ argTypes: {},
8
+ };
9
+
10
+ function Template() {
11
+ return html`
12
+ <h3>Noch im test ob Sinnvoll....</h3>
13
+ <div style="">
14
+ <pd-form-row>
15
+ <div style="background-color: blue;">Hier ist es blau</div>
16
+ <div style="background-color: red;">Hier ist es rot</div>
17
+ </pd-form-row>
18
+ </div>
19
+ `;
20
+ }
21
+
22
+ export const FormRow = Template.bind({});
23
+ FormRow.args = {};