@ptcwebops/ptcw-design 0.4.6 → 0.4.8

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/LICENSE +21 -21
  2. package/dist/cjs/{icon-asset_4.cjs.entry.js → icon-asset_8.cjs.entry.js} +299 -220
  3. package/dist/cjs/{interfaces-0ecd8027.js → interfaces-574e6df7.js} +9 -9
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/lottie-player.cjs.entry.js +354 -354
  6. package/dist/cjs/my-component.cjs.entry.js +13 -13
  7. package/dist/cjs/ptc-breadcrumb.cjs.entry.js +12 -12
  8. package/dist/cjs/ptc-button.cjs.entry.js +65 -65
  9. package/dist/cjs/ptc-card-bottom.cjs.entry.js +31 -31
  10. package/dist/cjs/ptc-card-content.cjs.entry.js +31 -31
  11. package/dist/cjs/ptc-card-plm.cjs.entry.js +16 -16
  12. package/dist/cjs/ptc-card.cjs.entry.js +68 -68
  13. package/dist/cjs/ptc-countdown.cjs.entry.js +8 -8
  14. package/dist/cjs/ptc-date.cjs.entry.js +48 -48
  15. package/dist/cjs/ptc-footer.cjs.entry.js +8 -8
  16. package/dist/cjs/ptc-form.cjs.entry.js +104 -104
  17. package/dist/cjs/ptc-hero.cjs.entry.js +18 -18
  18. package/dist/cjs/ptc-img_2.cjs.entry.js +169 -169
  19. package/dist/cjs/ptc-input.cjs.entry.js +20 -20
  20. package/dist/cjs/ptc-link.cjs.entry.js +42 -42
  21. package/dist/cjs/ptc-list.cjs.entry.js +20 -20
  22. package/dist/cjs/ptc-lottie.cjs.entry.js +12 -12
  23. package/dist/cjs/ptc-modal.cjs.entry.js +103 -103
  24. package/dist/cjs/ptc-nav-item.cjs.entry.js +83 -83
  25. package/dist/cjs/ptc-nav.cjs.entry.js +8 -8
  26. package/dist/cjs/ptc-para.cjs.entry.js +39 -39
  27. package/dist/cjs/ptc-picture.cjs.entry.js +158 -158
  28. package/dist/cjs/ptc-responsive-wrapper.cjs.entry.js +54 -54
  29. package/dist/cjs/ptc-select.cjs.entry.js +24 -24
  30. package/dist/cjs/ptc-social-share.cjs.entry.js +64 -64
  31. package/dist/cjs/ptc-spacer.cjs.entry.js +35 -35
  32. package/dist/cjs/ptc-span.cjs.entry.js +23 -23
  33. package/dist/cjs/ptc-title.cjs.entry.js +44 -44
  34. package/dist/cjs/ptcw-design.cjs.js +1 -1
  35. package/dist/collection/collection-manifest.json +3 -0
  36. package/dist/collection/components/icon-asset/icon-asset.css +4 -4
  37. package/dist/collection/components/icon-asset/icon-asset.js +199 -178
  38. package/dist/collection/components/icon-asset/media/brands.svg +1381 -1381
  39. package/dist/collection/components/icon-asset/media/designer.svg +316 -316
  40. package/dist/collection/components/icon-asset/media/regular.svg +463 -463
  41. package/dist/collection/components/icon-asset/media/solid.svg +3013 -3013
  42. package/dist/collection/components/icon-asset/media/svg-with-js.min.css +4 -4
  43. package/dist/collection/components/list-item/list-item.css +31 -0
  44. package/dist/collection/components/list-item/list-item.js +103 -84
  45. package/dist/collection/components/my-component/my-component.css +3 -3
  46. package/dist/collection/components/my-component/my-component.js +73 -73
  47. package/dist/collection/components/ptc-announcement/ptc-announcement.js +170 -170
  48. package/dist/collection/components/ptc-breadcrumb/ptc-breadcrumb.js +21 -21
  49. package/dist/collection/components/ptc-button/ptc-button.js +293 -293
  50. package/dist/collection/components/ptc-card/ptc-card.js +282 -282
  51. package/dist/collection/components/ptc-card-bottom/ptc-card-bottom.js +105 -105
  52. package/dist/collection/components/ptc-card-content/ptc-card-content.js +105 -105
  53. package/dist/collection/components/ptc-card-plm/ptc-card-plm.js +97 -97
  54. package/dist/collection/components/ptc-countdown/ptc-countdown.js +15 -15
  55. package/dist/collection/components/ptc-date/ptc-date.js +201 -201
  56. package/dist/collection/components/ptc-footer/ptc-footer.js +25 -25
  57. package/dist/collection/components/ptc-form/ptc-form.js +118 -118
  58. package/dist/collection/components/ptc-form/validation/FormValidation.js +4234 -4234
  59. package/dist/collection/components/ptc-hero/ptc-hero.js +67 -67
  60. package/dist/collection/components/ptc-img/ptc-img.js +314 -314
  61. package/dist/collection/components/ptc-input/ptc-input.js +133 -133
  62. package/dist/collection/components/ptc-link/ptc-link.js +198 -198
  63. package/dist/collection/components/ptc-list/ptc-list.js +63 -63
  64. package/dist/collection/components/ptc-lottie/ptc-lottie.css +5 -5
  65. package/dist/collection/components/ptc-lottie/ptc-lottie.js +58 -58
  66. package/dist/collection/components/ptc-minimized-footer/ptc-minimized-footer.css +44 -0
  67. package/dist/collection/components/ptc-minimized-footer/ptc-minimized-footer.js +17 -0
  68. package/dist/collection/components/ptc-minimized-header/ptc-minimized-header.css +77 -0
  69. package/dist/collection/components/ptc-minimized-header/ptc-minimized-header.js +80 -0
  70. package/dist/collection/components/ptc-mobile-select/ptc-mobile-select.css +1 -0
  71. package/dist/collection/components/ptc-mobile-select/ptc-mobile-select.js +221 -220
  72. package/dist/collection/components/ptc-modal/ptc-modal.js +252 -252
  73. package/dist/collection/components/ptc-nav/ptc-nav.js +21 -21
  74. package/dist/collection/components/ptc-nav-item/ptc-nav-item.js +252 -252
  75. package/dist/collection/components/ptc-overlay/ptc-overlay.js +99 -99
  76. package/dist/collection/components/ptc-para/ptc-para.js +157 -157
  77. package/dist/collection/components/ptc-picture/ptc-picture.js +428 -428
  78. package/dist/collection/components/ptc-previous-url/ptc-previous-url.css +29 -0
  79. package/dist/collection/components/ptc-previous-url/ptc-previous-url.js +54 -0
  80. package/dist/collection/components/ptc-responsive-wrapper/ptc-responsive-wrapper.css +3 -3
  81. package/dist/collection/components/ptc-responsive-wrapper/ptc-responsive-wrapper.js +62 -62
  82. package/dist/collection/components/ptc-select/ptc-select.js +105 -105
  83. package/dist/collection/components/ptc-social-share/ptc-social-share.js +206 -206
  84. package/dist/collection/components/ptc-spacer/ptc-spacer.css +322 -322
  85. package/dist/collection/components/ptc-spacer/ptc-spacer.js +99 -99
  86. package/dist/collection/components/ptc-span/ptc-span.js +89 -89
  87. package/dist/collection/components/ptc-svg-btn/ptc-svg-btn.css +22 -0
  88. package/dist/collection/components/ptc-svg-btn/ptc-svg-btn.js +71 -69
  89. package/dist/collection/components/ptc-title/ptc-title.js +231 -231
  90. package/dist/collection/index.js +1 -1
  91. package/dist/collection/media/svg-imgs/Back-arrow.svg +11 -0
  92. package/dist/collection/media/svg-imgs/close.svg +10 -10
  93. package/dist/collection/media/svg-imgs/slider-arrow-left.svg +18 -18
  94. package/dist/collection/media/svg-imgs/slider-arrow-right.svg +18 -18
  95. package/dist/collection/utils/interfaces.js +11 -11
  96. package/dist/collection/utils/utils.js +3 -3
  97. package/dist/custom-elements/index.d.ts +18 -0
  98. package/dist/custom-elements/index.js +2058 -1993
  99. package/dist/esm/{icon-asset_4.entry.js → icon-asset_8.entry.js} +296 -221
  100. package/dist/esm/{interfaces-c1c73092.js → interfaces-7c0243be.js} +9 -9
  101. package/dist/esm/loader.js +1 -1
  102. package/dist/esm/lottie-player.entry.js +354 -354
  103. package/dist/esm/my-component.entry.js +13 -13
  104. package/dist/esm/polyfills/core-js.js +0 -0
  105. package/dist/esm/polyfills/dom.js +0 -0
  106. package/dist/esm/polyfills/es5-html-element.js +0 -0
  107. package/dist/esm/polyfills/index.js +0 -0
  108. package/dist/esm/polyfills/system.js +0 -0
  109. package/dist/esm/ptc-breadcrumb.entry.js +12 -12
  110. package/dist/esm/ptc-button.entry.js +65 -65
  111. package/dist/esm/ptc-card-bottom.entry.js +31 -31
  112. package/dist/esm/ptc-card-content.entry.js +31 -31
  113. package/dist/esm/ptc-card-plm.entry.js +16 -16
  114. package/dist/esm/ptc-card.entry.js +68 -68
  115. package/dist/esm/ptc-countdown.entry.js +8 -8
  116. package/dist/esm/ptc-date.entry.js +48 -48
  117. package/dist/esm/ptc-footer.entry.js +8 -8
  118. package/dist/esm/ptc-form.entry.js +104 -104
  119. package/dist/esm/ptc-hero.entry.js +18 -18
  120. package/dist/esm/ptc-img_2.entry.js +169 -169
  121. package/dist/esm/ptc-input.entry.js +20 -20
  122. package/dist/esm/ptc-link.entry.js +42 -42
  123. package/dist/esm/ptc-list.entry.js +20 -20
  124. package/dist/esm/ptc-lottie.entry.js +12 -12
  125. package/dist/esm/ptc-modal.entry.js +103 -103
  126. package/dist/esm/ptc-nav-item.entry.js +83 -83
  127. package/dist/esm/ptc-nav.entry.js +8 -8
  128. package/dist/esm/ptc-para.entry.js +39 -39
  129. package/dist/esm/ptc-picture.entry.js +158 -158
  130. package/dist/esm/ptc-responsive-wrapper.entry.js +54 -54
  131. package/dist/esm/ptc-select.entry.js +24 -24
  132. package/dist/esm/ptc-social-share.entry.js +64 -64
  133. package/dist/esm/ptc-spacer.entry.js +35 -35
  134. package/dist/esm/ptc-span.entry.js +23 -23
  135. package/dist/esm/ptc-title.entry.js +44 -44
  136. package/dist/esm/ptcw-design.js +1 -1
  137. package/dist/ptcw-design/media/brands.svg +1381 -1381
  138. package/dist/ptcw-design/media/designer.svg +316 -316
  139. package/dist/ptcw-design/media/regular.svg +463 -463
  140. package/dist/ptcw-design/media/solid.svg +3013 -3013
  141. package/dist/ptcw-design/media/svg-with-js.min.css +4 -4
  142. package/dist/ptcw-design/{p-1e39bc14.entry.js → p-894e8c85.entry.js} +1 -1
  143. package/dist/ptcw-design/p-c2f4cf52.entry.js +7 -0
  144. package/dist/ptcw-design/{p-27538cac.entry.js → p-f2f1c015.entry.js} +1 -1
  145. package/dist/ptcw-design/ptcw-design.css +1 -1
  146. package/dist/ptcw-design/ptcw-design.esm.js +1 -1
  147. package/dist/ptcw-design/validation/FormValidation.js +4234 -4234
  148. package/dist/types/components/icon-asset/icon-asset.d.ts +36 -32
  149. package/dist/types/components/list-item/list-item.d.ts +8 -7
  150. package/dist/types/components/my-component/my-component.d.ts +16 -16
  151. package/dist/types/components/ptc-announcement/ptc-announcement.d.ts +35 -35
  152. package/dist/types/components/ptc-breadcrumb/ptc-breadcrumb.d.ts +4 -4
  153. package/dist/types/components/ptc-button/ptc-button.d.ts +56 -56
  154. package/dist/types/components/ptc-card/ptc-card.d.ts +50 -50
  155. package/dist/types/components/ptc-card-bottom/ptc-card-bottom.d.ts +15 -15
  156. package/dist/types/components/ptc-card-content/ptc-card-content.d.ts +15 -15
  157. package/dist/types/components/ptc-card-plm/ptc-card-plm.d.ts +8 -8
  158. package/dist/types/components/ptc-countdown/ptc-countdown.d.ts +3 -3
  159. package/dist/types/components/ptc-date/ptc-date.d.ts +41 -41
  160. package/dist/types/components/ptc-footer/ptc-footer.d.ts +3 -3
  161. package/dist/types/components/ptc-form/ptc-form.d.ts +11 -11
  162. package/dist/types/components/ptc-hero/ptc-hero.d.ts +12 -12
  163. package/dist/types/components/ptc-img/ptc-img.d.ts +51 -51
  164. package/dist/types/components/ptc-input/ptc-input.d.ts +19 -19
  165. package/dist/types/components/ptc-link/ptc-link.d.ts +36 -36
  166. package/dist/types/components/ptc-list/ptc-list.d.ts +6 -6
  167. package/dist/types/components/ptc-lottie/ptc-lottie.d.ts +12 -12
  168. package/dist/types/components/ptc-minimized-footer/ptc-minimized-footer.d.ts +3 -0
  169. package/dist/types/components/ptc-minimized-header/ptc-minimized-header.d.ts +6 -0
  170. package/dist/types/components/ptc-mobile-select/ptc-mobile-select.d.ts +40 -40
  171. package/dist/types/components/ptc-modal/ptc-modal.d.ts +46 -46
  172. package/dist/types/components/ptc-nav/ptc-nav.d.ts +3 -3
  173. package/dist/types/components/ptc-nav-item/ptc-nav-item.d.ts +53 -53
  174. package/dist/types/components/ptc-overlay/ptc-overlay.d.ts +20 -20
  175. package/dist/types/components/ptc-para/ptc-para.d.ts +28 -28
  176. package/dist/types/components/ptc-picture/ptc-picture.d.ts +82 -82
  177. package/dist/types/components/ptc-previous-url/ptc-previous-url.d.ts +5 -0
  178. package/dist/types/components/ptc-responsive-wrapper/ptc-responsive-wrapper.d.ts +8 -8
  179. package/dist/types/components/ptc-select/ptc-select.d.ts +9 -9
  180. package/dist/types/components/ptc-social-share/ptc-social-share.d.ts +25 -25
  181. package/dist/types/components/ptc-spacer/ptc-spacer.d.ts +16 -16
  182. package/dist/types/components/ptc-span/ptc-span.d.ts +16 -16
  183. package/dist/types/components/ptc-svg-btn/ptc-svg-btn.d.ts +12 -12
  184. package/dist/types/components/ptc-title/ptc-title.d.ts +41 -41
  185. package/dist/types/components.d.ts +85 -26
  186. package/dist/types/global.d.ts +1072 -1072
  187. package/dist/types/index.d.ts +1 -1
  188. package/dist/types/utils/interfaces.d.ts +14 -14
  189. package/dist/types/utils/utils.d.ts +1 -1
  190. package/package.json +58 -58
  191. package/readme.md +11 -11
  192. package/dist/cjs/list-item.cjs.entry.js +0 -29
  193. package/dist/esm/list-item.entry.js +0 -25
  194. package/dist/ptcw-design/p-439c9e49.entry.js +0 -7
  195. package/dist/ptcw-design/p-80c03571.entry.js +0 -1
  196. /package/dist/ptcw-design/{p-50e52c88.js → p-ee1183b2.js} +0 -0
@@ -3,167 +3,167 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-3adcf9f4.js');
6
- const interfaces = require('./interfaces-0ecd8027.js');
6
+ const interfaces = require('./interfaces-574e6df7.js');
7
7
 
8
8
  const ptcPictureCss = ":host{display:block;overflow:hidden}:host(.relative){position:relative}:host(.static){position:static}:host(.absoltue){position:absolute}img{max-width:100%}.cover{object-fit:cover}.fill{object-fit:fill}.contain{object-fit:contain}.scale-down{object-fit:scale-down}.none{object-fit:none}.initial{object-fit:initial}.inherit{object-fit:inherit}.radius-sm{border-radius:var(--ptc-border-radius-small)}.radius-md{border-radius:var(--ptc-border-radius-medium)}.radius-lg{border-radius:var(--ptc-border-radius-large)}.radius-x-lg{border-radius:var(--ptc-border-radius-x-large)}.is-full-height{height:100%}.is-full-width{width:100%}";
9
9
 
10
- let PtcPicture = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- /**
14
- * Image alt
15
- */
16
- this.alt = "image";
17
- /**
18
- * Image size for smallest screen
19
- * <=767px
20
- */
21
- this.sizeXs = '510x340';
22
- /**
23
- * Image size for small screen
24
- * >=768px and <=991px
25
- */
26
- this.sizeSm = '1240x496';
27
- /**
28
- * Image size for medium screen
29
- * >=992px and <=1199px
30
- */
31
- this.sizeMd = '1366x500';
32
- /**
33
- * Image solution for large screen
34
- * >=1200px
35
- */
36
- this.sizeLg = '1920x1080';
37
- /**
38
- * Image Position
39
- */
40
- this.imagePosition = 'static';
41
- /**
42
- * Object Fit
43
- * Default: cover
44
- */
45
- this.objectFit = 'cover';
46
- /**
47
- * Stretch height to 100%?
48
- */
49
- this.isFullHeight = false;
50
- /**
51
- * Stretch width to 100%?
52
- */
53
- this.isFullWidth = false;
54
- }
55
- WindowResize() {
56
- this.addIntersectionObserver();
57
- }
58
- componentDidLoad() {
59
- this.addIntersectionObserver();
60
- }
61
- componentWillUpdate() {
62
- if (this.src !== this.oldSrc) {
63
- this.addIntersectionObserver();
64
- }
65
- this.oldSrc = this.src;
66
- }
67
- //lazy-loading
68
- addIntersectionObserver() {
69
- if (!this.src) {
70
- return;
71
- }
72
- if ('IntersectionObserver' in window) {
73
- let lazyLoadImages = new IntersectionObserver(entries => {
74
- entries.forEach(entry => {
75
- if (entry.isIntersecting) {
76
- const image = this.el.shadowRoot.querySelector('img');
77
- image.src = this.setResponsiveBg();
78
- console.log('loaded');
79
- lazyLoadImages.unobserve(image);
80
- }
81
- });
82
- });
83
- lazyLoadImages.observe(this.el.shadowRoot.querySelector('img'));
84
- }
85
- else {
86
- // fall back to setTimeout for Safari and IE
87
- setTimeout(() => {
88
- const image = this.el.shadowRoot.querySelector('img');
89
- image.src = this.setResponsiveBg();
90
- image.onload = () => {
91
- image.removeAttribute('data-src');
92
- console.log('loaded fallback');
93
- };
94
- }, 5000);
95
- }
96
- }
97
- //responsive image
98
- setResponsiveBg() {
99
- // Define local variables
100
- let backgrounds = (this.el.shadowRoot || document).querySelectorAll('img'), el, elData, currentBreakpoint = this.getCurrentBreakPoints();
101
- for (var i = 0, len = backgrounds.length; i < len; i++) {
102
- // Set current variables
103
- el = backgrounds[i];
104
- elData = el.getAttribute('data-' + currentBreakpoint);
105
- if (elData !== null) {
106
- // console.log('img src= ' + elData);
107
- return elData;
108
- }
109
- else {
110
- if (typeof console == 'object') {
111
- console.warn('Data attribute: data-' + currentBreakpoint + ' not found on element:\n\n' + el.outerHTML + '\n\n\n');
112
- }
113
- }
114
- }
115
- }
116
- render() {
117
- const classMap = this.getCssClassMap();
118
- return (index.h(index.Host, { class: this.imagePosition }, this.styles && index.h("style", null, this.styles), index.h("img", Object.assign({ class: classMap, "data-xs": !!this.sizeXs ? `${this.src}:${this.sizeXs}` : `${this.src}`, "data-sm": !!this.sizeSm ? `${this.src}:${this.sizeSm}` : `${this.src}`, "data-md": !!this.sizeMd ? `${this.src}:${this.sizeMd}` : `${this.src}`, "data-lg": !!this.sizeLg ? `${this.src}:${this.sizeLg}` : `${this.src}` }, (!!this.width ? { width: this.width } : {}), (!!this.height ? { height: this.height } : {}), { alt: this.alt })), index.h("slot", null)));
119
- }
120
- getCurrentBreakPoints() {
121
- // Define local variables
122
- let doc = window.document, temp = doc.createElement('div'), env;
123
- // Append test node
124
- doc.body.appendChild(temp);
125
- // Loop through breakpoints
126
- for (let i = interfaces.ResponsivePictureVariables.envs.length - 1; i >= 0; i--) {
127
- env = interfaces.ResponsivePictureVariables.envs[i];
128
- // Add classes
129
- temp.className = 'hidden-' + env;
130
- // Found breakpoint
131
- if (temp.offsetParent === null) {
132
- // Remove our test node
133
- doc.body.removeChild(temp);
134
- console.log('remove test node');
135
- // Return current breakpoint
136
- return env;
137
- }
138
- }
139
- // Breakpoint not found, try fallback
140
- doc.body.removeChild(temp);
141
- return this.getFallbackBreakpoint();
142
- }
143
- getFallbackBreakpoint() {
144
- if (window.matchMedia('(min-width: 992px)').matches) {
145
- return 'lg';
146
- }
147
- else if (window.matchMedia('(min-width: 768px)').matches) {
148
- return 'md';
149
- }
150
- else if (window.matchMedia('(min-width: 576px)').matches) {
151
- return 'sm';
152
- }
153
- else {
154
- return 'xs';
155
- }
156
- }
157
- getCssClassMap() {
158
- return {
159
- [this.borderRadius]: this.borderRadius ? true : false,
160
- [this.objectFit]: true,
161
- [this.isFullHeight ? 'is-full-height' : 'is-normal-height']: true,
162
- [this.isFullWidth ? 'is-full-width' : 'is-normal-width']: true
163
- };
164
- }
165
- get el() { return index.getElement(this); }
166
- };
10
+ let PtcPicture = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ /**
14
+ * Image alt
15
+ */
16
+ this.alt = "image";
17
+ /**
18
+ * Image size for smallest screen
19
+ * <=767px
20
+ */
21
+ this.sizeXs = '510x340';
22
+ /**
23
+ * Image size for small screen
24
+ * >=768px and <=991px
25
+ */
26
+ this.sizeSm = '1240x496';
27
+ /**
28
+ * Image size for medium screen
29
+ * >=992px and <=1199px
30
+ */
31
+ this.sizeMd = '1366x500';
32
+ /**
33
+ * Image solution for large screen
34
+ * >=1200px
35
+ */
36
+ this.sizeLg = '1920x1080';
37
+ /**
38
+ * Image Position
39
+ */
40
+ this.imagePosition = 'static';
41
+ /**
42
+ * Object Fit
43
+ * Default: cover
44
+ */
45
+ this.objectFit = 'cover';
46
+ /**
47
+ * Stretch height to 100%?
48
+ */
49
+ this.isFullHeight = false;
50
+ /**
51
+ * Stretch width to 100%?
52
+ */
53
+ this.isFullWidth = false;
54
+ }
55
+ WindowResize() {
56
+ this.addIntersectionObserver();
57
+ }
58
+ componentDidLoad() {
59
+ this.addIntersectionObserver();
60
+ }
61
+ componentWillUpdate() {
62
+ if (this.src !== this.oldSrc) {
63
+ this.addIntersectionObserver();
64
+ }
65
+ this.oldSrc = this.src;
66
+ }
67
+ //lazy-loading
68
+ addIntersectionObserver() {
69
+ if (!this.src) {
70
+ return;
71
+ }
72
+ if ('IntersectionObserver' in window) {
73
+ let lazyLoadImages = new IntersectionObserver(entries => {
74
+ entries.forEach(entry => {
75
+ if (entry.isIntersecting) {
76
+ const image = this.el.shadowRoot.querySelector('img');
77
+ image.src = this.setResponsiveBg();
78
+ console.log('loaded');
79
+ lazyLoadImages.unobserve(image);
80
+ }
81
+ });
82
+ });
83
+ lazyLoadImages.observe(this.el.shadowRoot.querySelector('img'));
84
+ }
85
+ else {
86
+ // fall back to setTimeout for Safari and IE
87
+ setTimeout(() => {
88
+ const image = this.el.shadowRoot.querySelector('img');
89
+ image.src = this.setResponsiveBg();
90
+ image.onload = () => {
91
+ image.removeAttribute('data-src');
92
+ console.log('loaded fallback');
93
+ };
94
+ }, 5000);
95
+ }
96
+ }
97
+ //responsive image
98
+ setResponsiveBg() {
99
+ // Define local variables
100
+ let backgrounds = (this.el.shadowRoot || document).querySelectorAll('img'), el, elData, currentBreakpoint = this.getCurrentBreakPoints();
101
+ for (var i = 0, len = backgrounds.length; i < len; i++) {
102
+ // Set current variables
103
+ el = backgrounds[i];
104
+ elData = el.getAttribute('data-' + currentBreakpoint);
105
+ if (elData !== null) {
106
+ // console.log('img src= ' + elData);
107
+ return elData;
108
+ }
109
+ else {
110
+ if (typeof console == 'object') {
111
+ console.warn('Data attribute: data-' + currentBreakpoint + ' not found on element:\n\n' + el.outerHTML + '\n\n\n');
112
+ }
113
+ }
114
+ }
115
+ }
116
+ render() {
117
+ const classMap = this.getCssClassMap();
118
+ return (index.h(index.Host, { class: this.imagePosition }, this.styles && index.h("style", null, this.styles), index.h("img", Object.assign({ class: classMap, "data-xs": !!this.sizeXs ? `${this.src}:${this.sizeXs}` : `${this.src}`, "data-sm": !!this.sizeSm ? `${this.src}:${this.sizeSm}` : `${this.src}`, "data-md": !!this.sizeMd ? `${this.src}:${this.sizeMd}` : `${this.src}`, "data-lg": !!this.sizeLg ? `${this.src}:${this.sizeLg}` : `${this.src}` }, (!!this.width ? { width: this.width } : {}), (!!this.height ? { height: this.height } : {}), { alt: this.alt })), index.h("slot", null)));
119
+ }
120
+ getCurrentBreakPoints() {
121
+ // Define local variables
122
+ let doc = window.document, temp = doc.createElement('div'), env;
123
+ // Append test node
124
+ doc.body.appendChild(temp);
125
+ // Loop through breakpoints
126
+ for (let i = interfaces.ResponsivePictureVariables.envs.length - 1; i >= 0; i--) {
127
+ env = interfaces.ResponsivePictureVariables.envs[i];
128
+ // Add classes
129
+ temp.className = 'hidden-' + env;
130
+ // Found breakpoint
131
+ if (temp.offsetParent === null) {
132
+ // Remove our test node
133
+ doc.body.removeChild(temp);
134
+ console.log('remove test node');
135
+ // Return current breakpoint
136
+ return env;
137
+ }
138
+ }
139
+ // Breakpoint not found, try fallback
140
+ doc.body.removeChild(temp);
141
+ return this.getFallbackBreakpoint();
142
+ }
143
+ getFallbackBreakpoint() {
144
+ if (window.matchMedia('(min-width: 992px)').matches) {
145
+ return 'lg';
146
+ }
147
+ else if (window.matchMedia('(min-width: 768px)').matches) {
148
+ return 'md';
149
+ }
150
+ else if (window.matchMedia('(min-width: 576px)').matches) {
151
+ return 'sm';
152
+ }
153
+ else {
154
+ return 'xs';
155
+ }
156
+ }
157
+ getCssClassMap() {
158
+ return {
159
+ [this.borderRadius]: this.borderRadius ? true : false,
160
+ [this.objectFit]: true,
161
+ [this.isFullHeight ? 'is-full-height' : 'is-normal-height']: true,
162
+ [this.isFullWidth ? 'is-full-width' : 'is-normal-width']: true
163
+ };
164
+ }
165
+ get el() { return index.getElement(this); }
166
+ };
167
167
  PtcPicture.style = ptcPictureCss;
168
168
 
169
169
  exports.ptc_picture = PtcPicture;
@@ -6,60 +6,60 @@ const index = require('./index-3adcf9f4.js');
6
6
 
7
7
  const ptcResponsiveWrapperCss = ":host{display:block}";
8
8
 
9
- let PtcResponsiveWrapper = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- }
13
- componentDidLoad() {
14
- this.ro = new ResizeObserver(entries => {
15
- for (const entry of entries) {
16
- this.applySizeClasses(entry.contentRect.width);
17
- }
18
- });
19
- this.ro.observe(this.element);
20
- }
21
- disconnectedCallback() {
22
- this.ro.disconnect();
23
- }
24
- applySizeClasses(size) {
25
- let xsmall = false;
26
- let small = false;
27
- let medium = false;
28
- let large = false;
29
- let xlarge = false;
30
- let xxlarge = false;
31
- let large2k = false;
32
- let large4k = false;
33
- if (size >= 2600)
34
- large4k = true;
35
- else if (size >= 1980)
36
- large2k = true;
37
- else if (size >= 1600)
38
- xxlarge = true;
39
- else if (size >= 1440)
40
- xlarge = true;
41
- else if (size >= 1200)
42
- large = true;
43
- else if (size >= 992)
44
- medium = true;
45
- else if (size >= 768)
46
- small = true;
47
- else
48
- xsmall = true;
49
- this.element.classList.toggle("xsmall", xsmall);
50
- this.element.classList.toggle("small", small);
51
- this.element.classList.toggle("medium", medium);
52
- this.element.classList.toggle("large", large);
53
- this.element.classList.toggle("xlarge", xlarge);
54
- this.element.classList.toggle("xxlarge", xxlarge);
55
- this.element.classList.toggle("large2k", large2k);
56
- this.element.classList.toggle("large4k", large4k);
57
- }
58
- render() {
59
- return (index.h("div", null, index.h("slot", null)));
60
- }
61
- get element() { return index.getElement(this); }
62
- };
9
+ let PtcResponsiveWrapper = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ }
13
+ componentDidLoad() {
14
+ this.ro = new ResizeObserver(entries => {
15
+ for (const entry of entries) {
16
+ this.applySizeClasses(entry.contentRect.width);
17
+ }
18
+ });
19
+ this.ro.observe(this.element);
20
+ }
21
+ disconnectedCallback() {
22
+ this.ro.disconnect();
23
+ }
24
+ applySizeClasses(size) {
25
+ let xsmall = false;
26
+ let small = false;
27
+ let medium = false;
28
+ let large = false;
29
+ let xlarge = false;
30
+ let xxlarge = false;
31
+ let large2k = false;
32
+ let large4k = false;
33
+ if (size >= 2600)
34
+ large4k = true;
35
+ else if (size >= 1980)
36
+ large2k = true;
37
+ else if (size >= 1600)
38
+ xxlarge = true;
39
+ else if (size >= 1440)
40
+ xlarge = true;
41
+ else if (size >= 1200)
42
+ large = true;
43
+ else if (size >= 992)
44
+ medium = true;
45
+ else if (size >= 768)
46
+ small = true;
47
+ else
48
+ xsmall = true;
49
+ this.element.classList.toggle("xsmall", xsmall);
50
+ this.element.classList.toggle("small", small);
51
+ this.element.classList.toggle("medium", medium);
52
+ this.element.classList.toggle("large", large);
53
+ this.element.classList.toggle("xlarge", xlarge);
54
+ this.element.classList.toggle("xxlarge", xxlarge);
55
+ this.element.classList.toggle("large2k", large2k);
56
+ this.element.classList.toggle("large4k", large4k);
57
+ }
58
+ render() {
59
+ return (index.h("div", null, index.h("slot", null)));
60
+ }
61
+ get element() { return index.getElement(this); }
62
+ };
63
63
  PtcResponsiveWrapper.style = ptcResponsiveWrapperCss;
64
64
 
65
65
  exports.ptc_responsive_wrapper = PtcResponsiveWrapper;
@@ -6,30 +6,30 @@ const index = require('./index-3adcf9f4.js');
6
6
 
7
7
  const ptcSelectCss = ".sc-ptc-select-h{display:block}.ptc-select.sc-ptc-select{display:block;width:100%;padding:6px 12px;border:none;border-bottom:1px solid #3b4550;padding-left:20px;-webkit-box-shadow:1px 1px 25px 0 rgba(0, 0, 0, 0.16);box-shadow:1px 1px 25px 0 rgba(0, 0, 0, 0.16);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-left-radius:0;border-bottom-right-radius:0;font-size:16px;color:#707070;padding-top:14px;background:#fff}";
8
8
 
9
- let PtcSelect = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.valueOptions = [];
13
- }
14
- componentWillLoad() {
15
- const BASE_URL = 'https://countriesnow.space/api/v0.1/countries/iso';
16
- return fetch(`${BASE_URL}`)
17
- .then(response => response.json())
18
- .then(data => {
19
- this.valueOptions = data.data;
20
- console.log(this.valueOptions);
21
- });
22
- }
23
- render() {
24
- if (this.selectId == 'contact-country') {
25
- console.log('country field exist');
26
- }
27
- return (index.h("div", null, index.h("select", { id: this.selectId, class: "ptc-select", "data-eloqua-name": this.dataEloquaName, name: this.name }, this.selectId === 'contact-country'
28
- ? this.valueOptions.map(recipient => index.h("option", { value: recipient.Iso2 }, recipient.name))
29
- : this.valueOptions.map(recipient => index.h("option", { value: recipient.Iso3 }, recipient.name))), index.h("label", { htmlFor: this.selectId, class: "floating-label" }, index.h("slot", null))));
30
- }
31
- get el() { return index.getElement(this); }
32
- };
9
+ let PtcSelect = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.valueOptions = [];
13
+ }
14
+ componentWillLoad() {
15
+ const BASE_URL = 'https://countriesnow.space/api/v0.1/countries/iso';
16
+ return fetch(`${BASE_URL}`)
17
+ .then(response => response.json())
18
+ .then(data => {
19
+ this.valueOptions = data.data;
20
+ console.log(this.valueOptions);
21
+ });
22
+ }
23
+ render() {
24
+ if (this.selectId == 'contact-country') {
25
+ console.log('country field exist');
26
+ }
27
+ return (index.h("div", null, index.h("select", { id: this.selectId, class: "ptc-select", "data-eloqua-name": this.dataEloquaName, name: this.name }, this.selectId === 'contact-country'
28
+ ? this.valueOptions.map(recipient => index.h("option", { value: recipient.Iso2 }, recipient.name))
29
+ : this.valueOptions.map(recipient => index.h("option", { value: recipient.Iso3 }, recipient.name))), index.h("label", { htmlFor: this.selectId, class: "floating-label" }, index.h("slot", null))));
30
+ }
31
+ get el() { return index.getElement(this); }
32
+ };
33
33
  PtcSelect.style = ptcSelectCss;
34
34
 
35
35
  exports.ptc_select = PtcSelect;
@@ -6,70 +6,70 @@ const index = require('./index-3adcf9f4.js');
6
6
 
7
7
  const ptcSocialShareCss = ":host(.inline-block){display:inline-block}:host(.block){display:block}:host(.inline){display:inline}:host(.flex){display:flex}:host(.ptc-social-share){cursor:pointer}@media screen and (min-width: 1200px){:host(.ptc-social-m-left){margin-left:19px}}";
8
8
 
9
- let PtcSocialShare = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.display = 'inline-block';
13
- this.shareType = 'twitter';
14
- /**
15
- * Optional - source for linkedin
16
- */
17
- this.source = '';
18
- /**
19
- * Email recipient.
20
- * If you want to use mail share, you need to use this property
21
- */
22
- this.recipient = '';
23
- /**
24
- * is hover or not
25
- */
26
- this.isHover = false;
27
- }
28
- render() {
29
- const classMap = this.getCssClassMap();
30
- return (index.h(index.Host, { class: classMap }, index.h("div", { onClick: () => this.share(), onMouseEnter: () => this.hoverToggle(), onMouseLeave: () => this.hoverToggle() }, this.shareType == 'mail' ? index.h("icon-asset", Object.assign({ type: "ptc", size: "x-large", name: "plm-mail" }, (this.isHover ? { color: 'gray' } : { color: 'white' }))) : null, this.shareType == 'linkedin' ? index.h("icon-asset", Object.assign({ type: "ptc", size: "x-large", name: "plm-linkedin" }, (this.isHover ? { color: 'gray' } : { color: 'white' }))) : null, this.shareType == 'twitter' ? index.h("icon-asset", Object.assign({ type: "ptc", size: "x-large", name: "plm-twitter" }, (this.isHover ? { color: 'gray' } : { color: 'white' }))) : null, this.shareType == 'facebook' ? index.h("icon-asset", Object.assign({ type: "ptc", size: "x-large", name: "plm-fb" }, (this.isHover ? { color: 'gray' } : { color: 'white' }))) : null, this.shareType == 'share-api' ? index.h("icon-asset", Object.assign({ type: "solid", size: "x-large", name: "share-square" }, (this.isHover ? { color: 'gray' } : { color: 'white' }))) : null)));
31
- }
32
- getCssClassMap() {
33
- return {
34
- ['ptc-social-share']: true,
35
- [this.display]: true,
36
- };
37
- }
38
- hoverToggle() {
39
- this.isHover = !this.isHover;
40
- }
41
- share() {
42
- if (this.shareType == 'twitter') {
43
- window.open(`https://twitter.com/share?text=${this.text}&url=${this.url}`);
44
- }
45
- if (this.shareType == 'facebook') {
46
- window.open(`https://www.facebook.com/sharer/sharer.php?u=${this.url}`);
47
- }
48
- if (this.shareType == 'linkedin') {
49
- window.open(`https://www.linkedin.com/shareArticle?mini=true&url=${this.url}&title=${this.shareTitle}&summary=${this.text}&source=${this.source}`);
50
- }
51
- if (this.shareType == 'mail') {
52
- window.open(`mailto:${this.recipient}?subject=${this.text}&body=${this.url}`);
53
- }
54
- if (this.shareType == 'share-api') {
55
- if (navigator.share) {
56
- navigator
57
- .share({
58
- title: this.shareTitle,
59
- text: this.text,
60
- url: this.url,
61
- })
62
- .then(() => console.log('Successful share'))
63
- .catch(error => console.log('Error sharing', error));
64
- }
65
- else {
66
- // fallback to sharing to twitter
67
- window.open(`http://twitter.com/share?text=${this.text}&url=${this.url}`);
68
- }
69
- }
70
- }
71
- get el() { return index.getElement(this); }
72
- };
9
+ let PtcSocialShare = class {
10
+ constructor(hostRef) {
11
+ index.registerInstance(this, hostRef);
12
+ this.display = 'inline-block';
13
+ this.shareType = 'twitter';
14
+ /**
15
+ * Optional - source for linkedin
16
+ */
17
+ this.source = '';
18
+ /**
19
+ * Email recipient.
20
+ * If you want to use mail share, you need to use this property
21
+ */
22
+ this.recipient = '';
23
+ /**
24
+ * is hover or not
25
+ */
26
+ this.isHover = false;
27
+ }
28
+ render() {
29
+ const classMap = this.getCssClassMap();
30
+ return (index.h(index.Host, { class: classMap }, index.h("div", { onClick: () => this.share(), onMouseEnter: () => this.hoverToggle(), onMouseLeave: () => this.hoverToggle() }, this.shareType == 'mail' ? index.h("icon-asset", Object.assign({ type: "ptc", size: "x-large", name: "plm-mail" }, (this.isHover ? { color: 'gray' } : { color: 'white' }))) : null, this.shareType == 'linkedin' ? index.h("icon-asset", Object.assign({ type: "ptc", size: "x-large", name: "plm-linkedin" }, (this.isHover ? { color: 'gray' } : { color: 'white' }))) : null, this.shareType == 'twitter' ? index.h("icon-asset", Object.assign({ type: "ptc", size: "x-large", name: "plm-twitter" }, (this.isHover ? { color: 'gray' } : { color: 'white' }))) : null, this.shareType == 'facebook' ? index.h("icon-asset", Object.assign({ type: "ptc", size: "x-large", name: "plm-fb" }, (this.isHover ? { color: 'gray' } : { color: 'white' }))) : null, this.shareType == 'share-api' ? index.h("icon-asset", Object.assign({ type: "solid", size: "x-large", name: "share-square" }, (this.isHover ? { color: 'gray' } : { color: 'white' }))) : null)));
31
+ }
32
+ getCssClassMap() {
33
+ return {
34
+ ['ptc-social-share']: true,
35
+ [this.display]: true,
36
+ };
37
+ }
38
+ hoverToggle() {
39
+ this.isHover = !this.isHover;
40
+ }
41
+ share() {
42
+ if (this.shareType == 'twitter') {
43
+ window.open(`https://twitter.com/share?text=${this.text}&url=${this.url}`);
44
+ }
45
+ if (this.shareType == 'facebook') {
46
+ window.open(`https://www.facebook.com/sharer/sharer.php?u=${this.url}`);
47
+ }
48
+ if (this.shareType == 'linkedin') {
49
+ window.open(`https://www.linkedin.com/shareArticle?mini=true&url=${this.url}&title=${this.shareTitle}&summary=${this.text}&source=${this.source}`);
50
+ }
51
+ if (this.shareType == 'mail') {
52
+ window.open(`mailto:${this.recipient}?subject=${this.text}&body=${this.url}`);
53
+ }
54
+ if (this.shareType == 'share-api') {
55
+ if (navigator.share) {
56
+ navigator
57
+ .share({
58
+ title: this.shareTitle,
59
+ text: this.text,
60
+ url: this.url,
61
+ })
62
+ .then(() => console.log('Successful share'))
63
+ .catch(error => console.log('Error sharing', error));
64
+ }
65
+ else {
66
+ // fallback to sharing to twitter
67
+ window.open(`http://twitter.com/share?text=${this.text}&url=${this.url}`);
68
+ }
69
+ }
70
+ }
71
+ get el() { return index.getElement(this); }
72
+ };
73
73
  PtcSocialShare.style = ptcSocialShareCss;
74
74
 
75
75
  exports.ptc_social_share = PtcSocialShare;