@ptcwebops/ptcw-design 2.9.5 → 2.9.7

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 (28) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/ptc-back-to-top.cjs.entry.js +37 -1
  3. package/dist/cjs/ptc-theater-video-modal.cjs.entry.js +1 -1
  4. package/dist/cjs/ptc-value-led-layout.cjs.entry.js +117 -0
  5. package/dist/cjs/ptcw-design.cjs.js +1 -1
  6. package/dist/collection/collection-manifest.json +1 -0
  7. package/dist/collection/components/ptc-back-to-top/ptc-back-to-top.css +8 -2
  8. package/dist/collection/components/ptc-back-to-top/ptc-back-to-top.js +36 -0
  9. package/dist/collection/components/ptc-theater-video-modal/ptc-theater-video-modal.js +1 -1
  10. package/dist/collection/components/ptc-value-led-layout/ptc-value-led-layout.css +212 -0
  11. package/dist/collection/components/ptc-value-led-layout/ptc-value-led-layout.js +162 -0
  12. package/dist/custom-elements/index.d.ts +6 -0
  13. package/dist/custom-elements/index.js +153 -3
  14. package/dist/esm/loader.js +1 -1
  15. package/dist/esm/ptc-back-to-top.entry.js +38 -2
  16. package/dist/esm/ptc-theater-video-modal.entry.js +1 -1
  17. package/dist/esm/ptc-value-led-layout.entry.js +113 -0
  18. package/dist/esm/ptcw-design.js +1 -1
  19. package/dist/ptcw-design/{p-32c53741.entry.js → p-615f3811.entry.js} +1 -1
  20. package/dist/ptcw-design/p-6483cc96.entry.js +1 -0
  21. package/dist/ptcw-design/p-dede84ce.entry.js +1 -0
  22. package/dist/ptcw-design/ptcw-design.esm.js +1 -1
  23. package/dist/types/components/ptc-back-to-top/ptc-back-to-top.d.ts +1 -0
  24. package/dist/types/components/ptc-value-led-layout/ptc-value-led-layout.d.ts +18 -0
  25. package/dist/types/components.d.ts +15 -0
  26. package/package.json +1 -1
  27. package/readme.md +1 -1
  28. package/dist/ptcw-design/p-1286d2f5.entry.js +0 -1
@@ -2,8 +2,6 @@
2
2
  display: block;
3
3
  }
4
4
  :host .back-to-top-button {
5
- position: fixed;
6
- bottom: 140px;
7
5
  right: 24px;
8
6
  width: 64px;
9
7
  height: 58px;
@@ -25,6 +23,14 @@
25
23
  :host .back-to-top-button:hover {
26
24
  opacity: 1;
27
25
  }
26
+ :host .back-to-top-button-fixed {
27
+ position: fixed;
28
+ bottom: 140px;
29
+ }
30
+ :host .back-to-top-button-absolute {
31
+ position: absolute;
32
+ bottom: 140px;
33
+ }
28
34
  :host .arrow {
29
35
  margin-bottom: 5px;
30
36
  }
@@ -3,7 +3,42 @@ export class PtcBackToTop {
3
3
  constructor() {
4
4
  this.handleScroll = () => {
5
5
  const scrollY = window.pageYOffset || document.documentElement.scrollTop;
6
+ const containerHeight = document.querySelector('.ptc-container-relative');
6
7
  this.showButton = scrollY > window.innerHeight * 1;
8
+ if (containerHeight) {
9
+ if (this.showButton && scrollY <= (containerHeight.clientHeight - window.innerHeight)) {
10
+ const btnelement = this.el.shadowRoot.querySelector('.back-to-top-button');
11
+ if (btnelement) {
12
+ if (!btnelement.classList.contains('back-to-top-button-fixed')) {
13
+ btnelement.classList.add('back-to-top-button-fixed');
14
+ }
15
+ if (btnelement.classList.contains('back-to-top-button-absolute')) {
16
+ btnelement.classList.remove('back-to-top-button-absolute');
17
+ }
18
+ }
19
+ }
20
+ else if (this.showButton && scrollY > (containerHeight.clientHeight - window.innerHeight)) {
21
+ const btnelement = this.el.shadowRoot.querySelector('.back-to-top-button');
22
+ if (btnelement) {
23
+ if (btnelement.classList.contains('back-to-top-button-fixed')) {
24
+ btnelement.classList.remove('back-to-top-button-fixed');
25
+ }
26
+ if (!btnelement.classList.contains('back-to-top-button-absolute')) {
27
+ btnelement.classList.add('back-to-top-button-absolute');
28
+ }
29
+ }
30
+ }
31
+ }
32
+ else {
33
+ if (this.showButton) {
34
+ const btnelement = this.el.shadowRoot.querySelector('.back-to-top-button');
35
+ if (btnelement) {
36
+ if (!btnelement.classList.contains('back-to-top-button-fixed')) {
37
+ btnelement.classList.add('back-to-top-button-fixed');
38
+ }
39
+ }
40
+ }
41
+ }
7
42
  };
8
43
  this.showButton = false;
9
44
  }
@@ -49,6 +84,7 @@ export class PtcBackToTop {
49
84
  "showButton": {}
50
85
  };
51
86
  }
87
+ static get elementRef() { return "el"; }
52
88
  static get listeners() {
53
89
  return [{
54
90
  "name": "click",
@@ -28,8 +28,8 @@ export class PtcTheaterVideoModal {
28
28
  // });
29
29
  // console.log(this.cards);
30
30
  console.log(currentModalIndex);
31
- this.modalType = this.cards[this.currentCardIndex].modalType;
32
31
  this.currentCardIndex = currentModalIndex;
32
+ this.modalType = this.cards[this.currentCardIndex].modalType;
33
33
  this.showModal = true;
34
34
  }
35
35
  closeCardModal() {
@@ -0,0 +1,212 @@
1
+ .ptc-container {
2
+ padding-right: 24px;
3
+ padding-left: 24px;
4
+ margin-right: auto;
5
+ margin-left: auto;
6
+ }
7
+
8
+ @media only screen and (min-width: 1200px) {
9
+ .ptc-container {
10
+ padding-left: 0;
11
+ padding-right: 0;
12
+ max-width: 1136px;
13
+ }
14
+ }
15
+ @media only screen and (min-width: 1440px) {
16
+ .ptc-container {
17
+ padding-left: 0;
18
+ padding-right: 0;
19
+ max-width: 1200px;
20
+ }
21
+ }
22
+ .ptc-container-lg {
23
+ padding-right: 15px;
24
+ padding-left: 15px;
25
+ margin-right: auto;
26
+ margin-left: auto;
27
+ }
28
+
29
+ @media only screen and (min-width: 480px) {
30
+ .ptc-container-lg {
31
+ padding-left: var(--ptc-layout-spacing-03);
32
+ padding-right: var(--ptc-layout-spacing-03);
33
+ }
34
+ }
35
+ @media only screen and (min-width: 768px) {
36
+ .ptc-container-lg {
37
+ padding-left: var(--ptc-layout-spacing-04);
38
+ padding-right: var(--ptc-layout-spacing-04);
39
+ }
40
+ }
41
+ @media only screen and (min-width: 992px) {
42
+ .ptc-container-lg {
43
+ padding-left: var(--ptc-element-spacing-08);
44
+ padding-right: var(--ptc-element-spacing-08);
45
+ }
46
+ }
47
+ @media only screen and (min-width: 1980px) {
48
+ .ptc-container-lg {
49
+ padding-left: 0;
50
+ padding-right: 0;
51
+ max-width: 1900px;
52
+ }
53
+ }
54
+ .ptc-container-fluid {
55
+ width: 100%;
56
+ }
57
+
58
+ :host {
59
+ display: block;
60
+ position: relative;
61
+ }
62
+ :host * {
63
+ box-sizing: border-box;
64
+ }
65
+ :host .top-image {
66
+ background-color: rgba(0, 0, 0, 0.8);
67
+ background-blend-mode: multiply;
68
+ position: absolute;
69
+ z-index: -1;
70
+ width: 100%;
71
+ height: 500px;
72
+ background-size: cover;
73
+ background-position: center;
74
+ }
75
+ :host .pdf-slot-wrapper {
76
+ padding: 1rem 0;
77
+ width: 100%;
78
+ text-align: right;
79
+ }
80
+ :host .vl-layout-wrap {
81
+ margin-top: 64px;
82
+ width: 100%;
83
+ position: relative;
84
+ }
85
+ @media only screen and (min-width: 992px) {
86
+ :host .vl-layout-wrap {
87
+ display: flex;
88
+ }
89
+ }
90
+ @media only screen and (min-width: 992px) {
91
+ :host .vl-layout-wrap .vl-sidebar {
92
+ width: 22%;
93
+ margin-right: var(--ptc-layout-spacing-04);
94
+ }
95
+ }
96
+ :host .vl-layout-wrap .vl-list-wrap {
97
+ width: 100%;
98
+ padding: 8px 0;
99
+ max-height: calc(100vh - 200px);
100
+ background-color: #fff;
101
+ border-radius: var(--ptc-border-radius-standard);
102
+ }
103
+ @media only screen and (min-width: 992px) {
104
+ :host .vl-layout-wrap .vl-list-wrap {
105
+ z-index: 105;
106
+ margin: auto;
107
+ position: sticky;
108
+ top: 32px;
109
+ right: 0;
110
+ float: right;
111
+ overflow-y: auto;
112
+ overflow-x: hidden;
113
+ }
114
+ }
115
+ :host .vl-layout-wrap .vl-list-wrap ul {
116
+ margin: 0;
117
+ padding: 0;
118
+ list-style: none;
119
+ }
120
+ :host .vl-layout-wrap .vl-list-wrap ul li {
121
+ display: none;
122
+ }
123
+ @media only screen and (min-width: 992px) {
124
+ :host .vl-layout-wrap .vl-list-wrap ul li {
125
+ display: block;
126
+ }
127
+ }
128
+ :host .vl-layout-wrap .vl-list-wrap ul li a {
129
+ display: block;
130
+ padding: 12px 32px;
131
+ font-size: var(--ptc-font-size-small);
132
+ line-height: var(--ptc-line-height-densest);
133
+ text-decoration: none;
134
+ color: var(--color-gray-10);
135
+ position: relative;
136
+ }
137
+ :host .vl-layout-wrap .vl-list-wrap ul li a::before {
138
+ content: "";
139
+ display: block;
140
+ width: 2px;
141
+ height: calc(100% - 24px);
142
+ background-color: transparent;
143
+ position: absolute;
144
+ left: 24px;
145
+ }
146
+ :host .vl-layout-wrap .vl-list-wrap ul li a:hover {
147
+ font-weight: 700;
148
+ }
149
+ :host .vl-layout-wrap .vl-list-wrap ul li a:hover::before {
150
+ background-color: var(--color-green-07);
151
+ }
152
+ :host .vl-layout-wrap .vl-list-wrap ul li.active {
153
+ display: block;
154
+ }
155
+ :host .vl-layout-wrap .vl-list-wrap ul li.active a {
156
+ font-weight: 700;
157
+ }
158
+ :host .vl-layout-wrap .vl-list-wrap ul li.active a::before {
159
+ background-color: var(--color-green-07);
160
+ }
161
+ :host .vl-layout-wrap .vl-list-wrap::-webkit-scrollbar {
162
+ width: 8px;
163
+ }
164
+ :host .vl-layout-wrap .vl-list-wrap::-webkit-scrollbar-track {
165
+ background: transparent;
166
+ }
167
+ :host .vl-layout-wrap .vl-list-wrap::-webkit-scrollbar-thumb {
168
+ background: var(--color-gray-02);
169
+ border-radius: var(--ptc-border-radius-pill);
170
+ }
171
+ :host .vl-layout-wrap .vl-list-wrap select {
172
+ z-index: 105;
173
+ background-color: #fff;
174
+ }
175
+ :host .vl-layout-wrap .vl-content-wrap {
176
+ width: 100%;
177
+ padding: 0 32px 32px 32px;
178
+ background-color: #fff;
179
+ border-radius: var(--ptc-border-radius-standard);
180
+ }
181
+ @media only screen and (min-width: 992px) {
182
+ :host .vl-layout-wrap .vl-content-wrap {
183
+ width: 78%;
184
+ padding: 48px;
185
+ }
186
+ }
187
+ :host .vl-layout-wrap .vl-content-wrap.is-pinned {
188
+ padding-top: 75px;
189
+ }
190
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select {
191
+ font-size: 18px;
192
+ font-weight: 700;
193
+ line-height: 1.5;
194
+ position: sticky;
195
+ top: -1px;
196
+ z-index: 1056;
197
+ -moz-appearance: none;
198
+ /* Firefox */
199
+ -webkit-appearance: none;
200
+ /* Safari and Chrome */
201
+ appearance: none;
202
+ background: var(--color-white);
203
+ background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="10" viewBox="0 0 14 10" fill="none"><path d="M2 2.30469L6.94975 7.60799L11.8995 2.30469" stroke="%2300890B" stroke-width="3" stroke-linecap="round"/></svg>');
204
+ background-repeat: no-repeat;
205
+ border-radius: 4px 4px 0px 0px;
206
+ box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.24);
207
+ padding: 24px 48px 24px 24px;
208
+ border: none;
209
+ width: calc(100% + 64px);
210
+ margin-left: -32px;
211
+ background-position: calc(100% - 24px) 50%;
212
+ }
@@ -0,0 +1,162 @@
1
+ import { Host, h } from '@stencil/core';
2
+ export class PtcValueLedLayout {
3
+ constructor() {
4
+ this.sidebarData = [];
5
+ this.dropFlag = false;
6
+ this.topBackgroundImage = undefined;
7
+ this.isMobile = undefined;
8
+ }
9
+ handleMobileChange() {
10
+ if (this.isMobile) {
11
+ const mobileSelect = this.hostElement.shadowRoot.querySelector(".mobile-select");
12
+ const contentWrap = this.hostElement.shadowRoot.querySelector(".vl-content-wrap");
13
+ const observer = new IntersectionObserver(([e]) => {
14
+ const isPinned = e.intersectionRatio < 1;
15
+ mobileSelect.classList.toggle("is-pinned", isPinned);
16
+ contentWrap.classList.toggle("is-pinned", isPinned);
17
+ }, { threshold: [1] });
18
+ if (mobileSelect) {
19
+ observer.observe(mobileSelect);
20
+ }
21
+ }
22
+ }
23
+ componentWillLoad() {
24
+ this.getSidebarList();
25
+ this.isMobile = window.innerWidth < 992;
26
+ }
27
+ componentDidLoad() {
28
+ this.handleMobileChange();
29
+ this.setActiveItem();
30
+ }
31
+ getSidebarList() {
32
+ const sidebarList = document.querySelectorAll('.vl-content-item');
33
+ sidebarList.forEach(listItem => {
34
+ let itemTitle = listItem.getAttribute('comp-title');
35
+ let itemRef = listItem.getAttribute('id');
36
+ let vlItem = { title: itemTitle, ref: itemRef };
37
+ this.sidebarData.push(vlItem);
38
+ });
39
+ }
40
+ handleResize() {
41
+ this.isMobile = window.innerWidth < 992;
42
+ this.setActiveItem();
43
+ }
44
+ handleScroll() {
45
+ this.setActiveItem();
46
+ }
47
+ setActiveItem() {
48
+ const windowScroll = window.scrollY || window.pageYOffset;
49
+ if (windowScroll >= 100) {
50
+ this.sidebarData.forEach((item, i) => {
51
+ const section = document.getElementById(item.ref);
52
+ // console.log(section);
53
+ // console.log(section.offsetTop);
54
+ // console.log(windowScroll);
55
+ if (section && section.offsetTop <= windowScroll) {
56
+ this.updateActiveItem(i);
57
+ }
58
+ });
59
+ }
60
+ else {
61
+ this.updateActiveItem(0);
62
+ }
63
+ }
64
+ updateActiveItem(index) {
65
+ // console.log(index);
66
+ const activeListItem = this.hostElement.shadowRoot.querySelector('.vl-list-wrap ul li.active');
67
+ if (activeListItem) {
68
+ activeListItem.classList.remove('active');
69
+ }
70
+ const listItem = this.hostElement.shadowRoot.querySelector(`.vl-list-wrap ul li:nth-child(${index + 1})`);
71
+ if (listItem) {
72
+ listItem.classList.add('active');
73
+ }
74
+ // Update the selected option in the mobile select
75
+ const mobileSelect = this.hostElement.shadowRoot.querySelector('.mobile-select');
76
+ if (mobileSelect) {
77
+ mobileSelect.selectedIndex = index;
78
+ }
79
+ }
80
+ handleListItemClick(index) {
81
+ // Handle list item click
82
+ // console.log('test');
83
+ const section = document.getElementById(this.sidebarData[index].ref);
84
+ if (section) {
85
+ section.scrollIntoView({ behavior: 'smooth' });
86
+ }
87
+ this.setActiveItem();
88
+ }
89
+ handleSelectChange(event) {
90
+ // console.log('changed');
91
+ const selectedIndex = event.target.selectedIndex;
92
+ const section = document.getElementById(this.sidebarData[selectedIndex].ref);
93
+ if (section) {
94
+ section.scrollIntoView({ behavior: 'smooth' });
95
+ }
96
+ this.updateActiveItem(selectedIndex);
97
+ }
98
+ render() {
99
+ return (h(Host, null, h("div", { class: 'top-image', style: { backgroundImage: `url(${this.topBackgroundImage})` } }), h("div", { class: 'ptc-container' }, h("div", { class: "pdf-slot-wrapper" }, h("slot", { name: 'pdf-slot' })), h("div", { class: "vl-layout-wrap" }, (this.sidebarData.length > 0 && !this.isMobile) && (h("div", { class: 'vl-sidebar' }, h("div", { class: 'vl-list-wrap' }, h("ul", null, this.sidebarData.map((item, index) => (h("li", null, h("a", { href: "#" + item.ref, onClick: () => this.updateActiveItem(index) }, item.title)))))))), h("div", { class: 'vl-content-wrap' }, this.isMobile &&
100
+ h("select", { class: 'mobile-select', onChange: (event) => this.handleSelectChange(event) }, this.sidebarData.map((item) => (h("option", { value: item.title }, " ", item.title)))), h("slot", null))))));
101
+ }
102
+ static get is() { return "ptc-value-led-layout"; }
103
+ static get encapsulation() { return "shadow"; }
104
+ static get originalStyleUrls() {
105
+ return {
106
+ "$": ["ptc-value-led-layout.scss"]
107
+ };
108
+ }
109
+ static get styleUrls() {
110
+ return {
111
+ "$": ["ptc-value-led-layout.css"]
112
+ };
113
+ }
114
+ static get properties() {
115
+ return {
116
+ "topBackgroundImage": {
117
+ "type": "string",
118
+ "mutable": false,
119
+ "complexType": {
120
+ "original": "string",
121
+ "resolved": "string",
122
+ "references": {}
123
+ },
124
+ "required": false,
125
+ "optional": false,
126
+ "docs": {
127
+ "tags": [],
128
+ "text": ""
129
+ },
130
+ "attribute": "top-background-image",
131
+ "reflect": false
132
+ }
133
+ };
134
+ }
135
+ static get states() {
136
+ return {
137
+ "isMobile": {}
138
+ };
139
+ }
140
+ static get elementRef() { return "hostElement"; }
141
+ static get watchers() {
142
+ return [{
143
+ "propName": "isMobile",
144
+ "methodName": "handleMobileChange"
145
+ }];
146
+ }
147
+ static get listeners() {
148
+ return [{
149
+ "name": "resize",
150
+ "method": "handleResize",
151
+ "target": "window",
152
+ "capture": false,
153
+ "passive": true
154
+ }, {
155
+ "name": "scroll",
156
+ "method": "handleScroll",
157
+ "target": "window",
158
+ "capture": false,
159
+ "passive": true
160
+ }];
161
+ }
162
+ }
@@ -698,6 +698,12 @@ export const PtcTwoColumnMedia: {
698
698
  new (): PtcTwoColumnMedia;
699
699
  };
700
700
 
701
+ interface PtcValueLedLayout extends Components.PtcValueLedLayout, HTMLElement {}
702
+ export const PtcValueLedLayout: {
703
+ prototype: PtcValueLedLayout;
704
+ new (): PtcValueLedLayout;
705
+ };
706
+
701
707
  interface PtcValuePropCard extends Components.PtcValuePropCard, HTMLElement {}
702
708
  export const PtcValuePropCard: {
703
709
  prototype: PtcValuePropCard;