@progressive-development/pd-dialog 0.5.7 → 0.6.0
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/dist/generated/locale-codes.d.ts +14 -0
- package/dist/generated/locale-codes.d.ts.map +1 -0
- package/dist/generated/locales/be.d.ts +5 -0
- package/dist/generated/locales/be.d.ts.map +1 -0
- package/dist/generated/locales/de.d.ts +5 -0
- package/dist/generated/locales/de.d.ts.map +1 -0
- package/dist/generated/locales/en.d.ts +5 -0
- package/dist/generated/locales/en.d.ts.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -6
- package/dist/locales/be.d.ts +2 -0
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/pd-popup-dialog.d.ts +30 -0
- package/dist/pd-popup-dialog.d.ts.map +1 -0
- package/dist/pd-popup-dialog.js +210 -4
- package/dist/pd-popup.d.ts +25 -0
- package/dist/pd-popup.d.ts.map +1 -0
- package/dist/pd-popup.js +117 -4
- package/dist/pd-submit-dialog.d.ts +30 -0
- package/dist/pd-submit-dialog.d.ts.map +1 -0
- package/dist/pd-submit-dialog.js +202 -4
- package/dist/stories/pd-popup-dialog.stories.d.ts +20 -0
- package/dist/stories/pd-popup-dialog.stories.d.ts.map +1 -0
- package/dist/stories/pd-popup.stories.d.ts +24 -0
- package/dist/stories/pd-popup.stories.d.ts.map +1 -0
- package/dist/stories/pd-submit-dialog.stories.d.ts +33 -0
- package/dist/stories/pd-submit-dialog.stories.d.ts.map +1 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/package.json +81 -95
- package/dist/src/PdPopup.js +0 -112
- package/dist/src/PdPopupDialog.js +0 -188
- package/dist/src/PdSubmitDialog.js +0 -185
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The locale code that templates in this source code are written in.
|
|
3
|
+
*/
|
|
4
|
+
export declare const sourceLocale = "dev";
|
|
5
|
+
/**
|
|
6
|
+
* The other locale codes that this application is localized into. Sorted
|
|
7
|
+
* lexicographically.
|
|
8
|
+
*/
|
|
9
|
+
export declare const targetLocales: readonly ["be", "de", "en"];
|
|
10
|
+
/**
|
|
11
|
+
* All valid project locale codes. Sorted lexicographically.
|
|
12
|
+
*/
|
|
13
|
+
export declare const allLocales: readonly ["be", "de", "dev", "en"];
|
|
14
|
+
//# sourceMappingURL=locale-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale-codes.d.ts","sourceRoot":"","sources":["../../src/generated/locale-codes.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,aAAa,6BAA8B,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,UAAU,oCAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"be.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/be.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;CAGrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/de.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;CAGrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/en.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;CAGrB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { PdPopup } from './pd-popup.js';
|
|
2
|
+
export { PdPopupDialog } from './pd-popup-dialog.js';
|
|
3
|
+
export { PdSubmitDialog } from './pd-submit-dialog.js';
|
|
4
|
+
export type { PdDialogButton, PdSubmitDialogProps, PdSubmitDialogStatus, } from './types.js';
|
|
5
|
+
export { templates as beTemplates } from './generated/locales/be.js';
|
|
6
|
+
export { templates as deTemplates } from './generated/locales/de.js';
|
|
7
|
+
export { templates as enTemplates } from './generated/locales/en.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PdPopup } from "./
|
|
2
|
-
import { PdPopupDialog } from "./
|
|
3
|
-
import { PdSubmitDialog
|
|
1
|
+
import { PdPopup } from "./pd-popup.js";
|
|
2
|
+
import { PdPopupDialog } from "./pd-popup-dialog.js";
|
|
3
|
+
import { PdSubmitDialog } from "./pd-submit-dialog.js";
|
|
4
4
|
import { templates } from "./locales/be.js";
|
|
5
5
|
import { templates as templates2 } from "./locales/de.js";
|
|
6
6
|
import { templates as templates3 } from "./locales/en.js";
|
|
@@ -8,9 +8,6 @@ export {
|
|
|
8
8
|
PdPopup,
|
|
9
9
|
PdPopupDialog,
|
|
10
10
|
PdSubmitDialog,
|
|
11
|
-
STATUS_SEND,
|
|
12
|
-
STATUS_SEND_FAILED,
|
|
13
|
-
STATUS_SEND_SUCCESS,
|
|
14
11
|
templates as beTemplates,
|
|
15
12
|
templates2 as deTemplates,
|
|
16
13
|
templates3 as enTemplates
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LitElement, CSSResultGroup } from 'lit';
|
|
2
|
+
import { PdDialogButton } from './types';
|
|
3
|
+
export declare class PdPopupDialog extends LitElement {
|
|
4
|
+
/**
|
|
5
|
+
* Typ des Popups: info | warn | error | help
|
|
6
|
+
*/
|
|
7
|
+
type: string;
|
|
8
|
+
/**
|
|
9
|
+
* Titel, der im Header angezeigt wird
|
|
10
|
+
*/
|
|
11
|
+
title: string;
|
|
12
|
+
/**
|
|
13
|
+
* Konfigurierbare Buttons mit Text, Key und optionalem Status
|
|
14
|
+
*/
|
|
15
|
+
buttons: PdDialogButton[];
|
|
16
|
+
static styles: CSSResultGroup;
|
|
17
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
18
|
+
private _onButtonClick;
|
|
19
|
+
private _renderIcon;
|
|
20
|
+
/**
|
|
21
|
+
* Öffnet das Popup-Dialog manuell
|
|
22
|
+
*/
|
|
23
|
+
showPopup(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Schließt das Popup-Dialog manuell
|
|
26
|
+
*/
|
|
27
|
+
hidePopup(): void;
|
|
28
|
+
private _setModalDisplay;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=pd-popup-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-popup-dialog.d.ts","sourceRoot":"","sources":["../src/pd-popup-dialog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAG5D,OAAO,6CAA6C,CAAC;AACrD,OAAO,0CAA0C,CAAC;AAMlD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,qBACa,aAAc,SAAQ,UAAU;IAC3C;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAU;IAEtB;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAiB;IAE9B;;OAEG;IAEH,OAAO,EAAE,cAAc,EAAE,CAAM;IAE/B,OAAgB,MAAM,EAAE,cAAc,CAyFpC;IAEO,MAAM;IA6Bf,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,WAAW;IA0BnB;;OAEG;IACI,SAAS;IAIhB;;OAEG;IACI,SAAS;IAIhB,OAAO,CAAC,gBAAgB;CAMzB"}
|
package/dist/pd-popup-dialog.js
CHANGED
|
@@ -1,4 +1,210 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { css, LitElement, html } from "lit";
|
|
2
|
+
import { property, customElement } from "lit/decorators.js";
|
|
3
|
+
import "@progressive-development/pd-forms/pd-button";
|
|
4
|
+
import "@progressive-development/pd-icon/pd-icon";
|
|
5
|
+
import { PdColorStyles, PdFontStyles } from "@progressive-development/pd-shared-styles";
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
9
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
10
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11
|
+
if (decorator = decorators[i])
|
|
12
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
13
|
+
if (kind && result) __defProp(target, key, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
let PdPopupDialog = class extends LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.type = "info";
|
|
20
|
+
this.title = "Popup Title";
|
|
21
|
+
this.buttons = [];
|
|
22
|
+
}
|
|
23
|
+
render() {
|
|
24
|
+
return html`
|
|
25
|
+
<div id="modalId" class="modal">
|
|
26
|
+
<div class="modal-content">
|
|
27
|
+
<div class="header">
|
|
28
|
+
${this._renderIcon()}
|
|
29
|
+
<span class="header-txt">${this.title}</span>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="content">
|
|
32
|
+
<slot name="content"></slot>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="footer">
|
|
35
|
+
${this.buttons.map(
|
|
36
|
+
(bt) => html`
|
|
37
|
+
<pd-button
|
|
38
|
+
data-key=${bt.key}
|
|
39
|
+
text=${bt.name}
|
|
40
|
+
?disabled=${bt.disabled}
|
|
41
|
+
?primary=${bt.primary}
|
|
42
|
+
@button-clicked=${this._onButtonClick}
|
|
43
|
+
></pd-button>
|
|
44
|
+
`
|
|
45
|
+
)}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
_onButtonClick(e) {
|
|
52
|
+
const key = e.target.dataset.key;
|
|
53
|
+
this.dispatchEvent(
|
|
54
|
+
new CustomEvent("submit-button-clicked", {
|
|
55
|
+
detail: { button: key },
|
|
56
|
+
bubbles: true,
|
|
57
|
+
composed: true
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
_renderIcon() {
|
|
62
|
+
switch (this.type) {
|
|
63
|
+
case "warn":
|
|
64
|
+
return html`<pd-icon
|
|
65
|
+
icon="warningIconFld"
|
|
66
|
+
class="info-logo warn"
|
|
67
|
+
></pd-icon>`;
|
|
68
|
+
case "error":
|
|
69
|
+
return html`<pd-icon
|
|
70
|
+
icon="errorIconFld"
|
|
71
|
+
class="info-logo error"
|
|
72
|
+
></pd-icon>`;
|
|
73
|
+
case "help":
|
|
74
|
+
return html`<pd-icon
|
|
75
|
+
icon="helpIconFld"
|
|
76
|
+
class="info-logo help"
|
|
77
|
+
></pd-icon>`;
|
|
78
|
+
case "info":
|
|
79
|
+
default:
|
|
80
|
+
return html`<pd-icon
|
|
81
|
+
icon="infoIconFld"
|
|
82
|
+
class="info-logo info"
|
|
83
|
+
></pd-icon>`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Öffnet das Popup-Dialog manuell
|
|
88
|
+
*/
|
|
89
|
+
showPopup() {
|
|
90
|
+
this._setModalDisplay(true);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Schließt das Popup-Dialog manuell
|
|
94
|
+
*/
|
|
95
|
+
hidePopup() {
|
|
96
|
+
this._setModalDisplay(false);
|
|
97
|
+
}
|
|
98
|
+
_setModalDisplay(visible) {
|
|
99
|
+
var _a;
|
|
100
|
+
const modal = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById("modalId");
|
|
101
|
+
if (modal) {
|
|
102
|
+
modal.style.display = visible ? "block" : "none";
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
PdPopupDialog.styles = [
|
|
107
|
+
PdColorStyles,
|
|
108
|
+
PdFontStyles,
|
|
109
|
+
css`
|
|
110
|
+
:host {
|
|
111
|
+
display: block;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.modal {
|
|
115
|
+
position: fixed;
|
|
116
|
+
z-index: 100;
|
|
117
|
+
left: 0;
|
|
118
|
+
top: 0;
|
|
119
|
+
width: 100%;
|
|
120
|
+
height: 100%;
|
|
121
|
+
overflow: auto;
|
|
122
|
+
background-color: var(
|
|
123
|
+
--pd-popup-modal-bg-rgba,
|
|
124
|
+
rgba(175, 193, 210, 0.8)
|
|
125
|
+
);
|
|
126
|
+
display: block;
|
|
127
|
+
padding-top: 150px;
|
|
128
|
+
padding-left: 10px;
|
|
129
|
+
padding-right: 10px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.modal-content {
|
|
133
|
+
margin: auto;
|
|
134
|
+
border: 1px solid var(--pd-default-light-col);
|
|
135
|
+
box-shadow: -4px 4px 10px var(--pd-default-dark-col);
|
|
136
|
+
max-width: var(--pd-popup-max-width, 700px);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.header {
|
|
140
|
+
display: flex;
|
|
141
|
+
gap: 0.5em;
|
|
142
|
+
align-items: center;
|
|
143
|
+
background-color: var(--pd-popup-header-col, var(--pd-default-col));
|
|
144
|
+
height: var(--pd-popup-header-height, 45px);
|
|
145
|
+
padding-left: 0.5em;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.header-txt {
|
|
149
|
+
font-family: var(--pd-default-font-title-family);
|
|
150
|
+
font-size: var(--pd-popup-header-font-size, 1.3em);
|
|
151
|
+
color: var(--pd-popup-header-font-col, var(--pd-default-bg-col));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.info-logo {
|
|
155
|
+
width: 2em;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.error {
|
|
159
|
+
--pd-icon-col: #ff3232;
|
|
160
|
+
--pd-icon-stroke-width: 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.info,
|
|
164
|
+
.help {
|
|
165
|
+
--pd-icon-col: #6b86ff;
|
|
166
|
+
--pd-icon-stroke-width: 0;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.warn {
|
|
170
|
+
--pd-icon-col: #ffbf00;
|
|
171
|
+
--pd-icon-stroke-width: 0;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.content {
|
|
175
|
+
padding: 0.5rem 1rem 1rem 1rem;
|
|
176
|
+
background-color: var(
|
|
177
|
+
--pd-popup-header-font-col,
|
|
178
|
+
var(--pd-default-bg-col)
|
|
179
|
+
);
|
|
180
|
+
height: 100%;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.footer {
|
|
184
|
+
display: flex;
|
|
185
|
+
background: linear-gradient(
|
|
186
|
+
to right,
|
|
187
|
+
var(--pd-popup-footer-col, var(--pd-default-light-col)) 0%,
|
|
188
|
+
var(--pd-default-disabled-light-col) 100%
|
|
189
|
+
);
|
|
190
|
+
height: 70px;
|
|
191
|
+
align-items: center;
|
|
192
|
+
justify-content: space-around;
|
|
193
|
+
}
|
|
194
|
+
`
|
|
195
|
+
];
|
|
196
|
+
__decorateClass([
|
|
197
|
+
property({ type: String })
|
|
198
|
+
], PdPopupDialog.prototype, "type", 2);
|
|
199
|
+
__decorateClass([
|
|
200
|
+
property({ type: String })
|
|
201
|
+
], PdPopupDialog.prototype, "title", 2);
|
|
202
|
+
__decorateClass([
|
|
203
|
+
property({ type: Array })
|
|
204
|
+
], PdPopupDialog.prototype, "buttons", 2);
|
|
205
|
+
PdPopupDialog = __decorateClass([
|
|
206
|
+
customElement("pd-popup-dialog")
|
|
207
|
+
], PdPopupDialog);
|
|
208
|
+
export {
|
|
209
|
+
PdPopupDialog
|
|
210
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LitElement, CSSResultGroup } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Popup-Komponente, die bei Klick auf ein Trigger-Element (Slot `small-view`)
|
|
4
|
+
* ein modales Fenster (Slot `content`) öffnet.
|
|
5
|
+
*
|
|
6
|
+
* @element pd-popup
|
|
7
|
+
* @slot small-view - Inhalt, der das Popup triggert (z.B. Icon, Text)
|
|
8
|
+
* @slot content - Inhalt, der im Popup angezeigt wird
|
|
9
|
+
* @event popup-close - Wird ausgelöst, wenn das Popup geschlossen wurde
|
|
10
|
+
*/
|
|
11
|
+
export declare class PdPopup extends LitElement {
|
|
12
|
+
static styles: CSSResultGroup;
|
|
13
|
+
/**
|
|
14
|
+
* Öffnet das Popup programmatisch
|
|
15
|
+
*/
|
|
16
|
+
showPopup(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Schließt das Popup programmatisch
|
|
19
|
+
*/
|
|
20
|
+
hidePopup(): void;
|
|
21
|
+
protected render(): import('lit-html').TemplateResult<1>;
|
|
22
|
+
private _activatePopup;
|
|
23
|
+
private _closePopup;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=pd-popup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-popup.d.ts","sourceRoot":"","sources":["../src/pd-popup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAM5D,OAAO,0CAA0C,CAAC;AAElD;;;;;;;;GAQG;AACH,qBACa,OAAQ,SAAQ,UAAU;IACrC,OAAgB,MAAM,EAAE,cAAc,CA+CpC;IAEF;;OAEG;IACI,SAAS,IAAI,IAAI;IAIxB;;OAEG;IACI,SAAS,IAAI,IAAI;IAIxB,SAAS,CAAC,MAAM;IAqBhB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,WAAW;CAWpB"}
|
package/dist/pd-popup.js
CHANGED
|
@@ -1,4 +1,117 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import { css, LitElement, html } from "lit";
|
|
2
|
+
import { customElement } from "lit/decorators.js";
|
|
3
|
+
import { pdIcons } from "@progressive-development/pd-icon";
|
|
4
|
+
import { PdColorStyles } from "@progressive-development/pd-shared-styles";
|
|
5
|
+
import "@progressive-development/pd-icon/pd-icon";
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = decorator(result) || result;
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
let PdPopup = class extends LitElement {
|
|
15
|
+
/**
|
|
16
|
+
* Öffnet das Popup programmatisch
|
|
17
|
+
*/
|
|
18
|
+
showPopup() {
|
|
19
|
+
this._activatePopup();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Schließt das Popup programmatisch
|
|
23
|
+
*/
|
|
24
|
+
hidePopup() {
|
|
25
|
+
this._closePopup();
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return html`
|
|
29
|
+
<span @click=${this._activatePopup} @keypress=${this._activatePopup}>
|
|
30
|
+
<slot name="small-view"></slot>
|
|
31
|
+
</span>
|
|
32
|
+
|
|
33
|
+
<div id="modalId" class="modal">
|
|
34
|
+
<div class="modal-content">
|
|
35
|
+
<pd-icon
|
|
36
|
+
icon=${pdIcons.ICON_CLOSE}
|
|
37
|
+
class="close-icon"
|
|
38
|
+
@click=${this._closePopup}
|
|
39
|
+
></pd-icon>
|
|
40
|
+
<div class="modal-content-slot">
|
|
41
|
+
<slot name="content"></slot>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
_activatePopup() {
|
|
48
|
+
var _a;
|
|
49
|
+
const modal = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById("modalId");
|
|
50
|
+
if (modal) modal.style.display = "block";
|
|
51
|
+
}
|
|
52
|
+
_closePopup() {
|
|
53
|
+
var _a;
|
|
54
|
+
const modal = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById("modalId");
|
|
55
|
+
if (modal) modal.style.display = "none";
|
|
56
|
+
this.dispatchEvent(
|
|
57
|
+
new CustomEvent("popup-close", {
|
|
58
|
+
bubbles: true,
|
|
59
|
+
composed: true
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
PdPopup.styles = [
|
|
65
|
+
PdColorStyles,
|
|
66
|
+
css`
|
|
67
|
+
:host {
|
|
68
|
+
display: block;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.modal {
|
|
72
|
+
position: fixed;
|
|
73
|
+
z-index: 100;
|
|
74
|
+
left: 0;
|
|
75
|
+
top: 0;
|
|
76
|
+
width: 100%;
|
|
77
|
+
height: 100%;
|
|
78
|
+
overflow: auto;
|
|
79
|
+
background-color: var(
|
|
80
|
+
--pd-popup-modal-bg-rgba,
|
|
81
|
+
rgba(175, 193, 210, 0.8)
|
|
82
|
+
);
|
|
83
|
+
display: var(--pd-popup-default-display, none);
|
|
84
|
+
padding-top: 100px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.modal-content {
|
|
88
|
+
background-color: var(--pd-default-bg-col);
|
|
89
|
+
opacity: 1;
|
|
90
|
+
margin: auto;
|
|
91
|
+
padding: var(--pd-popup-modal-padding, 20px);
|
|
92
|
+
padding-bottom: 130px;
|
|
93
|
+
border: 2px solid var(--pd-default-col);
|
|
94
|
+
width: 80%;
|
|
95
|
+
max-width: 1200px;
|
|
96
|
+
position: relative;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.modal-content-slot {
|
|
100
|
+
max-width: var(--pd-popup-modal-slot-max-width, 1000px);
|
|
101
|
+
margin: var(--pd-popup-modal-slot-margin, 0 30px);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.close-icon {
|
|
105
|
+
position: absolute;
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
right: 1.2em;
|
|
108
|
+
top: 1.2em;
|
|
109
|
+
}
|
|
110
|
+
`
|
|
111
|
+
];
|
|
112
|
+
PdPopup = __decorateClass([
|
|
113
|
+
customElement("pd-popup")
|
|
114
|
+
], PdPopup);
|
|
115
|
+
export {
|
|
116
|
+
PdPopup
|
|
117
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* A submit dialog that shows progress, success or failure state.
|
|
4
|
+
*
|
|
5
|
+
* @fires submit-button-clicked - Triggered when a footer button is clicked, e.g. "Close" or "Back to Start".
|
|
6
|
+
* @slot submit-content - Content shown above the progress area
|
|
7
|
+
*/
|
|
8
|
+
export declare class PdSubmitDialog extends LitElement {
|
|
9
|
+
static styles: import('lit').CSSResult[];
|
|
10
|
+
/** Dialog title */
|
|
11
|
+
title: string;
|
|
12
|
+
/** Dialog type: `mail`, `editDate`, `order` (default) */
|
|
13
|
+
type: "mail" | "editDate" | "order";
|
|
14
|
+
/** Current status */
|
|
15
|
+
status: number;
|
|
16
|
+
/** Optional status message shown below the progress */
|
|
17
|
+
statusMsg: string;
|
|
18
|
+
/** Confirmation email address shown inside the content */
|
|
19
|
+
confirmMail: string;
|
|
20
|
+
/** Optional map with custom progress texts */
|
|
21
|
+
progressTxtMap: Map<number, string>;
|
|
22
|
+
/** Internal list of buttons shown in the popup dialog */
|
|
23
|
+
private _buttons;
|
|
24
|
+
updated(changedProps: PropertyValues<this>): void;
|
|
25
|
+
private _updateButtonsBasedOnStatus;
|
|
26
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
27
|
+
private _renderProgressRow;
|
|
28
|
+
private _goToStartpage;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=pd-submit-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-submit-dialog.d.ts","sourceRoot":"","sources":["../src/pd-submit-dialog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAI5D,OAAO,0CAA0C,CAAC;AAKlD,OAAO,sBAAsB,CAAC;AAE9B;;;;;GAKG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C,OAAgB,MAAM,4BAyDpB;IAEF,mBAAmB;IAEnB,KAAK,SAAwB;IAE7B,yDAAyD;IAEzD,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAW;IAE9C,qBAAqB;IAErB,MAAM,SAAK;IAEX,uDAAuD;IAEvD,SAAS,SAAM;IAEf,0DAA0D;IAE1D,WAAW,SAAM;IAEjB,8CAA8C;IAE9C,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAa;IAEhD,yDAAyD;IAChD,OAAO,CAAC,QAAQ,CAAwB;IAExC,OAAO,CAAC,YAAY,EAAE,cAAc,CAAC,IAAI,CAAC;IAMnD,OAAO,CAAC,2BAA2B;IAuB1B,MAAM;IAmBf,OAAO,CAAC,kBAAkB;IAiC1B,OAAO,CAAC,cAAc;CAUvB"}
|