@ptcwebops/ptcw-design 6.3.59-beta → 6.3.61-beta

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 (196) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/ptc-button.cjs.entry.js +89 -0
  3. package/dist/cjs/ptc-card_2.cjs.entry.js +3 -2
  4. package/dist/cjs/ptc-img.cjs.entry.js +85 -8
  5. package/dist/cjs/ptc-jumbotron.cjs.entry.js +6 -2
  6. package/dist/cjs/ptc-para.cjs.entry.js +127 -0
  7. package/dist/cjs/ptc-picture.cjs.entry.js +162 -0
  8. package/dist/cjs/ptc-spacer.cjs.entry.js +38 -0
  9. package/dist/cjs/ptc-title.cjs.entry.js +152 -0
  10. package/dist/cjs/ptcw-design.cjs.js +1 -1
  11. package/dist/collection/components/ptc-card/ptc-card.js +21 -2
  12. package/dist/collection/components/ptc-img/ptc-img.css +47 -0
  13. package/dist/collection/components/ptc-img/ptc-img.js +129 -7
  14. package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.js +24 -2
  15. package/dist/collection/stories/ResponsiveWrapper.stories.js +21 -0
  16. package/dist/collection/stories/organisms/ptc/Academic Form/preview.stories.js +22 -0
  17. package/dist/collection/stories/organisms/ptc/All Products/preview.stories.js +1616 -0
  18. package/dist/collection/stories/organisms/ptc/Announcement/preview.stories.js +58 -0
  19. package/dist/collection/stories/organisms/ptc/Background Video/preview.stories.js +58 -0
  20. package/dist/collection/stories/organisms/ptc/Blog Author Listing/preview.stories.js +32 -0
  21. package/dist/collection/stories/organisms/ptc/Blog Content/preview.stories.js +317 -0
  22. package/dist/collection/stories/organisms/ptc/Blog Detail/preview.stories.js +500 -0
  23. package/dist/collection/stories/organisms/ptc/Blogs Listing Page/preview.stories.js +368 -0
  24. package/dist/collection/stories/organisms/ptc/Bureau New Dynamic/preview.stories.js +54 -0
  25. package/dist/collection/stories/organisms/ptc/Case Studies/preview.stories.js +243 -0
  26. package/dist/collection/stories/organisms/ptc/Case Studies Detail Page/preview.stories.js +456 -0
  27. package/dist/collection/stories/organisms/ptc/Case Studies Slider/preview.stories.js +384 -0
  28. package/dist/collection/stories/organisms/ptc/Case Studies Slider New/preview.stories.js +171 -0
  29. package/dist/collection/stories/organisms/ptc/Clq Modal Quiz/preview.stories.js +100 -0
  30. package/dist/collection/stories/organisms/ptc/Contact Free Trial Form/preview.stories.js +22 -0
  31. package/dist/collection/stories/organisms/ptc/Countdown Example/preview.stories.js +29 -0
  32. package/dist/collection/stories/organisms/ptc/E Store Build Listing/preview.stories.js +543 -0
  33. package/dist/collection/stories/organisms/ptc/E Store Build Product/preview.stories.js +427 -0
  34. package/dist/collection/stories/organisms/ptc/Eloqua Library Contact Info/preview.stories.js +168 -0
  35. package/dist/collection/stories/organisms/ptc/Eloqua Library Visitor PCenter/preview.stories.js +60 -0
  36. package/dist/collection/stories/organisms/ptc/Eloqua Library Visitor Recipient Id/preview.stories.js +59 -0
  37. package/dist/collection/stories/organisms/ptc/Embedded Form/preview.stories.js +23 -0
  38. package/dist/collection/stories/organisms/ptc/Embedded Form Floating/preview.stories.js +165 -0
  39. package/dist/collection/stories/organisms/ptc/Event Detail/preview.stories.js +16 -0
  40. package/dist/collection/stories/organisms/ptc/Event Jumbotron/preview.stories.js +470 -0
  41. package/dist/collection/stories/organisms/ptc/Event Podcast Slider/preview.stories.js +142 -0
  42. package/dist/collection/stories/organisms/ptc/Events Listing Cards/preview.stories.js +169 -0
  43. package/dist/collection/stories/organisms/ptc/Events Listing Cards Horizontal/preview.stories.js +169 -0
  44. package/dist/collection/stories/organisms/ptc/Featured Events Slider/preview.stories.js +165 -0
  45. package/dist/collection/stories/organisms/ptc/Featured List/preview.stories.js +16 -0
  46. package/dist/collection/stories/organisms/ptc/Filter Level Theater/preview.stories.js +18 -0
  47. package/dist/collection/stories/organisms/ptc/Five Card Value Prop/preview.stories.js +64 -0
  48. package/dist/collection/stories/organisms/ptc/Footer Form/preview.stories.js +18 -0
  49. package/dist/collection/stories/organisms/ptc/Footer V2/preview.stories.js +138 -0
  50. package/dist/collection/stories/organisms/ptc/Footer V2 Cn/preview.stories.js +146 -0
  51. package/dist/collection/stories/organisms/ptc/Form Radio Button/preview.stories.js +42 -0
  52. package/dist/collection/stories/organisms/ptc/Framed Video 16 9/preview.stories.js +31 -0
  53. package/dist/collection/stories/organisms/ptc/Homepage Image Feature/preview.stories.js +41 -0
  54. package/dist/collection/stories/organisms/ptc/Homepage Jumbotron/preview.stories.js +166 -0
  55. package/dist/collection/stories/organisms/ptc/Homepage Toggled Content/preview.stories.js +227 -0
  56. package/dist/collection/stories/organisms/ptc/Hub Of Hubs/preview.stories.js +417 -0
  57. package/dist/collection/stories/organisms/ptc/Intro/preview.stories.js +41 -0
  58. package/dist/collection/stories/organisms/ptc/Jumbotron/preview.stories.js +431 -0
  59. package/dist/collection/stories/organisms/ptc/Jumbotron With Logos/preview.stories.js +431 -0
  60. package/dist/collection/stories/organisms/ptc/Large Bulleted List/preview.stories.js +224 -0
  61. package/dist/collection/stories/organisms/ptc/Large Bulleted List V2/preview.stories.js +326 -0
  62. package/dist/collection/stories/organisms/ptc/Listing Filter/preview.stories.js +256 -0
  63. package/dist/collection/stories/organisms/ptc/Main Nav Product Solutions Tab/preview.stories.js +200 -0
  64. package/dist/collection/stories/organisms/ptc/Mathcad Start Page/preview.stories.js +100 -0
  65. package/dist/collection/stories/organisms/ptc/Media Kit Speed Bump/preview.stories.js +39 -0
  66. package/dist/collection/stories/organisms/ptc/Most Popular News/preview.stories.js +28 -0
  67. package/dist/collection/stories/organisms/ptc/Mvc Form/preview.stories.js +22 -0
  68. package/dist/collection/stories/organisms/ptc/New Buttons/preview.stories.js +125 -0
  69. package/dist/collection/stories/organisms/ptc/Partners Detail/preview.stories.js +151 -0
  70. package/dist/collection/stories/organisms/ptc/Partners Listing/preview.stories.js +394 -0
  71. package/dist/collection/stories/organisms/ptc/Pdf Portal/preview.stories.js +140 -0
  72. package/dist/collection/stories/organisms/ptc/Plm On Demand 1/preview.stories.js +205 -0
  73. package/dist/collection/stories/organisms/ptc/Plm On Demand 2/preview.stories.js +180 -0
  74. package/dist/collection/stories/organisms/ptc/Podcast List/preview.stories.js +175 -0
  75. package/dist/collection/stories/organisms/ptc/Preference Center/preview.stories.js +235 -0
  76. package/dist/collection/stories/organisms/ptc/Preference Center Exit Page/preview.stories.js +85 -0
  77. package/dist/collection/stories/organisms/ptc/Preference Center Update Email/preview.stories.js +54 -0
  78. package/dist/collection/stories/organisms/ptc/Preference Center Update Personal Info/preview.stories.js +59 -0
  79. package/dist/collection/stories/organisms/ptc/Pricing Packaging Table/preview.stories.js +399 -0
  80. package/dist/collection/stories/organisms/ptc/Pricing Packaging Table Subnav/preview.stories.js +179 -0
  81. package/dist/collection/stories/organisms/ptc/Ptc 3 Card Value Prop/preview.stories.js +46 -0
  82. package/dist/collection/stories/organisms/ptc/Ptc Bio Cards/preview.stories.js +741 -0
  83. package/dist/collection/stories/organisms/ptc/Ptc Creo Start Page/preview.stories.js +111 -0
  84. package/dist/collection/stories/organisms/ptc/Ptc Editorial/preview.stories.js +84 -0
  85. package/dist/collection/stories/organisms/ptc/Ptc Form/preview.stories.js +18 -0
  86. package/dist/collection/stories/organisms/ptc/Ptc Icon Card Slider/preview.stories.js +121 -0
  87. package/dist/collection/stories/organisms/ptc/Ptc Icon Component/preview.stories.js +185 -0
  88. package/dist/collection/stories/organisms/ptc/Ptc Icon Sprites/preview.stories.js +150 -0
  89. package/dist/collection/stories/organisms/ptc/Ptc Innovator Toggle/preview.stories.js +421 -0
  90. package/dist/collection/stories/organisms/ptc/Ptc Media Cards/preview.stories.js +133 -0
  91. package/dist/collection/stories/organisms/ptc/Ptc News Detail/preview.stories.js +142 -0
  92. package/dist/collection/stories/organisms/ptc/Ptc News Detail Alternate/preview.stories.js +140 -0
  93. package/dist/collection/stories/organisms/ptc/Ptc Offices/preview.stories.js +405 -0
  94. package/dist/collection/stories/organisms/ptc/Ptc Readmore V3/preview.stories.js +71 -0
  95. package/dist/collection/stories/organisms/ptc/Ptc Showcase Card/preview.stories.js +177 -0
  96. package/dist/collection/stories/organisms/ptc/Ptc Sticky Share Icons/preview.stories.js +184 -0
  97. package/dist/collection/stories/organisms/ptc/Ptc Subnav V1/preview.stories.js +149 -0
  98. package/dist/collection/stories/organisms/ptc/Ptc Subnav V2/preview.stories.js +91 -0
  99. package/dist/collection/stories/organisms/ptc/Ptc Text Copy With Background/preview.stories.js +226 -0
  100. package/dist/collection/stories/organisms/ptc/Ptc Title Demo/preview.stories.js +24 -0
  101. package/dist/collection/stories/organisms/ptc/Ptc Tooltip V3/preview.stories.js +85 -0
  102. package/dist/collection/stories/organisms/ptc/Ptc Two Column Two Media/preview.stories.js +126 -0
  103. package/dist/collection/stories/organisms/ptc/Read More/preview.stories.js +278 -0
  104. package/dist/collection/stories/organisms/ptc/Related Cards/preview.stories.js +107 -0
  105. package/dist/collection/stories/organisms/ptc/Resource Center/preview.stories.js +149 -0
  106. package/dist/collection/stories/organisms/ptc/Search Result/preview.stories.js +62 -0
  107. package/dist/collection/stories/organisms/ptc/Search Result News/preview.stories.js +72 -0
  108. package/dist/collection/stories/organisms/ptc/Searchbar Plm On Demand/preview.stories.js +62 -0
  109. package/dist/collection/stories/organisms/ptc/Seo Test/preview.stories.js +215 -0
  110. package/dist/collection/stories/organisms/ptc/Sequential Slider/preview.stories.js +38 -0
  111. package/dist/collection/stories/organisms/ptc/Sequential Slider Mobile/preview.stories.js +90 -0
  112. package/dist/collection/stories/organisms/ptc/Shortform Agileworx/preview.stories.js +22 -0
  113. package/dist/collection/stories/organisms/ptc/Storefront Enhanced Product Listing/preview.stories.js +132 -0
  114. package/dist/collection/stories/organisms/ptc/Success Path Details Page/preview.stories.js +236 -0
  115. package/dist/collection/stories/organisms/ptc/Three Column Text/preview.stories.js +75 -0
  116. package/dist/collection/stories/organisms/ptc/Three Up Text Cards/preview.stories.js +134 -0
  117. package/dist/collection/stories/organisms/ptc/Two Column Media/preview.stories.js +181 -0
  118. package/dist/collection/stories/organisms/ptc/Two Column With Toggle/preview.stories.js +549 -0
  119. package/dist/collection/stories/organisms/ptc/Value Led Resource/preview.stories.js +479 -0
  120. package/dist/collection/stories/organisms/ptc/Volvo Three Col/preview.stories.js +115 -0
  121. package/dist/collection/stories/organisms/ptc/Vuforia Quiz/preview.stories.js +26 -0
  122. package/dist/collection/stories/organisms/ptc/White Paper/preview.stories.js +174 -0
  123. package/dist/custom-elements/index.js +97 -15
  124. package/dist/esm/blog-detail-content_2.entry.js +1 -1
  125. package/dist/esm/blog-detail-layout.entry.js +1 -1
  126. package/dist/esm/blogs-search-section.entry.js +1 -1
  127. package/dist/esm/homepage-jumbotron.entry.js +1 -1
  128. package/dist/esm/homepage-toggled-content.entry.js +1 -1
  129. package/dist/esm/{interfaces-7c0243be.js → interfaces-4caedd26.js} +1 -1
  130. package/dist/esm/loader.js +1 -1
  131. package/dist/esm/most-popular-news.entry.js +1 -1
  132. package/dist/esm/my-component.entry.js +1 -1
  133. package/dist/esm/ptc-accordion-item.entry.js +1 -1
  134. package/dist/esm/ptc-background-video.entry.js +1 -1
  135. package/dist/esm/ptc-button.entry.js +85 -0
  136. package/dist/esm/ptc-card_2.entry.js +3 -2
  137. package/dist/esm/ptc-collapse-list.entry.js +1 -1
  138. package/dist/esm/ptc-form-checkbox_4.entry.js +1 -1
  139. package/dist/esm/ptc-homepage-image-feature.entry.js +1 -1
  140. package/dist/esm/ptc-homepage-video-background.entry.js +1 -1
  141. package/dist/esm/ptc-icon-card.entry.js +1 -1
  142. package/dist/esm/ptc-img.entry.js +86 -9
  143. package/dist/esm/ptc-jumbotron.entry.js +6 -2
  144. package/dist/esm/ptc-link.entry.js +1 -1
  145. package/dist/esm/ptc-media-card.entry.js +1 -1
  146. package/dist/esm/ptc-para.entry.js +123 -0
  147. package/dist/esm/ptc-picture.entry.js +158 -0
  148. package/dist/esm/ptc-pricing-packaging-table.entry.js +1 -1
  149. package/dist/esm/ptc-pricing-tabs.entry.js +1 -1
  150. package/dist/esm/ptc-social-icons-footer.entry.js +1 -1
  151. package/dist/esm/ptc-spacer.entry.js +34 -0
  152. package/dist/esm/ptc-title.entry.js +148 -0
  153. package/dist/esm/ptcw-design.js +1 -1
  154. package/dist/esm/{utils-7c68b88a.js → utils-2f12c081.js} +1 -1
  155. package/dist/ptcw-design/p-0c4918f5.entry.js +1 -0
  156. package/dist/ptcw-design/p-0c69ea52.entry.js +1 -0
  157. package/dist/ptcw-design/{p-dffcfa42.entry.js → p-14b7693f.entry.js} +1 -1
  158. package/dist/ptcw-design/{p-30bfb2f9.entry.js → p-1eb40265.entry.js} +1 -1
  159. package/dist/ptcw-design/{p-068ea6b7.entry.js → p-1efb0486.entry.js} +1 -1
  160. package/dist/ptcw-design/{p-673cfd2e.entry.js → p-257267e3.entry.js} +1 -1
  161. package/dist/ptcw-design/{p-4056c365.entry.js → p-297a14cb.entry.js} +1 -1
  162. package/dist/ptcw-design/p-2cc7e2a8.entry.js +1 -0
  163. package/dist/ptcw-design/{p-16d47ac5.entry.js → p-45b1f3fc.entry.js} +1 -1
  164. package/dist/ptcw-design/{p-81e65926.entry.js → p-4702c233.entry.js} +1 -1
  165. package/dist/ptcw-design/{p-531caca4.entry.js → p-4ca956c1.entry.js} +1 -1
  166. package/dist/ptcw-design/{p-55e344bc.entry.js → p-52e17d34.entry.js} +1 -1
  167. package/dist/ptcw-design/p-539639ff.entry.js +1 -0
  168. package/dist/ptcw-design/{p-ee1183b2.js → p-711bcdad.js} +1 -1
  169. package/dist/ptcw-design/{p-e813ea2b.entry.js → p-76dab076.entry.js} +1 -1
  170. package/dist/ptcw-design/{p-826c17e8.js → p-80122e26.js} +1 -1
  171. package/dist/ptcw-design/{p-a5ad0eff.entry.js → p-8c121480.entry.js} +1 -1
  172. package/dist/ptcw-design/{p-5bd8b4be.entry.js → p-8cea8943.entry.js} +1 -1
  173. package/dist/ptcw-design/{p-757e3edb.entry.js → p-8e42a22d.entry.js} +1 -1
  174. package/dist/ptcw-design/{p-0252726c.entry.js → p-901c31b3.entry.js} +1 -1
  175. package/dist/ptcw-design/{p-2ba1ef9d.entry.js → p-9dbcfcee.entry.js} +1 -1
  176. package/dist/ptcw-design/{p-24a6eefa.entry.js → p-a5fc048f.entry.js} +1 -1
  177. package/dist/ptcw-design/p-a8872ce3.entry.js +1 -0
  178. package/dist/ptcw-design/{p-50770cc0.entry.js → p-b647f7a1.entry.js} +1 -1
  179. package/dist/ptcw-design/{p-80588c84.entry.js → p-d51438de.entry.js} +1 -1
  180. package/dist/ptcw-design/p-e4eb925f.entry.js +1 -0
  181. package/dist/ptcw-design/p-e94353a4.entry.js +1 -0
  182. package/dist/ptcw-design/{p-37c4f168.entry.js → p-f1734520.entry.js} +1 -1
  183. package/dist/ptcw-design/p-ff4d3794.entry.js +1 -0
  184. package/dist/ptcw-design/ptcw-design.esm.js +1 -1
  185. package/dist/types/components/ptc-card/ptc-card.d.ts +1 -0
  186. package/dist/types/components/ptc-img/ptc-img.d.ts +29 -1
  187. package/dist/types/components/ptc-jumbotron/ptc-jumbotron.d.ts +5 -0
  188. package/dist/types/components.d.ts +26 -0
  189. package/package.json +1 -1
  190. package/readme.md +1 -1
  191. package/dist/cjs/ptc-button_5.cjs.entry.js +0 -542
  192. package/dist/esm/ptc-button_5.entry.js +0 -534
  193. package/dist/ptcw-design/p-0529caaa.entry.js +0 -1
  194. package/dist/ptcw-design/p-5ca42138.entry.js +0 -1
  195. package/dist/ptcw-design/p-a3977a9e.entry.js +0 -1
  196. package/dist/ptcw-design/p-e9c5e74e.entry.js +0 -1
@@ -124,4 +124,51 @@ ptc-link, ptc-square-card,
124
124
  .hidden-lg {
125
125
  display: none !important;
126
126
  }
127
+ }
128
+ .lazy-bg {
129
+ background-image: none !important;
130
+ background-color: var(--color-gray-03);
131
+ }
132
+
133
+ .ptc-img {
134
+ position: relative;
135
+ width: 100%;
136
+ height: 100%;
137
+ background-size: cover;
138
+ background-repeat: no-repeat;
139
+ background-position: center center;
140
+ }
141
+
142
+ img {
143
+ width: 100%;
144
+ height: auto;
145
+ display: block;
146
+ }
147
+
148
+ .low-quality,
149
+ .medium-quality,
150
+ .high-quality {
151
+ position: absolute;
152
+ width: 100%;
153
+ height: 100%;
154
+ top: 0;
155
+ left: 0;
156
+ background-size: cover;
157
+ background-repeat: no-repeat;
158
+ background-position: center center;
159
+ transition: opacity 0.5s ease-in-out;
160
+ }
161
+
162
+ .low-quality {
163
+ z-index: 1;
164
+ }
165
+
166
+ .medium-quality {
167
+ z-index: 2;
168
+ opacity: 0;
169
+ }
170
+
171
+ .high-quality {
172
+ z-index: 3;
173
+ opacity: 0;
127
174
  }
@@ -11,26 +11,93 @@ export class PtcImg {
11
11
  this.borderRadius = '';
12
12
  this.loadMode = 'lazy-bg';
13
13
  this.styles = undefined;
14
+ this.enableLazyLoad = false;
15
+ this.delay = 2000;
16
+ this.bgSrcLazy = undefined;
17
+ this.bgSrcMedium = undefined;
18
+ this.bgSrcHigh = undefined;
19
+ this.isInViewport = false;
20
+ this.isImageUpgraded = false;
14
21
  }
15
- /**
16
- * Image Z Index
17
- */
18
- // @Prop() imageZIndex: 'z-index-auto' | 'z-index-n-2' | 'z-index-n-1' | 'z-index-p-1' | 'z-index-p-2' = 'z-index-auto';
19
22
  WindowResize() {
20
23
  this.setResponsiveBg();
21
24
  }
22
25
  render() {
23
26
  const classMap = this.getCssClassMap();
24
- return (h(Host, null, this.styles && h("style", null, this.styles), h("div", { class: classMap, "data-xs": `${this.imgUrl}`, "data-sm": `${this.imgUrl}`, "data-md": `${this.imgUrl}`, "data-lg": `${this.imgUrl}` }, this.imageType == 'smart-bg' ? h("slot", null) : null)));
27
+ if (this.enableLazyLoad && this.imgUrl) {
28
+ // Lazy loading functionality
29
+ return (h(Host, null, this.styles && h("style", null, this.styles), h("div", { class: classMap }, h("div", { class: "low-quality", style: {
30
+ backgroundImage: `url(${this.bgSrcLazy})`,
31
+ opacity: '1',
32
+ transition: 'opacity 0.5s ease-in-out',
33
+ } }), h("div", { class: "medium-quality", style: {
34
+ backgroundImage: `url(${this.bgSrcMedium})`,
35
+ opacity: '0',
36
+ transition: 'opacity 0.5s ease-in-out',
37
+ } }), h("div", { class: "high-quality", style: {
38
+ backgroundImage: `url(${this.bgSrcHigh})`,
39
+ opacity: '0',
40
+ transition: 'opacity 0.5s ease-in-out',
41
+ } }), this.imageType == 'smart-bg' ? h("slot", null) : null)));
42
+ }
43
+ else {
44
+ return (h(Host, null, this.styles && h("style", null, this.styles), h("div", { class: classMap, "data-xs": this.bgSrcLazy || this.imgUrl, "data-sm": this.bgSrcLazy || this.imgUrl, "data-md": this.bgSrcLazy || this.imgUrl, "data-lg": this.bgSrcLazy || this.imgUrl, style: { backgroundImage: `url(${this.bgSrcLazy || this.imgUrl})` } }, this.imageType == 'smart-bg' ? h("slot", null) : null)));
45
+ }
46
+ }
47
+ componentWillLoad() {
48
+ if (this.enableLazyLoad) {
49
+ this.isInViewport = false;
50
+ }
51
+ if (this.enableLazyLoad && this.imgUrl) {
52
+ this.bgSrcLazy = this.getImageUrl('lq');
53
+ this.bgSrcMedium = this.getImageUrl('mq');
54
+ this.bgSrcHigh = this.getImageUrl('hq');
55
+ }
56
+ else {
57
+ console.warn('Image URL is undefined or invalid.');
58
+ this.bgSrcLazy = '';
59
+ this.bgSrcMedium = '';
60
+ this.bgSrcHigh = '';
61
+ }
25
62
  }
26
63
  componentDidLoad() {
27
64
  this.addIntersectionObserver();
28
65
  this.setResponsiveBg();
66
+ if (this.enableLazyLoad && this.imgUrl) {
67
+ const that = this;
68
+ setTimeout(() => {
69
+ that.upgradeImageQuality();
70
+ }, that.delay);
71
+ }
29
72
  }
30
73
  componentWillUpdate() {
31
74
  this.addIntersectionObserver();
32
75
  this.setResponsiveBg();
33
76
  }
77
+ upgradeImageQuality() {
78
+ if (this.isInViewport && !this.isImageUpgraded) {
79
+ console.log('Low-quality image is visible.');
80
+ this.isImageUpgraded = true;
81
+ setTimeout(() => {
82
+ const mediumLayer = this.el.querySelector('.medium-quality');
83
+ if (mediumLayer) {
84
+ mediumLayer.style.opacity = '1';
85
+ console.log('Medium-quality image is now visible.');
86
+ }
87
+ setTimeout(() => {
88
+ const highLayer = this.el.querySelector('.high-quality');
89
+ if (highLayer) {
90
+ highLayer.style.opacity = '1';
91
+ console.log('High-quality image is now visible.');
92
+ }
93
+ if (mediumLayer) {
94
+ mediumLayer.style.opacity = '0';
95
+ console.log('Medium-quality image is hidden.');
96
+ }
97
+ }, this.delay);
98
+ }, this.delay / 2);
99
+ }
100
+ }
34
101
  //responsive image
35
102
  setResponsiveBg() {
36
103
  // Define local variables
@@ -58,12 +125,14 @@ export class PtcImg {
58
125
  }
59
126
  if ('IntersectionObserver' in window) {
60
127
  let lazyLoadBgs = (this.el || document).querySelectorAll('.lazy-bg');
61
- let bgObserver = new IntersectionObserver(entries => {
62
- entries.forEach(entry => {
128
+ let bgObserver = new IntersectionObserver((entries) => {
129
+ entries.forEach((entry) => {
63
130
  if (entry.isIntersecting) {
64
131
  const image = entry.target;
65
132
  image.classList.remove('lazy-bg');
66
133
  bgObserver.unobserve(image);
134
+ this.isInViewport = true;
135
+ this.upgradeImageQuality();
67
136
  }
68
137
  });
69
138
  });
@@ -77,6 +146,14 @@ export class PtcImg {
77
146
  // }, 5000);
78
147
  }
79
148
  }
149
+ getImageUrl(quality) {
150
+ if (this.imgUrl && this.imgUrl.includes('?')) {
151
+ return `${this.imgUrl}&t=ptcjumbdesk${quality}`;
152
+ }
153
+ else {
154
+ return `${this.imgUrl}?t=ptcjumbdesk${quality}`;
155
+ }
156
+ }
80
157
  getCssClassMap() {
81
158
  return {
82
159
  [this.imageType]: true,
@@ -294,9 +371,54 @@ export class PtcImg {
294
371
  },
295
372
  "attribute": "styles",
296
373
  "reflect": false
374
+ },
375
+ "enableLazyLoad": {
376
+ "type": "boolean",
377
+ "mutable": false,
378
+ "complexType": {
379
+ "original": "boolean",
380
+ "resolved": "boolean",
381
+ "references": {}
382
+ },
383
+ "required": false,
384
+ "optional": false,
385
+ "docs": {
386
+ "tags": [],
387
+ "text": "(optional) enable lazy loading"
388
+ },
389
+ "attribute": "enable-lazy-load",
390
+ "reflect": false,
391
+ "defaultValue": "false"
392
+ },
393
+ "delay": {
394
+ "type": "number",
395
+ "mutable": false,
396
+ "complexType": {
397
+ "original": "number",
398
+ "resolved": "number",
399
+ "references": {}
400
+ },
401
+ "required": false,
402
+ "optional": false,
403
+ "docs": {
404
+ "tags": [],
405
+ "text": "(optional) setTimeout delay fro Lazy loading"
406
+ },
407
+ "attribute": "delay",
408
+ "reflect": false,
409
+ "defaultValue": "2000"
297
410
  }
298
411
  };
299
412
  }
413
+ static get states() {
414
+ return {
415
+ "bgSrcLazy": {},
416
+ "bgSrcMedium": {},
417
+ "bgSrcHigh": {},
418
+ "isInViewport": {},
419
+ "isImageUpgraded": {}
420
+ };
421
+ }
300
422
  static get elementRef() { return "el"; }
301
423
  static get listeners() {
302
424
  return [{
@@ -30,6 +30,7 @@ export class PtcJumbotron {
30
30
  this.hasCountdown = false;
31
31
  this.logo = "";
32
32
  this.styles = undefined;
33
+ this.enableLazy = false;
33
34
  this.defer = undefined;
34
35
  this.hasCtaSlot = undefined;
35
36
  }
@@ -46,6 +47,9 @@ export class PtcJumbotron {
46
47
  componentDidLoad() {
47
48
  //this.adjustJumbotronHeight();
48
49
  }
50
+ componentDidUpdate() {
51
+ this.getContentBackground();
52
+ }
49
53
  render() {
50
54
  const classMap = this.getCssClassMap();
51
55
  let mediaElement;
@@ -65,10 +69,10 @@ export class PtcJumbotron {
65
69
  break;
66
70
  case 'dark':
67
71
  case 'light':
68
- mediaElement = (h("div", { class: 'dl-img-wrap' }, h("ptc-img", { "img-url": this.bgSrc, styles: ".smart-bg{background-position:right !important;}" }), this.hasPopupVideo && this.isMobile ? (h("div", { class: "mobile-modal-play-btn" }, ' ', h("slot", { name: "video" }))) : null));
72
+ mediaElement = (h("div", { class: 'dl-img-wrap' }, h("ptc-img", { "img-url": this.bgSrc, "enable-lazy-load": this.enableLazy, styles: ".smart-bg{background-position:right !important;}" }), this.hasPopupVideo && this.isMobile ? (h("div", { class: "mobile-modal-play-btn" }, ' ', h("slot", { name: "video" }))) : null));
69
73
  break;
70
74
  default:
71
- mediaElement = h("ptc-img", { "img-url": this.bgSrc, styles: ".smart-bg{background-position:right !important;}" });
75
+ mediaElement = h("ptc-img", { "img-url": this.bgSrc, "enable-lazy-load": this.enableLazy, styles: ".smart-bg{background-position:right !important;}" });
72
76
  }
73
77
  return (h(Host, { class: classMap }, this.styles && h("style", null, this.styles), h("div", { class: { 'parent': true, 'light-links': this.jumbotronType === 'dark' || this.jumbotronType === 'dark-video', 'hp-adjustments': this.isHomepage, 'transitioning': this.isTransitioning } }, h("div", { class: `div1 image-container ${this.jumbotronType === 'text' ? 'hidden' : ''}` }, mediaElement), h("div", { class: "div2 content-container" }, h("div", { class: "bg-overlay", style: { background: this.contentBackground } }), h("div", { class: { "ptc-container": true, "content-layout": true, 'hp-container': this.isHomepage, 'blog-container': (this.jumbotronType === "blog") } }, h("max-width-container", { "max-width-p": "60", breakpoint: 992, "content-align": this.jumbotronType === 'text' ? 'center' : this.textAlign, styles: ":host{z-index: 999}" }, h("slot", { name: "breadcrumb" }), !!this.logo && h("div", { class: "logo-frame" }, h("img", { alt: "Logo", src: this.logo })), h("span", { class: "main-content-items" }, h("ptc-spacer", { breakpoint: "small", size: "small" }), h("ptc-spacer", { breakpoint: "x-small", size: "medium" }), h("slot", { name: "main-title" }), h("slot", { name: "hp-sub-title" }), (this.jumbotronType !== 'text' || (this.jumbotronType === 'text' && this.subTitle)) && (!this.isHomepage) && (h("div", null, h("ptc-spacer", { breakpoint: "small", size: "small" }), h("ptc-spacer", { breakpoint: "x-small", size: "medium" }))), !this.isHomepage && (h("ptc-para", { styles: `p{color: ${this.contentColor}!important;}`, "font-size": this.jumbotronType === 'text' && this.isMobile ? 'x-small' : 'small', "font-weight": "w-4", "para-margin": `${this.jumbotronType === 'text' || this.jumbotronType === 'blog' ? 'margin-flush' : 'margin-bottom-6'}`, "para-color": "white", "para-line-h": "line-height-p", "para-align": this.jumbotronType === 'text' ? 'center' : 'left', "seo-compatibility-mode": true }, h("p", { innerHTML: this.subTitle, style: { margin: '0' } }), h("p", { style: { margin: '0' } }, h("slot", { name: "blog-date" })), this.jumbotronType === 'blog' && h("div", null, h("ptc-spacer", { breakpoint: 'x-small', size: 'medium' }), h("ptc-spacer", { breakpoint: 'small', size: 'small' }), h("div", { id: "header-blog-author", slot: "blog-author" }, h("div", { class: "image" }, h("img", { alt: this.blogAuthorImageAlt, src: this.blogAuthorImage })), h("ptc-para", { "font-size": "small", "font-weight": "w-4", "para-color": "primary-grey", "para-line-h": "line-height-p", "para-margin": "margin-flush" }, h("a", { class: "blog-author-name mf-listen", tabindex: "0", href: this.blogAuthorQueryHref, target: this.blogAuthorQueryTarget, "aria-label": "Other blogs by author" }, this.blogAuthorName)))))), this.hasCtaSlot && (h("div", { class: `u-flex u-flex-wrap gap-adjustment${this.jumbotronType === 'text' ? ' text-adjustment' : ''}` }, h("slot", { name: "j-cta" }))))), this.hasPopupVideo && this.jumbotronType !== 'png' ? h("slot", { name: "video" }) : null, this.hasCountdown ? h("slot", { name: "countdown" }) : null, this.jumbotronType === 'png' ? (h("div", { class: "desktop-media-image" }, h("div", { class: "media-image-wrapper" }, h("ptc-picture", { "is-full-width": true, src: this.pngSrc, styles: `img {${this.pngImgStyles}}` }), this.hasPopupVideo ? h("slot", { name: "video" }) : null))) : null, this.jumbotronType === 'gif' ? (h("div", { class: "desktop-media-image desk-gif-adjustment" }, h("img", { src: this.gifSrc }))) : null, this.jumbotronType === 'blog' ? (h("div", { class: "desktop-media-image" }, h("div", { class: "media-image-wrapper" }, h("ptc-picture", { "is-full-width": true, src: this.pngSrc, styles: "img {height: 100%;}" })))) : null)))));
74
78
  }
@@ -591,6 +595,24 @@ export class PtcJumbotron {
591
595
  "attribute": "styles",
592
596
  "reflect": false
593
597
  },
598
+ "enableLazy": {
599
+ "type": "boolean",
600
+ "mutable": false,
601
+ "complexType": {
602
+ "original": "boolean",
603
+ "resolved": "boolean",
604
+ "references": {}
605
+ },
606
+ "required": false,
607
+ "optional": false,
608
+ "docs": {
609
+ "tags": [],
610
+ "text": "(optional) to enable lazy loading"
611
+ },
612
+ "attribute": "enable-lazy",
613
+ "reflect": false,
614
+ "defaultValue": "false"
615
+ },
594
616
  "defer": {
595
617
  "type": "boolean",
596
618
  "mutable": false,
@@ -0,0 +1,21 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Utilities/Responsive Wrapper',
5
+ tags: [ 'autodocs' ],
6
+ };
7
+
8
+ const Template = args => { return html `<ptc-responsive-wrapper>
9
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
10
+ </ptc-responsive-wrapper>`;}
11
+
12
+ export const Example = Template.bind({});
13
+
14
+
15
+ Example.parameters = {
16
+ docs: {
17
+ description: {
18
+ story: `<h4>Please note: This atom is based on the content’s width</h4>`,
19
+ },
20
+ },
21
+ };
@@ -0,0 +1,22 @@
1
+ import { html } from 'lit';
2
+
3
+ export default {
4
+ title: 'Organisms/ptc/Academic Form'
5
+ };
6
+
7
+ const AlertsPage = args => {
8
+ return html`
9
+
10
+
11
+ <academic-form-test id="myForm"></academic-form-test>
12
+ <script>
13
+ const myForm = document.getElementById('myForm');
14
+ myForm.addEventListener('formSubmit', (event) => {
15
+ const formData = event.detail;
16
+ console.olog('Form submitted: ', formData)
17
+ })
18
+ </script>
19
+ `;
20
+ };
21
+
22
+ export const Preview = AlertsPage.bind();