@progressive-development/pd-content 0.7.16 → 0.9.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.
Files changed (101) hide show
  1. package/dist/index.d.ts +9 -5
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +21 -18
  4. package/dist/locales/be.js +2 -3
  5. package/dist/locales/de.js +2 -3
  6. package/dist/locales/en.js +2 -3
  7. package/dist/pd-box-view/PdBoxView.d.ts +9 -0
  8. package/dist/pd-box-view/PdBoxView.d.ts.map +1 -0
  9. package/dist/pd-box-view/PdBoxView.js +23 -0
  10. package/dist/pd-box-view/pd-box-view.d.ts +3 -0
  11. package/dist/pd-box-view/pd-box-view.d.ts.map +1 -0
  12. package/dist/{stories → pd-box-view}/pd-box-view.stories.d.ts +1 -1
  13. package/dist/pd-box-view/pd-box-view.stories.d.ts.map +1 -0
  14. package/dist/pd-box-view.d.ts +2 -6
  15. package/dist/pd-box-view.js +8 -33
  16. package/dist/pd-collapse/PdCollapse.d.ts +38 -0
  17. package/dist/pd-collapse/PdCollapse.d.ts.map +1 -0
  18. package/dist/pd-collapse/PdCollapse.js +216 -0
  19. package/dist/pd-collapse/pd-collapse.d.ts +3 -0
  20. package/dist/pd-collapse/pd-collapse.d.ts.map +1 -0
  21. package/dist/{stories → pd-collapse}/pd-collapse.stories.d.ts +1 -1
  22. package/dist/pd-collapse/pd-collapse.stories.d.ts.map +1 -0
  23. package/dist/pd-collapse-group/PdCollapseGroup.d.ts +28 -0
  24. package/dist/pd-collapse-group/PdCollapseGroup.d.ts.map +1 -0
  25. package/dist/pd-collapse-group/PdCollapseGroup.js +90 -0
  26. package/dist/pd-collapse-group/pd-collapse-group.d.ts +3 -0
  27. package/dist/pd-collapse-group/pd-collapse-group.d.ts.map +1 -0
  28. package/dist/pd-collapse-group/pd-collapse-group.stories.d.ts.map +1 -0
  29. package/dist/pd-collapse-group.d.ts +2 -27
  30. package/dist/pd-collapse-group.js +8 -97
  31. package/dist/pd-collapse.d.ts +2 -36
  32. package/dist/pd-collapse.js +6 -216
  33. package/dist/pd-edit-content/PdEditContent.d.ts +32 -0
  34. package/dist/pd-edit-content/PdEditContent.d.ts.map +1 -0
  35. package/dist/pd-edit-content/PdEditContent.js +221 -0
  36. package/dist/pd-edit-content/pd-edit-content.d.ts +3 -0
  37. package/dist/pd-edit-content/pd-edit-content.d.ts.map +1 -0
  38. package/dist/{stories → pd-edit-content}/pd-edit-content.stories.d.ts +2 -2
  39. package/dist/pd-edit-content/pd-edit-content.stories.d.ts.map +1 -0
  40. package/dist/pd-edit-content.d.ts +2 -29
  41. package/dist/pd-edit-content.js +6 -222
  42. package/dist/pd-more-info/PdMoreInfo.d.ts +25 -0
  43. package/dist/pd-more-info/PdMoreInfo.d.ts.map +1 -0
  44. package/dist/pd-more-info/PdMoreInfo.js +82 -0
  45. package/dist/pd-more-info/pd-more-info.d.ts +3 -0
  46. package/dist/pd-more-info/pd-more-info.d.ts.map +1 -0
  47. package/dist/pd-more-info/pd-more-info.stories.d.ts.map +1 -0
  48. package/dist/pd-more-info.d.ts +2 -23
  49. package/dist/pd-more-info.js +6 -81
  50. package/dist/pd-panel-viewer/PdPanel.d.ts +9 -0
  51. package/dist/pd-panel-viewer/PdPanel.d.ts.map +1 -0
  52. package/dist/pd-panel-viewer/PdPanel.js +38 -0
  53. package/dist/pd-panel-viewer/PdPanelViewer.d.ts +20 -0
  54. package/dist/pd-panel-viewer/PdPanelViewer.d.ts.map +1 -0
  55. package/dist/pd-panel-viewer/PdPanelViewer.js +206 -0
  56. package/dist/pd-panel-viewer/pd-panel-viewer.d.ts +3 -0
  57. package/dist/pd-panel-viewer/pd-panel-viewer.d.ts.map +1 -0
  58. package/dist/pd-panel-viewer/pd-panel.d.ts +3 -0
  59. package/dist/pd-panel-viewer/pd-panel.d.ts.map +1 -0
  60. package/dist/pd-panel-viewer.d.ts +2 -17
  61. package/dist/pd-panel-viewer.js +6 -205
  62. package/dist/pd-panel.d.ts +2 -6
  63. package/dist/pd-panel.js +7 -47
  64. package/dist/pd-resize-content/PdResizeContent.d.ts +27 -0
  65. package/dist/pd-resize-content/PdResizeContent.d.ts.map +1 -0
  66. package/dist/pd-resize-content/PdResizeContent.js +62 -0
  67. package/dist/pd-resize-content/pd-resize-content.d.ts +3 -0
  68. package/dist/pd-resize-content/pd-resize-content.d.ts.map +1 -0
  69. package/dist/pd-resize-content/pd-resize-content.stories.d.ts.map +1 -0
  70. package/dist/pd-resize-content.d.ts +2 -25
  71. package/dist/pd-resize-content.js +6 -62
  72. package/dist/pd-tab/PdTab.d.ts +16 -0
  73. package/dist/pd-tab/PdTab.d.ts.map +1 -0
  74. package/dist/pd-tab/PdTab.js +179 -0
  75. package/dist/pd-tab/pd-tab.d.ts +3 -0
  76. package/dist/pd-tab/pd-tab.d.ts.map +1 -0
  77. package/dist/{stories → pd-tab}/pd-tab.stories.d.ts +1 -1
  78. package/dist/pd-tab/pd-tab.stories.d.ts.map +1 -0
  79. package/dist/pd-tab.d.ts +2 -13
  80. package/dist/pd-tab.js +6 -180
  81. package/dist/types.d.ts.map +1 -1
  82. package/package.json +27 -48
  83. package/dist/pd-box-view.d.ts.map +0 -1
  84. package/dist/pd-collapse-group.d.ts.map +0 -1
  85. package/dist/pd-collapse.d.ts.map +0 -1
  86. package/dist/pd-edit-content.d.ts.map +0 -1
  87. package/dist/pd-more-info.d.ts.map +0 -1
  88. package/dist/pd-panel-viewer.d.ts.map +0 -1
  89. package/dist/pd-panel.d.ts.map +0 -1
  90. package/dist/pd-resize-content.d.ts.map +0 -1
  91. package/dist/pd-tab.d.ts.map +0 -1
  92. package/dist/stories/pd-box-view.stories.d.ts.map +0 -1
  93. package/dist/stories/pd-collapse-group.stories.d.ts.map +0 -1
  94. package/dist/stories/pd-collapse.stories.d.ts.map +0 -1
  95. package/dist/stories/pd-edit-content.stories.d.ts.map +0 -1
  96. package/dist/stories/pd-more-info.stories.d.ts.map +0 -1
  97. package/dist/stories/pd-resize-content.stories.d.ts.map +0 -1
  98. package/dist/stories/pd-tab.stories.d.ts.map +0 -1
  99. /package/dist/{stories → pd-collapse-group}/pd-collapse-group.stories.d.ts +0 -0
  100. /package/dist/{stories → pd-more-info}/pd-more-info.stories.d.ts +0 -0
  101. /package/dist/{stories → pd-resize-content}/pd-resize-content.stories.d.ts +0 -0
@@ -0,0 +1,206 @@
1
+ import { LitElement, css, html } from 'lit';
2
+ import { property } 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
+
7
+ var __defProp = Object.defineProperty;
8
+ var __decorateClass = (decorators, target, key, kind) => {
9
+ var result = void 0 ;
10
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
11
+ if (decorator = decorators[i])
12
+ result = (decorator(target, key, result) ) || result;
13
+ if (result) __defProp(target, key, result);
14
+ return result;
15
+ };
16
+ let timer;
17
+ class PdPanelViewer extends LitElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.withProgress = false;
21
+ this.deltaCalc = 3;
22
+ this._index = 0;
23
+ // eslint-disable-next-line no-undef
24
+ this._panData = {};
25
+ this._update = {};
26
+ }
27
+ static {
28
+ this.styles = css`
29
+ :host {
30
+ display: flex;
31
+ flex-direction: column;
32
+ width: 100%;
33
+ max-width: var(--pd-panel-width, 1170px);
34
+ overflow: var(--pd-panel-overflow, hidden);
35
+ background-color: var(--pd-panel-viewer-bg-col);
36
+ }
37
+
38
+ .panel-container {
39
+ position: relative;
40
+ height: var(--pd-panel-height, 60vh);
41
+ width: 100%;
42
+ display: flex;
43
+ flex-direction: column;
44
+ padding: 0 2rem;
45
+ box-sizing: border-box;
46
+ }
47
+
48
+ pd-icon {
49
+ position: absolute;
50
+ top: calc(50% - 25px);
51
+ height: 50px;
52
+ cursor: pointer;
53
+ }
54
+
55
+ #prev {
56
+ left: 0;
57
+ }
58
+
59
+ #next {
60
+ right: 0;
61
+ }
62
+
63
+ #progress {
64
+ position: relative;
65
+ height: 20px;
66
+ width: 50%;
67
+ margin: 0.5rem auto;
68
+ display: grid;
69
+ grid-auto-flow: column;
70
+ grid-auto-columns: 1fr;
71
+ grid-gap: 10px;
72
+ align-content: center;
73
+ align-self: flex-end;
74
+ }
75
+
76
+ #progress > div {
77
+ background: var(--pd-panel-progress-col, grey);
78
+ height: 4px;
79
+ transition: background 0.3s linear;
80
+ cursor: pointer;
81
+ }
82
+
83
+ #progress > div.watched {
84
+ background: var(--pd-panel-progress-col, yellow);
85
+ }
86
+
87
+ ::slotted(*) {
88
+ position: absolute;
89
+ width: 100%;
90
+ height: calc(100%);
91
+ transition: transform 0.35s ease-out;
92
+ left: 0;
93
+ }
94
+ `;
95
+ }
96
+ get index() {
97
+ return this._index;
98
+ }
99
+ set index(value) {
100
+ this.children[this._index].dispatchEvent(new CustomEvent("exited"));
101
+ this.children[value].dispatchEvent(new CustomEvent("entered"));
102
+ this._index = value;
103
+ }
104
+ render() {
105
+ return html`
106
+ <div class="panel-container">
107
+ <slot></slot>
108
+ <pd-icon
109
+ id="prev"
110
+ icon="previousArrow"
111
+ activeIcon
112
+ ?disabled="${this.index <= 0}"
113
+ @click=${this.previous}
114
+ ></pd-icon>
115
+ <pd-icon
116
+ id="next"
117
+ icon="nextArrow"
118
+ activeIcon
119
+ ?disabled="${this.index === this.children.length - 1}"
120
+ @click=${this.next}
121
+ ></pd-icon>
122
+ </div>
123
+ ${this.withProgress ? html` <div id="progress">
124
+ ${Array.from(this.children).map(
125
+ (childEl, i) => html` <div
126
+ @click="${() => {
127
+ this._index = i;
128
+ }}"
129
+ class=${classMap({ watched: i <= this.index })}
130
+ ></div>`
131
+ )}
132
+ </div>` : ""}
133
+ `;
134
+ }
135
+ firstUpdated() {
136
+ const hammerVal = new Hammer(this);
137
+ hammerVal.on("pan", (panEvent) => {
138
+ this._panData = panEvent;
139
+ });
140
+ const ro = new ResizeObserver((entries) => {
141
+ entries.forEach(() => {
142
+ window.clearTimeout(timer);
143
+ timer = setTimeout(() => {
144
+ this.requestUpdate();
145
+ }, 100);
146
+ });
147
+ });
148
+ ro.observe(this);
149
+ }
150
+ update(changedProperties) {
151
+ const { isFinal = false } = this._panData;
152
+ let { deltaX = 0 } = this._panData;
153
+ const width = this.clientWidth;
154
+ const minScale = 0.8;
155
+ if (!changedProperties.has("_index") && isFinal) {
156
+ if (deltaX > width / this.deltaCalc) {
157
+ this.previous();
158
+ } else if (deltaX < -width / this.deltaCalc) {
159
+ this.next();
160
+ }
161
+ }
162
+ deltaX = isFinal ? 0 : deltaX;
163
+ Array.from(this.children).forEach((el, i) => {
164
+ const x = (i - this.index) * width + deltaX;
165
+ const u = deltaX / width + (i - this.index);
166
+ const v = -Math.abs(u * (1 - minScale)) + 1;
167
+ const scale = Math.max(v, minScale);
168
+ el.style.transform = `translate3d(${x}px,0,0) scale(${scale})`;
169
+ el.style.opacity = scale;
170
+ });
171
+ super.update(changedProperties);
172
+ }
173
+ /* Advance to the next story card if possible */
174
+ next() {
175
+ this.index = Math.max(
176
+ 0,
177
+ Math.min(this.children.length - 1, this.index + 1)
178
+ );
179
+ this._update = false;
180
+ }
181
+ /* Go back to the previous story card if possible */
182
+ previous() {
183
+ this.index = Math.max(
184
+ 0,
185
+ Math.min(this.children.length - 1, this.index - 1)
186
+ );
187
+ this._update = false;
188
+ }
189
+ }
190
+ __decorateClass([
191
+ property({ type: Boolean })
192
+ ], PdPanelViewer.prototype, "withProgress");
193
+ __decorateClass([
194
+ property({ type: Number })
195
+ ], PdPanelViewer.prototype, "deltaCalc");
196
+ __decorateClass([
197
+ property({ type: Number, state: true })
198
+ ], PdPanelViewer.prototype, "_index");
199
+ __decorateClass([
200
+ property({ type: Object, state: true })
201
+ ], PdPanelViewer.prototype, "_panData");
202
+ __decorateClass([
203
+ property({ type: Boolean, state: true })
204
+ ], PdPanelViewer.prototype, "_update");
205
+
206
+ export { PdPanelViewer };
@@ -0,0 +1,3 @@
1
+ import { PdPanelViewer } from './PdPanelViewer.js';
2
+ export { PdPanelViewer };
3
+ //# 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/pd-panel-viewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOnD,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { PdPanel } from './PdPanel.js';
2
+ export { PdPanel };
3
+ //# sourceMappingURL=pd-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-panel.d.ts","sourceRoot":"","sources":["../../src/pd-panel-viewer/pd-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOvC,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,17 +1,2 @@
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
1
+ export * from './pd-panel-viewer/pd-panel-viewer'
2
+ export {}
@@ -1,207 +1,8 @@
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
- }
1
+ import { PdPanelViewer } from './pd-panel-viewer/PdPanelViewer.js';
129
2
 
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
- }
3
+ const tag = "pd-panel-viewer";
4
+ if (!customElements.get(tag)) {
5
+ customElements.define(tag, PdPanelViewer);
6
+ }
139
7
 
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
- };
8
+ export { PdPanelViewer };
@@ -1,6 +1,2 @@
1
- import { LitElement } from 'lit';
2
- export declare class PdPanel extends LitElement {
3
- static styles: import('lit').CSSResult;
4
- render(): import('lit-html').TemplateResult<1>;
5
- }
6
- //# sourceMappingURL=pd-panel.d.ts.map
1
+ export * from './pd-panel-viewer/pd-panel'
2
+ export {}
package/dist/pd-panel.js CHANGED
@@ -1,48 +1,8 @@
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
- }
1
+ import { PdPanel } from './pd-panel-viewer/PdPanel.js';
25
2
 
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
- };
3
+ const tag = "pd-panel";
4
+ if (!customElements.get(tag)) {
5
+ customElements.define(tag, PdPanel);
6
+ }
7
+
8
+ export { PdPanel };
@@ -0,0 +1,27 @@
1
+ import { LitElement } from 'lit';
2
+ /**
3
+ * @tagname pd-resize-content
4
+ *
5
+ * Komponente zur responsiven Darstellung von Inhalten.
6
+ * Wenn die Bildschirmbreite unter `resizeWidth` liegt, wird ein Popup angezeigt.
7
+ *
8
+ * @fires book-date – Wenn ein freier Termin ausgewählt wird (nicht aktiv)
9
+ * @fires edit-selection – Wenn der Nutzer Datum oder PLZ bearbeiten möchte (nicht aktiv)
10
+ *
11
+ * @slot resize-content - Der Hauptinhalt, der bei ausreichender Breite direkt angezeigt wird.
12
+ * @slot preview-content - Der Vorschauinhalt, der im Popup angezeigt wird, wenn die Breite nicht ausreicht.
13
+ */
14
+ export declare class PdResizeContent extends LitElement {
15
+ /**
16
+ * Minimale Breite, ab der der Inhalt direkt dargestellt wird. Darunter erscheint ein Popup.
17
+ */
18
+ resizeWidth: string;
19
+ /**
20
+ * Interner Zustand: Gibt an, ob der Inhalt versteckt werden soll und stattdessen ein Popup angezeigt wird.
21
+ */
22
+ private _hideContent;
23
+ static styles: import('lit').CSSResult;
24
+ connectedCallback(): void;
25
+ protected render(): import('lit').TemplateResult<1>;
26
+ }
27
+ //# sourceMappingURL=PdResizeContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PdResizeContent.d.ts","sourceRoot":"","sources":["../../src/pd-resize-content/PdResizeContent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAI5C,OAAO,6CAA6C,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAC7C;;OAEG;IAEH,WAAW,SAAY;IAEvB;;OAEG;IAEH,OAAO,CAAC,YAAY,CAAS;IAE7B,MAAM,CAAC,MAAM,0BAaX;IAEF,iBAAiB,IAAI,IAAI;IAUzB,SAAS,CAAC,MAAM;CAUjB"}
@@ -0,0 +1,62 @@
1
+ import { LitElement, css, html } from 'lit';
2
+ import { property, state } from 'lit/decorators.js';
3
+ import { installMediaQueryWatcher } from 'pwa-helpers/media-query';
4
+ import '@progressive-development/pd-dialog/pd-popup';
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __decorateClass = (decorators, target, key, kind) => {
8
+ var result = void 0 ;
9
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
+ if (decorator = decorators[i])
11
+ result = (decorator(target, key, result) ) || result;
12
+ if (result) __defProp(target, key, result);
13
+ return result;
14
+ };
15
+ class PdResizeContent extends LitElement {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.resizeWidth = "1232px";
19
+ this._hideContent = false;
20
+ }
21
+ static {
22
+ this.styles = css`
23
+ :host {
24
+ display: block;
25
+ }
26
+
27
+ h3 {
28
+ color: #084c61;
29
+ font-family: Oswald;
30
+ }
31
+
32
+ p {
33
+ color: #084c61;
34
+ }
35
+ `;
36
+ }
37
+ connectedCallback() {
38
+ super.connectedCallback();
39
+ installMediaQueryWatcher(
40
+ `(min-width: ${this.resizeWidth})`,
41
+ (matches) => {
42
+ this._hideContent = !matches;
43
+ }
44
+ );
45
+ }
46
+ render() {
47
+ return this._hideContent ? html`
48
+ <pd-popup>
49
+ <div slot="small-view"><slot name="preview-content"></slot></div>
50
+ <div slot="content"><slot name="resize-content"></slot></div>
51
+ </pd-popup>
52
+ ` : html`<slot name="resize-content"></slot>`;
53
+ }
54
+ }
55
+ __decorateClass([
56
+ property({ type: String })
57
+ ], PdResizeContent.prototype, "resizeWidth");
58
+ __decorateClass([
59
+ state()
60
+ ], PdResizeContent.prototype, "_hideContent");
61
+
62
+ export { PdResizeContent };
@@ -0,0 +1,3 @@
1
+ import { PdResizeContent } from './PdResizeContent.js';
2
+ export { PdResizeContent };
3
+ //# sourceMappingURL=pd-resize-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-resize-content.d.ts","sourceRoot":"","sources":["../../src/pd-resize-content/pd-resize-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAOvD,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-resize-content.stories.d.ts","sourceRoot":"","sources":["../../src/pd-resize-content/pd-resize-content.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,qBAAqB,CAAC;wBAWxB,IAAI;AATT,wBASU;AAqBV,eAAO,MAAM,OAAO,SAAoB,CAAC"}
@@ -1,25 +1,2 @@
1
- import { LitElement } from 'lit';
2
- /**
3
- * Komponente zur responsiven Darstellung von Inhalten.
4
- * Wenn die Bildschirmbreite unter `resizeWidth` liegt, wird ein Popup angezeigt.
5
- *
6
- * @fires book-date – Wenn ein freier Termin ausgewählt wird (nicht aktiv)
7
- * @fires edit-selection – Wenn der Nutzer Datum oder PLZ bearbeiten möchte (nicht aktiv)
8
- *
9
- * @slot resize-content - Der Hauptinhalt, der bei ausreichender Breite direkt angezeigt wird.
10
- * @slot preview-content - Der Vorschauinhalt, der im Popup angezeigt wird, wenn die Breite nicht ausreicht.
11
- */
12
- export declare class PdResizeContent extends LitElement {
13
- /**
14
- * Minimale Breite, ab der der Inhalt direkt dargestellt wird. Darunter erscheint ein Popup.
15
- */
16
- resizeWidth: string;
17
- /**
18
- * Interner Zustand: Gibt an, ob der Inhalt versteckt werden soll und stattdessen ein Popup angezeigt wird.
19
- */
20
- private _hideContent;
21
- static styles: import('lit').CSSResult;
22
- connectedCallback(): void;
23
- protected render(): import('lit-html').TemplateResult<1>;
24
- }
25
- //# sourceMappingURL=pd-resize-content.d.ts.map
1
+ export * from './pd-resize-content/pd-resize-content'
2
+ export {}