@ptcwebops/ptcw-design 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/icon-asset_5.cjs.entry.js +207 -0
- package/dist/{ptcw-design/index-f7043a90.js → cjs/index-ac192914.js} +195 -1311
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/interfaces-0ecd8027.js +15 -0
- package/dist/cjs/list-item.cjs.entry.js +27 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/lottie-player.cjs.entry.js +13476 -0
- package/dist/cjs/my-component.cjs.entry.js +26 -0
- package/dist/cjs/ptc-avatar.cjs.entry.js +19 -0
- package/dist/cjs/ptc-card.cjs.entry.js +75 -0
- package/dist/cjs/ptc-date.cjs.entry.js +48 -0
- package/dist/cjs/ptc-footer.cjs.entry.js +19 -0
- package/dist/cjs/ptc-img.cjs.entry.js +155 -0
- package/dist/cjs/ptc-link.cjs.entry.js +53 -0
- package/dist/cjs/ptc-list.cjs.entry.js +32 -0
- package/dist/cjs/ptc-lottie.cjs.entry.js +23 -0
- package/dist/cjs/ptc-nav-item.cjs.entry.js +94 -0
- package/dist/cjs/ptc-nav.cjs.entry.js +19 -0
- package/dist/cjs/ptc-overlay.cjs.entry.js +19 -0
- package/dist/cjs/ptc-picture.cjs.entry.js +167 -0
- package/dist/cjs/ptc-spacer.cjs.entry.js +46 -0
- package/dist/cjs/ptc-span.cjs.entry.js +31 -0
- package/dist/cjs/ptc-title.cjs.entry.js +49 -0
- package/dist/cjs/ptcw-design.cjs.js +19 -0
- package/dist/collection/assets/svg-imgs/close.svg +11 -0
- package/dist/collection/collection-manifest.json +40 -0
- package/dist/collection/components/icon-asset/assets/brands.svg +1381 -0
- package/dist/collection/components/icon-asset/assets/footer-social.svg +0 -0
- package/dist/collection/components/icon-asset/assets/ptc-sprite.svg +144 -0
- package/dist/collection/components/icon-asset/assets/regular.svg +463 -0
- package/dist/collection/components/icon-asset/assets/solid.svg +3013 -0
- package/dist/collection/components/icon-asset/assets/svg-with-js.min.css +5 -0
- package/dist/collection/components/icon-asset/icon-asset.css +30 -0
- package/dist/collection/components/icon-asset/icon-asset.js +177 -0
- package/dist/collection/components/list-item/list-item.css +3 -0
- package/dist/collection/components/list-item/list-item.js +63 -0
- package/dist/collection/components/my-component/my-component.css +3 -0
- package/dist/collection/components/my-component/my-component.js +74 -0
- package/dist/collection/components/ptc-announcement/ptc-announcement.css +87 -0
- package/dist/collection/components/ptc-announcement/ptc-announcement.js +127 -0
- package/dist/collection/components/ptc-avatar/ptc-avatar.css +3 -0
- package/dist/collection/components/ptc-avatar/ptc-avatar.js +15 -0
- package/dist/collection/components/ptc-button/ptc-button.css +155 -0
- package/dist/collection/components/ptc-button/ptc-button.js +223 -0
- package/dist/collection/components/ptc-card/ptc-card.css +262 -0
- package/dist/collection/components/ptc-card/ptc-card.js +260 -0
- package/dist/collection/components/ptc-date/ptc-date.css +3 -0
- package/dist/collection/components/ptc-date/ptc-date.js +155 -0
- package/dist/collection/components/ptc-footer/ptc-footer.css +40 -0
- package/dist/collection/components/ptc-footer/ptc-footer.js +25 -0
- package/dist/collection/components/ptc-img/ptc-img.css +65 -0
- package/dist/collection/components/ptc-img/ptc-img.js +309 -0
- package/dist/collection/components/ptc-link/ptc-link.css +168 -0
- package/dist/collection/components/ptc-link/ptc-link.js +197 -0
- package/dist/collection/components/ptc-list/ptc-list.css +24 -0
- package/dist/collection/components/ptc-list/ptc-list.js +66 -0
- package/dist/collection/components/ptc-lottie/ptc-lottie.css +5 -0
- package/dist/collection/components/ptc-lottie/ptc-lottie.js +58 -0
- package/dist/collection/components/ptc-nav/ptc-nav.css +29 -0
- package/dist/collection/components/ptc-nav/ptc-nav.js +21 -0
- package/dist/collection/components/ptc-nav-item/ptc-nav-item.css +81 -0
- package/dist/collection/components/ptc-nav-item/ptc-nav-item.js +252 -0
- package/dist/collection/components/ptc-overlay/ptc-overlay.css +3 -0
- package/dist/collection/components/ptc-overlay/ptc-overlay.js +14 -0
- package/dist/collection/components/ptc-para/ptc-para.css +88 -0
- package/dist/collection/components/ptc-para/ptc-para.js +111 -0
- package/dist/collection/components/ptc-picture/ptc-picture.css +32 -0
- package/dist/collection/components/ptc-picture/ptc-picture.js +356 -0
- package/dist/collection/components/ptc-spacer/ptc-spacer.css +307 -0
- package/dist/collection/components/ptc-spacer/ptc-spacer.js +99 -0
- package/dist/collection/components/ptc-span/ptc-span.css +36 -0
- package/dist/collection/components/ptc-span/ptc-span.js +86 -0
- package/dist/collection/components/ptc-svg-btn/ptc-svg-btn.css +77 -0
- package/dist/collection/components/ptc-svg-btn/ptc-svg-btn.js +34 -0
- package/dist/collection/components/ptc-title/ptc-title.css +64 -0
- package/dist/collection/components/ptc-title/ptc-title.js +105 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/interfaces.js +11 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/custom-elements/index.d.ts +6 -6
- package/dist/custom-elements/index.js +14559 -0
- package/dist/esm/icon-asset_5.entry.js +199 -0
- package/dist/esm/index-7a3883ee.js +1687 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/interfaces-3cb94654.js +12 -0
- package/dist/{ptcw-design → esm}/list-item.entry.js +1 -1
- package/dist/esm/loader.js +17 -0
- package/dist/{ptcw-design → esm}/lottie-player.entry.js +31 -782
- package/dist/{ptcw-design → esm}/my-component.entry.js +1 -1
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/ptc-avatar.entry.js +15 -0
- package/dist/{ptcw-design → esm}/ptc-card.entry.js +3 -3
- package/dist/{ptcw-design → esm}/ptc-date.entry.js +1 -1
- package/dist/{ptcw-design → esm}/ptc-footer.entry.js +1 -1
- package/dist/{ptcw-design → esm}/ptc-img.entry.js +6 -25
- package/dist/{ptcw-design → esm}/ptc-link.entry.js +1 -1
- package/dist/{ptcw-design → esm}/ptc-list.entry.js +1 -1
- package/dist/{ptcw-design → esm}/ptc-lottie.entry.js +1 -1
- package/dist/{ptcw-design → esm}/ptc-nav-item.entry.js +1 -1
- package/dist/{ptcw-design → esm}/ptc-nav.entry.js +1 -1
- package/dist/{ptcw-design → esm}/ptc-overlay.entry.js +1 -1
- package/dist/esm/ptc-picture.entry.js +163 -0
- package/dist/{ptcw-design → esm}/ptc-spacer.entry.js +1 -1
- package/dist/{ptcw-design → esm}/ptc-span.entry.js +1 -1
- package/dist/{ptcw-design → esm}/ptc-title.entry.js +1 -1
- package/dist/esm/ptcw-design.js +17 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/node_modules/@teamhive/lottie-player/dist/collection/components/lottie-player/lottie-player.css +187 -0
- package/dist/ptcw-design/index.esm.js +0 -1
- package/dist/ptcw-design/p-0c8df906.entry.js +1 -0
- package/dist/ptcw-design/p-18092cf1.entry.js +1 -0
- package/dist/ptcw-design/p-186beb2c.entry.js +1 -0
- package/dist/ptcw-design/p-240733ce.js +1 -0
- package/dist/ptcw-design/p-2d5f8cff.entry.js +1 -0
- package/dist/ptcw-design/p-50923c9a.js +1 -0
- package/dist/ptcw-design/p-51a3e9e6.entry.js +1 -0
- package/dist/ptcw-design/p-5f776886.entry.js +1 -0
- package/dist/ptcw-design/p-66ffa30c.entry.js +1 -0
- package/dist/ptcw-design/p-6b1a35e1.entry.js +1 -0
- package/dist/ptcw-design/p-73e2418e.entry.js +1 -0
- package/dist/ptcw-design/p-78a47bf1.entry.js +1 -0
- package/dist/ptcw-design/p-796b8287.entry.js +1 -0
- package/dist/ptcw-design/p-90402319.entry.js +1 -0
- package/dist/ptcw-design/p-919311d2.entry.js +1 -0
- package/dist/ptcw-design/p-ac449734.entry.js +1 -0
- package/dist/ptcw-design/p-bff9c1f2.entry.js +1 -0
- package/dist/ptcw-design/p-d6553853.entry.js +1 -0
- package/dist/ptcw-design/p-ef250898.entry.js +1 -0
- package/dist/ptcw-design/p-f694e46a.entry.js +1 -0
- package/dist/ptcw-design/p-f80152dc.entry.js +1 -0
- package/dist/ptcw-design/ptcw-design.css +2 -1030
- package/dist/ptcw-design/ptcw-design.esm.js +1 -122
- package/dist/types/components/ptc-avatar/ptc-avatar.d.ts +3 -0
- package/dist/types/components/ptc-para/ptc-para.d.ts +1 -1
- package/dist/types/components/ptc-picture/ptc-picture.d.ts +60 -1
- package/dist/types/components.d.ts +95 -33
- package/dist/types/utils/interfaces.d.ts +6 -1
- package/package.json +2 -2
- package/dist/ptcw-design/app-globals-0f993ce5.js +0 -3
- package/dist/ptcw-design/css-shim-003e9264.js +0 -4
- package/dist/ptcw-design/dom-1b195079.js +0 -73
- package/dist/ptcw-design/icon-asset.entry.js +0 -60
- package/dist/ptcw-design/ptc-announcement.entry.js +0 -31
- package/dist/ptcw-design/ptc-button.entry.js +0 -57
- package/dist/ptcw-design/ptc-image.entry.js +0 -54
- package/dist/ptcw-design/ptc-para.entry.js +0 -36
- package/dist/ptcw-design/ptc-picture.entry.js +0 -22
- package/dist/ptcw-design/ptc-svg-btn.entry.js +0 -27
- package/dist/ptcw-design/shadow-css-c1ad5fdc.js +0 -383
- package/dist/types/components/ptc-image/ptc-image.d.ts +0 -18
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { Component, Host, h, Prop, Listen, Element } from '@stencil/core';
|
|
2
|
+
import { ResponsiveBgVariables } from '../../utils/interfaces';
|
|
3
|
+
export class PtcImg {
|
|
4
|
+
constructor() {
|
|
5
|
+
/**
|
|
6
|
+
* Image size for smallest screen
|
|
7
|
+
* <=767px
|
|
8
|
+
*/
|
|
9
|
+
this.sizeXs = '510x340';
|
|
10
|
+
/**
|
|
11
|
+
* Image size for small screen
|
|
12
|
+
* >=768px and <=991px
|
|
13
|
+
*/
|
|
14
|
+
this.sizeSm = '1240x496';
|
|
15
|
+
/**
|
|
16
|
+
* Image size for medium screen
|
|
17
|
+
* >=992px and <=1199px
|
|
18
|
+
*/
|
|
19
|
+
this.sizeMd = '1366x500';
|
|
20
|
+
/**
|
|
21
|
+
* Image solution for large screen
|
|
22
|
+
* >=1200px
|
|
23
|
+
*/
|
|
24
|
+
this.sizeLg = '1920x1080';
|
|
25
|
+
/**
|
|
26
|
+
* Image type
|
|
27
|
+
*/
|
|
28
|
+
this.imageType = 'smart-bg';
|
|
29
|
+
/**
|
|
30
|
+
* Image border shape
|
|
31
|
+
*/
|
|
32
|
+
this.borderRadius = '';
|
|
33
|
+
/**
|
|
34
|
+
* Lazy loading option
|
|
35
|
+
*/
|
|
36
|
+
this.loadMode = 'lazy-bg';
|
|
37
|
+
}
|
|
38
|
+
WindowResize() {
|
|
39
|
+
this.setResponsiveBg();
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
const classMap = this.getCssClassMap();
|
|
43
|
+
return (h(Host, null,
|
|
44
|
+
h("div", { class: classMap, "data-xs": `${this.imgUrl}:${this.sizeXs}`, "data-sm": `${this.imgUrl}:${this.sizeSm}`, "data-md": `${this.imgUrl}:${this.sizeMd}`, "data-lg": `${this.imgUrl}:${this.sizeLg}` })));
|
|
45
|
+
}
|
|
46
|
+
componentDidLoad() {
|
|
47
|
+
this.addIntersectionObserver();
|
|
48
|
+
this.setResponsiveBg();
|
|
49
|
+
}
|
|
50
|
+
componentWillUpdate() {
|
|
51
|
+
// console.log('componentWillUpdate!');
|
|
52
|
+
this.addIntersectionObserver();
|
|
53
|
+
this.setResponsiveBg();
|
|
54
|
+
}
|
|
55
|
+
//responsive image
|
|
56
|
+
setResponsiveBg() {
|
|
57
|
+
// Define local variables
|
|
58
|
+
let backgrounds = (this.el || document).querySelectorAll(ResponsiveBgVariables.selector), el, elData, currentBreakpoint = this.getCurrentBreakPoints();
|
|
59
|
+
// console.log('current breakpoint: ' + currentBreakpoint);
|
|
60
|
+
// Loop through all target elements
|
|
61
|
+
for (var i = 0, len = backgrounds.length; i < len; i++) {
|
|
62
|
+
// Set current variables
|
|
63
|
+
el = backgrounds[i];
|
|
64
|
+
elData = el.getAttribute('data-' + currentBreakpoint);
|
|
65
|
+
// If the data attribute exists, set the background
|
|
66
|
+
if (elData !== null) {
|
|
67
|
+
el.style.backgroundImage = "url('" + elData + "')";
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
if (typeof console == 'object') {
|
|
71
|
+
console.warn('Data attribute: data-' + currentBreakpoint + ' not found on element:\n\n' + el.outerHTML + '\n\n\n');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//lazy loading
|
|
77
|
+
addIntersectionObserver() {
|
|
78
|
+
if (!this.imgUrl) {
|
|
79
|
+
console.log('no image!');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if ('IntersectionObserver' in window) {
|
|
83
|
+
let lazyLoadBgs = (this.el || document).querySelectorAll('.lazy-bg');
|
|
84
|
+
let bgObserver = new IntersectionObserver(entries => {
|
|
85
|
+
entries.forEach(entry => {
|
|
86
|
+
if (entry.isIntersecting) {
|
|
87
|
+
const image = entry.target;
|
|
88
|
+
image.classList.remove('lazy-bg');
|
|
89
|
+
// console.log('loaded');
|
|
90
|
+
bgObserver.unobserve(image);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
lazyLoadBgs.forEach(image => {
|
|
95
|
+
bgObserver.observe(image);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// fall back to setTimeout for Safari and IE
|
|
100
|
+
// setTimeout(() => {};
|
|
101
|
+
// }, 5000);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
getCssClassMap() {
|
|
105
|
+
return {
|
|
106
|
+
[this.imageType]: true,
|
|
107
|
+
'ptc-img': true,
|
|
108
|
+
[this.borderRadius]: true,
|
|
109
|
+
[this.loadMode]: true,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
getCurrentBreakPoints() {
|
|
113
|
+
// Define local variables
|
|
114
|
+
let doc = window.document, temp = doc.createElement('div'), env;
|
|
115
|
+
// Append test node
|
|
116
|
+
doc.body.appendChild(temp);
|
|
117
|
+
// Loop through breakpoints
|
|
118
|
+
for (let i = ResponsiveBgVariables.envs.length - 1; i >= 0; i--) {
|
|
119
|
+
env = ResponsiveBgVariables.envs[i];
|
|
120
|
+
// Add classes
|
|
121
|
+
temp.className = 'hidden-' + env;
|
|
122
|
+
// Found breakpoint
|
|
123
|
+
if (temp.offsetParent === null) {
|
|
124
|
+
// Remove our test node
|
|
125
|
+
doc.body.removeChild(temp);
|
|
126
|
+
console.log('remove test node');
|
|
127
|
+
// Return current breakpoint
|
|
128
|
+
return env;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Breakpoint not found, try fallback
|
|
132
|
+
doc.body.removeChild(temp);
|
|
133
|
+
return this.getFallbackBreakpoint();
|
|
134
|
+
}
|
|
135
|
+
getFallbackBreakpoint() {
|
|
136
|
+
if (window.matchMedia('(min-width: 992px)').matches) {
|
|
137
|
+
return 'lg';
|
|
138
|
+
}
|
|
139
|
+
else if (window.matchMedia('(min-width: 768px)').matches) {
|
|
140
|
+
return 'md';
|
|
141
|
+
}
|
|
142
|
+
else if (window.matchMedia('(min-width: 576px)').matches) {
|
|
143
|
+
return 'sm';
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
return 'xs';
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
static get is() { return "ptc-img"; }
|
|
150
|
+
static get originalStyleUrls() { return {
|
|
151
|
+
"$": ["ptc-img.scss"]
|
|
152
|
+
}; }
|
|
153
|
+
static get styleUrls() { return {
|
|
154
|
+
"$": ["ptc-img.css"]
|
|
155
|
+
}; }
|
|
156
|
+
static get properties() { return {
|
|
157
|
+
"sizeXs": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"mutable": true,
|
|
160
|
+
"complexType": {
|
|
161
|
+
"original": "string",
|
|
162
|
+
"resolved": "string",
|
|
163
|
+
"references": {}
|
|
164
|
+
},
|
|
165
|
+
"required": false,
|
|
166
|
+
"optional": false,
|
|
167
|
+
"docs": {
|
|
168
|
+
"tags": [],
|
|
169
|
+
"text": "Image size for smallest screen\n<=767px"
|
|
170
|
+
},
|
|
171
|
+
"attribute": "size-xs",
|
|
172
|
+
"reflect": false,
|
|
173
|
+
"defaultValue": "'510x340'"
|
|
174
|
+
},
|
|
175
|
+
"sizeSm": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"mutable": true,
|
|
178
|
+
"complexType": {
|
|
179
|
+
"original": "string",
|
|
180
|
+
"resolved": "string",
|
|
181
|
+
"references": {}
|
|
182
|
+
},
|
|
183
|
+
"required": false,
|
|
184
|
+
"optional": false,
|
|
185
|
+
"docs": {
|
|
186
|
+
"tags": [],
|
|
187
|
+
"text": "Image size for small screen\n>=768px and <=991px"
|
|
188
|
+
},
|
|
189
|
+
"attribute": "size-sm",
|
|
190
|
+
"reflect": false,
|
|
191
|
+
"defaultValue": "'1240x496'"
|
|
192
|
+
},
|
|
193
|
+
"sizeMd": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"mutable": true,
|
|
196
|
+
"complexType": {
|
|
197
|
+
"original": "string",
|
|
198
|
+
"resolved": "string",
|
|
199
|
+
"references": {}
|
|
200
|
+
},
|
|
201
|
+
"required": false,
|
|
202
|
+
"optional": false,
|
|
203
|
+
"docs": {
|
|
204
|
+
"tags": [],
|
|
205
|
+
"text": "Image size for medium screen\n>=992px and <=1199px"
|
|
206
|
+
},
|
|
207
|
+
"attribute": "size-md",
|
|
208
|
+
"reflect": false,
|
|
209
|
+
"defaultValue": "'1366x500'"
|
|
210
|
+
},
|
|
211
|
+
"sizeLg": {
|
|
212
|
+
"type": "string",
|
|
213
|
+
"mutable": true,
|
|
214
|
+
"complexType": {
|
|
215
|
+
"original": "string",
|
|
216
|
+
"resolved": "string",
|
|
217
|
+
"references": {}
|
|
218
|
+
},
|
|
219
|
+
"required": false,
|
|
220
|
+
"optional": false,
|
|
221
|
+
"docs": {
|
|
222
|
+
"tags": [],
|
|
223
|
+
"text": "Image solution for large screen\n>=1200px"
|
|
224
|
+
},
|
|
225
|
+
"attribute": "size-lg",
|
|
226
|
+
"reflect": false,
|
|
227
|
+
"defaultValue": "'1920x1080'"
|
|
228
|
+
},
|
|
229
|
+
"imgUrl": {
|
|
230
|
+
"type": "string",
|
|
231
|
+
"mutable": false,
|
|
232
|
+
"complexType": {
|
|
233
|
+
"original": "string",
|
|
234
|
+
"resolved": "string",
|
|
235
|
+
"references": {}
|
|
236
|
+
},
|
|
237
|
+
"required": false,
|
|
238
|
+
"optional": false,
|
|
239
|
+
"docs": {
|
|
240
|
+
"tags": [],
|
|
241
|
+
"text": "Image Src"
|
|
242
|
+
},
|
|
243
|
+
"attribute": "img-url",
|
|
244
|
+
"reflect": false
|
|
245
|
+
},
|
|
246
|
+
"imageType": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"mutable": false,
|
|
249
|
+
"complexType": {
|
|
250
|
+
"original": "'smart-bg' | 'smart-img'",
|
|
251
|
+
"resolved": "\"smart-bg\" | \"smart-img\"",
|
|
252
|
+
"references": {}
|
|
253
|
+
},
|
|
254
|
+
"required": false,
|
|
255
|
+
"optional": false,
|
|
256
|
+
"docs": {
|
|
257
|
+
"tags": [],
|
|
258
|
+
"text": "Image type"
|
|
259
|
+
},
|
|
260
|
+
"attribute": "image-type",
|
|
261
|
+
"reflect": false,
|
|
262
|
+
"defaultValue": "'smart-bg'"
|
|
263
|
+
},
|
|
264
|
+
"borderRadius": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"mutable": false,
|
|
267
|
+
"complexType": {
|
|
268
|
+
"original": "'radius-sm' | 'radius-md' | 'radius-lg' | ''",
|
|
269
|
+
"resolved": "\"\" | \"radius-lg\" | \"radius-md\" | \"radius-sm\"",
|
|
270
|
+
"references": {}
|
|
271
|
+
},
|
|
272
|
+
"required": false,
|
|
273
|
+
"optional": false,
|
|
274
|
+
"docs": {
|
|
275
|
+
"tags": [],
|
|
276
|
+
"text": "Image border shape"
|
|
277
|
+
},
|
|
278
|
+
"attribute": "border-radius",
|
|
279
|
+
"reflect": false,
|
|
280
|
+
"defaultValue": "''"
|
|
281
|
+
},
|
|
282
|
+
"loadMode": {
|
|
283
|
+
"type": "string",
|
|
284
|
+
"mutable": false,
|
|
285
|
+
"complexType": {
|
|
286
|
+
"original": "'lazy-bg' | 'eager-bg'",
|
|
287
|
+
"resolved": "\"eager-bg\" | \"lazy-bg\"",
|
|
288
|
+
"references": {}
|
|
289
|
+
},
|
|
290
|
+
"required": false,
|
|
291
|
+
"optional": false,
|
|
292
|
+
"docs": {
|
|
293
|
+
"tags": [],
|
|
294
|
+
"text": "Lazy loading option"
|
|
295
|
+
},
|
|
296
|
+
"attribute": "load-mode",
|
|
297
|
+
"reflect": false,
|
|
298
|
+
"defaultValue": "'lazy-bg'"
|
|
299
|
+
}
|
|
300
|
+
}; }
|
|
301
|
+
static get elementRef() { return "el"; }
|
|
302
|
+
static get listeners() { return [{
|
|
303
|
+
"name": "resize",
|
|
304
|
+
"method": "WindowResize",
|
|
305
|
+
"target": "window",
|
|
306
|
+
"capture": false,
|
|
307
|
+
"passive": true
|
|
308
|
+
}]; }
|
|
309
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
.disabled {
|
|
2
|
+
pointer-events: none;
|
|
3
|
+
cursor: default;
|
|
4
|
+
text-decoration: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ptc-link {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
color: var(--color-primary-uigrey);
|
|
10
|
+
font-weight: var(--ptc-font-weight-black);
|
|
11
|
+
position: relative;
|
|
12
|
+
line-height: var(--ptc-line-height-normal);
|
|
13
|
+
margin-bottom: var(--ptc-element-spacing-01);
|
|
14
|
+
outline: none;
|
|
15
|
+
text-decoration: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.simple::after {
|
|
19
|
+
content: "";
|
|
20
|
+
position: absolute;
|
|
21
|
+
width: 100%;
|
|
22
|
+
left: 0px;
|
|
23
|
+
bottom: 2px;
|
|
24
|
+
transition: opacity var(--ptc-transition-fast) var(--ptc-standard-ease);
|
|
25
|
+
border-bottom: 2px solid var(--color-primary-green);
|
|
26
|
+
opacity: 0;
|
|
27
|
+
}
|
|
28
|
+
.simple:hover.simple::after {
|
|
29
|
+
opacity: 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.arrow {
|
|
33
|
+
margin-right: var(--ptc-element-spacing-01);
|
|
34
|
+
}
|
|
35
|
+
.arrow::after {
|
|
36
|
+
position: absolute;
|
|
37
|
+
display: block;
|
|
38
|
+
content: "";
|
|
39
|
+
width: var(--ptc-element-spacing-06);
|
|
40
|
+
border-bottom: 2px solid var(--color-primary-green);
|
|
41
|
+
bottom: 1px;
|
|
42
|
+
transition: width var(--ptc-transition-fast) var(--ptc-standard-ease);
|
|
43
|
+
}
|
|
44
|
+
.arrow:hover.arrow::after {
|
|
45
|
+
width: 100%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.uppercase {
|
|
49
|
+
text-transform: uppercase;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.small {
|
|
53
|
+
font-size: var(--ptc-font-size-small);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.medium {
|
|
57
|
+
font-size: var(--ptc-font-size-medium);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.large {
|
|
61
|
+
font-size: var(--ptc-font-size-large);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
icon-asset {
|
|
65
|
+
position: absolute;
|
|
66
|
+
right: -25px;
|
|
67
|
+
transition: transform var(--ptc-transition-fast) var(--ptc-standard-ease);
|
|
68
|
+
}
|
|
69
|
+
icon-asset svg {
|
|
70
|
+
fill: var(--color-primary-green) !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ptc-link:hover.arrow icon-asset {
|
|
74
|
+
transform: translateX(var(--ptc-element-spacing-04));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.nav-title {
|
|
78
|
+
font-size: 17px;
|
|
79
|
+
line-height: var(--ptc-line-height-dense);
|
|
80
|
+
letter-spacing: var(--ptc-element-spacing-01);
|
|
81
|
+
color: #cac8c8;
|
|
82
|
+
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
|
|
83
|
+
font-weight: var(--ptc-font-weight-semibold);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.primary-nav-link {
|
|
87
|
+
display: inline-block;
|
|
88
|
+
position: relative;
|
|
89
|
+
font-size: var(--ptc-font-size-small);
|
|
90
|
+
line-height: var(--ptc-line-height-normal);
|
|
91
|
+
font-weight: var(--ptc-font-weight-bold);
|
|
92
|
+
color: var(--color-white);
|
|
93
|
+
transition: color var(--ptc-transition-slow) ease;
|
|
94
|
+
padding: var(--ptc-element-spacing-04) 50px;
|
|
95
|
+
background-color: transparent;
|
|
96
|
+
text-decoration: none;
|
|
97
|
+
outline: none;
|
|
98
|
+
}
|
|
99
|
+
.primary-nav-link:hover {
|
|
100
|
+
color: var(--color-secondary-turtlegreen);
|
|
101
|
+
text-decoration: none;
|
|
102
|
+
outline: none;
|
|
103
|
+
background-color: transparent;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.nav-title-link {
|
|
107
|
+
font-family: var(--ptc-font-secondary-latin);
|
|
108
|
+
font-size: var(--ptc-font-size-medium);
|
|
109
|
+
font-weight: var(--ptc-font-weight-bold);
|
|
110
|
+
line-height: 1.56;
|
|
111
|
+
color: var(--color-white);
|
|
112
|
+
text-decoration: none;
|
|
113
|
+
outline: none;
|
|
114
|
+
background-color: transparent;
|
|
115
|
+
transition: color var(--ptc-transition-medium) var(--ptc-decelerated-ease);
|
|
116
|
+
border-bottom: 1.5px solid transparent;
|
|
117
|
+
}
|
|
118
|
+
.nav-title-link:hover {
|
|
119
|
+
color: var(--color-white);
|
|
120
|
+
border-bottom: 1.5px solid var(--color-secondary-turtlegreen);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.secondary-nav-link {
|
|
124
|
+
display: inline-block;
|
|
125
|
+
position: relative;
|
|
126
|
+
font-size: var(--ptc-font-size-x-small);
|
|
127
|
+
line-height: 20px;
|
|
128
|
+
font-weight: var(--ptc-font-weight-light);
|
|
129
|
+
color: var(--color-white);
|
|
130
|
+
transition: color var(--ptc-transition-slow) ease;
|
|
131
|
+
padding: 10px 15px;
|
|
132
|
+
background-color: transparent;
|
|
133
|
+
text-decoration: none;
|
|
134
|
+
outline: none;
|
|
135
|
+
}
|
|
136
|
+
.secondary-nav-link:hover {
|
|
137
|
+
color: var(--color-secondary-turtlegreen);
|
|
138
|
+
text-decoration: none;
|
|
139
|
+
outline: none;
|
|
140
|
+
background-color: transparent;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.footer-nav-link {
|
|
144
|
+
color: var(--color-white);
|
|
145
|
+
transition: border var(--ptc-transition-medium) var(--ptc-standard-ease), color var(--ptc-transition-medium) var(--ptc-standard-ease);
|
|
146
|
+
border-bottom: 1px solid transparent;
|
|
147
|
+
outline: none;
|
|
148
|
+
text-decoration: none;
|
|
149
|
+
font-weight: var(--ptc-font-weight-semibold);
|
|
150
|
+
line-height: 1.73;
|
|
151
|
+
letter-spacing: 1.13px;
|
|
152
|
+
text-align: left;
|
|
153
|
+
font-size: 15px;
|
|
154
|
+
}
|
|
155
|
+
.footer-nav-link:hover {
|
|
156
|
+
outline: none;
|
|
157
|
+
text-decoration: none;
|
|
158
|
+
border-bottom: 0.1rem solid var(--color-secondary-turtlegreen);
|
|
159
|
+
color: var(--color-secondary-turtlegreen);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.copyright-link {
|
|
163
|
+
color: var(--color-white);
|
|
164
|
+
font-size: 13px;
|
|
165
|
+
font-weight: var(--ptc-font-weight-normal);
|
|
166
|
+
line-height: 2;
|
|
167
|
+
display: inline-block;
|
|
168
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { Component, h, Prop, Host } from '@stencil/core';
|
|
2
|
+
export class PtcLink {
|
|
3
|
+
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* Disabled link
|
|
6
|
+
*/
|
|
7
|
+
this.disabled = false;
|
|
8
|
+
/**
|
|
9
|
+
* Rxternal link
|
|
10
|
+
* */
|
|
11
|
+
this.external = false;
|
|
12
|
+
/**
|
|
13
|
+
* Target
|
|
14
|
+
*/
|
|
15
|
+
this.target = '_self';
|
|
16
|
+
/**
|
|
17
|
+
* Theme
|
|
18
|
+
*/
|
|
19
|
+
this.theme = 'simple';
|
|
20
|
+
/**
|
|
21
|
+
* Uppercase
|
|
22
|
+
*/
|
|
23
|
+
this.uppercase = false;
|
|
24
|
+
/**
|
|
25
|
+
* Font Size
|
|
26
|
+
*/
|
|
27
|
+
this.fontSize = 'medium';
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
const classMap = this.getCssClassMap();
|
|
31
|
+
return (h(Host, null,
|
|
32
|
+
h("a", { class: classMap, href: this.href, target: this.external ? '_blank' : this.target, title: this.linkTitle },
|
|
33
|
+
this.theme == 'arrow' ? h("icon-asset", { type: "solid", size: "small", name: "arrow-right" }) : '',
|
|
34
|
+
h("slot", null))));
|
|
35
|
+
}
|
|
36
|
+
getCssClassMap() {
|
|
37
|
+
return {
|
|
38
|
+
['ptc-link']: true,
|
|
39
|
+
[this.theme]: true,
|
|
40
|
+
['uppercase']: this.uppercase,
|
|
41
|
+
['disabled']: this.disabled,
|
|
42
|
+
[this.fontSize]: true,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static get is() { return "ptc-link"; }
|
|
46
|
+
static get encapsulation() { return "shadow"; }
|
|
47
|
+
static get originalStyleUrls() { return {
|
|
48
|
+
"$": ["ptc-link.scss"]
|
|
49
|
+
}; }
|
|
50
|
+
static get styleUrls() { return {
|
|
51
|
+
"$": ["ptc-link.css"]
|
|
52
|
+
}; }
|
|
53
|
+
static get properties() { return {
|
|
54
|
+
"disabled": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"mutable": false,
|
|
57
|
+
"complexType": {
|
|
58
|
+
"original": "boolean",
|
|
59
|
+
"resolved": "boolean",
|
|
60
|
+
"references": {}
|
|
61
|
+
},
|
|
62
|
+
"required": false,
|
|
63
|
+
"optional": false,
|
|
64
|
+
"docs": {
|
|
65
|
+
"tags": [],
|
|
66
|
+
"text": "Disabled link"
|
|
67
|
+
},
|
|
68
|
+
"attribute": "disabled",
|
|
69
|
+
"reflect": true,
|
|
70
|
+
"defaultValue": "false"
|
|
71
|
+
},
|
|
72
|
+
"external": {
|
|
73
|
+
"type": "boolean",
|
|
74
|
+
"mutable": false,
|
|
75
|
+
"complexType": {
|
|
76
|
+
"original": "boolean",
|
|
77
|
+
"resolved": "boolean",
|
|
78
|
+
"references": {}
|
|
79
|
+
},
|
|
80
|
+
"required": false,
|
|
81
|
+
"optional": false,
|
|
82
|
+
"docs": {
|
|
83
|
+
"tags": [],
|
|
84
|
+
"text": "Rxternal link"
|
|
85
|
+
},
|
|
86
|
+
"attribute": "external",
|
|
87
|
+
"reflect": true,
|
|
88
|
+
"defaultValue": "false"
|
|
89
|
+
},
|
|
90
|
+
"href": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"mutable": false,
|
|
93
|
+
"complexType": {
|
|
94
|
+
"original": "string | undefined",
|
|
95
|
+
"resolved": "string",
|
|
96
|
+
"references": {}
|
|
97
|
+
},
|
|
98
|
+
"required": false,
|
|
99
|
+
"optional": false,
|
|
100
|
+
"docs": {
|
|
101
|
+
"tags": [],
|
|
102
|
+
"text": "href"
|
|
103
|
+
},
|
|
104
|
+
"attribute": "href",
|
|
105
|
+
"reflect": false
|
|
106
|
+
},
|
|
107
|
+
"target": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"mutable": false,
|
|
110
|
+
"complexType": {
|
|
111
|
+
"original": "string | undefined",
|
|
112
|
+
"resolved": "string",
|
|
113
|
+
"references": {}
|
|
114
|
+
},
|
|
115
|
+
"required": false,
|
|
116
|
+
"optional": false,
|
|
117
|
+
"docs": {
|
|
118
|
+
"tags": [],
|
|
119
|
+
"text": "Target"
|
|
120
|
+
},
|
|
121
|
+
"attribute": "target",
|
|
122
|
+
"reflect": false,
|
|
123
|
+
"defaultValue": "'_self'"
|
|
124
|
+
},
|
|
125
|
+
"linkTitle": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"mutable": false,
|
|
128
|
+
"complexType": {
|
|
129
|
+
"original": "string | undefined",
|
|
130
|
+
"resolved": "string",
|
|
131
|
+
"references": {}
|
|
132
|
+
},
|
|
133
|
+
"required": false,
|
|
134
|
+
"optional": false,
|
|
135
|
+
"docs": {
|
|
136
|
+
"tags": [],
|
|
137
|
+
"text": "Title"
|
|
138
|
+
},
|
|
139
|
+
"attribute": "link-title",
|
|
140
|
+
"reflect": false
|
|
141
|
+
},
|
|
142
|
+
"theme": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"mutable": false,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "'simple' | 'arrow' | 'nav-title'| 'primary-nav-link' | 'nav-title-link' | 'secondary-nav-link' | 'footer-nav-link' | 'copyright-link'",
|
|
147
|
+
"resolved": "\"arrow\" | \"copyright-link\" | \"footer-nav-link\" | \"nav-title\" | \"nav-title-link\" | \"primary-nav-link\" | \"secondary-nav-link\" | \"simple\"",
|
|
148
|
+
"references": {}
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"optional": false,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "Theme"
|
|
155
|
+
},
|
|
156
|
+
"attribute": "theme",
|
|
157
|
+
"reflect": false,
|
|
158
|
+
"defaultValue": "'simple'"
|
|
159
|
+
},
|
|
160
|
+
"uppercase": {
|
|
161
|
+
"type": "boolean",
|
|
162
|
+
"mutable": false,
|
|
163
|
+
"complexType": {
|
|
164
|
+
"original": "boolean",
|
|
165
|
+
"resolved": "boolean",
|
|
166
|
+
"references": {}
|
|
167
|
+
},
|
|
168
|
+
"required": false,
|
|
169
|
+
"optional": false,
|
|
170
|
+
"docs": {
|
|
171
|
+
"tags": [],
|
|
172
|
+
"text": "Uppercase"
|
|
173
|
+
},
|
|
174
|
+
"attribute": "uppercase",
|
|
175
|
+
"reflect": false,
|
|
176
|
+
"defaultValue": "false"
|
|
177
|
+
},
|
|
178
|
+
"fontSize": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"mutable": false,
|
|
181
|
+
"complexType": {
|
|
182
|
+
"original": "'small' | 'medium' | 'large'",
|
|
183
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
184
|
+
"references": {}
|
|
185
|
+
},
|
|
186
|
+
"required": false,
|
|
187
|
+
"optional": false,
|
|
188
|
+
"docs": {
|
|
189
|
+
"tags": [],
|
|
190
|
+
"text": "Font Size"
|
|
191
|
+
},
|
|
192
|
+
"attribute": "font-size",
|
|
193
|
+
"reflect": false,
|
|
194
|
+
"defaultValue": "'medium'"
|
|
195
|
+
}
|
|
196
|
+
}; }
|
|
197
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
ptc-list .link-primary li {
|
|
2
|
+
font-size: var(--ptc-font-size-medium);
|
|
3
|
+
line-height: var(--ptc-line-height-normal);
|
|
4
|
+
letter-spacing: var(--ptc-letter-spacing-normal);
|
|
5
|
+
list-style: none;
|
|
6
|
+
}
|
|
7
|
+
ptc-list .link-primary li:not(:last-child) {
|
|
8
|
+
margin-bottom: 0.625rem;
|
|
9
|
+
}
|
|
10
|
+
ptc-list .link-primary li a {
|
|
11
|
+
color: var(--color-white);
|
|
12
|
+
outline: none;
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
font-family: Rajdhani;
|
|
15
|
+
font-size: var(--ptc-font-size-medium);
|
|
16
|
+
font-weight: var(--ptc-font-weight-bold);
|
|
17
|
+
line-height: var(--ptc-line-height-normal);
|
|
18
|
+
text-transform: uppercase;
|
|
19
|
+
letter-spacing: var(--ptc-letter-spacing-normal);
|
|
20
|
+
}
|
|
21
|
+
ptc-list .link-primary li a:hover {
|
|
22
|
+
color: var(--color-white);
|
|
23
|
+
border-bottom: 1.5px solid var(--color-primary-green);
|
|
24
|
+
}
|