@progressive-development/pd-content 0.5.9 → 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 +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -5
- 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-box-view.d.ts +6 -0
- package/dist/pd-box-view.d.ts.map +1 -0
- package/dist/pd-box-view.js +33 -4
- package/dist/pd-collapse.d.ts +31 -0
- package/dist/pd-collapse.d.ts.map +1 -0
- package/dist/pd-collapse.js +151 -4
- package/dist/pd-edit-content.d.ts +29 -0
- package/dist/pd-edit-content.d.ts.map +1 -0
- package/dist/pd-edit-content.js +224 -4
- package/dist/pd-more-info.d.ts +23 -0
- package/dist/pd-more-info.d.ts.map +1 -0
- package/dist/pd-more-info.js +83 -4
- package/dist/pd-resize-content.d.ts +25 -0
- package/dist/pd-resize-content.d.ts.map +1 -0
- package/dist/pd-resize-content.js +64 -4
- package/dist/stories/pd-box-view.stories.d.ts +10 -0
- package/dist/stories/pd-box-view.stories.d.ts.map +1 -0
- package/dist/stories/pd-collapse.stories.d.ts +21 -0
- package/dist/stories/pd-collapse.stories.d.ts.map +1 -0
- package/dist/stories/pd-edit-content.stories.d.ts +11 -0
- package/dist/stories/pd-edit-content.stories.d.ts.map +1 -0
- package/dist/stories/pd-more-info.stories.d.ts +6 -0
- package/dist/stories/pd-more-info.stories.d.ts.map +1 -0
- package/dist/stories/pd-resize-content.stories.d.ts +5 -0
- package/dist/stories/pd-resize-content.stories.d.ts.map +1 -0
- package/dist/types.d.ts +21 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +29 -45
- package/dist/src/PdBoxView.js +0 -24
- package/dist/src/PdCollapse.js +0 -135
- package/dist/src/PdEditContent.js +0 -223
- package/dist/src/PdMoreInfo.js +0 -77
- package/dist/src/PdResizeContent.js +0 -67
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import { html, LitElement, css } from "lit";
|
|
2
|
-
import { PDColorStyles, PDFontStyles } from "@progressive-development/pd-shared-styles";
|
|
3
|
-
/**
|
|
4
|
-
* @license
|
|
5
|
-
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
6
|
-
*/
|
|
7
|
-
const editIcon = html`<svg
|
|
8
|
-
class="edit"
|
|
9
|
-
id="Layer_1"
|
|
10
|
-
version="1.1"
|
|
11
|
-
viewBox="0 0 19 19"
|
|
12
|
-
xml:space="preserve"
|
|
13
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
-
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
15
|
-
>
|
|
16
|
-
<g>
|
|
17
|
-
<path
|
|
18
|
-
d="M8.44,7.25C8.348,7.342,8.277,7.447,8.215,7.557L8.174,7.516L8.149,7.69 C8.049,7.925,8.014,8.183,8.042,8.442l-0.399,2.796l2.797-0.399c0.259,0.028,0.517-0.007,0.752-0.107l0.174-0.024l-0.041-0.041 c0.109-0.062,0.215-0.133,0.307-0.225l5.053-5.053l-3.191-3.191L8.44,7.25z"
|
|
19
|
-
fill="var(--edit-fill-color)"
|
|
20
|
-
/>
|
|
21
|
-
<path
|
|
22
|
-
d="M18.183,1.568l-0.87-0.87c-0.641-0.641-1.637-0.684-2.225-0.097l-0.797,0.797l3.191,3.191l0.797-0.798 C18.867,3.205,18.824,2.209,18.183,1.568z"
|
|
23
|
-
fill="var(--edit-fill-color)"
|
|
24
|
-
/>
|
|
25
|
-
<path
|
|
26
|
-
d="M15,9.696V17H2V2h8.953l1.523-1.42c0.162-0.161,0.353-0.221,0.555-0.293 c0.043-0.119,0.104-0.18,0.176-0.287H0v19h17V7.928L15,9.696z"
|
|
27
|
-
fill="var(--edit-fill-color)"
|
|
28
|
-
/>
|
|
29
|
-
</g>
|
|
30
|
-
</svg>`;
|
|
31
|
-
class PdEditContent extends LitElement {
|
|
32
|
-
/**
|
|
33
|
-
* @event edit-content
|
|
34
|
-
*/
|
|
35
|
-
static get styles() {
|
|
36
|
-
return [
|
|
37
|
-
PDColorStyles,
|
|
38
|
-
PDFontStyles,
|
|
39
|
-
css`
|
|
40
|
-
:host {
|
|
41
|
-
display: block;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
h4 {
|
|
45
|
-
font-family: var(--pd-default-font-title-family);
|
|
46
|
-
font-size: var(--pd-ec-font-title-size, 1.2em);
|
|
47
|
-
margin-top: 0px;
|
|
48
|
-
margin-bottom: 2px;
|
|
49
|
-
line-height: 40px;
|
|
50
|
-
color: var(--pd-ec-font-title-col, var(--pd-default-bg-col));
|
|
51
|
-
padding-left: 5px;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.header {
|
|
55
|
-
display: flex;
|
|
56
|
-
gap: 5px;
|
|
57
|
-
background-color: var(--pd-ec-bg-col, var(--pd-default-col));
|
|
58
|
-
align-items: center;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.circle {
|
|
62
|
-
margin-left: 5px;
|
|
63
|
-
display: flex;
|
|
64
|
-
align-items: center;
|
|
65
|
-
justify-content: center;
|
|
66
|
-
width: 27px;
|
|
67
|
-
height: 27px;
|
|
68
|
-
border-radius: 50%;
|
|
69
|
-
background-color: var(--pd-ec-font-title-col, var(--pd-default-bg-col));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.step-number {
|
|
73
|
-
font-family: var(--pd-default-font-title-family);
|
|
74
|
-
font-size: var(--pd-ec-font-title-size, 1.2em);
|
|
75
|
-
font-weight: var(--pd-ec-nr-font-weight, bold); ;
|
|
76
|
-
color: var(--pd-ec-bg-col, var(--pd-default-col));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/* Temporär? Hier noch sehr aufwendig mit div/span? */
|
|
80
|
-
|
|
81
|
-
.label {
|
|
82
|
-
display: inline-block;
|
|
83
|
-
font-weight: bold;
|
|
84
|
-
width: 200px;
|
|
85
|
-
padding-top: 10px;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/* Temporär */
|
|
89
|
-
a {
|
|
90
|
-
cursor: pointer;
|
|
91
|
-
font-family: var(--pd-default-font-link-family);
|
|
92
|
-
font-size: var(--pd-default-font-link-size);
|
|
93
|
-
color: var(--pd-default-font-link-col);
|
|
94
|
-
--edit-fill-color: var(--pd-default-font-link-col);
|
|
95
|
-
}
|
|
96
|
-
a:hover {
|
|
97
|
-
color: var(--pd-default-font-link-col-hover);
|
|
98
|
-
--edit-fill-color: var(--pd-default-font-link-col-hover);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.edit {
|
|
102
|
-
width: 1.1em;
|
|
103
|
-
}
|
|
104
|
-
/*
|
|
105
|
-
could used as class for given svg icons, workaround class
|
|
106
|
-
hard coded for specific icon => maybe use custom properties here, but not for that hack...
|
|
107
|
-
*/
|
|
108
|
-
.own-edit-icon {
|
|
109
|
-
width: 2em;
|
|
110
|
-
margin-top: -10px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.link-row {
|
|
114
|
-
padding-top: 5px;
|
|
115
|
-
padding-bottom: 5px;
|
|
116
|
-
display: flex;
|
|
117
|
-
flex-wrap: wrap;
|
|
118
|
-
gap: 15px;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.link-item {
|
|
122
|
-
display: flex;
|
|
123
|
-
gap: 2px;
|
|
124
|
-
white-space: nowrap;
|
|
125
|
-
align-items: center;
|
|
126
|
-
pointer-events: none;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.param-data {
|
|
130
|
-
padding-bottom: 10px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
@media (max-width: 360px) {
|
|
134
|
-
.label {
|
|
135
|
-
width: 130px;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
`
|
|
139
|
-
];
|
|
140
|
-
}
|
|
141
|
-
static get properties() {
|
|
142
|
-
return {
|
|
143
|
-
stepNumber: { type: Number },
|
|
144
|
-
contentTitle: { type: String },
|
|
145
|
-
data: { type: Array },
|
|
146
|
-
editLinks: { type: Array },
|
|
147
|
-
// TODO: [TIM-37] Put together with edit icon/editDisabled
|
|
148
|
-
editDisabled: { type: Boolean }
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
constructor() {
|
|
152
|
-
super();
|
|
153
|
-
this.stepNumber = void 0;
|
|
154
|
-
this.contentTitle = "";
|
|
155
|
-
this.data = [];
|
|
156
|
-
this.editLinks = [];
|
|
157
|
-
this.editDisabled = false;
|
|
158
|
-
}
|
|
159
|
-
render() {
|
|
160
|
-
return html`
|
|
161
|
-
<div class="header">
|
|
162
|
-
${this.stepNumber ? html`
|
|
163
|
-
<div class="circle">
|
|
164
|
-
<span class="step-number">${this.stepNumber}</span>
|
|
165
|
-
</div>
|
|
166
|
-
` : ""}
|
|
167
|
-
<h4>${this.contentTitle}</h4>
|
|
168
|
-
</div>
|
|
169
|
-
<div>
|
|
170
|
-
${this.data ? html`
|
|
171
|
-
<div class="param-data">
|
|
172
|
-
${this.data.map(
|
|
173
|
-
(dataEntry) => html`
|
|
174
|
-
<div>
|
|
175
|
-
<span class="label">${dataEntry.name}</span>
|
|
176
|
-
<span class="value">${dataEntry.val}</span>
|
|
177
|
-
</div>
|
|
178
|
-
`
|
|
179
|
-
)}
|
|
180
|
-
</div>` : ""}
|
|
181
|
-
<slot></slot>
|
|
182
|
-
<div class="link-row">
|
|
183
|
-
${this.editDisabled ? "" : html`
|
|
184
|
-
<a @click="${this._editContent}">
|
|
185
|
-
<div class="link-item">${editIcon} Bewerk ${this.contentTitle}</div>
|
|
186
|
-
</a>
|
|
187
|
-
`}
|
|
188
|
-
${this.editLinks.map(
|
|
189
|
-
(link) => html`
|
|
190
|
-
<a data-link="${link.key}" @click="${this._editContent}">
|
|
191
|
-
<div class="link-item">${PdEditContent._getLinkLogo(link)} ${link.txt}</div>
|
|
192
|
-
</a>`
|
|
193
|
-
)}
|
|
194
|
-
</div>
|
|
195
|
-
</div>
|
|
196
|
-
`;
|
|
197
|
-
}
|
|
198
|
-
static _getLinkLogo(link) {
|
|
199
|
-
if (link.icon) {
|
|
200
|
-
return link.icon;
|
|
201
|
-
}
|
|
202
|
-
if (link.defaultIcon) {
|
|
203
|
-
return editIcon;
|
|
204
|
-
}
|
|
205
|
-
return "";
|
|
206
|
-
}
|
|
207
|
-
_editContent(e) {
|
|
208
|
-
const { link } = e.target.dataset;
|
|
209
|
-
this.dispatchEvent(
|
|
210
|
-
new CustomEvent("edit-content", {
|
|
211
|
-
detail: {
|
|
212
|
-
step: this.stepNumber,
|
|
213
|
-
link
|
|
214
|
-
},
|
|
215
|
-
bubbles: true,
|
|
216
|
-
composed: true
|
|
217
|
-
})
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
export {
|
|
222
|
-
PdEditContent
|
|
223
|
-
};
|
package/dist/src/PdMoreInfo.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html } from "lit";
|
|
2
|
-
import { updateWhenLocaleChanges, msg } from "@lit/localize";
|
|
3
|
-
import { PDFontStyles } from "@progressive-development/pd-shared-styles";
|
|
4
|
-
/**
|
|
5
|
-
* @license
|
|
6
|
-
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
7
|
-
*/
|
|
8
|
-
class PdMoreInfo extends LitElement {
|
|
9
|
-
static get styles() {
|
|
10
|
-
return [
|
|
11
|
-
PDFontStyles,
|
|
12
|
-
css`
|
|
13
|
-
:host {
|
|
14
|
-
display: block;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
p {
|
|
18
|
-
color: var(--pd-default-font-content-col);
|
|
19
|
-
font-size: var(--pd-default-font-content-size);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
a {
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
font-family: var(--pd-default-font-link-family);
|
|
25
|
-
font-size: var(--pd-default-font-link-size);
|
|
26
|
-
color: var(--pd-default-font-link-col);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
a:hover {
|
|
30
|
-
color: var(--pd-default-font-link-col-hover);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
`
|
|
34
|
-
];
|
|
35
|
-
}
|
|
36
|
-
static get properties() {
|
|
37
|
-
return {
|
|
38
|
-
_lessInfo: { type: Boolean }
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
constructor() {
|
|
42
|
-
super();
|
|
43
|
-
this._lessInfo = true;
|
|
44
|
-
updateWhenLocaleChanges(this);
|
|
45
|
-
}
|
|
46
|
-
render() {
|
|
47
|
-
if (this._lessInfo) {
|
|
48
|
-
return html`
|
|
49
|
-
<p>
|
|
50
|
-
<slot name="small-view"></slot>
|
|
51
|
-
<a @click="${this._showMoreInfo}">${msg("Mehr Informationen", { id: "pd.moreInfo.more" })}</a>
|
|
52
|
-
</p>
|
|
53
|
-
`;
|
|
54
|
-
}
|
|
55
|
-
return html`
|
|
56
|
-
<p>
|
|
57
|
-
<slot name="large-view"></slot>
|
|
58
|
-
<a @click="${this._showLessInfo}">${msg("Text ausblenden", { id: "pd.moreInfo.less" })}</a>
|
|
59
|
-
</p>
|
|
60
|
-
`;
|
|
61
|
-
}
|
|
62
|
-
_showMoreInfo() {
|
|
63
|
-
this._lessInfo = false;
|
|
64
|
-
}
|
|
65
|
-
_showLessInfo() {
|
|
66
|
-
this._lessInfo = true;
|
|
67
|
-
const rect = this.getBoundingClientRect();
|
|
68
|
-
window.scrollBy({
|
|
69
|
-
top: rect.top - 150,
|
|
70
|
-
left: 0,
|
|
71
|
-
behavior: "smooth"
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
export {
|
|
76
|
-
PdMoreInfo
|
|
77
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { LitElement, css, html } from "lit";
|
|
2
|
-
import { installMediaQueryWatcher } from "pwa-helpers/media-query.js";
|
|
3
|
-
import "@progressive-development/pd-dialog/pd-popup";
|
|
4
|
-
/**
|
|
5
|
-
* @license
|
|
6
|
-
* Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
|
|
7
|
-
*/
|
|
8
|
-
class PdResizeContent extends LitElement {
|
|
9
|
-
/**
|
|
10
|
-
* Fired when free date clicked => At the moment only for freeDates
|
|
11
|
-
* @event book-date
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Fired when date or ZIP should edited by the user
|
|
15
|
-
* @event edit-selection
|
|
16
|
-
*/
|
|
17
|
-
static get styles() {
|
|
18
|
-
return css`
|
|
19
|
-
:host {
|
|
20
|
-
display: block;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
h3 {
|
|
24
|
-
color: #084c61;
|
|
25
|
-
font-family: Oswald;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
p {
|
|
29
|
-
color: #084c61;
|
|
30
|
-
}
|
|
31
|
-
`;
|
|
32
|
-
}
|
|
33
|
-
static get properties() {
|
|
34
|
-
return {
|
|
35
|
-
resizeWidth: { type: String },
|
|
36
|
-
_hideContent: { type: Boolean }
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
constructor() {
|
|
40
|
-
super();
|
|
41
|
-
this.resizeWidth = "1232px";
|
|
42
|
-
this._hideContent = false;
|
|
43
|
-
}
|
|
44
|
-
firstUpdated() {
|
|
45
|
-
installMediaQueryWatcher(`(min-width: ${this.resizeWidth})`, (matches) => {
|
|
46
|
-
if (matches) {
|
|
47
|
-
this._hideContent = false;
|
|
48
|
-
} else {
|
|
49
|
-
this._hideContent = true;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
render() {
|
|
54
|
-
if (this._hideContent) {
|
|
55
|
-
return html`
|
|
56
|
-
<pd-popup>
|
|
57
|
-
<div slot="small-view"><slot name="preview-content"></slot></div>
|
|
58
|
-
<div slot="content"><slot name="resize-content"></slot></div>
|
|
59
|
-
</pd-popup>
|
|
60
|
-
`;
|
|
61
|
-
}
|
|
62
|
-
return html` <slot name="resize-content"></slot> `;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
export {
|
|
66
|
-
PdResizeContent
|
|
67
|
-
};
|