@progressive-development/pd-forms 0.0.5 → 0.0.6
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/index.js +20 -3
- package/package.json +3 -2
- package/src/shared-input-styles.js +227 -0
- package/src/squi-base-ui-input.js +68 -0
- package/src/squi-base-ui.js +14 -0
- package/src/squi-button-group.js +52 -0
- package/src/squi-button.js +187 -0
- package/src/squi-checkbox.js +290 -0
- package/src/squi-form-container.js +51 -0
- package/src/squi-form-row.js +103 -0
- package/src/squi-input-area.js +185 -0
- package/src/squi-input.js +206 -0
- package/src/squi-radio-group.js +111 -0
- package/src/squi-select.js +308 -0
- package/src/test-el.js +0 -32
package/index.js
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SquiSelect } from './src/squi-select.js';
|
|
2
|
+
import { SquiButton } from './src/squi-button.js';
|
|
3
|
+
import { SquiCheckbox } from './src/squi-checkbox.js';
|
|
4
|
+
import { SquiFormContainer } from './src/squi-form-container.js';
|
|
5
|
+
import { SquiFormRow } from './src/squi-form-row.js';
|
|
6
|
+
import { SquiInputArea } from './src/squi-input-area.js';
|
|
7
|
+
import { SquiInput } from './src/squi-input.js';
|
|
8
|
+
import { SquiRadioGroup } from './src/squi-radio-group.js';
|
|
2
9
|
|
|
3
|
-
window.customElements.define('
|
|
10
|
+
window.customElements.define('squi-select', SquiSelect);
|
|
11
|
+
window.customElements.define('squi-button', SquiButton);
|
|
12
|
+
window.customElements.define('squi-checkbox', SquiCheckbox);
|
|
13
|
+
window.customElements.define('squi-form-container', SquiFormContainer);
|
|
14
|
+
window.customElements.define('squi-form-row', SquiFormRow);
|
|
15
|
+
window.customElements.define('squi-input-area', SquiInputArea);
|
|
16
|
+
window.customElements.define('squi-input', SquiInput);
|
|
17
|
+
window.customElements.define('squi-radio-group', SquiRadioGroup);
|
|
4
18
|
|
|
5
|
-
export {
|
|
19
|
+
export {
|
|
20
|
+
SquiSelect, SquiButton, SquiCheckbox, SquiFormContainer,
|
|
21
|
+
SquiFormRow, SquiInputArea, SquiInput, SquiRadioGroup
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Webcomponent pd-forms following open-wc recommendations",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "PD Progressive Development",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.6",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"storybook:build": "npm run analyze -- --exclude dist && build-storybook"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"
|
|
20
|
+
"@progressive-development/pd-icon": "0.0.2",
|
|
21
|
+
"lit": "^2.0.0-rc.4"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@license
|
|
3
|
+
Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
|
|
4
|
+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
|
5
|
+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
6
|
+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
7
|
+
Code distributed by Google as part of the polymer project is also
|
|
8
|
+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { css } from 'lit';
|
|
12
|
+
|
|
13
|
+
export const SharedInputStyles = css`
|
|
14
|
+
:host {
|
|
15
|
+
/*
|
|
16
|
+
display: block;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
perspective: none;
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/* define color layout for elements depending on customizables vals:
|
|
22
|
+
squi-primary-color, squi-secondary-color, squi-text-color, squi-highlight-color,
|
|
23
|
+
squi-border-radius, squi-error-color, squi-error-background-color, squi-display-font, squi-font-size
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/* Border for input Elements Select, Input, Input Area */
|
|
27
|
+
--my-border-color: var(--squi-primary-color, #177e89);
|
|
28
|
+
--my-border-color-focus: var(--squi-primary-color, #177e89);
|
|
29
|
+
--my-border-color-hover: var(--squi-highlight-color, #ffc857);
|
|
30
|
+
--my-border-radius: var(--squi-border-radius, 0rem);
|
|
31
|
+
|
|
32
|
+
/* Background color input Elements Select, Input, Input Area */
|
|
33
|
+
--my-background-color: var(--squi-secondary-color, #fefefe);
|
|
34
|
+
--my-background-gradient-color: var(--squi-third-color, #8caed8a1);
|
|
35
|
+
--my-error-background-color: var(--squi-error-background-color, #f6d4d4a1);
|
|
36
|
+
|
|
37
|
+
/* Error colors for Elements Select, Input, Input Area */
|
|
38
|
+
--my-error-color: var(--squi-error-color, #d6242d);
|
|
39
|
+
|
|
40
|
+
/* Text color input Elements Select, Input, Input Area */
|
|
41
|
+
--my-text-color: var(--squi-text-color, #000000);
|
|
42
|
+
--my-label-color: var(--squi-text-color, #000000);
|
|
43
|
+
--my-font-family: var(--squi-display-font, 'Montserrat');
|
|
44
|
+
--my-font-size: var(--squi-font-size, 1rem);
|
|
45
|
+
|
|
46
|
+
--my-input-height: var(--squi-input-height, 2.4rem);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Describe input div (with icon) around input/select/area element */
|
|
50
|
+
.input {
|
|
51
|
+
display: inline-block;
|
|
52
|
+
/*position: relative; Prüfen: Wennd as an ist, felder über scroll-menu?*/
|
|
53
|
+
/* squi-icon smaller than input */
|
|
54
|
+
--squi-icon-computed-size: calc(var(--my-input-height) * 0.75); /* calc */
|
|
55
|
+
|
|
56
|
+
/* Hack um eine Form Row (input mit Button => Booking) zu bekommen*/
|
|
57
|
+
padding-top: var(--squi-input-padding, 0.5rem);
|
|
58
|
+
}
|
|
59
|
+
.input.error {
|
|
60
|
+
color: var(--my-error-color);
|
|
61
|
+
}
|
|
62
|
+
/* squi icon depends on input styles to fit inside */
|
|
63
|
+
squi-icon {
|
|
64
|
+
display: none;
|
|
65
|
+
position: absolute;
|
|
66
|
+
--squi-icon-height: var(--squi-icon-computed-size, 2rem);
|
|
67
|
+
--squi-icon-width: var(--squi-icon-computed-size, 2rem);
|
|
68
|
+
--squi-icon-fill-color: var(--squi-input-icon-fill-color, currentcolor);
|
|
69
|
+
--squi-icon-stroke-color: var(--squi-input-icon-stroke-color, none);
|
|
70
|
+
}
|
|
71
|
+
squi-icon:hover {
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
}
|
|
74
|
+
/* Display icon if it's positioned */
|
|
75
|
+
:host([icon-right]) .input squi-icon {
|
|
76
|
+
display: inline-block;
|
|
77
|
+
right: 0;
|
|
78
|
+
}
|
|
79
|
+
:host([icon-left]) .input squi-icon {
|
|
80
|
+
display: inline-block;
|
|
81
|
+
left: 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Padding space for squi-icon => Noch input spezifisch? */
|
|
85
|
+
:host([icon-right]) > input {
|
|
86
|
+
padding-right: var(--my-input-height);
|
|
87
|
+
}
|
|
88
|
+
:host([icon-left]) > input {
|
|
89
|
+
padding-left: var(--my-input-height);
|
|
90
|
+
}
|
|
91
|
+
/* Text direction */
|
|
92
|
+
:host([text-right]) > input {
|
|
93
|
+
text-align: right;
|
|
94
|
+
}
|
|
95
|
+
:host([text-left]) > input {
|
|
96
|
+
text-align: left;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Label for input, select, area */
|
|
100
|
+
label {
|
|
101
|
+
display: block;
|
|
102
|
+
padding: 0;
|
|
103
|
+
color: var(--my-label-color);
|
|
104
|
+
text-align: left;
|
|
105
|
+
font-size: 0.9rem;
|
|
106
|
+
margin-bottom: -5px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Working progress, used at the moment for radio-group, work out and adapt to others... */
|
|
110
|
+
.error-box {
|
|
111
|
+
color: var(--my-error-color);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Error Msg Div for input, select, area */
|
|
115
|
+
.error-msg {
|
|
116
|
+
background: var(--my-error-background-color);
|
|
117
|
+
border: 1px solid var(--my-error-color);
|
|
118
|
+
border-radius: var(--my-border-radius);
|
|
119
|
+
padding: 0.25rem;
|
|
120
|
+
white-space: nowrap;
|
|
121
|
+
display: block;
|
|
122
|
+
font-size: 0.8rem;
|
|
123
|
+
max-width: var(--squi-input-width, 250px);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/*
|
|
127
|
+
* Descrive size, style for input, area and select element
|
|
128
|
+
* not use iput here => because of own select css...
|
|
129
|
+
*/
|
|
130
|
+
.input-style {
|
|
131
|
+
width: var(--squi-input-width, 250px);
|
|
132
|
+
padding: var(--squi-input-padding, 0.5rem);
|
|
133
|
+
|
|
134
|
+
background-color: var(--my-background-color);
|
|
135
|
+
/*opacity: 80%;*/
|
|
136
|
+
color: var(--my-text-color);
|
|
137
|
+
/*font-size: var(--squi-input-font-size, calc(var(--squi-input-height) / 1.8));*/
|
|
138
|
+
font-size: var(--my-font-size);
|
|
139
|
+
font-family: var(--my-font-family);
|
|
140
|
+
|
|
141
|
+
/* ToDo Border Angaben? (ganz, nur bottom, und variablen dazu) Hier für ontact us fest eingebunden...*/
|
|
142
|
+
border: 1px solid #cacaca;
|
|
143
|
+
box-shadow: inset 0 1px 2px rgba(50, 48, 49, 0.1);
|
|
144
|
+
border-bottom: 2px solid var(--my-border-color);
|
|
145
|
+
border-radius: var(--my-border-radius);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Höhe soll nicht für Text Area gelten, daher ausgelagert (überschreibt sonst rows) */
|
|
149
|
+
input.input-style,
|
|
150
|
+
select.input-style {
|
|
151
|
+
height: var(--my-input-height);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.gradient {
|
|
155
|
+
background: linear-gradient(
|
|
156
|
+
to bottom,
|
|
157
|
+
var(--my-background-gradient-color) 0%,
|
|
158
|
+
var(--my-background-color) 100%
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Hover for input, area, select */
|
|
163
|
+
.input-style:hover {
|
|
164
|
+
border-color: var(--my-border-color-hover);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Fokus for input, area => select with own css.? */
|
|
168
|
+
.input-style:focus {
|
|
169
|
+
border: var(--my-border-color-focus) 2px solid;
|
|
170
|
+
outline: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* error element style for input, area => select has own css.? */
|
|
174
|
+
.error .input-style {
|
|
175
|
+
border: 1px solid var(--my-error-color);
|
|
176
|
+
color: var(--my-error-color);
|
|
177
|
+
background-color: var(--my-error-background-color);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.error .gradient {
|
|
181
|
+
background: linear-gradient(
|
|
182
|
+
to bottom,
|
|
183
|
+
var(--my-background-gradient-color) 10%,
|
|
184
|
+
#f5979b 100%
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Error Focus for input, area, select */
|
|
189
|
+
.error .input-style:focus {
|
|
190
|
+
border: 2px solid var(--my-error-color);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/*
|
|
194
|
+
* Disabled style for input, select, area
|
|
195
|
+
*/
|
|
196
|
+
/* Disabled for input, area => select with own css.? */
|
|
197
|
+
.input-style[disabled] {
|
|
198
|
+
/* TODO: Angaben nach oben ziehen */
|
|
199
|
+
--squi-input-placeholder-color: rgba(
|
|
200
|
+
var(--raw-game-color-light-lighter),
|
|
201
|
+
1
|
|
202
|
+
);
|
|
203
|
+
border-color: #aaa;
|
|
204
|
+
color: var(--raw-game-color-light-lightest, #7a7777);
|
|
205
|
+
background-color: #d3d2d2;
|
|
206
|
+
text-shadow: 2px 2px 3px var(--raw-game-color-dark-darker, #999);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.gradient[disabled] {
|
|
210
|
+
background: linear-gradient(to bottom, #ebebeb 0%, #999 100%);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.input-style[disabled]:hover {
|
|
214
|
+
border-color: #6e6c6c;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Placeholder color */
|
|
218
|
+
::placeholder {
|
|
219
|
+
color: var(--squi-input-placeholder-color, #474747);
|
|
220
|
+
}
|
|
221
|
+
:-ms-input-placeholder {
|
|
222
|
+
color: var(--squi-input-placeholder-color, #474747);
|
|
223
|
+
}
|
|
224
|
+
::-ms-input-placeholder {
|
|
225
|
+
color: var(--squi-input-placeholder-color, #474747);
|
|
226
|
+
}
|
|
227
|
+
`;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
@license squi-licence
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { SquiBaseUI } from './squi-base-ui.js';
|
|
6
|
+
|
|
7
|
+
export const INPUT_TYPE_TEXT = 1;
|
|
8
|
+
export const INPUT_TYPE_SELECT = 2;
|
|
9
|
+
export const INPUT_TYPE_CHECK = 3;
|
|
10
|
+
export const INPUT_TYPE_RANGE = 4;
|
|
11
|
+
export const INPUT_TYPE_AREA = 5;
|
|
12
|
+
|
|
13
|
+
export class SquiBaseUIInput extends SquiBaseUI {
|
|
14
|
+
|
|
15
|
+
static get properties() {
|
|
16
|
+
return {
|
|
17
|
+
gradient: { type: Boolean }, // true for gradient background
|
|
18
|
+
disabled: { type: Boolean }, // disabled flag for element
|
|
19
|
+
readonly: { type: Boolean }, // readonly flag for element
|
|
20
|
+
valueName: { type: String },
|
|
21
|
+
defaultValue: { type: String }, // default value for input element (used for reset) TODO: Das hier ggf. automatisch mit erstem gesetzten Wert füllen?
|
|
22
|
+
label: { type: String }, // label text for input
|
|
23
|
+
value: {type: String}, // current value (set from outside) TODO: Typ (Object, Number, Txt, Bool...)
|
|
24
|
+
errorMsg: {type: String}, // errorMsg (could set fronm outside for busines validation, internal validation=> todo)
|
|
25
|
+
_inputType: {type: Number}, // number value for type (text, select, range....), set constructor of sub-class
|
|
26
|
+
_input: { type: Object } // reference for input html element
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.gradient = false;
|
|
33
|
+
this.disabled = false;
|
|
34
|
+
this.readonly = false;
|
|
35
|
+
this.defaultValue = '';
|
|
36
|
+
this.label = '';
|
|
37
|
+
this.value = '';
|
|
38
|
+
this.errorMsg = '';
|
|
39
|
+
this._inputType = -1;
|
|
40
|
+
this._input = {};
|
|
41
|
+
this.valueName = '';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Test: Clear input with value => Dann in BasisKlasse und alle leiten von Basis UI Element ab
|
|
45
|
+
clear() {
|
|
46
|
+
this.value = '';
|
|
47
|
+
this._input.value = this.value;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Test: Reset input with value
|
|
51
|
+
reset() {
|
|
52
|
+
this.value = this.defaultValue || '';
|
|
53
|
+
this._input.value = this.value;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
get value() {
|
|
58
|
+
return this._value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
set value(newValue) {
|
|
62
|
+
console.info("Meine Werte vor Set _value, input.value, newValue: ", this._value, this._input.value, newValue);
|
|
63
|
+
this._value = newValue;
|
|
64
|
+
this._input.value = newValue;
|
|
65
|
+
console.info("Meine Werte nach Set: ", this._value, this._input.value, newValue);
|
|
66
|
+
}
|
|
67
|
+
*/
|
|
68
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { html, css , LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
import { SharedInputStyles } from './shared-input-styles.js';
|
|
4
|
+
import './squi-button.js';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SquiButtonGroup extends LitElement {
|
|
8
|
+
|
|
9
|
+
static get styles() {
|
|
10
|
+
return [
|
|
11
|
+
// Import Shared Styles for defined styles vars
|
|
12
|
+
SharedInputStyles,
|
|
13
|
+
css`
|
|
14
|
+
|
|
15
|
+
:host {
|
|
16
|
+
--my-justify-prop: var(--justify-prop, space-around);
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.button-group {
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: var(--my-justify-prop);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
`];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static get properties() {
|
|
30
|
+
return {
|
|
31
|
+
buttons: {type: Array}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
constructor() {
|
|
36
|
+
super();
|
|
37
|
+
this.buttons = []
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
render() {
|
|
41
|
+
return html`
|
|
42
|
+
<div class="button-group">
|
|
43
|
+
${this.buttons.map(entry => html`
|
|
44
|
+
<squi-button text="${entry.text}" style="visibility: ${entry.visibility};"></squi-button>
|
|
45
|
+
`)}
|
|
46
|
+
</div>
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
customElements.define('squi-button-group', SquiButtonGroup);
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { html, css , LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
import { SharedInputStyles } from './shared-input-styles.js';
|
|
4
|
+
|
|
5
|
+
export class SquiButton extends LitElement {
|
|
6
|
+
|
|
7
|
+
static get styles() {
|
|
8
|
+
return [
|
|
9
|
+
// Import Shared Styles for defined styles vars
|
|
10
|
+
SharedInputStyles,
|
|
11
|
+
css`
|
|
12
|
+
|
|
13
|
+
:host {
|
|
14
|
+
--my-primary-color: var(--squi-primary-color, #177E89);
|
|
15
|
+
--my-button-background-color: var(--squi-button-background-color, #ffc857);
|
|
16
|
+
--my-button-background-hover-color: var(--squi-button-background-color, #ffb724);
|
|
17
|
+
--my-button-text-color: var(--squi-button-text-color, #084c61);
|
|
18
|
+
--my-button-font-family: var(--squi-primary-font-family, Oswald);
|
|
19
|
+
|
|
20
|
+
--my-button-width: var(--squi-input-width, 140px);
|
|
21
|
+
|
|
22
|
+
display: block;
|
|
23
|
+
/*
|
|
24
|
+
height: 100%;
|
|
25
|
+
width: 100%; => Ohne diese Angabe eht die % Angaben icht
|
|
26
|
+
*/
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* Style for Button */
|
|
30
|
+
a {
|
|
31
|
+
display: inline-block;
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
font-family: var(--my-button-font-family);
|
|
34
|
+
font-size: var(--my-font-size);
|
|
35
|
+
line-height: 2.3em;
|
|
36
|
+
|
|
37
|
+
text-align: center;
|
|
38
|
+
/*box-shadow: -2px 2px 4px #999;/* TODO: From var */
|
|
39
|
+
/*border-bottom: 1px solid var(--my-border-color);*/
|
|
40
|
+
|
|
41
|
+
background-color: var(--my-button-background-color);
|
|
42
|
+
border-radius: var(--my-border-radius);
|
|
43
|
+
border: none;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
/*will-change: transform; Dann über Menu bei Scroll...*/
|
|
46
|
+
|
|
47
|
+
color: var(--my-button-text-color);
|
|
48
|
+
transition-property: box-shadow, background;
|
|
49
|
+
transition: .2s ease-in;
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
white-space: nowrap;
|
|
52
|
+
|
|
53
|
+
/*overflow: hidden;
|
|
54
|
+
text-overflow: ellipsis;*/
|
|
55
|
+
margin: 1rem auto;
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/*padding: var(--squi-input-padding, .5rem);*/
|
|
59
|
+
|
|
60
|
+
width: var(--my-button-width);
|
|
61
|
+
height: var(--my-input-height);
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
a *{
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
a[disabled] {
|
|
71
|
+
border-color: #5a5858;
|
|
72
|
+
color: var(--raw-game-color-light-lightest, #4b4848);
|
|
73
|
+
background-color: #d3d2d2;
|
|
74
|
+
text-shadow: 2px 2px 3px var(--raw-game-color-dark-darker, #999);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
a:not([disabled]):hover {
|
|
78
|
+
box-shadow: -1px 1px 2px #1f2b2a;
|
|
79
|
+
background: var(--my-button-background-hover-color);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
a.primary:not([disabled]):hover {
|
|
83
|
+
/* tbd: at the momment the same definition as without primary style */
|
|
84
|
+
box-shadow: -1px 1px 2px #1f2b2a;
|
|
85
|
+
background: var(--my-border-color-hover);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
a.primary {
|
|
89
|
+
background-color: var(--my-primary-color);
|
|
90
|
+
color: #fefefe; /* ToDo */
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
a.primary[disabled] {
|
|
94
|
+
background-color: #d3d2d2;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.b-gradient {
|
|
98
|
+
background: linear-gradient(to right, var(--my-background-gradient-color) 0%, var(--my-background-color) 100%);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.b-gradient.primary {
|
|
102
|
+
background: linear-gradient(to right, var(--my-primary-color) 0%, var(--my-background-color) 100%);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.b-gradient[disabled] {
|
|
106
|
+
background: linear-gradient(to right, lightgrey 0%, grey 100%);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* button icon not integrated at the moment */
|
|
110
|
+
.button-icon {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
white-space: nowrap;
|
|
115
|
+
--squi-icon-fill: var(--icon-fill-light);
|
|
116
|
+
--squi-icon-fill-hover: var(--icon-fill-light);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.button-icon:not([disabled]) {
|
|
120
|
+
--squi-icon-fill: var(--app-primary-color);
|
|
121
|
+
--squi-icon-fill-hover: var(--app-primary-color-dark);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.button-icon squi-icon {
|
|
125
|
+
max-width: 1.25rem;
|
|
126
|
+
height: 1.25rem;
|
|
127
|
+
width: 1.25rem;
|
|
128
|
+
margin: 0 .15rem;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.button-icon.small squi-icon {
|
|
132
|
+
max-width: 1.25rem;
|
|
133
|
+
height: 1.25rem;
|
|
134
|
+
width: 1.25rem;
|
|
135
|
+
padding-right: .15rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.button-icon svg {
|
|
139
|
+
max-width: 1rem;
|
|
140
|
+
height: 1rem;
|
|
141
|
+
width: 1rem;
|
|
142
|
+
padding-right: .5rem;
|
|
143
|
+
fill: var(--app-primary-color);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.button-icon:hover squi-icon,
|
|
147
|
+
.button-icon:hover svg {
|
|
148
|
+
fill: var(--app-primary-color);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@media (min-width: 580px) {
|
|
152
|
+
.button-icon squi-icon {
|
|
153
|
+
margin: 0 .5rem;
|
|
154
|
+
}
|
|
155
|
+
.button-icon.small squi-icon {
|
|
156
|
+
padding-right: .5rem;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
`];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
static get properties() {
|
|
164
|
+
return {
|
|
165
|
+
primary: {type: Boolean},
|
|
166
|
+
gradient: {type: Boolean},
|
|
167
|
+
disabled: {type: Boolean},
|
|
168
|
+
text: {type: String}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
constructor() {
|
|
173
|
+
super();
|
|
174
|
+
this.primary = false;
|
|
175
|
+
this.gradient = false;
|
|
176
|
+
this.disabled = false;
|
|
177
|
+
this.text = 'Ok';
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
render() {
|
|
181
|
+
// eslint-disable-next-line lit-a11y/anchor-is-valid
|
|
182
|
+
return html`<a class="${this.gradient ? 'b-gradient' : ''} ${this.primary ? 'primary' : ''}" ?disabled="${this.disabled}">
|
|
183
|
+
${this.text}
|
|
184
|
+
</a>`;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
}
|