@progressive-development/pd-dialog 0.5.8 → 0.6.1
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
package/dist/pd-submit-dialog.js
CHANGED
|
@@ -1,4 +1,202 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { css, LitElement, html } from "lit";
|
|
2
|
+
import { property, state, customElement } from "lit/decorators.js";
|
|
3
|
+
import { msg } from "@lit/localize";
|
|
4
|
+
import "@progressive-development/pd-icon/pd-icon";
|
|
5
|
+
import { PdColorStyles } from "@progressive-development/pd-shared-styles";
|
|
6
|
+
import { PdSubmitDialogStatus } from "./types.js";
|
|
7
|
+
import "./pd-popup-dialog.js";
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
11
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
12
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
13
|
+
if (decorator = decorators[i])
|
|
14
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
15
|
+
if (kind && result) __defProp(target, key, result);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
let PdSubmitDialog = class extends LitElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.title = "Order Submit Title";
|
|
22
|
+
this.type = "order";
|
|
23
|
+
this.status = 0;
|
|
24
|
+
this.statusMsg = "";
|
|
25
|
+
this.confirmMail = "";
|
|
26
|
+
this.progressTxtMap = /* @__PURE__ */ new Map();
|
|
27
|
+
this._buttons = [];
|
|
28
|
+
}
|
|
29
|
+
updated(changedProps) {
|
|
30
|
+
if (changedProps.has("status")) {
|
|
31
|
+
this._updateButtonsBasedOnStatus();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
_updateButtonsBasedOnStatus() {
|
|
35
|
+
if (this.status === PdSubmitDialogStatus.SUCCESS) {
|
|
36
|
+
this._buttons = [{ name: "Close", key: 2 }];
|
|
37
|
+
} else if (this.status === PdSubmitDialogStatus.FAILED) {
|
|
38
|
+
if (this.type === "mail") {
|
|
39
|
+
this._buttons = [{ name: "Close", key: 2 }];
|
|
40
|
+
} else {
|
|
41
|
+
this._buttons = [
|
|
42
|
+
{
|
|
43
|
+
name: msg("Daten bearbeiten", { id: "pd.submit.dialog.closeStay" }),
|
|
44
|
+
key: 2
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: msg("Zur Startseite", { id: "pd.submit.dialog.startPage" }),
|
|
48
|
+
key: 1
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
this._buttons = [];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
return html`
|
|
58
|
+
<pd-popup-dialog
|
|
59
|
+
class="popup-dialog"
|
|
60
|
+
.title=${this.title}
|
|
61
|
+
.buttons=${this._buttons}
|
|
62
|
+
@submit-button-clicked=${this._goToStartpage}
|
|
63
|
+
>
|
|
64
|
+
<div slot="content">
|
|
65
|
+
<slot name="submit-content"></slot>
|
|
66
|
+
<div class="progress-container">
|
|
67
|
+
<div class="progress-row">${this._renderProgressRow()}</div>
|
|
68
|
+
</div>
|
|
69
|
+
<p>${this.statusMsg}</p>
|
|
70
|
+
</div>
|
|
71
|
+
</pd-popup-dialog>
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
_renderProgressRow() {
|
|
75
|
+
switch (this.status) {
|
|
76
|
+
case PdSubmitDialogStatus.SEND:
|
|
77
|
+
return html`
|
|
78
|
+
<div class="first-row-tmp"><div class="loader"></div></div>
|
|
79
|
+
<span class="progress-txt"
|
|
80
|
+
>${this.progressTxtMap.get(PdSubmitDialogStatus.SEND)}</span
|
|
81
|
+
>
|
|
82
|
+
`;
|
|
83
|
+
case PdSubmitDialogStatus.SUCCESS:
|
|
84
|
+
return html`
|
|
85
|
+
<div class="first-row-tmp">
|
|
86
|
+
<pd-icon class="success-icon" icon="checkBox" activeIcon></pd-icon>
|
|
87
|
+
</div>
|
|
88
|
+
<span class="progress-txt"
|
|
89
|
+
>${this.progressTxtMap.get(PdSubmitDialogStatus.SUCCESS)}</span
|
|
90
|
+
>
|
|
91
|
+
`;
|
|
92
|
+
case PdSubmitDialogStatus.FAILED:
|
|
93
|
+
return html`
|
|
94
|
+
<div class="first-row-tmp">
|
|
95
|
+
<pd-icon class="error-icon" icon="checkBox"></pd-icon>
|
|
96
|
+
</div>
|
|
97
|
+
<span class="progress-txt"
|
|
98
|
+
>${this.progressTxtMap.get(PdSubmitDialogStatus.FAILED)}</span
|
|
99
|
+
>
|
|
100
|
+
`;
|
|
101
|
+
default:
|
|
102
|
+
console.warn("Unexpected status:", this.status);
|
|
103
|
+
return "";
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
_goToStartpage(e) {
|
|
107
|
+
var _a, _b;
|
|
108
|
+
const clickedKey = ((_a = e.detail) == null ? void 0 : _a.button) ?? ((_b = this._buttons[0]) == null ? void 0 : _b.key) ?? 0;
|
|
109
|
+
this.dispatchEvent(
|
|
110
|
+
new CustomEvent("submit-button-clicked", {
|
|
111
|
+
detail: { button: clickedKey },
|
|
112
|
+
bubbles: true,
|
|
113
|
+
composed: true
|
|
114
|
+
})
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
PdSubmitDialog.styles = [
|
|
119
|
+
PdColorStyles,
|
|
120
|
+
css`
|
|
121
|
+
:host {
|
|
122
|
+
display: block;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.progress-container {
|
|
126
|
+
padding: 20px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.progress-row {
|
|
130
|
+
display: flex;
|
|
131
|
+
justify-content: start;
|
|
132
|
+
align-items: center;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.first-row-tmp {
|
|
136
|
+
width: 80px;
|
|
137
|
+
height: 40px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.loader {
|
|
141
|
+
border: 16px solid var(--pd-default-disabled-light-col);
|
|
142
|
+
border-top: 16px solid var(--pd-default-col);
|
|
143
|
+
border-radius: 50%;
|
|
144
|
+
width: 10px;
|
|
145
|
+
height: 10px;
|
|
146
|
+
animation: spin 2s linear infinite;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.success-icon {
|
|
150
|
+
padding-top: 5px;
|
|
151
|
+
--pd-icon-col-active: var(--pd-default-success-light-col);
|
|
152
|
+
--pd-icon-stroke-col-active: var(--pd-default-success-col);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.error-icon {
|
|
156
|
+
padding-top: 5px;
|
|
157
|
+
--pd-icon-col: var(--pd-default-error-light-col);
|
|
158
|
+
--pd-icon-stroke-col: var(--pd-default-error-col);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.progress-txt {
|
|
162
|
+
font-size: 1em;
|
|
163
|
+
color: var(--pd-default-dark-col);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
@keyframes spin {
|
|
167
|
+
0% {
|
|
168
|
+
transform: rotate(0deg);
|
|
169
|
+
}
|
|
170
|
+
100% {
|
|
171
|
+
transform: rotate(360deg);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
`
|
|
175
|
+
];
|
|
176
|
+
__decorateClass([
|
|
177
|
+
property({ type: String })
|
|
178
|
+
], PdSubmitDialog.prototype, "title", 2);
|
|
179
|
+
__decorateClass([
|
|
180
|
+
property({ type: String })
|
|
181
|
+
], PdSubmitDialog.prototype, "type", 2);
|
|
182
|
+
__decorateClass([
|
|
183
|
+
property({ type: Number })
|
|
184
|
+
], PdSubmitDialog.prototype, "status", 2);
|
|
185
|
+
__decorateClass([
|
|
186
|
+
property({ type: String })
|
|
187
|
+
], PdSubmitDialog.prototype, "statusMsg", 2);
|
|
188
|
+
__decorateClass([
|
|
189
|
+
property({ type: String })
|
|
190
|
+
], PdSubmitDialog.prototype, "confirmMail", 2);
|
|
191
|
+
__decorateClass([
|
|
192
|
+
property({ type: Object })
|
|
193
|
+
], PdSubmitDialog.prototype, "progressTxtMap", 2);
|
|
194
|
+
__decorateClass([
|
|
195
|
+
state()
|
|
196
|
+
], PdSubmitDialog.prototype, "_buttons", 2);
|
|
197
|
+
PdSubmitDialog = __decorateClass([
|
|
198
|
+
customElement("pd-submit-dialog")
|
|
199
|
+
], PdSubmitDialog);
|
|
200
|
+
export {
|
|
201
|
+
PdSubmitDialog
|
|
202
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
render: ({ title, type, buttons }: import('@storybook/web-components').Args) => import('lit-html').TemplateResult<1>;
|
|
5
|
+
argTypes: {
|
|
6
|
+
title: {
|
|
7
|
+
control: "text";
|
|
8
|
+
};
|
|
9
|
+
type: {
|
|
10
|
+
control: "select";
|
|
11
|
+
options: string[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj;
|
|
17
|
+
export declare const Info: Story;
|
|
18
|
+
export declare const Error: Story;
|
|
19
|
+
export declare const Warn: Story;
|
|
20
|
+
//# sourceMappingURL=pd-popup-dialog.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-popup-dialog.stories.d.ts","sourceRoot":"","sources":["../../src/stories/pd-popup-dialog.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAIhE,OAAO,uBAAuB,CAAC;AAE/B,QAAA,MAAM,IAAI;;;;;;;;;;;;CAcM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAOtB,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAMlB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: string;
|
|
5
|
+
render: ({ smallViewSlot, contentSlot }: import('@storybook/web-components').Args) => import('lit-html').TemplateResult<1>;
|
|
6
|
+
argTypes: {
|
|
7
|
+
smallViewSlot: {
|
|
8
|
+
control: "text";
|
|
9
|
+
description: string;
|
|
10
|
+
defaultValue: string;
|
|
11
|
+
};
|
|
12
|
+
contentSlot: {
|
|
13
|
+
control: "text";
|
|
14
|
+
description: string;
|
|
15
|
+
defaultValue: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
type Story = StoryObj;
|
|
21
|
+
export declare const DefaultPopup: Story;
|
|
22
|
+
export declare const LongContent: Story;
|
|
23
|
+
export declare const CustomStyledContent: Story;
|
|
24
|
+
//# sourceMappingURL=pd-popup.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-popup.stories.d.ts","sourceRoot":"","sources":["../../src/stories/pd-popup.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,gBAAgB,CAAC;AAGxB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;CAqBM,CAAC;AAEjB,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAazB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAUjC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/web-components';
|
|
2
|
+
import { PdSubmitDialogStatus } from '../types.js';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: string;
|
|
6
|
+
render: ({ title, status, statusMsg, confirmMail }: import('@storybook/web-components').Args) => import('lit-html').TemplateResult<1>;
|
|
7
|
+
argTypes: {
|
|
8
|
+
title: {
|
|
9
|
+
control: "text";
|
|
10
|
+
};
|
|
11
|
+
status: {
|
|
12
|
+
control: "select";
|
|
13
|
+
options: PdSubmitDialogStatus[];
|
|
14
|
+
mapping: {
|
|
15
|
+
SEND: PdSubmitDialogStatus;
|
|
16
|
+
SUCCESS: PdSubmitDialogStatus;
|
|
17
|
+
FAILED: PdSubmitDialogStatus;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
statusMsg: {
|
|
21
|
+
control: "text";
|
|
22
|
+
};
|
|
23
|
+
confirmMail: {
|
|
24
|
+
control: "text";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj;
|
|
30
|
+
export declare const Send: Story;
|
|
31
|
+
export declare const Success: Story;
|
|
32
|
+
export declare const Failed: Story;
|
|
33
|
+
//# sourceMappingURL=pd-submit-dialog.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-submit-dialog.stories.d.ts","sourceRoot":"","sources":["../../src/stories/pd-submit-dialog.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,wBAAwB,CAAC;AAahC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;CAmCM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,IAAI,EAAE,KAOlB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAOpB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface für konfigurierbare Buttons im Dialog
|
|
3
|
+
*/
|
|
4
|
+
export interface PdDialogButton {
|
|
5
|
+
key: string | number;
|
|
6
|
+
name: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
primary?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Enum für mögliche Statuswerte im SubmitDialog.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum PdSubmitDialogStatus {
|
|
14
|
+
SEND = 1,
|
|
15
|
+
SUCCESS = 2,
|
|
16
|
+
FAILED = 3
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Interface für die Properties des SubmitDialogs.
|
|
20
|
+
*/
|
|
21
|
+
export interface PdSubmitDialogProps {
|
|
22
|
+
title: string;
|
|
23
|
+
type?: "order" | "mail" | string;
|
|
24
|
+
status: PdSubmitDialogStatus;
|
|
25
|
+
statusMsg?: string;
|
|
26
|
+
confirmMail?: string;
|
|
27
|
+
progressTxtMap?: Map<PdSubmitDialogStatus, string>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,IAAI,IAAI;IACR,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IACjC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;CACpD"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var PdSubmitDialogStatus = /* @__PURE__ */ ((PdSubmitDialogStatus2) => {
|
|
2
|
+
PdSubmitDialogStatus2[PdSubmitDialogStatus2["SEND"] = 1] = "SEND";
|
|
3
|
+
PdSubmitDialogStatus2[PdSubmitDialogStatus2["SUCCESS"] = 2] = "SUCCESS";
|
|
4
|
+
PdSubmitDialogStatus2[PdSubmitDialogStatus2["FAILED"] = 3] = "FAILED";
|
|
5
|
+
return PdSubmitDialogStatus2;
|
|
6
|
+
})(PdSubmitDialogStatus || {});
|
|
7
|
+
export {
|
|
8
|
+
PdSubmitDialogStatus
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,97 +1,83 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"*.js": [
|
|
84
|
-
"eslint --fix",
|
|
85
|
-
"prettier --write"
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
"keywords": [
|
|
89
|
-
"pd",
|
|
90
|
-
"progressive",
|
|
91
|
-
"development",
|
|
92
|
-
"dialog",
|
|
93
|
-
"popup",
|
|
94
|
-
"submit",
|
|
95
|
-
"send"
|
|
96
|
-
]
|
|
2
|
+
"name": "@progressive-development/pd-dialog",
|
|
3
|
+
"version": "0.6.1",
|
|
4
|
+
"description": "Progressive Development dialog components.",
|
|
5
|
+
"author": "PD Progressive Development",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./dist/index.js",
|
|
12
|
+
"./pd-popup-dialog": "./dist/pd-popup-dialog.js",
|
|
13
|
+
"./pd-popup": "./dist/pd-popup.js",
|
|
14
|
+
"./pd-submit-dialog": "./dist/pd-submit-dialog.js",
|
|
15
|
+
"./locales/be": "./dist/locales/be.js",
|
|
16
|
+
"./locales/de": "./dist/locales/de.js",
|
|
17
|
+
"./locales/en": "./dist/locales/en.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist/",
|
|
21
|
+
"package.json",
|
|
22
|
+
"README.md",
|
|
23
|
+
"LICENSE"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"analyze": "cem analyze --litelement --exclude dist,demo",
|
|
27
|
+
"start": "vite",
|
|
28
|
+
"build": "vite build",
|
|
29
|
+
"preview": "vite preview",
|
|
30
|
+
"clean": "rm -rf dist",
|
|
31
|
+
"lint": "eslint --ext .ts,.html src --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
|
|
32
|
+
"format": "eslint --ext .ts,.html src --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
|
|
33
|
+
"test": "vitest run --coverage",
|
|
34
|
+
"test:watch": "vitest --watch",
|
|
35
|
+
"check": "npm run lint && npm run build",
|
|
36
|
+
"prepublishOnly": "npm run clean && npm run check",
|
|
37
|
+
"localizeExtract": "lit-localize extract",
|
|
38
|
+
"localizeBuild": "lit-localize build",
|
|
39
|
+
"storybook": "storybook dev -p 6006",
|
|
40
|
+
"build-storybook": "storybook build"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@lit/localize": "^0.12.2",
|
|
44
|
+
"@progressive-development/pd-forms": "^0.6.3",
|
|
45
|
+
"@progressive-development/pd-icon": "^0.6.1",
|
|
46
|
+
"@progressive-development/pd-price": "^0.6.0",
|
|
47
|
+
"@progressive-development/pd-shared-styles": "^0.2.1",
|
|
48
|
+
"lit": "^3.3.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@chromatic-com/storybook": "^1.9.0",
|
|
52
|
+
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
53
|
+
"@lit/localize-tools": "^0.6.10",
|
|
54
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
55
|
+
"@storybook/addon-links": "^8.6.14",
|
|
56
|
+
"@storybook/blocks": "^8.0.10",
|
|
57
|
+
"@storybook/test": "^8.6.14",
|
|
58
|
+
"@storybook/web-components": "^8.0.10",
|
|
59
|
+
"@storybook/web-components-vite": "^8.6.14",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
61
|
+
"@typescript-eslint/parser": "^8.32.1",
|
|
62
|
+
"eslint": "^8.57.1",
|
|
63
|
+
"eslint-config-prettier": "^9.1.0",
|
|
64
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
65
|
+
"prettier": "^3.5.3",
|
|
66
|
+
"rollup-plugin-visualizer": "^5.14.0",
|
|
67
|
+
"storybook": "^8.6.14",
|
|
68
|
+
"typescript": "^5.8.3",
|
|
69
|
+
"vite": "^5.4.19",
|
|
70
|
+
"vite-plugin-dts": "^4.5.4",
|
|
71
|
+
"vitest": "^2.1.9"
|
|
72
|
+
},
|
|
73
|
+
"customElements": "custom-elements.json",
|
|
74
|
+
"keywords": [
|
|
75
|
+
"pd",
|
|
76
|
+
"progressive",
|
|
77
|
+
"development",
|
|
78
|
+
"dialog",
|
|
79
|
+
"popup",
|
|
80
|
+
"submit",
|
|
81
|
+
"send"
|
|
82
|
+
]
|
|
97
83
|
}
|
package/dist/src/PdPopup.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html } from "lit";
|
|
2
|
-
import { ICON_CLOSE } from "@progressive-development/pd-icon";
|
|
3
|
-
import "@progressive-development/pd-icon/pd-icon";
|
|
4
|
-
import { PDColorStyles } from "@progressive-development/pd-shared-styles";
|
|
5
|
-
/**
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
8
|
-
*/
|
|
9
|
-
class PdPopup extends LitElement {
|
|
10
|
-
static get styles() {
|
|
11
|
-
return [
|
|
12
|
-
PDColorStyles,
|
|
13
|
-
css`
|
|
14
|
-
:host {
|
|
15
|
-
display: block;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/* The Modal (background) */
|
|
19
|
-
.modal {
|
|
20
|
-
position: fixed; /* Stay in place */
|
|
21
|
-
z-index: 100; /* Sit on top */
|
|
22
|
-
left: 0;
|
|
23
|
-
top: 0;
|
|
24
|
-
width: 100%; /* Full width */
|
|
25
|
-
height: 100%; /* Full height */
|
|
26
|
-
overflow: auto; /* Enable scroll if needed */
|
|
27
|
-
/* RGBA Wert muss hier verwendet werden #AFC1D2 to rgba for opacity */
|
|
28
|
-
background-color: var(--pd-popup-modal-bg-rgba, rgba(175, 193, 210, 0.8));
|
|
29
|
-
|
|
30
|
-
/* specific for PdPopup, abobe also used for PdPopupDialog */
|
|
31
|
-
display: var(--pd-popup-default-display, none); /* Hidden by default */
|
|
32
|
-
padding-top: 100px; /* Location of the box */
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* Modal Content */
|
|
36
|
-
.modal-content {
|
|
37
|
-
background-color: var(--pd-default-bg-col);
|
|
38
|
-
opacity: 1;
|
|
39
|
-
margin: auto;
|
|
40
|
-
padding: var(--pd-popup-modal-padding, 20px);
|
|
41
|
-
padding-bottom: 130px;
|
|
42
|
-
border: 2px solid var(--pd-default-col);
|
|
43
|
-
width: 80%;
|
|
44
|
-
max-width: 1200px;
|
|
45
|
-
position: relative;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.modal-content-slot {
|
|
49
|
-
max-width: var(--pd-popup-modal-slot-max-width, 1000px);
|
|
50
|
-
margin: var(--pd-popup-modal-slot-margin, 0 30px);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.close-icon {
|
|
54
|
-
position: absolute;
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
right: 1.2em;
|
|
57
|
-
top: 1.2em;
|
|
58
|
-
}`
|
|
59
|
-
];
|
|
60
|
-
}
|
|
61
|
-
render() {
|
|
62
|
-
return html`
|
|
63
|
-
<!-- Trigger/Open The Modal -->
|
|
64
|
-
<span @click="${this._activatePopup}" @keypress="${this._activatePopup}"
|
|
65
|
-
><slot name="small-view"></slot
|
|
66
|
-
></span>
|
|
67
|
-
|
|
68
|
-
<!-- The Modal -->
|
|
69
|
-
<div id="modalId" class="modal">
|
|
70
|
-
<!-- Modal content -->
|
|
71
|
-
<div class="modal-content">
|
|
72
|
-
<pd-icon icon="${ICON_CLOSE}" class="close-icon"
|
|
73
|
-
@click="${this._closePopup}"></pd-icon>
|
|
74
|
-
<div class="modal-content-slot">
|
|
75
|
-
<slot name="content"></slot>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
`;
|
|
80
|
-
}
|
|
81
|
-
showPopup() {
|
|
82
|
-
this._activatePopup();
|
|
83
|
-
}
|
|
84
|
-
hidePopup() {
|
|
85
|
-
this._closePopup();
|
|
86
|
-
}
|
|
87
|
-
_activatePopup() {
|
|
88
|
-
const modal = this.shadowRoot.getElementById("modalId");
|
|
89
|
-
modal.style.display = "block";
|
|
90
|
-
}
|
|
91
|
-
_closePopup() {
|
|
92
|
-
const modal = this.shadowRoot.getElementById("modalId");
|
|
93
|
-
modal.style.display = "none";
|
|
94
|
-
this.dispatchEvent(
|
|
95
|
-
new CustomEvent("popup-close", {
|
|
96
|
-
bubbles: true,
|
|
97
|
-
composed: true
|
|
98
|
-
})
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
/*
|
|
102
|
-
// When the user clicks anywhere outside of the modal, close it
|
|
103
|
-
window.onclick = function(event) {
|
|
104
|
-
if (event.target == modal) {
|
|
105
|
-
modal.style.display = "none";
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
*/
|
|
109
|
-
}
|
|
110
|
-
export {
|
|
111
|
-
PdPopup
|
|
112
|
-
};
|