@progressive-development/pd-wizard 0.1.59 → 0.1.60

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
@@ -14,7 +14,7 @@
14
14
  "order",
15
15
  "steps"
16
16
  ],
17
- "version": "0.1.59",
17
+ "version": "0.1.60",
18
18
  "main": "index.js",
19
19
  "module": "index.js",
20
20
  "scripts": {
package/src/PdSteps.js CHANGED
@@ -100,7 +100,7 @@ class PdSteps extends LitElement {
100
100
  z-index: 51;
101
101
  width: 100%;
102
102
 
103
- padding-top: 10px;
103
+ padding-top: var(--pd-steps-padding-top, 10px);
104
104
  }
105
105
 
106
106
  .step {
@@ -220,7 +220,7 @@ class PdSteps extends LitElement {
220
220
  background-color: var(--my-hr-bg-color);
221
221
  height: 3px;
222
222
  position: relative;
223
- top: 43px;
223
+ top: calc(33px + var(--pd-steps-padding-top, 10px));
224
224
  z-index: 50;
225
225
  }
226
226
 
package/src/PdWizard.js CHANGED
@@ -7,7 +7,7 @@
7
7
  import { LitElement, html, css } from 'lit';
8
8
  import { msg, updateWhenLocaleChanges } from '@lit/localize';
9
9
 
10
- import { ICON_CLOSE as CLOSEICON } from '@progressive-development/pd-icon/src/PdIcon.js';
10
+ import { ICON_CLOSE as CLOSEICON, ICON_ARROW_BACK, ICON_CAMERA, ICON_NEXT, ICON_PREVIOUS, ICON_XCLOSE } from '@progressive-development/pd-icon/src/PdIcon.js';
11
11
 
12
12
  import '@progressive-development/pd-icon/pd-icon.js';
13
13
  import '@progressive-development/pd-forms/pd-button.js';
@@ -89,12 +89,6 @@ export class PdWizard extends LitElement {
89
89
  top: 6px;
90
90
  right: 6px;
91
91
 
92
- display: flex;
93
- align-items: center;
94
- gap: 5px;
95
-
96
- font-size: 0.8rem;
97
-
98
92
  cursor: pointer;
99
93
 
100
94
  --pd-icon-col: var(--my-header-bg-col);
@@ -117,7 +111,6 @@ export class PdWizard extends LitElement {
117
111
  display: flex;
118
112
  justify-content: var(--pd-wizard-justify-content, center);
119
113
  flex-grow: 1;
120
- height: 100%;
121
114
 
122
115
  background-color: var(--pd-wizard-content-bg-col, var(--pd-default-bg-col));
123
116
  padding: var(--pd-wizard-content-padding, 1em);
@@ -145,6 +138,42 @@ export class PdWizard extends LitElement {
145
138
  border-bottom-right-radius: var(--pd-wizard-bottom-borderradius, 5px);
146
139
  }
147
140
 
141
+ /*
142
+ * CSS for panel wizard
143
+ */
144
+ .wiz-panel-h {
145
+ padding: 0.5em 2.5em 0.5em 2.5em;
146
+ display: flex;
147
+ align-items: center;
148
+ justify-content: space-between;
149
+ }
150
+
151
+ .wiz-panel-h h1 {
152
+ color: var(--pd-default-col);
153
+ padding: 0;
154
+ margin: 0;
155
+ font-size: 1.6em;
156
+ }
157
+
158
+ .header-icons {
159
+ display: flex;
160
+ align-items: center;
161
+ gap: 0.2em;
162
+ }
163
+
164
+ .header-icons pd-icon {
165
+ --pd-icon-stroke-col-active: var(--pd-default-col);
166
+ --pd-icon-col-active: var(--pd-default-light-col);
167
+ --pd-icon-stroke-col: var(--pd-default-col);
168
+ --pd-icon-col: var(--pd-default-light-col);
169
+ cursor: pointer;
170
+ }
171
+
172
+ .panel-close-icon {
173
+ --pd-icon-size: 3em;
174
+ padding-left: 1.8em;
175
+ }
176
+
148
177
 
149
178
  /* Size Elements for small width */
150
179
  @media (max-width: 700px) {
@@ -164,6 +193,7 @@ export class PdWizard extends LitElement {
164
193
  currentNumber: { type: Number },
165
194
  wizardSteps: { Array },
166
195
  logo: { type: Object },
196
+ panelWizard: { type: Boolean },
167
197
  };
168
198
  }
169
199
 
@@ -172,6 +202,7 @@ export class PdWizard extends LitElement {
172
202
  updateWhenLocaleChanges(this);
173
203
  this.currentNumber = -99;
174
204
  this.wizardSteps = [];
205
+ this.panelWizard = false;
175
206
  }
176
207
 
177
208
  render() {
@@ -180,18 +211,38 @@ export class PdWizard extends LitElement {
180
211
 
181
212
  <div class="wiz-header">
182
213
 
183
- <div class="wiz-title">
184
- <slot name="slotLogo"></slot>
185
- <span class="title"
186
- >${this.currentNumber >= 1 && this.wizardSteps
187
- ? this.wizardSteps[this.currentNumber - 1].title
188
- : 'No-Title'}</span
189
- >
190
- <div class="close" @click="${this._closeWizard}">
191
- <span>Close</span>
192
- <pd-icon icon="${CLOSEICON}"></pd-icon>
214
+ ${this.panelWizard ? html`
215
+ <div class="wiz-panel-h">
216
+ <h1>${this.currentNumber >= 1 && this.wizardSteps
217
+ ? this.wizardSteps[this.currentNumber - 1].title
218
+ : 'No-Title'}</h1>
219
+ <div class="header-icons">
220
+ <pd-icon icon="${ICON_ARROW_BACK}" ?disabled="${this.currentNumber === 1}"
221
+ title="Previous Step" activeIcon @click="${this._previousStep}"></pd-icon>
222
+
223
+ ${this.currentNumber !== this.wizardSteps.length ? html`
224
+ <pd-icon style="transform: rotate(180deg);" icon="${ICON_ARROW_BACK}" ?disabled="${this.wizardSteps[this.currentNumber - 1].next === false}"
225
+ title="Next Step" activeIcon @click="${this._nextStep}"></pd-icon>
226
+ ` : html`
227
+ <pd-icon icon="${ICON_CAMERA}"
228
+ title="Submit" activeIcon @click="${this._submit}"></pd-icon>
229
+ `}
230
+
231
+ <pd-icon class="panel-close-icon"
232
+ title="Close" activeIcon icon="${ICON_XCLOSE}" @click="${this._closeWizard}"></pd-icon>
193
233
  </div>
194
234
  </div>
235
+ ` : html`
236
+ <div class="wiz-title">
237
+ <slot name="slotLogo"></slot>
238
+ <span class="title"
239
+ >${this.currentNumber >= 1 && this.wizardSteps
240
+ ? this.wizardSteps[this.currentNumber - 1].title
241
+ : 'No-Title'}</span
242
+ >
243
+ <pd-icon class="close" icon="${CLOSEICON}" @click="${this._closeWizard}"></pd-icon>
244
+ </div>
245
+ `}
195
246
 
196
247
  <div class="wiz-breadcrumbs">
197
248
  <pd-steps
@@ -199,7 +250,7 @@ export class PdWizard extends LitElement {
199
250
  currentStepNr="${this.currentNumber}"
200
251
  ></pd-steps>
201
252
  </div>
202
-
253
+
203
254
  </div>
204
255
 
205
256
  <div class="wiz-content">
@@ -224,6 +275,7 @@ export class PdWizard extends LitElement {
224
275
 
225
276
  </div>
226
277
 
278
+ ${!this.panelWizard ? html`
227
279
  <div class="wiz-buttons">
228
280
  ${this.currentNumber >= 1 && this.wizardSteps
229
281
  ? html`
@@ -251,6 +303,7 @@ export class PdWizard extends LitElement {
251
303
  `
252
304
  : ''}
253
305
  </div>
306
+ ` : ''}
254
307
  `;
255
308
  }
256
309
  return '';
@@ -59,6 +59,10 @@ function WizardPanelTemplate({ wizardSteps, currentNumber }) {
59
59
  display: block;
60
60
  }
61
61
 
62
+ :host {
63
+ display: block;
64
+ }
65
+
62
66
  /* The Modal (background) */
63
67
  .modal {
64
68
  position: fixed; /* Stay in place */
@@ -72,26 +76,42 @@ function WizardPanelTemplate({ wizardSteps, currentNumber }) {
72
76
 
73
77
  width: 100%; /* Full width */
74
78
  height: 100%; /* Full height */
75
- overflow: auto;
79
+ overflow: hidden;
76
80
  /* RGBA Wert muss hier verwendet werden #AFC1D2 to rgba for opacity */
77
- background-color: var(--pd-popup-modal-bg-rgba, rgba(175, 193, 210, 0.8));
81
+ background-color: var(--pd-modal-panel-bg-rgba, rgba(175, 193, 210, 0.8));
78
82
  }
79
83
 
80
84
  .content {
81
- background-color: var(--pd-loading-state-bg-col, #edf7fd);
82
- border: 2px solid var(--pd-loading-state-bg-col, var(--pd-default-col, #067394));
83
- z-index: 101; /* Sit on top */
85
+ background-color: var(--pd-modal-panel-content-bg-col, var(--pd-default-bg-col, #edf7fd));
86
+ border: 2px solid var(--pd-modal-panel-content-border-col, var(--pd-default-col, #067394));
87
+ border-radius: 5px;
88
+
89
+ height: var(--pd-modal-panel-content-height, auto);
90
+ height: var(--pd-modal-panel-content-min-height, auto);
91
+ max-height: var(--pd-modal-panel-content-max-height, auto);
92
+ min-width: var(--pd-modal-panel-content-min-width, auto);
93
+ padding: var(--pd-modal-panel-content-padding, 0);
94
+ margin: var(--pd-modal-panel-content-margin, 1em);
95
+ }
96
+
97
+ .event-details-panel {
98
+ --pd-modal-panel-content-bg-col: white;
99
+ --pd-modal-panel-content-max-height: 90%;
100
+ }
84
101
 
85
- height: 90%;
86
- margin: 1em;
102
+ .event-wizard-panel {
103
+ --pd-modal-panel-content-min-width: 60%;
104
+ --pd-modal-panel-content-min-height: 45em;
105
+ --pd-steps-padding-top: 0px;
87
106
  }
88
107
  </style>
89
108
 
90
- <div id="modalId" class="modal">
109
+ <div id="modalId" class="modal event-wizard-panel">
91
110
  <div class="content">
92
111
 
93
112
  <pd-wizard
94
113
  id="wizardId"
114
+ panelWizard
95
115
  .wizardSteps="${wizardSteps}"
96
116
  currentNumber="${currentNr}"
97
117
  @previous-step="${() => {currentNr -= 1; console.log("Hier hin");}}"