@ptcwebops/ptcw-design 3.2.6 → 3.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,7 +96,7 @@
96
96
  :host .vl-layout-wrap .vl-list-wrap {
97
97
  width: 100%;
98
98
  padding: 8px 0;
99
- max-height: calc(100vh - 200px);
99
+ max-height: calc(100vh - 64px);
100
100
  background-color: #fff;
101
101
  border-radius: var(--ptc-border-radius-standard);
102
102
  }
@@ -190,9 +190,6 @@
190
190
  }
191
191
  }
192
192
  :host .vl-layout-wrap .vl-content-wrap .mobile-select {
193
- font-size: 18px;
194
- font-weight: 700;
195
- line-height: 1.5;
196
193
  position: sticky;
197
194
  top: -1px;
198
195
  z-index: 1056;
@@ -202,15 +199,8 @@
202
199
  /* Safari and Chrome */
203
200
  appearance: none;
204
201
  background: var(--color-white);
205
- background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="10" viewBox="0 0 14 10" fill="none"><path d="M2 2.30469L6.94975 7.60799L11.8995 2.30469" stroke="%2300890B" stroke-width="3" stroke-linecap="round"/></svg>');
206
- background-repeat: no-repeat;
207
- border-radius: 4px 4px 0px 0px;
208
- box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.24);
209
- padding: 24px 48px 24px 24px;
210
- border: none;
211
202
  width: calc(100% + 40px);
212
203
  margin-left: -20px;
213
- background-position: calc(100% - 24px) 50%;
214
204
  }
215
205
  @media only screen and (min-width: 480px) {
216
206
  :host .vl-layout-wrap .vl-content-wrap .mobile-select {
@@ -218,6 +208,126 @@
218
208
  margin-left: -32px;
219
209
  }
220
210
  }
211
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select {
212
+ display: block;
213
+ }
214
+ @media only screen and (min-width: 992px) {
215
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select {
216
+ display: none;
217
+ }
218
+ }
219
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-button {
220
+ width: 100%;
221
+ background-color: transparent;
222
+ border-radius: 0.25rem;
223
+ cursor: pointer;
224
+ font-weight: 700;
225
+ line-height: 1.5;
226
+ font-size: 18px;
227
+ display: flex;
228
+ justify-content: space-between;
229
+ align-items: center;
230
+ border-radius: 4px 4px 0px 0px;
231
+ box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.24);
232
+ padding: 24px;
233
+ border: none;
234
+ }
235
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-button .selected-value {
236
+ text-align: left;
237
+ font-weight: 700;
238
+ line-height: 1.5;
239
+ font-size: 18px;
240
+ display: -webkit-box;
241
+ -webkit-line-clamp: 1;
242
+ -webkit-box-orient: vertical;
243
+ overflow: hidden;
244
+ text-overflow: ellipsis;
245
+ overflow-wrap: break-word;
246
+ }
247
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-button .arrow {
248
+ min-width: 14px;
249
+ width: 14px;
250
+ height: 10px;
251
+ background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="10" viewBox="0 0 14 10" fill="none"><path d="M2 2.30469L6.94975 7.60799L11.8995 2.30469" stroke="%2300890B" stroke-width="3" stroke-linecap="round"/></svg>');
252
+ background-repeat: no-repeat;
253
+ transition: transform ease-in-out 0.3s;
254
+ margin-left: 15px;
255
+ }
256
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown {
257
+ position: absolute;
258
+ list-style: none;
259
+ width: 100%;
260
+ border-radius: 0 0 4px 4px;
261
+ background: var(--color-white);
262
+ margin: 0;
263
+ padding: 0;
264
+ /* Drop Shadow (X-Large) */
265
+ box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.24);
266
+ max-height: 70vh;
267
+ overflow-y: auto;
268
+ transition: 0.5s ease;
269
+ z-index: 30000;
270
+ opacity: 0;
271
+ visibility: hidden;
272
+ }
273
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown:focus-within {
274
+ box-shadow: 0 10px 25px rgba(94, 108, 233, 0.6);
275
+ }
276
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown li {
277
+ position: relative;
278
+ cursor: pointer;
279
+ }
280
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown li label {
281
+ display: block;
282
+ width: 100%;
283
+ box-sizing: border-box;
284
+ padding: 16px 32px;
285
+ cursor: pointer;
286
+ font-size: 18px;
287
+ line-height: 1.25;
288
+ font-weight: 400;
289
+ }
290
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown li label::before {
291
+ content: "";
292
+ display: block;
293
+ width: 2px;
294
+ height: calc(100% - 32px);
295
+ background-color: transparent;
296
+ position: absolute;
297
+ left: 16px;
298
+ }
299
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown li.active label {
300
+ font-weight: 700;
301
+ }
302
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown li.active label::before {
303
+ background-color: var(--color-green-07);
304
+ }
305
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown input[type=radio] {
306
+ position: absolute;
307
+ left: 0;
308
+ opacity: 0;
309
+ }
310
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown input[type=radio]:checked ~ label {
311
+ font-weight: 700;
312
+ }
313
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown::-webkit-scrollbar {
314
+ width: 7px;
315
+ }
316
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown::-webkit-scrollbar-track {
317
+ background: #f1f1f1;
318
+ border-radius: 25px;
319
+ }
320
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown::-webkit-scrollbar-thumb {
321
+ background: #ccc;
322
+ border-radius: 25px;
323
+ }
324
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select.active .arrow {
325
+ transform: rotate(180deg);
326
+ }
327
+ :host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select.active .select-dropdown {
328
+ opacity: 1;
329
+ visibility: visible;
330
+ }
221
331
  :host .vl-layout-wrap .vl-content-wrap .mobile-select:focus-visible {
222
332
  outline: none;
223
333
  }
@@ -233,4 +343,7 @@
233
343
  :host .vl-layout-wrap .vl-content-wrap .vl-content-slot-wrap {
234
344
  padding: 0;
235
345
  }
346
+ }
347
+ :host .select-dropdown input:focus ~ label {
348
+ background-color: #dfdfdf;
236
349
  }
@@ -5,6 +5,7 @@ export class PtcValueLedLayout {
5
5
  this.dropFlag = false;
6
6
  this.topBackgroundImage = undefined;
7
7
  this.isMobile = undefined;
8
+ this.selectedValue = undefined;
8
9
  }
9
10
  // @Watch('isMobile')
10
11
  // handleMobileChange() {
@@ -24,23 +25,31 @@ export class PtcValueLedLayout {
24
25
  // }
25
26
  // }
26
27
  // }
27
- handleResize() {
28
+ componentWillLoad() {
29
+ this.getSidebarList();
28
30
  this.isMobile = window.innerWidth < 992;
29
- if (!this.isMobile) {
30
- this.setActiveItem();
31
- }
31
+ }
32
+ componentDidLoad() {
33
+ //if (!this.isMobile) {
34
+ this.setActiveItem();
35
+ //}
36
+ this.selectBtn = this.hostElement.shadowRoot.querySelector('.select-button');
37
+ this.customSelect = this.hostElement.shadowRoot.querySelector(".custom-select");
38
+ this.optionsList = this.hostElement.shadowRoot.querySelectorAll(".select-dropdown li");
39
+ this.selectBtn.addEventListener('click', this.handleSelectButtonClick.bind(this));
40
+ this.customSelectDropdown();
32
41
  }
33
42
  handleScroll() {
34
43
  this.setActiveItem();
35
44
  }
36
- componentWillLoad() {
37
- this.getSidebarList();
45
+ handleResize() {
38
46
  this.isMobile = window.innerWidth < 992;
47
+ this.setActiveItem();
48
+ this.customSelectDropdown();
39
49
  }
40
- componentDidLoad() {
41
- if (!this.isMobile) {
42
- this.setActiveItem();
43
- }
50
+ handleSelectButtonClick() {
51
+ this.customSelect.classList.toggle("active");
52
+ this.selectBtn.setAttribute("aria-expanded", this.selectBtn.getAttribute("aria-expanded") === "true" ? "false" : "true");
44
53
  }
45
54
  getSidebarList() {
46
55
  const sidebarList = document.querySelectorAll('.vl-content-item');
@@ -57,9 +66,6 @@ export class PtcValueLedLayout {
57
66
  if (windowScroll >= 149) {
58
67
  this.sidebarData.forEach((item, i) => {
59
68
  const section = document.getElementById(item.ref);
60
- // console.log(section);
61
- // console.log(section.offsetTop);
62
- // console.log(windowScroll);
63
69
  if (section && section.offsetTop <= windowScroll + scrollAdd) {
64
70
  this.updateActiveItem(i);
65
71
  }
@@ -67,11 +73,12 @@ export class PtcValueLedLayout {
67
73
  }
68
74
  else {
69
75
  this.updateActiveItem(0);
76
+ if (this.isMobile) {
77
+ this.selectedValue = this.optionsList[0].textContent;
78
+ }
70
79
  }
71
80
  }
72
81
  updateActiveItem(index) {
73
- // console.log(index);
74
- // debugger
75
82
  const listItem = this.hostElement.shadowRoot.querySelector(`.vl-list-wrap ul li:nth-child(${index + 1})`);
76
83
  const activeListItem = this.hostElement.shadowRoot.querySelector('.vl-list-wrap ul li.active');
77
84
  if (activeListItem) {
@@ -81,13 +88,27 @@ export class PtcValueLedLayout {
81
88
  listItem.classList.add('active');
82
89
  }
83
90
  // Update the selected option in the mobile select
84
- const mobileSelect = this.hostElement.shadowRoot.querySelector('.mobile-select');
85
- if (mobileSelect) {
86
- mobileSelect.selectedIndex = index;
91
+ this.mobileSelect = this.hostElement.shadowRoot.querySelector('.mobile-select');
92
+ if (this.mobileSelect) {
93
+ // this.mobileSelect.selectedIndex = index;
94
+ this.selectedValue = this.hostElement.shadowRoot.querySelector(".selected-value");
95
+ this.optionsList = this.hostElement.shadowRoot.querySelectorAll(".select-dropdown li");
96
+ this.optionsList.forEach((option) => {
97
+ if (parseInt(option.id) === index) {
98
+ this.selectedValue.textContent = option.children[1].textContent;
99
+ }
100
+ });
101
+ const listItemDrop = this.hostElement.shadowRoot.querySelector(`.select-dropdown li:nth-child(${index + 1})`);
102
+ const activeListItemDrop = this.hostElement.shadowRoot.querySelector('.select-dropdown li.active');
103
+ if (activeListItemDrop) {
104
+ activeListItemDrop.classList.remove('active');
105
+ }
106
+ if (listItemDrop) {
107
+ listItemDrop.classList.add('active');
108
+ }
87
109
  }
88
110
  }
89
- handleSelectChange(event) {
90
- const selectedIndex = event.target.selectedIndex;
111
+ handleSelectChange(selectedIndex) {
91
112
  const section = document.getElementById(this.sidebarData[selectedIndex].ref);
92
113
  if (section) {
93
114
  section.scrollIntoView({ behavior: 'smooth' });
@@ -95,9 +116,35 @@ export class PtcValueLedLayout {
95
116
  window.scrollTo(0, sectionTop - 75);
96
117
  }
97
118
  }
119
+ customSelectDropdown() {
120
+ this.selectedValue = this.hostElement.shadowRoot.querySelector(".selected-value");
121
+ if (this.customSelect && this.isMobile) {
122
+ // add click event to select button
123
+ this.optionsList.forEach((option, index) => {
124
+ // Use arrow function to preserve the 'this' context
125
+ const handler = (e) => {
126
+ // Click Events
127
+ if (e.type === "click" && e.clientX !== 0 && e.clientY !== 0) {
128
+ this.selectedValue.textContent = option.children[1].textContent;
129
+ this.customSelect.classList.remove("active");
130
+ // Call handleSelectChange with the selected index
131
+ this.handleSelectChange(index);
132
+ }
133
+ // Key Events
134
+ if (e.key === "Enter") {
135
+ this.selectedValue.textContent = option.textContent;
136
+ this.customSelect.classList.remove("active");
137
+ // Call handleSelectChange with the selected index
138
+ this.handleSelectChange(index);
139
+ }
140
+ };
141
+ option.addEventListener("keyup", handler);
142
+ option.addEventListener("click", handler);
143
+ });
144
+ }
145
+ }
98
146
  render() {
99
- return (h(Host, null, h("div", { class: 'top-image', style: { backgroundImage: `url(${this.topBackgroundImage})` } }), h("div", { class: 'ptc-container' }, h("div", { class: "pdf-slot-wrapper" }, h("slot", { name: 'pdf-slot' })), h("div", { class: "vl-layout-wrap" }, (this.sidebarData.length > 0 && !this.isMobile) && (h("div", { class: 'vl-sidebar' }, h("div", { class: 'vl-list-wrap' }, h("ul", null, this.sidebarData.map((item) => (h("li", null, h("a", { href: "#" + item.ref }, h("ptc-tooltip", { "max-length": "70", description: item.title, "no-overflow": "true" }))))))))), h("div", { class: 'vl-content-wrap' }, this.isMobile &&
100
- h("select", { class: 'mobile-select', onChange: (event) => this.handleSelectChange(event) }, this.sidebarData.map((item) => (h("option", { value: item.title }, " ", item.title)))), h("div", { class: 'vl-content-slot-wrap' }, h("slot", null)))))));
147
+ return (h(Host, null, h("div", { class: 'top-image', style: { backgroundImage: `url(${this.topBackgroundImage})` } }), h("div", { class: 'ptc-container' }, h("div", { class: "pdf-slot-wrapper" }, h("slot", { name: 'pdf-slot' })), h("div", { class: "vl-layout-wrap" }, (this.sidebarData.length > 0 && !this.isMobile) && (h("div", { class: 'vl-sidebar' }, h("div", { class: 'vl-list-wrap' }, h("ul", null, this.sidebarData.map((item) => (h("li", null, h("a", { href: "#" + item.ref }, h("ptc-tooltip", { "max-length": "70", description: item.title, "no-overflow": "true" }))))))))), h("span", { style: { display: 'none !important' } }), h("div", { class: 'vl-content-wrap' }, h("div", { class: "custom-select mobile-select" }, h("button", { class: "select-button", role: "combobox", "aria-labelledby": "select button", "aria-haspopup": "listbox", "aria-expanded": "false", "aria-controls": "select-dropdown" }, h("span", { class: "selected-value" }, "Select option"), h("span", { class: "arrow" })), h("ul", { class: "select-dropdown", role: "listbox", id: "select-dropdown" }, this.sidebarData.map((item, index) => (h("li", { role: "option", id: index }, h("input", { type: "radio", id: item.title, name: "vl-drop-list" }), h("label", { htmlFor: item.title }, h("i", { class: "bx bxl-github" }), item.title)))))), h("div", { class: 'vl-content-slot-wrap' }, h("slot", null)))))));
101
148
  }
102
149
  static get is() { return "ptc-value-led-layout"; }
103
150
  static get encapsulation() { return "shadow"; }
@@ -129,6 +176,23 @@ export class PtcValueLedLayout {
129
176
  },
130
177
  "attribute": "top-background-image",
131
178
  "reflect": false
179
+ },
180
+ "selectedValue": {
181
+ "type": "any",
182
+ "mutable": true,
183
+ "complexType": {
184
+ "original": "any",
185
+ "resolved": "any",
186
+ "references": {}
187
+ },
188
+ "required": false,
189
+ "optional": false,
190
+ "docs": {
191
+ "tags": [],
192
+ "text": ""
193
+ },
194
+ "attribute": "selected-value",
195
+ "reflect": false
132
196
  }
133
197
  };
134
198
  }
@@ -140,14 +204,14 @@ export class PtcValueLedLayout {
140
204
  static get elementRef() { return "hostElement"; }
141
205
  static get listeners() {
142
206
  return [{
143
- "name": "resize",
144
- "method": "handleResize",
207
+ "name": "scroll",
208
+ "method": "handleScroll",
145
209
  "target": "window",
146
210
  "capture": false,
147
211
  "passive": true
148
212
  }, {
149
- "name": "scroll",
150
- "method": "handleScroll",
213
+ "name": "resize",
214
+ "method": "handleResize",
151
215
  "target": "window",
152
216
  "capture": false,
153
217
  "passive": true
@@ -68,7 +68,7 @@ export class PtcValueLedSpeedBump {
68
68
  },
69
69
  "isMobile": {
70
70
  "type": "boolean",
71
- "mutable": false,
71
+ "mutable": true,
72
72
  "complexType": {
73
73
  "original": "boolean",
74
74
  "resolved": "boolean",
@@ -25564,7 +25564,7 @@ const PtcValueLedIntro$1 = class extends HTMLElement$1 {
25564
25564
  static get style() { return ptcValueLedIntroCss; }
25565
25565
  };
25566
25566
 
25567
- const ptcValueLedLayoutCss = ".ptc-container{padding-right:24px;padding-left:24px;margin-right:auto;margin-left:auto}@media only screen and (min-width: 1200px){.ptc-container{padding-left:0;padding-right:0;max-width:1136px}}@media only screen and (min-width: 1440px){.ptc-container{padding-left:0;padding-right:0;max-width:1200px}}.ptc-container-lg{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media only screen and (min-width: 480px){.ptc-container-lg{padding-left:var(--ptc-layout-spacing-03);padding-right:var(--ptc-layout-spacing-03)}}@media only screen and (min-width: 768px){.ptc-container-lg{padding-left:var(--ptc-layout-spacing-04);padding-right:var(--ptc-layout-spacing-04)}}@media only screen and (min-width: 992px){.ptc-container-lg{padding-left:var(--ptc-element-spacing-08);padding-right:var(--ptc-element-spacing-08)}}@media only screen and (min-width: 1980px){.ptc-container-lg{padding-left:0;padding-right:0;max-width:1900px}}.ptc-container-fluid{width:100%}:host{display:block;position:relative}:host *{box-sizing:border-box}:host .top-image{background-color:rgba(0, 0, 0, 0.8);background-blend-mode:multiply;position:absolute;z-index:-1;width:100%;height:500px;background-size:cover;background-position:center}:host .pdf-slot-wrapper{padding:1rem 0;width:100%;text-align:right}:host .vl-layout-wrap{margin-top:64px;width:100%;position:relative}@media only screen and (min-width: 992px){:host .vl-layout-wrap{display:flex}}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-sidebar{width:22%;margin-right:var(--ptc-layout-spacing-04)}}:host .vl-layout-wrap .vl-list-wrap{width:100%;padding:8px 0;max-height:calc(100vh - 200px);background-color:#fff;border-radius:var(--ptc-border-radius-standard)}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-list-wrap{z-index:105;margin:auto;position:sticky;top:32px;right:0;float:right;overflow-y:auto;overflow-x:hidden}}:host .vl-layout-wrap .vl-list-wrap ul{margin:0;padding:0;list-style:none}:host .vl-layout-wrap .vl-list-wrap ul li{display:none}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-list-wrap ul li{display:block;margin:0 16px 8px 16px}}:host .vl-layout-wrap .vl-list-wrap ul li a{display:block;padding:8px 16px;font-size:var(--ptc-font-size-small);line-height:var(--ptc-line-height-densest);text-decoration:none;color:var(--color-gray-10);position:relative;background-color:transparent;border-radius:var(--ptc-border-radius-standard)}:host .vl-layout-wrap .vl-list-wrap ul li a::before{content:\"\";display:block;width:2px;height:calc(100% - 16px);background-color:transparent;position:absolute;left:8px}:host .vl-layout-wrap .vl-list-wrap ul li a:hover{background-color:var(--color-gray-02)}:host .vl-layout-wrap .vl-list-wrap ul li.active{display:block}:host .vl-layout-wrap .vl-list-wrap ul li.active a{font-weight:700}:host .vl-layout-wrap .vl-list-wrap ul li.active a::before{background-color:var(--color-green-07)}:host .vl-layout-wrap .vl-list-wrap::-webkit-scrollbar{width:8px}:host .vl-layout-wrap .vl-list-wrap::-webkit-scrollbar-track{background:transparent}:host .vl-layout-wrap .vl-list-wrap::-webkit-scrollbar-thumb{background:var(--color-gray-02);border-radius:var(--ptc-border-radius-pill)}:host .vl-layout-wrap .vl-list-wrap select{z-index:105;background-color:#fff}:host .vl-layout-wrap .vl-content-wrap{width:100%;padding:0 20px 20px 20px;background-color:#fff;border-radius:var(--ptc-border-radius-standard)}@media only screen and (min-width: 480px){:host .vl-layout-wrap .vl-content-wrap{padding:0 32px 32px 32px}}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-content-wrap{width:78%;padding:48px}}:host .vl-layout-wrap .vl-content-wrap .mobile-select{font-size:18px;font-weight:700;line-height:1.5;position:sticky;top:-1px;z-index:1056;-moz-appearance:none;-webkit-appearance:none;appearance:none;background:var(--color-white);background-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"10\" viewBox=\"0 0 14 10\" fill=\"none\"><path d=\"M2 2.30469L6.94975 7.60799L11.8995 2.30469\" stroke=\"%2300890B\" stroke-width=\"3\" stroke-linecap=\"round\"/></svg>');background-repeat:no-repeat;border-radius:4px 4px 0px 0px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.24);padding:24px 48px 24px 24px;border:none;width:calc(100% + 40px);margin-left:-20px;background-position:calc(100% - 24px) 50%}@media only screen and (min-width: 480px){:host .vl-layout-wrap .vl-content-wrap .mobile-select{width:calc(100% + 64px);margin-left:-32px}}:host .vl-layout-wrap .vl-content-wrap .mobile-select:focus-visible{outline:none}:host .vl-layout-wrap .vl-content-wrap .vl-content-slot-wrap{padding:0}@media only screen and (min-width: 768px){:host .vl-layout-wrap .vl-content-wrap .vl-content-slot-wrap{padding-top:32px}}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-content-wrap .vl-content-slot-wrap{padding:0}}";
25567
+ const ptcValueLedLayoutCss = ".ptc-container{padding-right:24px;padding-left:24px;margin-right:auto;margin-left:auto}@media only screen and (min-width: 1200px){.ptc-container{padding-left:0;padding-right:0;max-width:1136px}}@media only screen and (min-width: 1440px){.ptc-container{padding-left:0;padding-right:0;max-width:1200px}}.ptc-container-lg{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media only screen and (min-width: 480px){.ptc-container-lg{padding-left:var(--ptc-layout-spacing-03);padding-right:var(--ptc-layout-spacing-03)}}@media only screen and (min-width: 768px){.ptc-container-lg{padding-left:var(--ptc-layout-spacing-04);padding-right:var(--ptc-layout-spacing-04)}}@media only screen and (min-width: 992px){.ptc-container-lg{padding-left:var(--ptc-element-spacing-08);padding-right:var(--ptc-element-spacing-08)}}@media only screen and (min-width: 1980px){.ptc-container-lg{padding-left:0;padding-right:0;max-width:1900px}}.ptc-container-fluid{width:100%}:host{display:block;position:relative}:host *{box-sizing:border-box}:host .top-image{background-color:rgba(0, 0, 0, 0.8);background-blend-mode:multiply;position:absolute;z-index:-1;width:100%;height:500px;background-size:cover;background-position:center}:host .pdf-slot-wrapper{padding:1rem 0;width:100%;text-align:right}:host .vl-layout-wrap{margin-top:64px;width:100%;position:relative}@media only screen and (min-width: 992px){:host .vl-layout-wrap{display:flex}}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-sidebar{width:22%;margin-right:var(--ptc-layout-spacing-04)}}:host .vl-layout-wrap .vl-list-wrap{width:100%;padding:8px 0;max-height:calc(100vh - 64px);background-color:#fff;border-radius:var(--ptc-border-radius-standard)}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-list-wrap{z-index:105;margin:auto;position:sticky;top:32px;right:0;float:right;overflow-y:auto;overflow-x:hidden}}:host .vl-layout-wrap .vl-list-wrap ul{margin:0;padding:0;list-style:none}:host .vl-layout-wrap .vl-list-wrap ul li{display:none}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-list-wrap ul li{display:block;margin:0 16px 8px 16px}}:host .vl-layout-wrap .vl-list-wrap ul li a{display:block;padding:8px 16px;font-size:var(--ptc-font-size-small);line-height:var(--ptc-line-height-densest);text-decoration:none;color:var(--color-gray-10);position:relative;background-color:transparent;border-radius:var(--ptc-border-radius-standard)}:host .vl-layout-wrap .vl-list-wrap ul li a::before{content:\"\";display:block;width:2px;height:calc(100% - 16px);background-color:transparent;position:absolute;left:8px}:host .vl-layout-wrap .vl-list-wrap ul li a:hover{background-color:var(--color-gray-02)}:host .vl-layout-wrap .vl-list-wrap ul li.active{display:block}:host .vl-layout-wrap .vl-list-wrap ul li.active a{font-weight:700}:host .vl-layout-wrap .vl-list-wrap ul li.active a::before{background-color:var(--color-green-07)}:host .vl-layout-wrap .vl-list-wrap::-webkit-scrollbar{width:8px}:host .vl-layout-wrap .vl-list-wrap::-webkit-scrollbar-track{background:transparent}:host .vl-layout-wrap .vl-list-wrap::-webkit-scrollbar-thumb{background:var(--color-gray-02);border-radius:var(--ptc-border-radius-pill)}:host .vl-layout-wrap .vl-list-wrap select{z-index:105;background-color:#fff}:host .vl-layout-wrap .vl-content-wrap{width:100%;padding:0 20px 20px 20px;background-color:#fff;border-radius:var(--ptc-border-radius-standard)}@media only screen and (min-width: 480px){:host .vl-layout-wrap .vl-content-wrap{padding:0 32px 32px 32px}}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-content-wrap{width:78%;padding:48px}}:host .vl-layout-wrap .vl-content-wrap .mobile-select{position:sticky;top:-1px;z-index:1056;-moz-appearance:none;-webkit-appearance:none;appearance:none;background:var(--color-white);width:calc(100% + 40px);margin-left:-20px}@media only screen and (min-width: 480px){:host .vl-layout-wrap .vl-content-wrap .mobile-select{width:calc(100% + 64px);margin-left:-32px}}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select{display:block}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select{display:none}}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-button{width:100%;background-color:transparent;border-radius:0.25rem;cursor:pointer;font-weight:700;line-height:1.5;font-size:18px;display:flex;justify-content:space-between;align-items:center;border-radius:4px 4px 0px 0px;box-shadow:0px 4px 8px 0px rgba(0, 0, 0, 0.24);padding:24px;border:none}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-button .selected-value{text-align:left;font-weight:700;line-height:1.5;font-size:18px;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;overflow-wrap:break-word}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-button .arrow{min-width:14px;width:14px;height:10px;background-image:url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14\" height=\"10\" viewBox=\"0 0 14 10\" fill=\"none\"><path d=\"M2 2.30469L6.94975 7.60799L11.8995 2.30469\" stroke=\"%2300890B\" stroke-width=\"3\" stroke-linecap=\"round\"/></svg>');background-repeat:no-repeat;transition:transform ease-in-out 0.3s;margin-left:15px}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown{position:absolute;list-style:none;width:100%;border-radius:0 0 4px 4px;background:var(--color-white);margin:0;padding:0;box-shadow:0px 8px 24px 0px rgba(0, 0, 0, 0.24);max-height:70vh;overflow-y:auto;transition:0.5s ease;z-index:30000;opacity:0;visibility:hidden}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown:focus-within{box-shadow:0 10px 25px rgba(94, 108, 233, 0.6)}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown li{position:relative;cursor:pointer}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown li label{display:block;width:100%;box-sizing:border-box;padding:16px 32px;cursor:pointer;font-size:18px;line-height:1.25;font-weight:400}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown li label::before{content:\"\";display:block;width:2px;height:calc(100% - 32px);background-color:transparent;position:absolute;left:16px}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown li.active label{font-weight:700}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown li.active label::before{background-color:var(--color-green-07)}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown input[type=radio]{position:absolute;left:0;opacity:0}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown input[type=radio]:checked~label{font-weight:700}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown::-webkit-scrollbar{width:7px}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown::-webkit-scrollbar-track{background:#f1f1f1;border-radius:25px}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select .select-dropdown::-webkit-scrollbar-thumb{background:#ccc;border-radius:25px}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select.active .arrow{transform:rotate(180deg)}:host .vl-layout-wrap .vl-content-wrap .mobile-select.custom-select.active .select-dropdown{opacity:1;visibility:visible}:host .vl-layout-wrap .vl-content-wrap .mobile-select:focus-visible{outline:none}:host .vl-layout-wrap .vl-content-wrap .vl-content-slot-wrap{padding:0}@media only screen and (min-width: 768px){:host .vl-layout-wrap .vl-content-wrap .vl-content-slot-wrap{padding-top:32px}}@media only screen and (min-width: 992px){:host .vl-layout-wrap .vl-content-wrap .vl-content-slot-wrap{padding:0}}:host .select-dropdown input:focus~label{background-color:#dfdfdf}";
25568
25568
 
25569
25569
  const PtcValueLedLayout$1 = class extends HTMLElement$1 {
25570
25570
  constructor() {
@@ -25575,6 +25575,7 @@ const PtcValueLedLayout$1 = class extends HTMLElement$1 {
25575
25575
  this.dropFlag = false;
25576
25576
  this.topBackgroundImage = undefined;
25577
25577
  this.isMobile = undefined;
25578
+ this.selectedValue = undefined;
25578
25579
  }
25579
25580
  // @Watch('isMobile')
25580
25581
  // handleMobileChange() {
@@ -25594,23 +25595,31 @@ const PtcValueLedLayout$1 = class extends HTMLElement$1 {
25594
25595
  // }
25595
25596
  // }
25596
25597
  // }
25597
- handleResize() {
25598
+ componentWillLoad() {
25599
+ this.getSidebarList();
25598
25600
  this.isMobile = window.innerWidth < 992;
25599
- if (!this.isMobile) {
25600
- this.setActiveItem();
25601
- }
25601
+ }
25602
+ componentDidLoad() {
25603
+ //if (!this.isMobile) {
25604
+ this.setActiveItem();
25605
+ //}
25606
+ this.selectBtn = this.hostElement.shadowRoot.querySelector('.select-button');
25607
+ this.customSelect = this.hostElement.shadowRoot.querySelector(".custom-select");
25608
+ this.optionsList = this.hostElement.shadowRoot.querySelectorAll(".select-dropdown li");
25609
+ this.selectBtn.addEventListener('click', this.handleSelectButtonClick.bind(this));
25610
+ this.customSelectDropdown();
25602
25611
  }
25603
25612
  handleScroll() {
25604
25613
  this.setActiveItem();
25605
25614
  }
25606
- componentWillLoad() {
25607
- this.getSidebarList();
25615
+ handleResize() {
25608
25616
  this.isMobile = window.innerWidth < 992;
25617
+ this.setActiveItem();
25618
+ this.customSelectDropdown();
25609
25619
  }
25610
- componentDidLoad() {
25611
- if (!this.isMobile) {
25612
- this.setActiveItem();
25613
- }
25620
+ handleSelectButtonClick() {
25621
+ this.customSelect.classList.toggle("active");
25622
+ this.selectBtn.setAttribute("aria-expanded", this.selectBtn.getAttribute("aria-expanded") === "true" ? "false" : "true");
25614
25623
  }
25615
25624
  getSidebarList() {
25616
25625
  const sidebarList = document.querySelectorAll('.vl-content-item');
@@ -25627,9 +25636,6 @@ const PtcValueLedLayout$1 = class extends HTMLElement$1 {
25627
25636
  if (windowScroll >= 149) {
25628
25637
  this.sidebarData.forEach((item, i) => {
25629
25638
  const section = document.getElementById(item.ref);
25630
- // console.log(section);
25631
- // console.log(section.offsetTop);
25632
- // console.log(windowScroll);
25633
25639
  if (section && section.offsetTop <= windowScroll + scrollAdd) {
25634
25640
  this.updateActiveItem(i);
25635
25641
  }
@@ -25637,11 +25643,12 @@ const PtcValueLedLayout$1 = class extends HTMLElement$1 {
25637
25643
  }
25638
25644
  else {
25639
25645
  this.updateActiveItem(0);
25646
+ if (this.isMobile) {
25647
+ this.selectedValue = this.optionsList[0].textContent;
25648
+ }
25640
25649
  }
25641
25650
  }
25642
25651
  updateActiveItem(index) {
25643
- // console.log(index);
25644
- // debugger
25645
25652
  const listItem = this.hostElement.shadowRoot.querySelector(`.vl-list-wrap ul li:nth-child(${index + 1})`);
25646
25653
  const activeListItem = this.hostElement.shadowRoot.querySelector('.vl-list-wrap ul li.active');
25647
25654
  if (activeListItem) {
@@ -25651,13 +25658,27 @@ const PtcValueLedLayout$1 = class extends HTMLElement$1 {
25651
25658
  listItem.classList.add('active');
25652
25659
  }
25653
25660
  // Update the selected option in the mobile select
25654
- const mobileSelect = this.hostElement.shadowRoot.querySelector('.mobile-select');
25655
- if (mobileSelect) {
25656
- mobileSelect.selectedIndex = index;
25661
+ this.mobileSelect = this.hostElement.shadowRoot.querySelector('.mobile-select');
25662
+ if (this.mobileSelect) {
25663
+ // this.mobileSelect.selectedIndex = index;
25664
+ this.selectedValue = this.hostElement.shadowRoot.querySelector(".selected-value");
25665
+ this.optionsList = this.hostElement.shadowRoot.querySelectorAll(".select-dropdown li");
25666
+ this.optionsList.forEach((option) => {
25667
+ if (parseInt(option.id) === index) {
25668
+ this.selectedValue.textContent = option.children[1].textContent;
25669
+ }
25670
+ });
25671
+ const listItemDrop = this.hostElement.shadowRoot.querySelector(`.select-dropdown li:nth-child(${index + 1})`);
25672
+ const activeListItemDrop = this.hostElement.shadowRoot.querySelector('.select-dropdown li.active');
25673
+ if (activeListItemDrop) {
25674
+ activeListItemDrop.classList.remove('active');
25675
+ }
25676
+ if (listItemDrop) {
25677
+ listItemDrop.classList.add('active');
25678
+ }
25657
25679
  }
25658
25680
  }
25659
- handleSelectChange(event) {
25660
- const selectedIndex = event.target.selectedIndex;
25681
+ handleSelectChange(selectedIndex) {
25661
25682
  const section = document.getElementById(this.sidebarData[selectedIndex].ref);
25662
25683
  if (section) {
25663
25684
  section.scrollIntoView({ behavior: 'smooth' });
@@ -25665,9 +25686,35 @@ const PtcValueLedLayout$1 = class extends HTMLElement$1 {
25665
25686
  window.scrollTo(0, sectionTop - 75);
25666
25687
  }
25667
25688
  }
25689
+ customSelectDropdown() {
25690
+ this.selectedValue = this.hostElement.shadowRoot.querySelector(".selected-value");
25691
+ if (this.customSelect && this.isMobile) {
25692
+ // add click event to select button
25693
+ this.optionsList.forEach((option, index) => {
25694
+ // Use arrow function to preserve the 'this' context
25695
+ const handler = (e) => {
25696
+ // Click Events
25697
+ if (e.type === "click" && e.clientX !== 0 && e.clientY !== 0) {
25698
+ this.selectedValue.textContent = option.children[1].textContent;
25699
+ this.customSelect.classList.remove("active");
25700
+ // Call handleSelectChange with the selected index
25701
+ this.handleSelectChange(index);
25702
+ }
25703
+ // Key Events
25704
+ if (e.key === "Enter") {
25705
+ this.selectedValue.textContent = option.textContent;
25706
+ this.customSelect.classList.remove("active");
25707
+ // Call handleSelectChange with the selected index
25708
+ this.handleSelectChange(index);
25709
+ }
25710
+ };
25711
+ option.addEventListener("keyup", handler);
25712
+ option.addEventListener("click", handler);
25713
+ });
25714
+ }
25715
+ }
25668
25716
  render() {
25669
- return (h$1(Host, null, h$1("div", { class: 'top-image', style: { backgroundImage: `url(${this.topBackgroundImage})` } }), h$1("div", { class: 'ptc-container' }, h$1("div", { class: "pdf-slot-wrapper" }, h$1("slot", { name: 'pdf-slot' })), h$1("div", { class: "vl-layout-wrap" }, (this.sidebarData.length > 0 && !this.isMobile) && (h$1("div", { class: 'vl-sidebar' }, h$1("div", { class: 'vl-list-wrap' }, h$1("ul", null, this.sidebarData.map((item) => (h$1("li", null, h$1("a", { href: "#" + item.ref }, h$1("ptc-tooltip", { "max-length": "70", description: item.title, "no-overflow": "true" }))))))))), h$1("div", { class: 'vl-content-wrap' }, this.isMobile &&
25670
- h$1("select", { class: 'mobile-select', onChange: (event) => this.handleSelectChange(event) }, this.sidebarData.map((item) => (h$1("option", { value: item.title }, " ", item.title)))), h$1("div", { class: 'vl-content-slot-wrap' }, h$1("slot", null)))))));
25717
+ return (h$1(Host, null, h$1("div", { class: 'top-image', style: { backgroundImage: `url(${this.topBackgroundImage})` } }), h$1("div", { class: 'ptc-container' }, h$1("div", { class: "pdf-slot-wrapper" }, h$1("slot", { name: 'pdf-slot' })), h$1("div", { class: "vl-layout-wrap" }, (this.sidebarData.length > 0 && !this.isMobile) && (h$1("div", { class: 'vl-sidebar' }, h$1("div", { class: 'vl-list-wrap' }, h$1("ul", null, this.sidebarData.map((item) => (h$1("li", null, h$1("a", { href: "#" + item.ref }, h$1("ptc-tooltip", { "max-length": "70", description: item.title, "no-overflow": "true" }))))))))), h$1("span", { style: { display: 'none !important' } }), h$1("div", { class: 'vl-content-wrap' }, h$1("div", { class: "custom-select mobile-select" }, h$1("button", { class: "select-button", role: "combobox", "aria-labelledby": "select button", "aria-haspopup": "listbox", "aria-expanded": "false", "aria-controls": "select-dropdown" }, h$1("span", { class: "selected-value" }, "Select option"), h$1("span", { class: "arrow" })), h$1("ul", { class: "select-dropdown", role: "listbox", id: "select-dropdown" }, this.sidebarData.map((item, index) => (h$1("li", { role: "option", id: index }, h$1("input", { type: "radio", id: item.title, name: "vl-drop-list" }), h$1("label", { htmlFor: item.title }, h$1("i", { class: "bx bxl-github" }), item.title)))))), h$1("div", { class: 'vl-content-slot-wrap' }, h$1("slot", null)))))));
25671
25718
  }
25672
25719
  get hostElement() { return this; }
25673
25720
  static get style() { return ptcValueLedLayoutCss; }
@@ -26477,8 +26524,8 @@ const PtcValueLedCard = /*@__PURE__*/proxyCustomElement(PtcValueLedCard$1, [1,"p
26477
26524
  const PtcValueLedContent = /*@__PURE__*/proxyCustomElement(PtcValueLedContent$1, [1,"ptc-value-led-content"]);
26478
26525
  const PtcValueLedContentHighlight = /*@__PURE__*/proxyCustomElement(PtcValueLedContentHighlight$1, [6,"ptc-value-led-content-highlight"]);
26479
26526
  const PtcValueLedIntro = /*@__PURE__*/proxyCustomElement(PtcValueLedIntro$1, [1,"ptc-value-led-intro",{"contentTag":[1,"content-tag"]}]);
26480
- const PtcValueLedLayout = /*@__PURE__*/proxyCustomElement(PtcValueLedLayout$1, [1,"ptc-value-led-layout",{"topBackgroundImage":[1,"top-background-image"],"isMobile":[32]},[[9,"resize","handleResize"],[9,"scroll","handleScroll"]]]);
26481
- const PtcValueLedSpeedBump = /*@__PURE__*/proxyCustomElement(PtcValueLedSpeedBump$1, [1,"ptc-value-led-speed-bump",{"cardTitle":[1,"card-title"],"cardImage":[1,"card-image"],"isMobile":[4,"is-mobile"]},[[9,"resize","handleResize"]]]);
26527
+ const PtcValueLedLayout = /*@__PURE__*/proxyCustomElement(PtcValueLedLayout$1, [1,"ptc-value-led-layout",{"topBackgroundImage":[1,"top-background-image"],"selectedValue":[1032,"selected-value"],"isMobile":[32]},[[9,"scroll","handleScroll"],[9,"resize","handleResize"]]]);
26528
+ const PtcValueLedSpeedBump = /*@__PURE__*/proxyCustomElement(PtcValueLedSpeedBump$1, [1,"ptc-value-led-speed-bump",{"cardTitle":[1,"card-title"],"cardImage":[1,"card-image"],"isMobile":[1028,"is-mobile"]},[[9,"resize","handleResize"]]]);
26482
26529
  const PtcValuePropCard = /*@__PURE__*/proxyCustomElement(PtcValuePropCard$1, [1,"ptc-value-prop-card",{"cardHref":[1,"card-href"],"target":[1],"rel":[1],"cardTitle":[1,"card-title"],"backgroundImage":[1,"background-image"]}]);
26483
26530
  const PtcWhitePaper = /*@__PURE__*/proxyCustomElement(PtcWhitePaper$1, [1,"ptc-white-paper",{"items":[16],"topBackgroundImage":[1,"top-background-image"],"topBackgroundImageAlt":[1,"top-background-image-alt"],"itemsPerPage":[2,"items-per-page"],"currentPage":[32],"totalPages":[32],"isMobile":[32]},[[9,"resize","handleResize"]]]);
26484
26531
  const SequentialBundle = /*@__PURE__*/proxyCustomElement(SequentialBundle$1, [1,"sequential-bundle",{"isMobile":[32]},[[9,"resize","handleResize"]]]);