@progressive-development/pd-wizard 0.1.59 → 0.1.61

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.61",
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,43 @@ 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
+ font-family: var(--pd-default-font-title-family);
157
+ }
158
+
159
+ .header-icons {
160
+ display: flex;
161
+ align-items: center;
162
+ gap: 0.2em;
163
+ }
164
+
165
+ .header-icons pd-icon {
166
+ --pd-icon-stroke-col-active: var(--pd-default-col);
167
+ --pd-icon-col-active: var(--pd-default-light-col);
168
+ --pd-icon-stroke-col: var(--pd-default-col);
169
+ --pd-icon-col: var(--pd-default-light-col);
170
+ cursor: pointer;
171
+ }
172
+
173
+ .panel-close-icon {
174
+ --pd-icon-size: 3em;
175
+ padding-left: 1.8em;
176
+ }
177
+
148
178
 
149
179
  /* Size Elements for small width */
150
180
  @media (max-width: 700px) {
@@ -164,6 +194,7 @@ export class PdWizard extends LitElement {
164
194
  currentNumber: { type: Number },
165
195
  wizardSteps: { Array },
166
196
  logo: { type: Object },
197
+ panelWizard: { type: Boolean },
167
198
  };
168
199
  }
169
200
 
@@ -172,6 +203,7 @@ export class PdWizard extends LitElement {
172
203
  updateWhenLocaleChanges(this);
173
204
  this.currentNumber = -99;
174
205
  this.wizardSteps = [];
206
+ this.panelWizard = false;
175
207
  }
176
208
 
177
209
  render() {
@@ -180,18 +212,38 @@ export class PdWizard extends LitElement {
180
212
 
181
213
  <div class="wiz-header">
182
214
 
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>
215
+ ${this.panelWizard ? html`
216
+ <div class="wiz-panel-h">
217
+ <h1>${this.currentNumber >= 1 && this.wizardSteps
218
+ ? this.wizardSteps[this.currentNumber - 1].title
219
+ : 'No-Title'}</h1>
220
+ <div class="header-icons">
221
+ <pd-icon icon="${ICON_ARROW_BACK}" ?disabled="${this.currentNumber === 1}"
222
+ title="Previous Step" activeIcon @click="${this._previousStep}"></pd-icon>
223
+
224
+ ${this.currentNumber !== this.wizardSteps.length ? html`
225
+ <pd-icon style="transform: rotate(180deg);" icon="${ICON_ARROW_BACK}" ?disabled="${this.wizardSteps[this.currentNumber - 1].next === false}"
226
+ title="Next Step" activeIcon @click="${this._nextStep}"></pd-icon>
227
+ ` : html`
228
+ <pd-icon icon="${ICON_CAMERA}"
229
+ title="Submit" activeIcon @click="${this._submit}"></pd-icon>
230
+ `}
231
+
232
+ <pd-icon class="panel-close-icon"
233
+ title="Close" activeIcon icon="${ICON_XCLOSE}" @click="${this._closeWizard}"></pd-icon>
193
234
  </div>
194
235
  </div>
236
+ ` : html`
237
+ <div class="wiz-title">
238
+ <slot name="slotLogo"></slot>
239
+ <span class="title"
240
+ >${this.currentNumber >= 1 && this.wizardSteps
241
+ ? this.wizardSteps[this.currentNumber - 1].title
242
+ : 'No-Title'}</span
243
+ >
244
+ <pd-icon class="close" icon="${CLOSEICON}" @click="${this._closeWizard}"></pd-icon>
245
+ </div>
246
+ `}
195
247
 
196
248
  <div class="wiz-breadcrumbs">
197
249
  <pd-steps
@@ -199,7 +251,7 @@ export class PdWizard extends LitElement {
199
251
  currentStepNr="${this.currentNumber}"
200
252
  ></pd-steps>
201
253
  </div>
202
-
254
+
203
255
  </div>
204
256
 
205
257
  <div class="wiz-content">
@@ -224,6 +276,7 @@ export class PdWizard extends LitElement {
224
276
 
225
277
  </div>
226
278
 
279
+ ${!this.panelWizard ? html`
227
280
  <div class="wiz-buttons">
228
281
  ${this.currentNumber >= 1 && this.wizardSteps
229
282
  ? html`
@@ -251,6 +304,7 @@ export class PdWizard extends LitElement {
251
304
  `
252
305
  : ''}
253
306
  </div>
307
+ ` : ''}
254
308
  `;
255
309
  }
256
310
  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");}}"