@progressive-development/pd-content 0.6.0 → 0.6.2
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/pd-panel-viewer.d.ts +17 -0
- package/dist/pd-panel-viewer.d.ts.map +1 -0
- package/dist/pd-panel-viewer.js +207 -0
- package/dist/pd-panel.d.ts +6 -0
- package/dist/pd-panel.d.ts.map +1 -0
- package/dist/pd-panel.js +48 -0
- package/dist/pd-tab.d.ts +13 -0
- package/dist/pd-tab.d.ts.map +1 -0
- package/dist/pd-tab.js +182 -0
- package/dist/stories/pd-tab.stories.d.ts +23 -0
- package/dist/stories/pd-tab.stories.d.ts.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class PdPanelViewer extends LitElement {
|
|
3
|
+
withProgress: boolean;
|
|
4
|
+
deltaCalc: number;
|
|
5
|
+
_index: number;
|
|
6
|
+
_panData: any;
|
|
7
|
+
_update: {};
|
|
8
|
+
static styles: import('lit').CSSResult;
|
|
9
|
+
get index(): number;
|
|
10
|
+
set index(value: number);
|
|
11
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
12
|
+
firstUpdated(): void;
|
|
13
|
+
update(changedProperties: any): void;
|
|
14
|
+
next(): void;
|
|
15
|
+
previous(): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=pd-panel-viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-panel-viewer.d.ts","sourceRoot":"","sources":["../src/pd-panel-viewer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAM5C,OAAO,0CAA0C,CAAC;AAIlD,qBACa,aAAc,SAAQ,UAAU;IAE3C,YAAY,UAAS;IAGrB,SAAS,SAAK;IAGd,MAAM,SAAK;IAIX,QAAQ,EAAE,GAAG,CAAM;IAGnB,OAAO,KAAM;IAEb,MAAM,CAAC,MAAM,0BAkEX;IAEF,IAAI,KAAK,WAER;IAED,IAAI,KAAK,CAAC,KAAK,QAAA,EAId;IAED,MAAM;IAmCN,YAAY;IAoBZ,MAAM,CAAC,iBAAiB,EAAE,GAAG;IAkC7B,IAAI;IASJ,QAAQ;CAOT"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { css, LitElement, html } from "lit";
|
|
2
|
+
import { property, customElement } from "lit/decorators.js";
|
|
3
|
+
import { classMap } from "lit/directives/class-map.js";
|
|
4
|
+
import Hammer from "hammerjs";
|
|
5
|
+
import "@progressive-development/pd-icon/pd-icon";
|
|
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 timer;
|
|
17
|
+
let PdPanelViewer = class extends LitElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.withProgress = false;
|
|
21
|
+
this.deltaCalc = 3;
|
|
22
|
+
this._index = 0;
|
|
23
|
+
this._panData = {};
|
|
24
|
+
this._update = {};
|
|
25
|
+
}
|
|
26
|
+
get index() {
|
|
27
|
+
return this._index;
|
|
28
|
+
}
|
|
29
|
+
set index(value) {
|
|
30
|
+
this.children[this._index].dispatchEvent(new CustomEvent("exited"));
|
|
31
|
+
this.children[value].dispatchEvent(new CustomEvent("entered"));
|
|
32
|
+
this._index = value;
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return html`
|
|
36
|
+
<div class="panel-container">
|
|
37
|
+
<slot></slot>
|
|
38
|
+
<pd-icon
|
|
39
|
+
id="prev"
|
|
40
|
+
icon="previousArrow"
|
|
41
|
+
activeIcon
|
|
42
|
+
?disabled="${this.index <= 0}"
|
|
43
|
+
@click=${this.previous}
|
|
44
|
+
></pd-icon>
|
|
45
|
+
<pd-icon
|
|
46
|
+
id="next"
|
|
47
|
+
icon="nextArrow"
|
|
48
|
+
activeIcon
|
|
49
|
+
?disabled="${this.index === this.children.length - 1}"
|
|
50
|
+
@click=${this.next}
|
|
51
|
+
></pd-icon>
|
|
52
|
+
</div>
|
|
53
|
+
${this.withProgress ? html` <div id="progress">
|
|
54
|
+
${Array.from(this.children).map(
|
|
55
|
+
(childEl, i) => html` <div
|
|
56
|
+
@click="${() => {
|
|
57
|
+
this._index = i;
|
|
58
|
+
}}"
|
|
59
|
+
class=${classMap({ watched: i <= this.index })}
|
|
60
|
+
></div>`
|
|
61
|
+
)}
|
|
62
|
+
</div>` : ""}
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
firstUpdated() {
|
|
66
|
+
const hammerVal = new Hammer(this);
|
|
67
|
+
hammerVal.on("pan", (panEvent) => {
|
|
68
|
+
this._panData = panEvent;
|
|
69
|
+
});
|
|
70
|
+
const ro = new ResizeObserver((entries) => {
|
|
71
|
+
entries.forEach(() => {
|
|
72
|
+
window.clearTimeout(timer);
|
|
73
|
+
timer = setTimeout(() => {
|
|
74
|
+
this.requestUpdate();
|
|
75
|
+
}, 100);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
ro.observe(this);
|
|
79
|
+
}
|
|
80
|
+
update(changedProperties) {
|
|
81
|
+
const { isFinal = false } = this._panData;
|
|
82
|
+
let { deltaX = 0 } = this._panData;
|
|
83
|
+
const width = this.clientWidth;
|
|
84
|
+
const minScale = 0.8;
|
|
85
|
+
if (!changedProperties.has("_index") && isFinal) {
|
|
86
|
+
if (deltaX > width / this.deltaCalc) {
|
|
87
|
+
this.previous();
|
|
88
|
+
} else if (deltaX < -width / this.deltaCalc) {
|
|
89
|
+
this.next();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
deltaX = isFinal ? 0 : deltaX;
|
|
93
|
+
Array.from(this.children).forEach((el, i) => {
|
|
94
|
+
const x = (i - this.index) * width + deltaX;
|
|
95
|
+
const u = deltaX / width + (i - this.index);
|
|
96
|
+
const v = -Math.abs(u * (1 - minScale)) + 1;
|
|
97
|
+
const scale = Math.max(v, minScale);
|
|
98
|
+
el.style.transform = `translate3d(${x}px,0,0) scale(${scale})`;
|
|
99
|
+
el.style.opacity = scale;
|
|
100
|
+
});
|
|
101
|
+
super.update(changedProperties);
|
|
102
|
+
}
|
|
103
|
+
/* Advance to the next story card if possible */
|
|
104
|
+
next() {
|
|
105
|
+
this.index = Math.max(
|
|
106
|
+
0,
|
|
107
|
+
Math.min(this.children.length - 1, this.index + 1)
|
|
108
|
+
);
|
|
109
|
+
this._update = false;
|
|
110
|
+
}
|
|
111
|
+
/* Go back to the previous story card if possible */
|
|
112
|
+
previous() {
|
|
113
|
+
this.index = Math.max(
|
|
114
|
+
0,
|
|
115
|
+
Math.min(this.children.length - 1, this.index - 1)
|
|
116
|
+
);
|
|
117
|
+
this._update = false;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
PdPanelViewer.styles = css`
|
|
121
|
+
:host {
|
|
122
|
+
display: flex;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
width: 100%;
|
|
125
|
+
max-width: var(--pd-panel-width, 1170px);
|
|
126
|
+
overflow: var(--pd-panel-overflow, hidden);
|
|
127
|
+
background-color: var(--pd-panel-viewer-bg-col);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.panel-container {
|
|
131
|
+
position: relative;
|
|
132
|
+
height: var(--pd-panel-height, 60vh);
|
|
133
|
+
width: 100%;
|
|
134
|
+
display: flex;
|
|
135
|
+
flex-direction: column;
|
|
136
|
+
padding: 0 2rem;
|
|
137
|
+
box-sizing: border-box;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
pd-icon {
|
|
141
|
+
position: absolute;
|
|
142
|
+
top: calc(50% - 25px);
|
|
143
|
+
height: 50px;
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
#prev {
|
|
148
|
+
left: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
#next {
|
|
152
|
+
right: 0;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
#progress {
|
|
156
|
+
position: relative;
|
|
157
|
+
height: 20px;
|
|
158
|
+
width: 50%;
|
|
159
|
+
margin: 0.5rem auto;
|
|
160
|
+
display: grid;
|
|
161
|
+
grid-auto-flow: column;
|
|
162
|
+
grid-auto-columns: 1fr;
|
|
163
|
+
grid-gap: 10px;
|
|
164
|
+
align-content: center;
|
|
165
|
+
align-self: flex-end;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
#progress > div {
|
|
169
|
+
background: var(--pd-panel-progress-col, grey);
|
|
170
|
+
height: 4px;
|
|
171
|
+
transition: background 0.3s linear;
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
#progress > div.watched {
|
|
176
|
+
background: var(--pd-panel-progress-col, yellow);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
::slotted(*) {
|
|
180
|
+
position: absolute;
|
|
181
|
+
width: 100%;
|
|
182
|
+
height: calc(100%);
|
|
183
|
+
transition: transform 0.35s ease-out;
|
|
184
|
+
left: 0;
|
|
185
|
+
}
|
|
186
|
+
`;
|
|
187
|
+
__decorateClass([
|
|
188
|
+
property({ type: Boolean })
|
|
189
|
+
], PdPanelViewer.prototype, "withProgress", 2);
|
|
190
|
+
__decorateClass([
|
|
191
|
+
property({ type: Number })
|
|
192
|
+
], PdPanelViewer.prototype, "deltaCalc", 2);
|
|
193
|
+
__decorateClass([
|
|
194
|
+
property({ type: Number, state: true })
|
|
195
|
+
], PdPanelViewer.prototype, "_index", 2);
|
|
196
|
+
__decorateClass([
|
|
197
|
+
property({ type: Object, state: true })
|
|
198
|
+
], PdPanelViewer.prototype, "_panData", 2);
|
|
199
|
+
__decorateClass([
|
|
200
|
+
property({ type: Boolean, state: true })
|
|
201
|
+
], PdPanelViewer.prototype, "_update", 2);
|
|
202
|
+
PdPanelViewer = __decorateClass([
|
|
203
|
+
customElement("pd-panel-viewer")
|
|
204
|
+
], PdPanelViewer);
|
|
205
|
+
export {
|
|
206
|
+
PdPanelViewer
|
|
207
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-panel.d.ts","sourceRoot":"","sources":["../src/pd-panel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,UAAU,EAAO,MAAM,KAAK,CAAC;AAG5C,qBACa,OAAQ,SAAQ,UAAU;IACrC,MAAM,CAAC,MAAM,0BAsBX;IAEF,MAAM;CAOP"}
|
package/dist/pd-panel.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { css, LitElement, html } from "lit";
|
|
2
|
+
import { customElement } from "lit/decorators.js";
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
+
if (decorator = decorators[i])
|
|
8
|
+
result = decorator(result) || result;
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
let PdPanel = class extends LitElement {
|
|
12
|
+
render() {
|
|
13
|
+
return html`
|
|
14
|
+
<div id="content">
|
|
15
|
+
<slot></slot>
|
|
16
|
+
</div>
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
PdPanel.styles = css`
|
|
21
|
+
:host {
|
|
22
|
+
background: var(--pd-panel-bg, #afc1d2);
|
|
23
|
+
border-radius: var(--pd-panel-border-radius, 0.2em);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Default styles for content */
|
|
27
|
+
#content {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
right: 0;
|
|
31
|
+
bottom: 0;
|
|
32
|
+
left: 0;
|
|
33
|
+
padding: 2rem;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: flex-start;
|
|
38
|
+
}
|
|
39
|
+
#content > slot::slotted(*) {
|
|
40
|
+
margin: 0;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
PdPanel = __decorateClass([
|
|
44
|
+
customElement("pd-panel")
|
|
45
|
+
], PdPanel);
|
|
46
|
+
export {
|
|
47
|
+
PdPanel
|
|
48
|
+
};
|
package/dist/pd-tab.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LitElement, CSSResultGroup } from 'lit';
|
|
2
|
+
import { TabHeader } from './types';
|
|
3
|
+
export declare class PdTab extends LitElement {
|
|
4
|
+
tabs: TabHeader[];
|
|
5
|
+
defaultTab?: string;
|
|
6
|
+
_activeTab?: string;
|
|
7
|
+
static styles: CSSResultGroup;
|
|
8
|
+
protected update(changedProperties: any): void;
|
|
9
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
10
|
+
reset(): void;
|
|
11
|
+
private _tabSelected;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=pd-tab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-tab.d.ts","sourceRoot":"","sources":["../src/pd-tab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAO,cAAc,EAAE,MAAM,KAAK,CAAC;AAO5D,OAAO,0CAA0C,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,qBACa,KAAM,SAAQ,UAAU;IAEnC,IAAI,EAAE,SAAS,EAAE,CAAM;IAGvB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,MAAM,CAAC,MAAM,EAmGR,cAAc,CAAC;IAEpB,SAAS,CAAC,MAAM,CAAC,iBAAiB,EAAE,GAAG,GAAG,IAAI;IAQ9C,MAAM;IAgCN,KAAK;IAKL,OAAO,CAAC,YAAY;CAQrB"}
|
package/dist/pd-tab.js
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { css, LitElement, html } from "lit";
|
|
2
|
+
import { property, customElement } from "lit/decorators.js";
|
|
3
|
+
import { PdColorStyles, PdFontStyles } from "@progressive-development/pd-shared-styles";
|
|
4
|
+
import "@progressive-development/pd-icon/pd-icon";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
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 = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
+
if (kind && result) __defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
let PdTab = class extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.tabs = [];
|
|
19
|
+
}
|
|
20
|
+
update(changedProperties) {
|
|
21
|
+
if (changedProperties.has("defaultTab") && this.defaultTab) {
|
|
22
|
+
console.log("PdTab: Set active from default selection", this.defaultTab);
|
|
23
|
+
this._activeTab = this.defaultTab;
|
|
24
|
+
}
|
|
25
|
+
super.update(changedProperties);
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return html`
|
|
29
|
+
<div class="header-container">
|
|
30
|
+
${this.tabs.map(
|
|
31
|
+
(t) => html`
|
|
32
|
+
<div
|
|
33
|
+
class="tab-header ${this._activeTab === t.key ? "active-header" : ""} ${t.disabled ? "disabled-header" : ""}"
|
|
34
|
+
data-key="${t.key}"
|
|
35
|
+
@click="${this._tabSelected}"
|
|
36
|
+
>
|
|
37
|
+
${t.name}
|
|
38
|
+
</div>
|
|
39
|
+
`
|
|
40
|
+
)}
|
|
41
|
+
</div>
|
|
42
|
+
${this.tabs.map(
|
|
43
|
+
(t) => html`
|
|
44
|
+
<div
|
|
45
|
+
id="${`slot${t.key}`}"
|
|
46
|
+
class="slot-container ${this._activeTab === t.key ? "active-slot" : ""}"
|
|
47
|
+
>
|
|
48
|
+
<slot name="${t.key}"></slot>
|
|
49
|
+
</div>
|
|
50
|
+
`
|
|
51
|
+
)}
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
reset() {
|
|
55
|
+
this._activeTab = this.defaultTab;
|
|
56
|
+
}
|
|
57
|
+
// eslint-disable-next-line class-methods-use-this
|
|
58
|
+
_tabSelected(e) {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
this._activeTab = (_b = (_a = e.target) == null ? void 0 : _a.dataset) == null ? void 0 : _b.key;
|
|
61
|
+
this.dispatchEvent(
|
|
62
|
+
new CustomEvent("tab-selected", {
|
|
63
|
+
detail: this._activeTab
|
|
64
|
+
})
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
PdTab.styles = [
|
|
69
|
+
PdColorStyles,
|
|
70
|
+
PdFontStyles,
|
|
71
|
+
css`
|
|
72
|
+
:host {
|
|
73
|
+
display: block;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.header-container {
|
|
77
|
+
display: flex;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.tab-header {
|
|
81
|
+
padding: var(--pd-tab-header-padding, 0.8em 1.5em);
|
|
82
|
+
background-color: var(--pd-tab-bg-col, var(--pd-default-light-col));
|
|
83
|
+
font-family: var(--pd-default-font-title-family);
|
|
84
|
+
color: var(--pd-tab-text-col, var(--pd-default-font-title-col));
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
border: 2px solid var(--pd-tab-border-col, #ccc); /* Dünner Rahmen */
|
|
87
|
+
border-bottom: none; /* Tabs sollen nahtlos an den Inhalt anschließen */
|
|
88
|
+
border-radius: 8px 8px 0 0; /* Abgerundete obere Ecken */
|
|
89
|
+
display: inline-block; /* Tabs nebeneinander anzeigen */
|
|
90
|
+
margin-right: 5px; /* Abstand zwischen Tabs */
|
|
91
|
+
box-shadow: var(
|
|
92
|
+
--pd-tab-shadow,
|
|
93
|
+
0 2px 4px rgba(0, 0, 0, 0.1)
|
|
94
|
+
); /* Leichter Schatten für Tiefe */
|
|
95
|
+
transition:
|
|
96
|
+
background-color 0.3s,
|
|
97
|
+
box-shadow 0.3s; /* Weiche Übergänge bei Hover */
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.tab-header:hover {
|
|
101
|
+
background-color: var(
|
|
102
|
+
--pd-tab-bg-hover-col,
|
|
103
|
+
var(--pd-default-hover-col)
|
|
104
|
+
);
|
|
105
|
+
box-shadow: var(
|
|
106
|
+
--pd-tab-shadow-hover,
|
|
107
|
+
0 4px 8px rgba(0, 0, 0, 0.2)
|
|
108
|
+
); /* Schattenintensität bei Hover erhöhen */
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.tab-header.active-header {
|
|
112
|
+
background-color: var(--pd-tab-bg-active-col, var(--pd-default-col));
|
|
113
|
+
border-bottom: 2px solid
|
|
114
|
+
var(--pd-tab-border-active-col, var(--pd-default-col));
|
|
115
|
+
color: var(
|
|
116
|
+
--pd-tab-active-text-col,
|
|
117
|
+
var(--pd-default-bg-col)
|
|
118
|
+
); /* Textfarbe für aktiven Tab */
|
|
119
|
+
box-shadow: none; /* Schatten entfernen, wenn Tab aktiv ist */
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.tab-header.disabled-header {
|
|
123
|
+
background-color: var(--pd-tab-bg-active-col, var(--pd-default-col));
|
|
124
|
+
border-bottom: 2px solid
|
|
125
|
+
var(--pd-tab-border-active-col, var(--pd-default-col));
|
|
126
|
+
color: var(
|
|
127
|
+
--pd-tab-active-text-col,
|
|
128
|
+
var(--pd-default-bg-col)
|
|
129
|
+
); /* Textfarbe für aktiven Tab */
|
|
130
|
+
box-shadow: none; /* Schatten entfernen, wenn Tab aktiv ist */
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.tab-header.disabled-header {
|
|
134
|
+
pointer-events: none; /* Deaktiviert die Klickbarkeit */
|
|
135
|
+
background-color: var(
|
|
136
|
+
--pd-tab-disabled-bg-col,
|
|
137
|
+
#f0f0f0
|
|
138
|
+
); /* Hellere Farbe für deaktivierte Tabs */
|
|
139
|
+
color: var(--pd-tab-disabled-text-col, #999); /* Hellere Textfarbe */
|
|
140
|
+
border-color: var(
|
|
141
|
+
--pd-tab-disabled-border-col,
|
|
142
|
+
#ddd
|
|
143
|
+
); /* Angepasste Rahmenfarbe */
|
|
144
|
+
cursor: not-allowed; /* Zeigt an, dass der Tab nicht interaktiv ist */
|
|
145
|
+
opacity: 0.6; /* Reduziert die Sichtbarkeit für einen "deaktivierten" Look */
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.tab-header:focus {
|
|
149
|
+
outline: none; /* Entfernt den Standardfokusrahmen */
|
|
150
|
+
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.5); /* Fokusring für Tastaturnavigation */
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.slot-container {
|
|
154
|
+
display: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.active-slot {
|
|
158
|
+
padding: var(--pd-tab-content-padding, 1em);
|
|
159
|
+
display: block;
|
|
160
|
+
border: var(--pd-tab-content-border, 1px solid var(--pd-default-col));
|
|
161
|
+
border-top: var(
|
|
162
|
+
--pd-tab-content-border-top,
|
|
163
|
+
3px solid var(--pd-default-col)
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
`
|
|
167
|
+
];
|
|
168
|
+
__decorateClass([
|
|
169
|
+
property({ type: Array })
|
|
170
|
+
], PdTab.prototype, "tabs", 2);
|
|
171
|
+
__decorateClass([
|
|
172
|
+
property({ type: String })
|
|
173
|
+
], PdTab.prototype, "defaultTab", 2);
|
|
174
|
+
__decorateClass([
|
|
175
|
+
property({ type: String, state: true })
|
|
176
|
+
], PdTab.prototype, "_activeTab", 2);
|
|
177
|
+
PdTab = __decorateClass([
|
|
178
|
+
customElement("pd-tab")
|
|
179
|
+
], PdTab);
|
|
180
|
+
export {
|
|
181
|
+
PdTab
|
|
182
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
render: (args: import('@storybook/web-components').Args) => import('lit-html').TemplateResult<1>;
|
|
5
|
+
argTypes: {
|
|
6
|
+
backgroundColor: {
|
|
7
|
+
control: "color";
|
|
8
|
+
};
|
|
9
|
+
onClick: {
|
|
10
|
+
action: string;
|
|
11
|
+
};
|
|
12
|
+
size: {
|
|
13
|
+
control: {
|
|
14
|
+
type: "select";
|
|
15
|
+
};
|
|
16
|
+
options: string[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
type Story = StoryObj;
|
|
22
|
+
export declare const TabDefault: Story;
|
|
23
|
+
//# sourceMappingURL=pd-tab.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-tab.stories.d.ts","sourceRoot":"","sources":["../../src/stories/pd-tab.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,cAAc,CAAC;AAGtB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;CAqBM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAEtB,eAAO,MAAM,UAAU,EAAE,KAiBxB,CAAC"}
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progressive-development/pd-content",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Progressive Development content components. ",
|
|
5
5
|
"author": "PD Progressive Development",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"./pd-edit-content": "./dist/pd-edit-content.js",
|
|
15
15
|
"./pd-more-info": "./dist/pd-more-info.js",
|
|
16
16
|
"./pd-resize-content": "./dist/pd-resize-content.js",
|
|
17
|
+
"./pd-tab": "./dist/pd-tab.js",
|
|
18
|
+
"./pd-panel-viewer": "./dist/pd-panel-viewer.js",
|
|
19
|
+
"./pd-panel": "./dist/pd-panel.js",
|
|
17
20
|
"./locales/be": "./dist/locales/be.js",
|
|
18
21
|
"./locales/de": "./dist/locales/de.js",
|
|
19
22
|
"./locales/en": "./dist/locales/en.js"
|
|
@@ -46,10 +49,12 @@
|
|
|
46
49
|
"@progressive-development/pd-dialog": "^0.6.0",
|
|
47
50
|
"@progressive-development/pd-icon": "^0.6.1",
|
|
48
51
|
"@progressive-development/pd-shared-styles": "^0.2.1",
|
|
52
|
+
"hammerjs": "^2.0.8",
|
|
49
53
|
"lit": "^3.3.0",
|
|
50
54
|
"pwa-helpers": "^0.9.1"
|
|
51
55
|
},
|
|
52
56
|
"devDependencies": {
|
|
57
|
+
"@types/hammerjs": "^2.0.46",
|
|
53
58
|
"@chromatic-com/storybook": "^1.9.0",
|
|
54
59
|
"@custom-elements-manifest/analyzer": "^0.4.17",
|
|
55
60
|
"@lit/localize-tools": "^0.6.10",
|