@progressive-development/pd-forms 0.0.13 → 0.0.15
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 +2 -2
- package/pd-button-goup.js +3 -0
- package/pd-button.js +3 -0
- package/pd-checkbox.js +3 -0
- package/pd-form-container.js +3 -0
- package/pd-form-row.js +3 -0
- package/pd-input-area.js +3 -0
- package/pd-input.js +3 -0
- package/pd-label-value.js +3 -0
- package/pd-radio-group.js +3 -0
- package/pd-select.js +3 -0
- package/src/{squi-base-ui.js → PdBaseUi.js} +1 -1
- package/src/{squi-base-ui-input.js → PdBaseUiInput.js} +2 -2
- package/src/{squi-button.js → PdButton.js} +10 -10
- package/src/{squi-button-group.js → PdButtonGroup.js} +3 -3
- package/src/{squi-checkbox.js → PdCheckbox.js} +22 -22
- package/src/{squi-form-container.js → PdFormContainer.js} +1 -1
- package/src/{squi-form-row.js → PdFormRow.js} +1 -1
- package/src/{squi-input.js → PdInput.js} +15 -15
- package/src/{squi-input-area.js → PdInputArea.js} +13 -13
- package/src/PdLabelValue.js +75 -0
- package/src/{squi-radio-group.js → PdRadioGroup.js} +4 -4
- package/src/{squi-select.js → PdSelect.js} +9 -9
- package/src/shared-input-styles.js +11 -11
- package/stories/button.stories.js +15 -0
- package/stories/checkbox.stories.js +50 -0
- package/stories/form-container.stories.js +50 -0
- package/stories/index.stories.js +297 -29
- package/stories/input-area.stories.js +129 -0
- package/stories/input.stories.js +130 -0
- package/stories/label-value.stories.js +32 -0
- package/stories/radio-group.stories.js +45 -0
- package/stories/select.stories.js +104 -0
- package/PdButton.js +0 -3
- package/PdButtonGroup.js +0 -3
- package/PdCheckbox.js +0 -3
- package/PdFormContainer.js +0 -3
- package/PdFormRow.js +0 -3
- package/PdInput.js +0 -3
- package/PdInputArea.js +0 -3
- package/PdRadioGroup.js +0 -3
- package/PdSelect.js +0 -3
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.
|
|
6
|
+
"version": "0.0.15",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"storybook:build": "npm run analyze -- --exclude dist && build-storybook"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@progressive-development/pd-icon": "0.0.
|
|
20
|
+
"@progressive-development/pd-icon": "0.0.6",
|
|
21
21
|
"lit": "^2.0.0-rc.4",
|
|
22
22
|
"@lit-labs/motion": "^1.0.0-rc.2"
|
|
23
23
|
},
|
package/pd-button.js
ADDED
package/pd-checkbox.js
ADDED
package/pd-form-row.js
ADDED
package/pd-input-area.js
ADDED
package/pd-input.js
ADDED
package/pd-select.js
ADDED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { PdBaseUI } from './PdBaseUi.js';
|
|
7
7
|
|
|
8
8
|
export const INPUT_TYPE_TEXT = 1;
|
|
9
9
|
export const INPUT_TYPE_SELECT = 2;
|
|
@@ -11,7 +11,7 @@ export const INPUT_TYPE_CHECK = 3;
|
|
|
11
11
|
export const INPUT_TYPE_RANGE = 4;
|
|
12
12
|
export const INPUT_TYPE_AREA = 5;
|
|
13
13
|
|
|
14
|
-
export class
|
|
14
|
+
export class PdBaseUIInput extends PdBaseUI {
|
|
15
15
|
|
|
16
16
|
static get properties() {
|
|
17
17
|
return {
|
|
@@ -7,7 +7,7 @@ import { html, css , LitElement } from 'lit';
|
|
|
7
7
|
|
|
8
8
|
import { SharedInputStyles } from './shared-input-styles.js';
|
|
9
9
|
|
|
10
|
-
export class
|
|
10
|
+
export class PdButton extends LitElement {
|
|
11
11
|
|
|
12
12
|
static get styles() {
|
|
13
13
|
return [
|
|
@@ -117,23 +117,23 @@ export class SquiButton extends LitElement {
|
|
|
117
117
|
align-items: center;
|
|
118
118
|
justify-content: center;
|
|
119
119
|
white-space: nowrap;
|
|
120
|
-
--
|
|
121
|
-
--
|
|
120
|
+
--pd-icon-fill: var(--icon-fill-light);
|
|
121
|
+
--pd-icon-fill-hover: var(--icon-fill-light);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.button-icon:not([disabled]) {
|
|
125
|
-
--
|
|
126
|
-
--
|
|
125
|
+
--pd-icon-fill: var(--app-primary-color);
|
|
126
|
+
--pd-icon-fill-hover: var(--app-primary-color-dark);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
.button-icon
|
|
129
|
+
.button-icon pd-icon {
|
|
130
130
|
max-width: 1.25rem;
|
|
131
131
|
height: 1.25rem;
|
|
132
132
|
width: 1.25rem;
|
|
133
133
|
margin: 0 .15rem;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.button-icon.small
|
|
136
|
+
.button-icon.small pd-icon {
|
|
137
137
|
max-width: 1.25rem;
|
|
138
138
|
height: 1.25rem;
|
|
139
139
|
width: 1.25rem;
|
|
@@ -148,16 +148,16 @@ export class SquiButton extends LitElement {
|
|
|
148
148
|
fill: var(--app-primary-color);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
.button-icon:hover
|
|
151
|
+
.button-icon:hover pd-icon,
|
|
152
152
|
.button-icon:hover svg {
|
|
153
153
|
fill: var(--app-primary-color);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
@media (min-width: 580px) {
|
|
157
|
-
.button-icon
|
|
157
|
+
.button-icon pd-icon {
|
|
158
158
|
margin: 0 .5rem;
|
|
159
159
|
}
|
|
160
|
-
.button-icon.small
|
|
160
|
+
.button-icon.small pd-icon {
|
|
161
161
|
padding-right: .5rem;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
import { html, css , LitElement } from 'lit';
|
|
7
7
|
|
|
8
8
|
import { SharedInputStyles } from './shared-input-styles.js';
|
|
9
|
-
import '
|
|
9
|
+
import '../pd-button.js';
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
export class
|
|
12
|
+
export class PdButtonGroup extends LitElement {
|
|
13
13
|
|
|
14
14
|
static get styles() {
|
|
15
15
|
return [
|
|
@@ -46,7 +46,7 @@ export class SquiButtonGroup extends LitElement {
|
|
|
46
46
|
return html`
|
|
47
47
|
<div class="button-group">
|
|
48
48
|
${this.buttons.map(entry => html`
|
|
49
|
-
<
|
|
49
|
+
<pd-button text="${entry.text}" style="visibility: ${entry.visibility};"></pd-button>
|
|
50
50
|
`)}
|
|
51
51
|
</div>
|
|
52
52
|
`;
|
|
@@ -9,12 +9,12 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
|
9
9
|
// import {GestureEventListeners} from '@polymer/polymer/lib/mixins/gesture-event-listeners.js';
|
|
10
10
|
|
|
11
11
|
import '@progressive-development/pd-icon';
|
|
12
|
-
import {
|
|
12
|
+
import { PdBaseUIInput, INPUT_TYPE_CHECK } from "./PdBaseUiInput.js";
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
// import { installMediaQueryWatcher } from 'pwa-helpers/media-query.js';
|
|
16
16
|
|
|
17
|
-
export class
|
|
17
|
+
export class PdCheckbox extends PdBaseUIInput {
|
|
18
18
|
static get properties() {
|
|
19
19
|
return {
|
|
20
20
|
hasInner: { type: Boolean },
|
|
@@ -54,7 +54,7 @@ export class SquiCheckbox extends SquiBaseUIInput {
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
/* TODO vars used in
|
|
57
|
+
/* TODO vars used in pd-icon */
|
|
58
58
|
--squi-checkbox-checked-color: var(--my-primary);
|
|
59
59
|
--squi-checkbox-unchecked-color: var(--my-ligth);
|
|
60
60
|
--squi-checkbox-bg: var(--my-dark);
|
|
@@ -63,21 +63,21 @@ export class SquiCheckbox extends SquiBaseUIInput {
|
|
|
63
63
|
|
|
64
64
|
--squi-checkbox-label-disabled-color: var(--app-copy-color, #303030);
|
|
65
65
|
|
|
66
|
-
/* Checkbox
|
|
67
|
-
--
|
|
68
|
-
--
|
|
69
|
-
--
|
|
70
|
-
--
|
|
66
|
+
/* Checkbox pd-icon */
|
|
67
|
+
--pd-icon-fill: var(--my-icon-bg-color);
|
|
68
|
+
--pd-icon-bg: var(--my-icon-fill);
|
|
69
|
+
--pd-icon-fill-active: var(--my-icon-bg-active-color);
|
|
70
|
+
--pd-icon-bg-active: var(--my-icon-active-fill);
|
|
71
71
|
|
|
72
72
|
display: inline-block;
|
|
73
73
|
font-size: .8rem;
|
|
74
74
|
}
|
|
75
|
-
/* Switch
|
|
75
|
+
/* Switch pd-icon */
|
|
76
76
|
:host([isSwitch]) {
|
|
77
|
-
--
|
|
78
|
-
--
|
|
79
|
-
--
|
|
80
|
-
--
|
|
77
|
+
--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);
|
|
80
|
+
--pd-icon-bg-active: var(--my-icon-bg-active-color);
|
|
81
81
|
}
|
|
82
82
|
div {
|
|
83
83
|
display: flex;
|
|
@@ -98,7 +98,7 @@ export class SquiCheckbox extends SquiBaseUIInput {
|
|
|
98
98
|
align-items: center;
|
|
99
99
|
justify-content: center;
|
|
100
100
|
}
|
|
101
|
-
.checkbox
|
|
101
|
+
.checkbox pd-icon {
|
|
102
102
|
margin: .25rem;
|
|
103
103
|
}
|
|
104
104
|
.label {
|
|
@@ -145,16 +145,16 @@ export class SquiCheckbox extends SquiBaseUIInput {
|
|
|
145
145
|
min-width: 2rem;
|
|
146
146
|
background: none;
|
|
147
147
|
|
|
148
|
-
--
|
|
149
|
-
--
|
|
150
|
-
--
|
|
151
|
-
--
|
|
148
|
+
--pd-icon-bg: transparent;
|
|
149
|
+
--pd-icon-fill: var(--card-dark-red);
|
|
150
|
+
--pd-icon-fill-hover: var(--pd-icon-fill);
|
|
151
|
+
--pd-icon-fill-active: var(--card-medium-green);
|
|
152
152
|
}
|
|
153
|
-
.readonly .isChecked.switch-paddle
|
|
153
|
+
.readonly .isChecked.switch-paddle pd-icon {
|
|
154
154
|
transform: translate3d(0, 0, 0);
|
|
155
155
|
left: 0.25rem;
|
|
156
156
|
}
|
|
157
|
-
.switch-paddle
|
|
157
|
+
.switch-paddle pd-icon {
|
|
158
158
|
position: absolute;
|
|
159
159
|
top: 0.25rem;
|
|
160
160
|
left: 0.25rem;
|
|
@@ -168,7 +168,7 @@ export class SquiCheckbox extends SquiBaseUIInput {
|
|
|
168
168
|
transition: all 0.25s ease-out;
|
|
169
169
|
content: '';
|
|
170
170
|
}
|
|
171
|
-
.isChecked.switch-paddle
|
|
171
|
+
.isChecked.switch-paddle pd-icon {
|
|
172
172
|
left: 2.25rem;
|
|
173
173
|
}
|
|
174
174
|
|
|
@@ -211,7 +211,7 @@ export class SquiCheckbox extends SquiBaseUIInput {
|
|
|
211
211
|
return html`<div @click="${this.onClick}" class="${classMap({'disabled': this.disabled, 'switch': this.isSwitch, 'readonly': this.readonly})}">
|
|
212
212
|
<a href="#" @click="${this.linkClick}" @keypress="${this.onKeyPress}"
|
|
213
213
|
class="${classMap({'switch-paddle': this.isSwitch, 'checkbox': !this.isSwitch, 'isChecked': checked, 'isUnchecked': !checked})}">
|
|
214
|
-
<
|
|
214
|
+
<pd-icon icon="checkBox" class="${classMap({'switch': this.isSwitch, 'checkBox': !this.isSwitch})}" ?activeIcon="${checked}"></pd-icon>
|
|
215
215
|
</a>
|
|
216
216
|
${this.hasInner
|
|
217
217
|
? html`<span class="label">
|
|
@@ -11,7 +11,7 @@ import {LitElement, html, css} from 'lit';
|
|
|
11
11
|
* @slot - This element has a slot
|
|
12
12
|
* @csspart button - The button
|
|
13
13
|
*/
|
|
14
|
-
export class
|
|
14
|
+
export class PdFormContainer extends LitElement {
|
|
15
15
|
|
|
16
16
|
static get styles() {
|
|
17
17
|
return css`
|
|
@@ -7,7 +7,7 @@ import { html, css } from 'lit';
|
|
|
7
7
|
import { classMap } from 'lit/directives/class-map.js';
|
|
8
8
|
import { SharedInputStyles } from './shared-input-styles.js';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { PdBaseUIInput, INPUT_TYPE_TEXT } from './PdBaseUiInput.js';
|
|
11
11
|
|
|
12
12
|
import '@progressive-development/pd-icon/pd-icon.js';
|
|
13
13
|
|
|
@@ -39,34 +39,34 @@ import '@progressive-development/pd-icon/pd-icon.js';
|
|
|
39
39
|
*
|
|
40
40
|
* The icon inside `squi-input` is hidden by default. To show it, set the attribute `icon-right` or `icon-left`.
|
|
41
41
|
*
|
|
42
|
-
* <
|
|
43
|
-
* <
|
|
42
|
+
* <pd-input icon-left></pd-input>
|
|
43
|
+
* <pd-input icon-right></pd-input>
|
|
44
44
|
*
|
|
45
|
-
* <
|
|
45
|
+
* <pd-input icon-left .icon="${'hardware:headset'}"></pd-input>
|
|
46
46
|
*
|
|
47
47
|
* Text can be left or right aligned. Default is left alignment.
|
|
48
48
|
*
|
|
49
|
-
* <
|
|
50
|
-
* <
|
|
49
|
+
* <pd-input text-right></pd-input>
|
|
50
|
+
* <pd-input text-left></pd-input>
|
|
51
51
|
*/
|
|
52
|
-
export class
|
|
52
|
+
export class PdInput extends PdBaseUIInput {
|
|
53
53
|
/**
|
|
54
|
-
* Fired when `
|
|
54
|
+
* Fired when `pd-input` has focus and the user press `Enter` key.
|
|
55
55
|
* @event enter-pressed
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* Fired when `
|
|
59
|
+
* Fired when `pd-input` has focus and the user press any key except `Enter`.
|
|
60
60
|
* @event key-pressed
|
|
61
61
|
*/
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* Fire when the `
|
|
64
|
+
* Fire when the `pd-input` loses focus.
|
|
65
65
|
* @event focus-lost
|
|
66
66
|
*/
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
* Fire when the icon inside `
|
|
69
|
+
* Fire when the icon inside `pd-input` is clicked.
|
|
70
70
|
* @event icon-clicked
|
|
71
71
|
*/
|
|
72
72
|
|
|
@@ -85,10 +85,10 @@ export class SquiInput extends SquiBaseUIInput {
|
|
|
85
85
|
return {
|
|
86
86
|
key: { type: String }, // Test, wird für das setzten der Error Msg benötigt
|
|
87
87
|
|
|
88
|
-
/** Placeholder for `
|
|
88
|
+
/** Placeholder for `pd-input` initial text. */
|
|
89
89
|
placeHolder: { type: String },
|
|
90
90
|
/**
|
|
91
|
-
* Icon to be shown inside `
|
|
91
|
+
* Icon to be shown inside `pd-input`.
|
|
92
92
|
*/
|
|
93
93
|
icon: { type: String },
|
|
94
94
|
secret: { type: Boolean }, // True for type password
|
|
@@ -110,10 +110,10 @@ export class SquiInput extends SquiBaseUIInput {
|
|
|
110
110
|
return html`
|
|
111
111
|
<label for="${this.id}Input">${this.label}</label>
|
|
112
112
|
<div class="input ${classMap({ error: this.errorMsg.length > 0 })}">
|
|
113
|
-
<
|
|
113
|
+
<pd-icon
|
|
114
114
|
icon="toggleCollapse"
|
|
115
115
|
@click="${this._onIconClick}"
|
|
116
|
-
></
|
|
116
|
+
></pd-icon>
|
|
117
117
|
<input
|
|
118
118
|
id="${this.id}Input"
|
|
119
119
|
class="input-style ${this.gradient ? 'gradient' : ''}"
|
|
@@ -7,7 +7,7 @@ import { html, css } from 'lit';
|
|
|
7
7
|
import { classMap } from 'lit/directives/class-map.js';
|
|
8
8
|
import { SharedInputStyles } from './shared-input-styles.js';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { PdBaseUIInput, INPUT_TYPE_AREA } from './PdBaseUiInput.js';
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
import '@progressive-development/pd-icon/pd-icon.js';
|
|
@@ -40,35 +40,35 @@ import '@progressive-development/pd-icon/pd-icon.js';
|
|
|
40
40
|
*
|
|
41
41
|
* The icon inside `squi-input` is hidden by default. To show it, set the attribute `icon-right` or `icon-left`.
|
|
42
42
|
*
|
|
43
|
-
* <
|
|
44
|
-
* <
|
|
43
|
+
* <pd-input icon-left></pd-input>
|
|
44
|
+
* <pd-input icon-right></pd-input>
|
|
45
45
|
*
|
|
46
|
-
* <
|
|
46
|
+
* <pd-input icon-left .icon="${'hardware:headset'}"></pd-input>
|
|
47
47
|
*
|
|
48
48
|
* Text can be left or right aligned. Default is left alignment.
|
|
49
49
|
*
|
|
50
|
-
* <
|
|
51
|
-
* <
|
|
50
|
+
* <pd-input text-right></pd-input>
|
|
51
|
+
* <pd-input text-left></pd-input>
|
|
52
52
|
*/
|
|
53
|
-
export class
|
|
53
|
+
export class PdInputArea extends PdBaseUIInput {
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* Fired when `
|
|
56
|
+
* Fired when `pd-input-area` has focus and the user press `Enter` key.
|
|
57
57
|
* @event enter-pressed
|
|
58
58
|
*/
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
|
-
* Fired when `
|
|
61
|
+
* Fired when `pd-input-area` has focus and the user press any key except `Enter`.
|
|
62
62
|
* @event key-pressed
|
|
63
63
|
*/
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
* Fire when the `
|
|
66
|
+
* Fire when the `pd-input-area` loses focus.
|
|
67
67
|
* @event focus-lost
|
|
68
68
|
*/
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
|
-
* Fire when the icon inside `
|
|
71
|
+
* Fire when the icon inside `pd-input-area` is clicked.
|
|
72
72
|
* @event icon-clicked
|
|
73
73
|
*/
|
|
74
74
|
|
|
@@ -116,8 +116,8 @@ export class SquiInputArea extends SquiBaseUIInput {
|
|
|
116
116
|
return html`
|
|
117
117
|
<label for="${this.id}InputArea">${this.label}</label>
|
|
118
118
|
<div class="input ${classMap({'error': this.errorMsg.length > 0})}">
|
|
119
|
-
<
|
|
120
|
-
@click="${this._onIconClick}"></
|
|
119
|
+
<pd-icon icon="toggleCollapse"
|
|
120
|
+
@click="${this._onIconClick}"></pd-icon>
|
|
121
121
|
<textarea
|
|
122
122
|
id="${this.id}InputArea"
|
|
123
123
|
class="input-style ${this.gradient ? 'gradient' : ''}"
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
|
|
4
|
+
* This code may only be used under the BSD style license found at
|
|
5
|
+
* http://polymer.github.io/LICENSE.txt
|
|
6
|
+
* The complete set of authors may be found at
|
|
7
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
8
|
+
* The complete set of contributors may be found at
|
|
9
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
10
|
+
* Code distributed by Google as part of the polymer project is also
|
|
11
|
+
* subject to an additional IP rights grant found at
|
|
12
|
+
* http://polymer.github.io/PATENTS.txt
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import {LitElement, html, css} from 'lit';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* An example element.
|
|
19
|
+
*
|
|
20
|
+
* @slot - This element has a slot
|
|
21
|
+
* @csspart button - The button
|
|
22
|
+
*/
|
|
23
|
+
export class PdLabelValue extends LitElement {
|
|
24
|
+
|
|
25
|
+
static get styles() {
|
|
26
|
+
return css`
|
|
27
|
+
:host {
|
|
28
|
+
|
|
29
|
+
--my-label-color: var(--squi-background-color, #24a3b9);
|
|
30
|
+
--my-label-font: var(--squi-background-color, #24a3b9);
|
|
31
|
+
|
|
32
|
+
--my-value-color: var(--squi-background-hover-color, #23636e);
|
|
33
|
+
--my-value-font: var(--squi-background-hover-color, #23636e);
|
|
34
|
+
|
|
35
|
+
display: block;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.container {
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.label {
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.value {
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static get properties() {
|
|
54
|
+
return {
|
|
55
|
+
label: {type: String},
|
|
56
|
+
value: {type: String}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
constructor() {
|
|
61
|
+
super();
|
|
62
|
+
this.label = '';
|
|
63
|
+
this.value = '';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
render() {
|
|
67
|
+
return html`
|
|
68
|
+
<div class="container">
|
|
69
|
+
<span class="label">${this.label}</span>
|
|
70
|
+
<span class="value">${this.value}</span>
|
|
71
|
+
</div>
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
}
|
|
@@ -13,7 +13,7 @@ import { SharedInputStyles } from './shared-input-styles.js';
|
|
|
13
13
|
* @slot - This element has a slot
|
|
14
14
|
* @csspart button - The button
|
|
15
15
|
*/
|
|
16
|
-
export class
|
|
16
|
+
export class PdRadioGroup extends LitElement {
|
|
17
17
|
|
|
18
18
|
static get styles() {
|
|
19
19
|
return [
|
|
@@ -52,7 +52,7 @@ export class SquiRadioGroup extends LitElement {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
get value() {
|
|
55
|
-
const elColl = this.getElementsByTagName('
|
|
55
|
+
const elColl = this.getElementsByTagName('pd-checkbox');
|
|
56
56
|
let returnVal;
|
|
57
57
|
Object.keys(elColl).forEach(keyValue => {
|
|
58
58
|
if (elColl[keyValue].value === 'true') {
|
|
@@ -66,7 +66,7 @@ export class SquiRadioGroup extends LitElement {
|
|
|
66
66
|
|
|
67
67
|
// add event listener
|
|
68
68
|
this.addEventListener('checkbox-changed', (e) => {
|
|
69
|
-
const elCollection = this.getElementsByTagName('
|
|
69
|
+
const elCollection = this.getElementsByTagName('pd-checkbox');
|
|
70
70
|
Object.keys(elCollection).forEach(keyValue => {
|
|
71
71
|
if (elCollection[keyValue] !== e.target) {
|
|
72
72
|
elCollection[keyValue].value = false;
|
|
@@ -78,7 +78,7 @@ export class SquiRadioGroup extends LitElement {
|
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
// set default
|
|
81
|
-
const elColl = this.getElementsByTagName('
|
|
81
|
+
const elColl = this.getElementsByTagName('pd-checkbox');
|
|
82
82
|
Object.keys(elColl).forEach(keyValue => {
|
|
83
83
|
elColl[keyValue].readonly = elColl[keyValue].value === 'true';
|
|
84
84
|
});
|
|
@@ -7,7 +7,7 @@ import { html, css } from 'lit';
|
|
|
7
7
|
import { classMap } from 'lit/directives/class-map.js';
|
|
8
8
|
import { SharedInputStyles } from './shared-input-styles.js';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { PdBaseUIInput, INPUT_TYPE_SELECT } from './PdBaseUiInput.js';
|
|
11
11
|
|
|
12
12
|
import '@progressive-development/pd-icon/pd-icon.js';
|
|
13
13
|
|
|
@@ -39,17 +39,17 @@ import '@progressive-development/pd-icon/pd-icon.js';
|
|
|
39
39
|
*
|
|
40
40
|
* The icon inside `squi-input` is hidden by default. To show it, set the attribute `icon-right` or `icon-left`.
|
|
41
41
|
*
|
|
42
|
-
* <
|
|
43
|
-
* <
|
|
42
|
+
* <pd-input icon-left></pd-input>
|
|
43
|
+
* <pd-input icon-right></pd-input>
|
|
44
44
|
*
|
|
45
|
-
* <
|
|
45
|
+
* <pd-input icon-left .icon="${'hardware:headset'}"></pd-input>
|
|
46
46
|
*
|
|
47
47
|
* Text can be left or right aligned. Default is left alignment.
|
|
48
48
|
*
|
|
49
|
-
* <
|
|
50
|
-
* <
|
|
49
|
+
* <pd-input text-right></pd-input>
|
|
50
|
+
* <pd-input text-left></pd-input>
|
|
51
51
|
*/
|
|
52
|
-
export class
|
|
52
|
+
export class PdSelect extends PdBaseUIInput {
|
|
53
53
|
/**
|
|
54
54
|
* Fired when `squi-input` has focus and the user press `Enter` key.
|
|
55
55
|
* @event enter-pressed
|
|
@@ -202,10 +202,10 @@ export class SquiSelect extends SquiBaseUIInput {
|
|
|
202
202
|
return html`
|
|
203
203
|
<label for="${this.id}Select">${this.label}</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
210
|
id="${this.id}Input"
|
|
211
211
|
class="select-css input-style ${this.gradient ? 'gradient' : ''}"
|
|
@@ -45,8 +45,8 @@ export const SharedInputStyles = css`
|
|
|
45
45
|
.input {
|
|
46
46
|
display: inline-block;
|
|
47
47
|
/*position: relative; Prüfen: Wennd as an ist, felder über scroll-menu?*/
|
|
48
|
-
/*
|
|
49
|
-
--
|
|
48
|
+
/* pd-icon smaller than input */
|
|
49
|
+
--pd-icon-computed-size: calc(var(--my-input-height) * 0.75); /* calc */
|
|
50
50
|
|
|
51
51
|
/* Hack um eine Form Row (input mit Button => Booking) zu bekommen*/
|
|
52
52
|
padding-top: var(--squi-input-padding, 0.5rem);
|
|
@@ -55,28 +55,28 @@ export const SharedInputStyles = css`
|
|
|
55
55
|
color: var(--my-error-color);
|
|
56
56
|
}
|
|
57
57
|
/* squi icon depends on input styles to fit inside */
|
|
58
|
-
|
|
58
|
+
pd-icon {
|
|
59
59
|
display: none;
|
|
60
60
|
position: absolute;
|
|
61
|
-
--
|
|
62
|
-
--
|
|
63
|
-
--
|
|
64
|
-
--
|
|
61
|
+
--pd-icon-height: var(--pd-icon-computed-size, 2rem);
|
|
62
|
+
--pd-icon-width: var(--pd-icon-computed-size, 2rem);
|
|
63
|
+
--pd-icon-fill-color: var(--squi-input-icon-fill-color, currentcolor);
|
|
64
|
+
--pd-icon-stroke-color: var(--squi-input-icon-stroke-color, none);
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
pd-icon:hover {
|
|
67
67
|
cursor: pointer;
|
|
68
68
|
}
|
|
69
69
|
/* Display icon if it's positioned */
|
|
70
|
-
:host([icon-right]) .input
|
|
70
|
+
:host([icon-right]) .input pd-icon {
|
|
71
71
|
display: inline-block;
|
|
72
72
|
right: 0;
|
|
73
73
|
}
|
|
74
|
-
:host([icon-left]) .input
|
|
74
|
+
:host([icon-left]) .input pd-icon {
|
|
75
75
|
display: inline-block;
|
|
76
76
|
left: 0;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
/* Padding space for
|
|
79
|
+
/* Padding space for pd-icon => Noch input spezifisch? */
|
|
80
80
|
:host([icon-right]) > input {
|
|
81
81
|
padding-right: var(--my-input-height);
|
|
82
82
|
}
|