@progressive-development/pd-wizard 0.0.6 → 0.0.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/LICENSE CHANGED
@@ -1,21 +1,2 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 pd-wizard
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ No License, all rights reserved
2
+ @2021 - PD Progressive Development UG
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progressive-development/pd-wizard",
3
3
  "description": "Webcomponent pd-wizard following open-wc recommendations",
4
- "license": "MIT",
4
+ "license": "SEE LICENSE IN LICENSE",
5
5
  "author": "PD Progressive Development",
6
6
  "directories": {
7
7
  "test": "test"
@@ -14,7 +14,7 @@
14
14
  "order",
15
15
  "steps"
16
16
  ],
17
- "version": "0.0.6",
17
+ "version": "0.0.8",
18
18
  "main": "index.js",
19
19
  "module": "index.js",
20
20
  "scripts": {
package/src/PdSteps.js CHANGED
@@ -1,306 +1,308 @@
1
1
  /* eslint-disable lit-a11y/click-events-have-key-events */
2
2
  /**
3
3
  * @license
4
- * Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
5
- * This code may only be used under the BSD style license found at
6
- * http://polymer.github.io/LICENSE.txt
7
- * The complete set of authors may be found at
8
- * http://polymer.github.io/AUTHORS.txt
9
- * The complete set of contributors may be found at
10
- * http://polymer.github.io/CONTRIBUTORS.txt
11
- * Code distributed by Google as part of the polymer project is also
12
- * subject to an additional IP rights grant found at
13
- * http://polymer.github.io/PATENTS.txt
4
+ * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
14
5
  */
15
6
 
16
- import {LitElement, html, css} from 'lit';
7
+ import { LitElement, html, css } from 'lit';
17
8
 
18
- /**
19
- * An example element.
20
- *
21
- * @slot - This element has a slot
22
- * @csspart button - The button
23
- */
9
+ /**
10
+ * An example element.
11
+ *
12
+ * @slot - This element has a slot
13
+ * @csspart button - The button
14
+ */
24
15
  class PdSteps extends LitElement {
25
-
26
- /**
27
- * Fired when `step` (when not current) clicked.
28
- * @event step-clicked
29
- */
30
-
31
- static get styles() {
32
- return css`
33
- :host {
34
-
35
- --my-font: var(--app-font, Oswald);
36
- --my-step-text-color: var(--squi-test, #177E89);
37
- --my-step-current-text-color: var(--squi-test, #fefefe);
38
-
39
- --my-step-current-name-circle-color: var(--squi-test, #FFC857);
40
- --my-step-passed-name-circle-color: var(--squi-test, #fefefe);
41
- --my-step-name-circle-color: var(--squi-test, #fefefe);
42
-
43
- --my-step-unfinished-border-color: var(--squi-test, #fefefe);
44
- --my-step-passed-border-color: var(--squi-test, #fefefe);
45
- --my-step-current-border-color: var(--squi-test, #fefefe);
46
-
47
- --my-step-unfinished-color: var(--squi-test, #fefefe);
48
- --my-step-passed-color: var(--squi-test, #fefefe);
49
- --my-step-passed-gradient-color: var(--squi-test, #084c61);
50
- --my-step-current-color: var(--squi-test, #177E89);
51
- --my-step-current-gradient-color: var(--squi-test, #f3d7a0);
52
-
53
- --my-step-hover-color: var(--squi-test, #3ab6db);
54
-
55
- --my-bg-color: var(--squi-step-bg-color, #177E89);
56
- --my-hr-bg-color: var(--squi-hr-bg-color, #fefefe);
57
-
58
- display: block;
59
- background-color: var(--my-bg-color);
60
-
61
- /* Hack => Wegen HR Linie wird das elemt 10 nach oben geschoben, sonst immer Abstand <hr> block display etc. => wie zu lösen? */
62
- margin-top: -10px;
63
-
64
- }
65
-
66
- .parent {
67
- display: flex;
68
- /*
16
+ /**
17
+ * Fired when `step` (when not current) clicked.
18
+ * @event step-clicked
19
+ */
20
+
21
+ static get styles() {
22
+ return css`
23
+ :host {
24
+ --my-font: var(--app-font, Oswald);
25
+ --my-step-text-color: var(--squi-test, #177e89);
26
+ --my-step-current-text-color: var(--squi-test, #fefefe);
27
+
28
+ --my-step-current-name-circle-color: var(--squi-test, #ffc857);
29
+ --my-step-passed-name-circle-color: var(--squi-test, #fefefe);
30
+ --my-step-name-circle-color: var(--squi-test, #fefefe);
31
+
32
+ --my-step-unfinished-border-color: var(--squi-test, #fefefe);
33
+ --my-step-passed-border-color: var(--squi-test, #fefefe);
34
+ --my-step-current-border-color: var(--squi-test, #fefefe);
35
+
36
+ --my-step-unfinished-color: var(--squi-test, #fefefe);
37
+ --my-step-passed-color: var(--squi-test, #fefefe);
38
+ --my-step-passed-gradient-color: var(--squi-test, #084c61);
39
+ --my-step-current-color: var(--squi-test, #177e89);
40
+ --my-step-current-gradient-color: var(--squi-test, #f3d7a0);
41
+
42
+ --my-step-hover-color: var(--squi-test, #3ab6db);
43
+
44
+ --my-bg-color: var(--squi-step-bg-color, #177e89);
45
+ --my-hr-bg-color: var(--squi-hr-bg-color, #fefefe);
46
+
47
+ display: block;
48
+ background-color: var(--my-bg-color);
49
+
50
+ /* Hack => Wegen HR Linie wird das elemt 10 nach oben geschoben, sonst immer Abstand <hr> block display etc. => wie zu lösen? */
51
+ margin-top: -10px;
52
+ }
53
+
54
+ .parent {
55
+ display: flex;
56
+ /*
69
57
  flex-direction: row; /* default *
70
58
  flex-wrap: nowrap; /* default *
71
59
  */
72
- /* short hand for above lines => default, not needed */
73
- flex-flow: row nowrap;
74
- align-items: center;
75
- /*height: 50px; /* Or whatever */
76
- padding-bottom: 10px;
77
-
78
- }
79
-
80
- .parent.circle {
81
- justify-content: space-around;
82
- }
83
-
84
- .parent.tab {
85
- justify-content: start;
86
- }
87
-
88
- /* Eingeführt, um den Text unter dem Circle zentral darzustellen => !Funktioniert nur für circle im Augenblick*/
89
- .step-container {
90
- display: flex;
91
- flex-direction: column;
92
- align-items: center;
93
-
94
- text-align: center;
95
- z-index: 51;
96
- width: 100%;
97
- }
98
-
99
- .step {
100
- /*margin: auto; /* Magic!/*/
101
-
102
- }
103
-
104
- .step.circle {
105
- width: 40px; /* Or whatever */
106
- height: 40px; /* Or whatever */
107
- border-radius: 50%;
108
-
109
- border: solid 1px var(--my-step-unfinished-border-color);
110
- box-shadow: 1px 1px grey;
111
- /*background-image: linear-gradient(to right, var(--my-step-unfinished-color), lightgrey);*/
112
- background-color: var(--my-step-unfinished-color);
113
- }
114
-
115
- .step.tab {
116
- width: 100%;
117
- max-width: 250px;
118
- height: 40px;
119
- border: solid 1px var(--my-step-unfinished-border-color);
120
- box-shadow: 1px 1px grey;
121
- background-image: linear-gradient(to right, var(--my-step-unfinished-color) , grey);
122
- cursor: pointer;
123
- }
124
-
125
- .step.tab:hover:not(.current) {
126
- border: solid 1px yellow;
127
- background-image: linear-gradient(to right, var(--my-step-hover-color), grey);
128
- }
129
-
130
- .circle.passed {
131
- /*background-image: linear-gradient(to right, var(--my-step-passed-color) , var(--my-step-passed-gradient-color)); */
132
- background-color: var(--my-step-passed-color);
133
- border: solid 2px var(--my-step-passed-border-color);
134
- cursor: pointer;
135
- }
136
-
137
- .circle.passed:hover {
138
- background-color: var(--my-step-current-name-circle-color);
139
- }
140
-
141
- .circle.current {
142
- /*background-image: linear-gradient(to right, var(--my-step-current-color) , var(--my-step-current-gradient-color)); */
143
- background-color: var(--my-step-current-color);
144
- border: solid 2px var(--my-step-current-border-color);
145
- }
146
-
147
- .tab.current {
148
- background-image: linear-gradient(to right, var(--my-step-current-color), grey);
149
- box-shadow: 1px 1px grey;
150
- border-color: var(--my-step-current-border-color);
151
- cursor: auto;
152
- }
153
-
154
- .step-nr {
155
- font-family: var(--my-font);
156
- color: var(--my-step-text-color);
157
- font-weight: bold;
158
- font-size: 1.5em;
159
- line-height: 37px;
160
- pointer-events: none;
161
- }
162
-
163
- /* Style Tab ohne Step Nr /*/
164
- .tab .step-nr {
165
- display: none;
166
- }
167
-
168
- .step-name {
169
- color: var(--my-step-text-color);
170
- font-family: var(--my-font);
171
- font-size: 1em;
172
- }
173
-
174
- /* Style Circle ohne Step Name => ToDo: Nur ab bestimmter Breite /*/
175
- .circle .step-name {
176
- white-space: nowrap;
177
- color: var(--my-step-name-circle-color);
178
- /* display: none; */
179
- font-weight: bold;
180
- padding-top: 8px;
181
- }
182
-
183
- .circle .step-name.passed {
184
- color: var(--my-step-passed-name-circle-color);
185
- }
186
-
187
- .circle .step-name.current {
188
- color: var(--my-step-current-name-circle-color);
189
- }
190
-
191
- .circle .step-nr.current {
192
- color: var(--my-step-current-text-color);
193
- }
194
-
195
- /* used for circle style */
196
- hr {
197
- /*background: linear-gradient(to right, var(--my-step-passed-color) , var(--my-step-unfinished-color));*/
198
- background-color: var(--my-hr-bg-color);
199
- height: 3px;
200
- position: relative;
201
- top: 33px;
202
- z-index: 50;
203
- width: 100%;
204
- }
205
-
206
- /* Size Elements for small width */
207
- @media (max-width: 600px) {
208
- .parent {
209
- /*height: 30px; /* Or whatever */
210
- }
211
- .step.circle {
212
- height: 30px; /* Or whatever */
213
- width: 30px;
214
- }
215
- .step.tab {
216
- height: 30px; /* Or whatever */
217
- }
218
- hr {
219
- height: 2px;
220
- top: 28px;
221
- }
222
- .step-nr {
223
- font-size: 1.2em;
224
- text-align: center;
225
- line-height: 28px;
226
- }
227
- .step-name {
228
- font-size: 0.9em;
229
- }
230
-
231
- .circle .step-name {
232
- padding-top: 3px;
233
- }
234
- }
235
- `;
236
- }
237
-
238
- static get properties() {
239
- return {
240
- /**
241
- * The steps for this component
242
- */
243
- steps: {type: Array},
244
- currentStepNr: {type: Number},
245
- styleTyp: {type: String}
246
- };
247
- }
248
-
249
- constructor() {
250
- super();
251
- this.steps = [];
252
- this.currentStepNr = -99;
253
- this.styleTyp = 'circle';
254
- }
255
-
256
- render() {
257
- switch (this.styleTyp) {
258
- // TODO: Noch das gleiche, ggf. später gebraucht...
259
- case 'circle':
260
- return this._renderCircle();
261
- case 'tab':
262
- return this._renderCircle();
263
- default:
264
- return '';
265
- }
266
- }
267
-
268
- _renderCircle() {
269
- return html`
270
- ${this.styleTyp === 'circle' ? html`<hr/>` : ''}
271
- <div class="parent ${this.styleTyp}">
272
- ${this.steps.map((st, index) => {
273
- let pClass = ''
274
- if (this.currentStepNr > index) {
275
- pClass = this.currentStepNr === (index + 1) ? 'current' : 'passed';
276
- }
277
- return html`
278
- <div class="step-container">
279
- <div class="step ${this.styleTyp} ${pClass}" data-step="${index + 1}" @click="${this._stepClicked}">
280
- <span class="step-nr ${pClass}">${index + 1}</span>
281
- </div>
282
- <span class="step-name ${pClass}">${st.name}</span>
283
- </div>
284
-
285
- `})}
60
+ /* short hand for above lines => default, not needed */
61
+ flex-flow: row nowrap;
62
+ align-items: center;
63
+ /*height: 50px; /* Or whatever */
64
+ padding-bottom: 10px;
65
+ }
66
+
67
+ .parent.circle {
68
+ justify-content: space-around;
69
+ }
70
+
71
+ .parent.tab {
72
+ justify-content: start;
73
+ }
74
+
75
+ /* Eingeführt, um den Text unter dem Circle zentral darzustellen => !Funktioniert nur für circle im Augenblick*/
76
+ .step-container {
77
+ display: flex;
78
+ flex-direction: column;
79
+ align-items: center;
80
+
81
+ text-align: center;
82
+ z-index: 51;
83
+ width: 100%;
84
+ }
85
+
86
+ .step {
87
+ /*margin: auto; /* Magic!/*/
88
+ }
89
+
90
+ .step.circle {
91
+ width: 40px; /* Or whatever */
92
+ height: 40px; /* Or whatever */
93
+ border-radius: 50%;
94
+
95
+ border: solid 1px var(--my-step-unfinished-border-color);
96
+ box-shadow: 1px 1px grey;
97
+ /*background-image: linear-gradient(to right, var(--my-step-unfinished-color), lightgrey);*/
98
+ background-color: var(--my-step-unfinished-color);
99
+ }
100
+
101
+ .step.tab {
102
+ width: 100%;
103
+ max-width: 250px;
104
+ height: 40px;
105
+ border: solid 1px var(--my-step-unfinished-border-color);
106
+ box-shadow: 1px 1px grey;
107
+ background-image: linear-gradient(
108
+ to right,
109
+ var(--my-step-unfinished-color),
110
+ grey
111
+ );
112
+ cursor: pointer;
113
+ }
114
+
115
+ .step.tab:hover:not(.current) {
116
+ border: solid 1px yellow;
117
+ background-image: linear-gradient(
118
+ to right,
119
+ var(--my-step-hover-color),
120
+ grey
121
+ );
122
+ }
123
+
124
+ .circle.passed {
125
+ /*background-image: linear-gradient(to right, var(--my-step-passed-color) , var(--my-step-passed-gradient-color)); */
126
+ background-color: var(--my-step-passed-color);
127
+ border: solid 2px var(--my-step-passed-border-color);
128
+ cursor: pointer;
129
+ }
130
+
131
+ .circle.passed:hover {
132
+ background-color: var(--my-step-current-name-circle-color);
133
+ }
134
+
135
+ .circle.current {
136
+ /*background-image: linear-gradient(to right, var(--my-step-current-color) , var(--my-step-current-gradient-color)); */
137
+ background-color: var(--my-step-current-color);
138
+ border: solid 2px var(--my-step-current-border-color);
139
+ }
140
+
141
+ .tab.current {
142
+ background-image: linear-gradient(
143
+ to right,
144
+ var(--my-step-current-color),
145
+ grey
146
+ );
147
+ box-shadow: 1px 1px grey;
148
+ border-color: var(--my-step-current-border-color);
149
+ cursor: auto;
150
+ }
151
+
152
+ .step-nr {
153
+ font-family: var(--my-font);
154
+ color: var(--my-step-text-color);
155
+ font-weight: bold;
156
+ font-size: 1.5em;
157
+ line-height: 37px;
158
+ pointer-events: none;
159
+ }
160
+
161
+ /* Style Tab ohne Step Nr /*/
162
+ .tab .step-nr {
163
+ display: none;
164
+ }
165
+
166
+ .step-name {
167
+ color: var(--my-step-text-color);
168
+ font-family: var(--my-font);
169
+ font-size: 1em;
170
+ }
171
+
172
+ /* Style Circle ohne Step Name => ToDo: Nur ab bestimmter Breite /*/
173
+ .circle .step-name {
174
+ white-space: nowrap;
175
+ color: var(--my-step-name-circle-color);
176
+ /* display: none; */
177
+ font-weight: bold;
178
+ padding-top: 8px;
179
+ }
180
+
181
+ .circle .step-name.passed {
182
+ color: var(--my-step-passed-name-circle-color);
183
+ }
184
+
185
+ .circle .step-name.current {
186
+ color: var(--my-step-current-name-circle-color);
187
+ }
188
+
189
+ .circle .step-nr.current {
190
+ color: var(--my-step-current-text-color);
191
+ }
192
+
193
+ /* used for circle style */
194
+ hr {
195
+ /*background: linear-gradient(to right, var(--my-step-passed-color) , var(--my-step-unfinished-color));*/
196
+ background-color: var(--my-hr-bg-color);
197
+ height: 3px;
198
+ position: relative;
199
+ top: 33px;
200
+ z-index: 50;
201
+ width: 100%;
202
+ }
203
+
204
+ /* Size Elements for small width */
205
+ @media (max-width: 600px) {
206
+ .parent {
207
+ /*height: 30px; /* Or whatever */
208
+ }
209
+ .step.circle {
210
+ height: 30px; /* Or whatever */
211
+ width: 30px;
212
+ }
213
+ .step.tab {
214
+ height: 30px; /* Or whatever */
215
+ }
216
+ hr {
217
+ height: 2px;
218
+ top: 28px;
219
+ }
220
+ .step-nr {
221
+ font-size: 1.2em;
222
+ text-align: center;
223
+ line-height: 28px;
224
+ }
225
+ .step-name {
226
+ font-size: 0.9em;
227
+ }
228
+
229
+ .circle .step-name {
230
+ padding-top: 3px;
231
+ }
232
+ }
233
+ `;
234
+ }
235
+
236
+ static get properties() {
237
+ return {
238
+ /**
239
+ * The steps for this component
240
+ */
241
+ steps: { type: Array },
242
+ currentStepNr: { type: Number },
243
+ styleTyp: { type: String },
244
+ };
245
+ }
246
+
247
+ constructor() {
248
+ super();
249
+ this.steps = [];
250
+ this.currentStepNr = -99;
251
+ this.styleTyp = 'circle';
252
+ }
253
+
254
+ render() {
255
+ switch (this.styleTyp) {
256
+ // TODO: Noch das gleiche, ggf. später gebraucht...
257
+ case 'circle':
258
+ return this._renderCircle();
259
+ case 'tab':
260
+ return this._renderCircle();
261
+ default:
262
+ return '';
263
+ }
264
+ }
265
+
266
+ _renderCircle() {
267
+ return html`
268
+ ${this.styleTyp === 'circle' ? html`<hr />` : ''}
269
+ <div class="parent ${this.styleTyp}">
270
+ ${this.steps.map((st, index) => {
271
+ let pClass = '';
272
+ if (this.currentStepNr > index) {
273
+ pClass = this.currentStepNr === index + 1 ? 'current' : 'passed';
274
+ }
275
+ return html`
276
+ <div class="step-container">
277
+ <div
278
+ class="step ${this.styleTyp} ${pClass}"
279
+ data-step="${index + 1}"
280
+ @click="${this._stepClicked}"
281
+ >
282
+ <span class="step-nr ${pClass}">${index + 1}</span>
283
+ </div>
284
+ <span class="step-name ${pClass}">${st.name}</span>
285
+ </div>
286
+ `;
287
+ })}
286
288
  </div>
287
- `;
288
- }
289
-
290
- _stepClicked(e) {
291
- const stepNr = e.target.dataset.step;
292
- if (stepNr < this.currentStepNr) {
293
- this.dispatchEvent(new CustomEvent('go-to', {
294
- detail: {
295
- step: stepNr
296
- },
297
- bubbles: true,
298
- composed: true
299
- }));
300
- }
301
- }
302
-
303
- }
304
-
305
- window.customElements.define('pd-steps', PdSteps);
306
-
289
+ `;
290
+ }
291
+
292
+ _stepClicked(e) {
293
+ const stepNr = e.target.dataset.step;
294
+ if (stepNr < this.currentStepNr) {
295
+ this.dispatchEvent(
296
+ new CustomEvent('go-to', {
297
+ detail: {
298
+ step: stepNr,
299
+ },
300
+ bubbles: true,
301
+ composed: true,
302
+ })
303
+ );
304
+ }
305
+ }
306
+ }
307
+
308
+ window.customElements.define('pd-steps', PdSteps);
package/src/PdWizard.js CHANGED
@@ -1,300 +1,358 @@
1
1
  /**
2
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
3
+ * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
13
4
  */
14
5
 
15
- import { LitElement, html, css, svg } from 'lit';
6
+ import { LitElement, html, css } from 'lit';
16
7
 
17
8
  import '@progressive-development/pd-forms/PdButton.js';
18
9
  import './PdSteps.js';
19
-
20
- /**
21
- * An example element.
22
- *
23
- * @slot - This element has a slot
24
- * @csspart button - The button
25
- */
26
- export class PdWizard extends LitElement {
27
- /**
28
- * Fired when next step clicked
29
- * @event next-step
30
- */
31
-
32
- /**
33
- * Fired when previous step clicked
34
- * @event previous-step
35
- */
36
-
37
- /**
38
- * Fired when wizard submited
39
- * @event submit-wizard
40
- */
41
- /**
42
- * Fired when wizard submited
43
- * @event close-wizard
44
- */
45
-
46
- static get styles() {
47
- return css`
48
- :host {
49
- --my-font: var(--app-font, Oswald);
50
-
51
- --my-header-background-color: var(--squi-test, #084c61);
52
- --my-header-text-color: var(--squi-test, white);
53
-
54
- --my-footer-background-color: var(--squi-test, #fefefe);
55
-
56
- display: block;
57
- /*min-height: 100%;*/
58
- height: 100%;
59
- }
60
-
61
- /* Layout Grid for the Wizard Component
10
+
11
+ // TODO: dont get it running with attribute???
12
+ export const ticomiLogo = html`
13
+ <svg
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ viewBox="0 0 298.09 120.94"
16
+ class="logo"
17
+ >
18
+ <g id="Ebene_2" data-name="Ebene 2">
19
+ <!--g style="fill: var(--logo-fill-1,#15a1dc)"-->
20
+ <g id="Ebene_1-2" data-name="Ebene 1">
21
+ <path
22
+ d="M115.21,72.59c-2,0-3.5-1.46-3.5-4.68V48.68h7.2V44h-7.17l.12-9.64h-7l-3.49,9.6-5,.65v4.1h4.44V61.75c0,2.68-.07,4.52-.07,6.91,0,6.78,3.64,9.55,9.87,9.55,5,0,8.23-2,10.05-5.49l-1.68-1.65A6.16,6.16,0,0,1,115.21,72.59Z"
23
+ style="fill:#fff"
24
+ ></path>
25
+ <path
26
+ d="M136.92,62.74V53.63l.21-10L136,42.92l-14.38,4.57v2.7l4.24.62c.14,2.75.21,4.88.21,8.66v3.27c0,2.89,0,7.08-.1,10.43l-3.69.8v3.2h18.22V74L137,73.26C137,69.89,136.92,65.66,136.92,62.74Z"
27
+ style="fill:#fff"
28
+ ></path>
29
+ <ellipse
30
+ cx="131.35"
31
+ cy="32.37"
32
+ rx="5.82"
33
+ ry="5.47"
34
+ style="fill:#fff"
35
+ ></ellipse>
36
+ <path
37
+ d="M163.55,46.46a10.9,10.9,0,0,1,1.29.08l.44,3.46c.33,4.84,2.56,6.51,5.27,6.51,2.47,0,3.89-1.12,4.63-3.58-.5-5.48-5.58-10-12.83-10-10.25,0-18.55,6.51-18.55,17.74,0,11.55,7.74,17.55,17.1,17.55,6.5,0,11.44-2.67,14.09-8.27l-2.39-2.11a9.87,9.87,0,0,1-7.73,3.82c-5.77,0-9.57-4.34-9.57-12.25C155.3,50.11,159.6,46.46,163.55,46.46Z"
38
+ style="fill:#fff"
39
+ ></path>
40
+ <path
41
+ d="M196.07,42.92c-9.83,0-17.44,6.95-17.44,17.51s6.72,17.78,17.44,17.78,17.44-7.07,17.44-17.78S205.86,42.92,196.07,42.92Zm0,31.7c-3.88,0-5.81-4.24-5.81-14s1.93-14.07,5.81-14.07,5.81,4.32,5.81,14.07S199.92,74.62,196.07,74.62Z"
42
+ style="fill:#fff"
43
+ ></path>
44
+ <path
45
+ d="M272.87,62.74V55.07c0-8.16-3.08-12.15-10-12.15-3.92,0-7.26,1.47-11.09,6.12-1.35-4.09-4.39-6.12-9.07-6.12-4.13,0-7.47,1.94-10.76,5.8l-.41-5.06-1.18-.74L216.8,47.49v2.7l4.2.62c.19,2.75.21,4.18.21,8v4c0,2.89,0,7.07-.1,10.43l-3.7.8v3.2h18.07V74l-3.23-.69c-.06-3.37-.1-7.62-.1-10.54V52.07a9.42,9.42,0,0,1,5.68-2.5c3,0,4,1.76,4,6.56v6.61c0,3,0,7.1-.09,10.43l-3.56.8v3.2h17.73V74l-3.23-.7c-.07-3.34-.1-7.52-.1-10.53v-8a22.71,22.71,0,0,0-.15-2.69,9.14,9.14,0,0,1,5.8-2.48c2.82,0,3.91,1.36,3.91,6.52v6.65c0,3,0,7.11-.09,10.44l-3.32.79v3.2H276.4V74L273,73.24C272.9,69.91,272.87,65.74,272.87,62.74Z"
46
+ style="fill:#fff"
47
+ ></path>
48
+ <ellipse
49
+ cx="288.99"
50
+ cy="32.37"
51
+ rx="5.82"
52
+ ry="5.47"
53
+ style="fill:#fff"
54
+ ></ellipse>
55
+ <path
56
+ d="M294.66,73.26c-.06-3.37-.09-7.6-.09-10.52V53.63l.2-10-1.18-.74-14.38,4.57v2.7l4.24.62c.14,2.75.21,4.88.21,8.66v3.27c0,2.89,0,7.08-.1,10.43l-3.69.8v3.2h18.22V74Z"
57
+ style="fill:#fff"
58
+ ></path>
59
+ <path
60
+ d="M100.27,113.34V97.1H96.33V95.29l4-.22.29-7.31h2v7.31h7.32v2H102.6v16.42c0,3.22.81,5.4,4.29,5.4a9.14,9.14,0,0,0,3.17-.8l.61,1.88a14.75,14.75,0,0,1-4.13.94C101.69,120.94,100.27,117.87,100.27,113.34Zm17-5.6c0-8.24,5.36-13.3,11-13.3,6,0,9.67,4.25,9.67,11.68a10.92,10.92,0,0,1-.13,1.89H119.71c.09,6.37,3.82,10.93,9.51,10.93A11.4,11.4,0,0,0,136,116.7l1,1.76a13.84,13.84,0,0,1-8,2.48C122.55,120.94,117.32,116,117.32,107.74Zm18.49-1.64c0-6.45-2.92-9.66-7.46-9.66-4.26,0-8.12,3.62-8.65,9.66Zm10.84,1.64c0-8.44,5.4-13.3,11.54-13.3a10.35,10.35,0,0,1,7.39,3.11l-1.37,1.62a8.57,8.57,0,0,0-6-2.68c-5.16,0-9.15,4.6-9.15,11.25s3.63,11.15,9.12,11.15A10,10,0,0,0,165,116l1.2,1.63a12,12,0,0,1-8.06,3.33C151.59,120.94,146.65,116.09,146.65,107.74Zm29.67-25.25h2.32v11l0,5.56c2.64-2.62,5.26-4.59,8.74-4.59,5.21,0,7.63,3.16,7.63,9.68v16.19h-2.32V104.43c0-5.36-1.69-7.9-5.75-7.9-3,0-5.19,1.59-8.26,4.74v19h-2.32ZM208,95.07h2l.25,3.91h.12c2.57-2.57,5.2-4.54,8.68-4.54,5.22,0,7.64,3.16,7.64,9.68v16.19h-2.32V104.43c0-5.36-1.7-7.9-5.76-7.9-3,0-5.18,1.59-8.25,4.74v19H208Zm31-8.16a2.12,2.12,0,0,1,4.23,0,2.12,2.12,0,0,1-4.23,0Zm.91,8.16h2.32v25.24h-2.32Zm13.85,12.67c0-8.44,5.4-13.3,11.54-13.3a10.35,10.35,0,0,1,7.39,3.11l-1.37,1.62a8.57,8.57,0,0,0-6-2.68c-5.16,0-9.15,4.6-9.15,11.25s3.63,11.15,9.12,11.15a10,10,0,0,0,6.76-2.91l1.2,1.63a12,12,0,0,1-8.06,3.33C258.71,120.94,253.77,116.09,253.77,107.74Zm26.53,9.71,1.34-1.69a11.7,11.7,0,0,0,8,3.2c4,0,6-2.33,6-5,0-3.16-3.27-4.55-6.18-5.6-3.81-1.35-8-2.9-8-7.22,0-3.63,2.88-6.71,8.13-6.71a11.89,11.89,0,0,1,7.22,2.61l-1.25,1.68a9.6,9.6,0,0,0-6-2.31c-3.94,0-5.72,2.27-5.72,4.6,0,2.88,3,4,6,5.11,3.91,1.49,8.24,2.78,8.24,7.7,0,3.8-3,7.11-8.51,7.11A14.39,14.39,0,0,1,280.3,117.45Z"
61
+ style="fill:#fff"
62
+ ></path>
63
+ <path
64
+ d="M74,70.68C74,27.21,29.57,0,29.57,0a121.75,121.75,0,0,1-9,30.61C13.35,46.77,0,57.83,0,76.72c0,24.43,17.1,44.22,37.18,44.22S74,98.27,74,70.68Z"
65
+ style="fill:#db3a34"
66
+ ></path>
67
+ <path
68
+ d="M67.14,78.6C67.14,42,31,19.07,31,19.07a105.49,105.49,0,0,1-7.34,25.78C17.74,58.46,6.86,67.78,6.86,83.7c0,20.57,13.93,37.24,30.29,37.24S67.14,101.84,67.14,78.6Z"
69
+ style="fill:#f7931e"
70
+ ></path>
71
+ <path
72
+ d="M57.92,88.46c0-28.09-25.12-45.67-25.12-45.67a87.16,87.16,0,0,1-5.1,19.78C23.63,73,16.08,80.16,16.08,92.37c0,15.78,9.67,28.57,21,28.57S57.92,106.29,57.92,88.46Z"
73
+ style="fill:#ffc857"
74
+ ></path>
75
+ <path
76
+ d="M47.44,104.74c0-14-12.53-22.77-12.53-22.77a43.35,43.35,0,0,1-2.55,9.86c-2,5.21-5.79,8.77-5.79,14.86,0,7.87,4.82,14.25,10.48,14.25S47.44,113.64,47.44,104.74Z"
77
+ style="fill:#fff"
78
+ ></path>
79
+ </g>
80
+ </g>
81
+ </svg>
82
+ `;
83
+
84
+ /**
85
+ * An example element.
86
+ *
87
+ * @slot - This element has a slot
88
+ * @csspart button - The button
89
+ */
90
+ export class PdWizard extends LitElement {
91
+ /**
92
+ * Fired when next step clicked
93
+ * @event next-step
94
+ */
95
+
96
+ /**
97
+ * Fired when previous step clicked
98
+ * @event previous-step
99
+ */
100
+
101
+ /**
102
+ * Fired when wizard submited
103
+ * @event submit-wizard
104
+ */
105
+ /**
106
+ * Fired when wizard submited
107
+ * @event close-wizard
108
+ */
109
+
110
+ static get styles() {
111
+ return css`
112
+ :host {
113
+ --my-font: var(--app-font, Oswald);
114
+
115
+ --my-header-background-color: var(--squi-test, #084c61);
116
+ --my-header-text-color: var(--squi-test, white);
117
+
118
+ --my-footer-background-color: var(--squi-test, #fefefe);
119
+
120
+ display: block;
121
+ /*min-height: 100%;*/
122
+ height: 100%;
123
+ }
124
+
125
+ /* Layout Grid for the Wizard Component
62
126
  Wird hier für die "Text-Bildschirmgröße" verwendet, umstellen/gleichziehen => verschiedene Implementierungen, die Flex Variante (ticomi-web) scheint am schlankesten...
63
127
  */
64
- .layout-container {
65
- /*min-height: 100%;*/
66
- height: 100%;
67
- display: grid;
68
- grid-template-columns: minmax(10px, auto) minmax(300px, 1000px) minmax(
69
- 5px,
70
- auto
71
- );
72
- /*grid-template-rows: auto minmax(30em, 1fr) 4.166rem; /* ToDo wie 100% hoch????* für content, damit footer unten ist?*/
73
- gap: 1px;
74
- grid-template-areas:
75
- 'header header header'
76
- '. content .'
77
- '. footer .';
78
- }
79
-
80
- /* Grid Area positions for layout container above */
81
- .wiz-header {
82
- grid-area: header;
83
- }
84
- .wiz-content {
85
- grid-area: content;
86
- margin-top: 20px; /* ToDo: Steps sind verschoben, daher hier mehr*/
87
- /*min-height: 100%;*/
88
- height: 100%;
89
- max-width: 1200px;
90
- }
91
-
92
- .wiz-buttons {
93
- grid-area: footer;
94
- display: flex;
95
- /*padding-left: 50px;
128
+ .layout-container {
129
+ /*min-height: 100%;*/
130
+ height: 100%;
131
+ display: grid;
132
+ grid-template-columns: minmax(10px, auto) minmax(300px, 1000px) minmax(
133
+ 5px,
134
+ auto
135
+ );
136
+ /*grid-template-rows: auto minmax(30em, 1fr) 4.166rem; /* ToDo wie 100% hoch????* für content, damit footer unten ist?*/
137
+ gap: 1px;
138
+ grid-template-areas:
139
+ 'header header header'
140
+ '. content .'
141
+ '. footer .';
142
+ }
143
+
144
+ /* Grid Area positions for layout container above */
145
+ .wiz-header {
146
+ grid-area: header;
147
+ }
148
+ .wiz-content {
149
+ grid-area: content;
150
+ margin-top: 20px; /* ToDo: Steps sind verschoben, daher hier mehr*/
151
+ /*min-height: 100%;*/
152
+ height: 100%;
153
+ max-width: 1200px;
154
+ }
155
+
156
+ .wiz-buttons {
157
+ grid-area: footer;
158
+ display: flex;
159
+ /*padding-left: 50px;
96
160
  padding-right: 50px;*/
97
- justify-content: space-between;
98
- background-color: var(--my-footer-background-color);
99
- }
100
-
101
- .wiz-breadcrumbs {
102
- }
103
-
104
- .wiz-title {
105
- text-align: center;
106
- background-color: var(--my-header-background-color);
107
- height: 80px;
108
- line-height: 80px;
109
- padding-left: 80px;
110
- }
111
-
112
- .title {
113
- font-family: var(--my-font);
114
- font-size: 1.8em;
115
- font-weight: bolder;
116
- color: var(--my-header-text-color);
117
- }
118
-
119
- .logo {
120
- max-width: 8rem;
121
- width: 8rem; /* wird sonst im Chrome nicht angezeigt*/
122
- position: absolute;
123
- left: 20px;
124
- top: 10px;
125
- }
126
-
127
- /* The Close Button */
128
- .close {
129
- position: absolute;
130
- color: #fefefe;
131
- font-size: 2.5em;
132
- font-weight: bold;
133
- line-height: 1em;
134
- top: 5px;
135
- right: 10px;
136
- }
137
-
138
- .close:hover,
139
- .close:focus {
140
- color: rgb(247, 211, 8);
141
- text-decoration: none;
142
- cursor: pointer;
143
- }
144
-
145
- /* Size Elements for small width */
146
- @media (max-width: 550px) {
147
- .wiz-title {
148
- height: 60px;
149
- line-height: 60px;
150
- }
151
-
152
- .wiz-breadcrumbs {
153
- }
154
-
155
- .title {
156
- font-size: 1.5em;
157
- }
158
-
159
- .logo {
160
- max-width: 6rem;
161
- width: 6rem; /* wird sonst im Chrome nicht angezeigt*/
162
- }
163
-
164
- .close {
165
- font-size: 1.5em;
166
- right: 5px;
167
- }
168
- }
169
-
170
- /* Size Elements for small width */
171
- @media (max-width: 380px) {
172
- .wiz-title {
173
- text-align: right;
174
- padding-right: 20px;
175
- }
176
-
177
- .title {
178
- font-size: 1.2em;
179
- }
180
- }
181
- `;
182
- }
183
-
184
- static get properties() {
185
- return {
186
- currentNumber: { type: Number },
187
- wizardSteps: { Array },
188
- logo: { type: Object }
189
- };
190
- }
191
-
192
- constructor() {
193
- super();
194
- this.currentNumber = -99;
195
- this.wizardSteps = [];
196
- this.logo = {};
197
- }
198
-
199
- render() {
200
- if (this.wizardSteps && this.wizardSteps.length > 0) {
201
- return html`
202
- <div class="layout-container">
203
- <div class="wiz-header">
204
- <div class="wiz-title">
205
-
206
- ${this.logo && (this.logo.src || this.logo.svg)
207
- ? html`
208
- ${this.logo.src
209
- ? html` <img src="${this.logo.src}" alt="" /> `
210
- : svg`${this.logo.svg}`}
211
- ` : ''}
212
-
213
- <span class="title"
214
- >${this.currentNumber >= 1 && this.wizardSteps
215
- ? this.wizardSteps[this.currentNumber - 1].title
216
- : 'No-Title'}</span
217
- >
218
- <span
219
- class="close"
220
- @click="${this._closeWizard}"
221
- @keypress="${this._closeWizard}"
222
- >&times;</span
223
- >
224
- </div>
225
- <div class="wiz-breadcrumbs">
226
- <pd-steps
227
- .steps="${this.wizardSteps}"
228
- currentStepNr="${this.currentNumber}"
229
- ></pd-steps>
230
- </div>
231
- </div>
232
-
233
- <div class="wiz-content">
234
- <div style="${this.currentNumber === 1 ? '' : 'display:none'}">
235
- <slot name="step-1"></slot>
236
- </div>
237
- <div style="${this.currentNumber === 2 ? '' : 'display:none'}">
238
- <slot name="step-2"></slot>
239
- </div>
240
- <div style="${this.currentNumber === 3 ? '' : 'display:none'}">
241
- <slot name="step-3"></slot>
242
- </div>
243
- <div style="${this.currentNumber === 4 ? '' : 'display:none'}">
244
- <slot name="step-4"></slot>
245
- </div>
246
- </div>
247
-
248
- <div class="wiz-buttons">
249
- ${this.currentNumber >= 1 && this.wizardSteps
250
- ? html`
251
- <squi-button
252
- @click="${this._previousStep}"
253
- text="Terug"
254
- style="visibility: ${this.currentNumber === 1
255
- ? 'hidden'
256
- : 'visible'};"
257
- ></squi-button>
258
- ${this.currentNumber !== this.wizardSteps.length &&
259
- this.wizardSteps[this.currentNumber - 1].next !== false
260
- ? html`<squi-button
261
- @click="${this._nextStep}"
262
- text="Volgende"
263
- ></squi-button>`
264
- : ''}
265
- ${this.currentNumber === this.wizardSteps.length
266
- ? html`<squi-button
267
- primary
268
- @click="${this._submit}"
269
- text="Order"
270
- ></squi-button>`
271
- : ''}
272
- `
273
- : ''}
274
- </div>
275
- </div>
276
- `;
277
- }
278
- return '';
279
- }
280
-
281
- _previousStep() {
282
- this.dispatchEvent(new CustomEvent('previous-step'));
283
- }
284
-
285
- _nextStep() {
286
- this.dispatchEvent(new CustomEvent('next-step'));
287
- }
288
-
289
- _submit() {
290
- this.dispatchEvent(new CustomEvent('submit-wizard'));
291
- }
292
-
293
- _closeWizard() {
294
- // eslint-disable-next-line no-restricted-globals
295
- const r = confirm('Data will be lost, abort current order?');
296
- if (r === true) {
297
- this.dispatchEvent(new CustomEvent('close-wizard'));
298
- }
299
- }
300
- }
161
+ justify-content: space-between;
162
+ background-color: var(--my-footer-background-color);
163
+ }
164
+
165
+ .wiz-breadcrumbs {
166
+ }
167
+
168
+ .wiz-title {
169
+ text-align: center;
170
+ background-color: var(--my-header-background-color);
171
+ height: 80px;
172
+ line-height: 80px;
173
+ padding-left: 80px;
174
+ }
175
+
176
+ .title {
177
+ font-family: var(--my-font);
178
+ font-size: 1.8em;
179
+ font-weight: bolder;
180
+ color: var(--my-header-text-color);
181
+ }
182
+
183
+ .logo {
184
+ max-width: 8rem;
185
+ width: 8rem; /* wird sonst im Chrome nicht angezeigt*/
186
+ position: absolute;
187
+ left: 20px;
188
+ top: 10px;
189
+ }
190
+
191
+ /* The Close Button */
192
+ .close {
193
+ position: absolute;
194
+ color: #fefefe;
195
+ font-size: 2.5em;
196
+ font-weight: bold;
197
+ line-height: 1em;
198
+ top: 5px;
199
+ right: 10px;
200
+ }
201
+
202
+ .close:hover,
203
+ .close:focus {
204
+ color: rgb(247, 211, 8);
205
+ text-decoration: none;
206
+ cursor: pointer;
207
+ }
208
+
209
+ /* Size Elements for small width */
210
+ @media (max-width: 550px) {
211
+ .wiz-title {
212
+ height: 60px;
213
+ line-height: 60px;
214
+ }
215
+
216
+ .wiz-breadcrumbs {
217
+ }
218
+
219
+ .title {
220
+ font-size: 1.5em;
221
+ }
222
+
223
+ .logo {
224
+ max-width: 6rem;
225
+ width: 6rem; /* wird sonst im Chrome nicht angezeigt*/
226
+ }
227
+
228
+ .close {
229
+ font-size: 1.5em;
230
+ right: 5px;
231
+ }
232
+ }
233
+
234
+ /* Size Elements for small width */
235
+ @media (max-width: 380px) {
236
+ .wiz-title {
237
+ text-align: right;
238
+ padding-right: 20px;
239
+ }
240
+
241
+ .title {
242
+ font-size: 1.2em;
243
+ }
244
+ }
245
+ `;
246
+ }
247
+
248
+ static get properties() {
249
+ return {
250
+ currentNumber: { type: Number },
251
+ wizardSteps: { Array },
252
+ logo: { type: Object },
253
+ };
254
+ }
255
+
256
+ constructor() {
257
+ super();
258
+ this.currentNumber = -99;
259
+ this.wizardSteps = [];
260
+ this.logo = {};
261
+ }
262
+
263
+ render() {
264
+ if (this.wizardSteps && this.wizardSteps.length > 0) {
265
+ return html`
266
+ <div class="layout-container">
267
+ <div class="wiz-header">
268
+ <div class="wiz-title">
269
+ ${ticomiLogo}
270
+
271
+ <span class="title"
272
+ >${this.currentNumber >= 1 && this.wizardSteps
273
+ ? this.wizardSteps[this.currentNumber - 1].title
274
+ : 'No-Title'}</span
275
+ >
276
+ <span
277
+ class="close"
278
+ @click="${this._closeWizard}"
279
+ @keypress="${this._closeWizard}"
280
+ >&times;</span
281
+ >
282
+ </div>
283
+ <div class="wiz-breadcrumbs">
284
+ <pd-steps
285
+ .steps="${this.wizardSteps}"
286
+ currentStepNr="${this.currentNumber}"
287
+ ></pd-steps>
288
+ </div>
289
+ </div>
290
+
291
+ <div class="wiz-content">
292
+ <div style="${this.currentNumber === 1 ? '' : 'display:none'}">
293
+ <slot name="step-1"></slot>
294
+ </div>
295
+ <div style="${this.currentNumber === 2 ? '' : 'display:none'}">
296
+ <slot name="step-2"></slot>
297
+ </div>
298
+ <div style="${this.currentNumber === 3 ? '' : 'display:none'}">
299
+ <slot name="step-3"></slot>
300
+ </div>
301
+ <div style="${this.currentNumber === 4 ? '' : 'display:none'}">
302
+ <slot name="step-4"></slot>
303
+ </div>
304
+ </div>
305
+
306
+ <div class="wiz-buttons">
307
+ ${this.currentNumber >= 1 && this.wizardSteps
308
+ ? html`
309
+ <squi-button
310
+ @click="${this._previousStep}"
311
+ text="Terug"
312
+ style="visibility: ${this.currentNumber === 1
313
+ ? 'hidden'
314
+ : 'visible'};"
315
+ ></squi-button>
316
+ ${this.currentNumber !== this.wizardSteps.length &&
317
+ this.wizardSteps[this.currentNumber - 1].next !== false
318
+ ? html`<squi-button
319
+ @click="${this._nextStep}"
320
+ text="Volgende"
321
+ ></squi-button>`
322
+ : ''}
323
+ ${this.currentNumber === this.wizardSteps.length
324
+ ? html`<squi-button
325
+ primary
326
+ @click="${this._submit}"
327
+ text="Order"
328
+ ></squi-button>`
329
+ : ''}
330
+ `
331
+ : ''}
332
+ </div>
333
+ </div>
334
+ `;
335
+ }
336
+ return '';
337
+ }
338
+
339
+ _previousStep() {
340
+ this.dispatchEvent(new CustomEvent('previous-step'));
341
+ }
342
+
343
+ _nextStep() {
344
+ this.dispatchEvent(new CustomEvent('next-step'));
345
+ }
346
+
347
+ _submit() {
348
+ this.dispatchEvent(new CustomEvent('submit-wizard'));
349
+ }
350
+
351
+ _closeWizard() {
352
+ // eslint-disable-next-line no-restricted-globals
353
+ const r = confirm('Data will be lost, abort current order?');
354
+ if (r === true) {
355
+ this.dispatchEvent(new CustomEvent('close-wizard'));
356
+ }
357
+ }
358
+ }
@@ -19,7 +19,9 @@ describe('PdWizard', () => {
19
19
  });
20
20
 
21
21
  it('can override the title via attribute', async () => {
22
- const el = await fixture(html`<pd-wizard title="attribute title"></pd-wizard>`);
22
+ const el = await fixture(
23
+ html`<pd-wizard title="attribute title"></pd-wizard>`
24
+ );
23
25
 
24
26
  expect(el.title).to.equal('attribute title');
25
27
  });