@ptcwebops/ptcw-design 5.9.0 → 5.9.2

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 (55) hide show
  1. package/dist/cjs/blog-detail-content_21.cjs.entry.js +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/ptc-case-studies-slider.cjs.entry.js +181 -43
  4. package/dist/cjs/ptc-collapse-list.cjs.entry.js +7 -6
  5. package/dist/cjs/ptc-ellipsis-dropdown.cjs.entry.js +128 -3
  6. package/dist/cjs/ptc-tab-list.cjs.entry.js +110 -2
  7. package/dist/cjs/ptcw-design.cjs.js +1 -1
  8. package/dist/cjs/tab-content.cjs.entry.js +12 -2
  9. package/dist/cjs/tab-header.cjs.entry.js +7 -1
  10. package/dist/collection/components/ptc-case-studies-slider/ptc-case-studies-slider.css +9 -2
  11. package/dist/collection/components/ptc-case-studies-slider/ptc-case-studies-slider.js +191 -42
  12. package/dist/collection/components/ptc-collapse-list/ptc-collapse-list.js +7 -6
  13. package/dist/collection/components/ptc-ellipsis-dropdown/ptc-ellipsis-dropdown.css +8 -0
  14. package/dist/collection/components/ptc-ellipsis-dropdown/ptc-ellipsis-dropdown.js +138 -2
  15. package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.css +7 -5
  16. package/dist/collection/components/ptc-tab-list/ptc-tab-list.css +5 -1
  17. package/dist/collection/components/ptc-tab-list/ptc-tab-list.js +148 -2
  18. package/dist/collection/components/tab-content/tab-content.css +0 -7
  19. package/dist/collection/components/tab-content/tab-content.js +11 -1
  20. package/dist/collection/components/tab-header/tab-header.css +12 -0
  21. package/dist/collection/components/tab-header/tab-header.js +6 -0
  22. package/dist/custom-elements/index.js +450 -62
  23. package/dist/esm/blog-detail-content_21.entry.js +1 -1
  24. package/dist/esm/loader.js +1 -1
  25. package/dist/esm/ptc-case-studies-slider.entry.js +181 -43
  26. package/dist/esm/ptc-collapse-list.entry.js +7 -6
  27. package/dist/esm/ptc-ellipsis-dropdown.entry.js +128 -3
  28. package/dist/esm/ptc-tab-list.entry.js +110 -2
  29. package/dist/esm/ptcw-design.js +1 -1
  30. package/dist/esm/tab-content.entry.js +13 -3
  31. package/dist/esm/tab-header.entry.js +8 -2
  32. package/dist/ptcw-design/p-0eb16aec.entry.js +1 -0
  33. package/dist/ptcw-design/p-2c2f895a.entry.js +1 -0
  34. package/dist/ptcw-design/p-38a56ed6.entry.js +1 -0
  35. package/dist/ptcw-design/p-592d99fd.entry.js +1 -0
  36. package/dist/ptcw-design/p-8038bf31.entry.js +1 -0
  37. package/dist/ptcw-design/p-849655f7.entry.js +1 -0
  38. package/dist/ptcw-design/p-f618e1d4.entry.js +1 -0
  39. package/dist/ptcw-design/ptcw-design.esm.js +1 -1
  40. package/dist/types/components/ptc-case-studies-slider/ptc-case-studies-slider.d.ts +12 -0
  41. package/dist/types/components/ptc-ellipsis-dropdown/ptc-ellipsis-dropdown.d.ts +12 -0
  42. package/dist/types/components/ptc-tab-list/ptc-tab-list.d.ts +12 -0
  43. package/dist/types/components/tab-content/tab-content.d.ts +4 -0
  44. package/dist/types/components/tab-header/tab-header.d.ts +1 -0
  45. package/dist/types/components.d.ts +2 -0
  46. package/dist/types/utils/interfaces.d.ts +2 -0
  47. package/package.json +1 -1
  48. package/readme.md +1 -1
  49. package/dist/ptcw-design/p-01223c98.entry.js +0 -1
  50. package/dist/ptcw-design/p-21a3fd97.entry.js +0 -1
  51. package/dist/ptcw-design/p-47c97f32.entry.js +0 -1
  52. package/dist/ptcw-design/p-754fe9f4.entry.js +0 -1
  53. package/dist/ptcw-design/p-904abfc9.entry.js +0 -1
  54. package/dist/ptcw-design/p-c0f223bb.entry.js +0 -1
  55. package/dist/ptcw-design/p-c642d666.entry.js +0 -1
@@ -5,57 +5,194 @@ export class PtcCaseStudiesSlider {
5
5
  // SLider List
6
6
  this.caseStudiesThumbs = null;
7
7
  this.caseStudiesSlides = null;
8
+ this.tabs = [];
9
+ this.tabPanels = [];
10
+ this.activeTabIndex = 0;
11
+ this.firstTab = null;
12
+ this.lastTab = null;
8
13
  }
9
14
  componentDidLoad() {
10
- this.initSlider();
11
- this.slideChangeHandler();
12
15
  this.renderSlides('swiper-slide-thumb', 'swiper-wrapper-thumbs');
13
16
  this.renderSlides('swiper-slide-content', 'swiper-wrapper-content');
17
+ this.initializeTabs();
18
+ this.initSlider();
19
+ this.slideChangeHandler();
14
20
  //Added for preloader skeleton issue
15
21
  setTimeout(() => { this.initSlider(); }, 3100);
16
22
  }
17
- initSlider() {
18
- this.caseStudiesThumbs = new Swiper(this.caeStudiesThumbRef, {
19
- modules: [Navigation, Pagination, FreeMode, Grid],
20
- loop: false,
21
- slidesPerView: 'auto',
22
- freeMode: true,
23
- watchSlidesProgress: true,
24
- centerInsufficientSlides: true,
25
- breakpoints: {
26
- 992: {
27
- slidesPerView: 7,
28
- },
23
+ // Initialize Tabs
24
+ initializeTabs() {
25
+ var _a, _b;
26
+ const tablist = (_a = this.caeStudiesThumbRef) === null || _a === void 0 ? void 0 : _a.querySelector('.swiper-wrapper-thumbs');
27
+ if (!tablist)
28
+ return;
29
+ // Updated selector to match existing class names
30
+ this.tabs = Array.from(tablist.querySelectorAll('.swiper-slide-thumb'));
31
+ this.tabPanels = Array.from(((_b = this.caseStudiesSlidesRef) === null || _b === void 0 ? void 0 : _b.querySelectorAll('.swiper-slide-content')) || []);
32
+ this.tabs.forEach((tab, index) => {
33
+ tab.setAttribute('role', 'tab');
34
+ tab.setAttribute('aria-selected', 'false');
35
+ tab.setAttribute('aria-controls', `tabpanel-${index}`);
36
+ tab.setAttribute('tabindex', '-1');
37
+ tab.id = `tab-${index}`;
38
+ // Set first and last tab
39
+ if (index === 0) {
40
+ this.firstTab = tab;
29
41
  }
42
+ this.lastTab = tab;
30
43
  });
31
- this.caseStudiesSlides = new Swiper(this.caseStudiesSlidesRef, {
32
- modules: [Navigation, Pagination, Thumbs, Autoplay, EffectFade],
33
- loop: false,
34
- grabCursor: true,
35
- effect: 'fade',
36
- autoplay: {
37
- delay: 10000,
38
- disableOnInteraction: false,
39
- waitForTransition: true,
40
- },
41
- thumbs: {
42
- swiper: this.caseStudiesThumbs,
43
- },
44
- pagination: {
45
- el: this.paginationRef,
46
- clickable: true,
47
- },
44
+ const tablistContainer = this.caeStudiesThumbRef;
45
+ if (tablistContainer) {
46
+ tablistContainer.setAttribute('role', 'tablist');
47
+ tablistContainer.setAttribute('aria-label', 'Case Studies Tabs');
48
+ }
49
+ // Select the first tab by default
50
+ if (this.tabs.length > 0) {
51
+ this.setSelectedTab(0);
52
+ }
53
+ }
54
+ // Set the selected tab by index
55
+ setSelectedTab(index) {
56
+ this.tabs.forEach((tab, i) => {
57
+ var _a;
58
+ if (i === index) {
59
+ tab.setAttribute('aria-selected', 'true');
60
+ tab.setAttribute('tabindex', '0');
61
+ this.tabPanels[i].classList.remove('is-hidden');
62
+ (_a = this.caseStudiesSlides) === null || _a === void 0 ? void 0 : _a.slideTo(i);
63
+ this.activeTabIndex = i;
64
+ }
65
+ else {
66
+ tab.setAttribute('aria-selected', 'false');
67
+ tab.setAttribute('tabindex', '-1');
68
+ this.tabPanels[i].classList.add('is-hidden');
69
+ }
48
70
  });
49
71
  }
72
+ // Handle keyboard navigation
73
+ handleKeyDown(event) {
74
+ const tgt = event.currentTarget;
75
+ let flag = false;
76
+ switch (event.key) {
77
+ case 'ArrowRight':
78
+ this.moveFocusToNextTab(tgt);
79
+ flag = true;
80
+ break;
81
+ case 'ArrowLeft':
82
+ this.moveFocusToPreviousTab(tgt);
83
+ flag = true;
84
+ break;
85
+ case 'Enter':
86
+ case ' ':
87
+ const index = this.tabs.indexOf(tgt);
88
+ if (index !== -1) {
89
+ this.setSelectedTab(index);
90
+ flag = true;
91
+ }
92
+ break;
93
+ default:
94
+ break;
95
+ }
96
+ if (flag) {
97
+ event.stopPropagation();
98
+ event.preventDefault();
99
+ }
100
+ }
101
+ // Move focus to a specific tab
102
+ moveFocusToTab(currentTab) {
103
+ currentTab.focus();
104
+ }
105
+ // Move focus to the previous tab
106
+ moveFocusToPreviousTab(currentTab) {
107
+ if (currentTab === this.firstTab) {
108
+ if (this.lastTab) {
109
+ this.moveFocusToTab(this.lastTab);
110
+ }
111
+ }
112
+ else {
113
+ const index = this.tabs.indexOf(currentTab);
114
+ if (index > 0) {
115
+ this.moveFocusToTab(this.tabs[index - 1]);
116
+ }
117
+ }
118
+ }
119
+ // Move focus to the next tab
120
+ moveFocusToNextTab(currentTab) {
121
+ if (currentTab === this.lastTab) {
122
+ if (this.firstTab) {
123
+ this.moveFocusToTab(this.firstTab);
124
+ }
125
+ }
126
+ else {
127
+ const index = this.tabs.indexOf(currentTab);
128
+ if (index < this.tabs.length - 1) {
129
+ this.moveFocusToTab(this.tabs[index + 1]);
130
+ }
131
+ }
132
+ }
133
+ // Handle tab click
134
+ onClick(index) {
135
+ this.setSelectedTab(index);
136
+ this.tabs[index].focus();
137
+ }
138
+ initSlider() {
139
+ if (this.caeStudiesThumbRef && !this.caseStudiesThumbs) {
140
+ this.caseStudiesThumbs = new Swiper(this.caeStudiesThumbRef, {
141
+ modules: [Navigation, Pagination, FreeMode, Grid],
142
+ loop: false,
143
+ slidesPerView: 'auto',
144
+ freeMode: true,
145
+ watchSlidesProgress: true,
146
+ centerInsufficientSlides: true,
147
+ breakpoints: {
148
+ 992: {
149
+ slidesPerView: 7,
150
+ },
151
+ },
152
+ });
153
+ }
154
+ if (this.caseStudiesSlidesRef && !this.caseStudiesSlides) {
155
+ this.caseStudiesSlides = new Swiper(this.caseStudiesSlidesRef, {
156
+ modules: [Navigation, Pagination, Thumbs, Autoplay, EffectFade],
157
+ loop: false,
158
+ grabCursor: true,
159
+ effect: 'fade',
160
+ autoplay: {
161
+ delay: 10000,
162
+ disableOnInteraction: false,
163
+ waitForTransition: true,
164
+ },
165
+ thumbs: {
166
+ swiper: this.caseStudiesThumbs,
167
+ },
168
+ pagination: {
169
+ el: this.paginationRef,
170
+ clickable: true,
171
+ },
172
+ keyboard: {
173
+ enabled: false,
174
+ },
175
+ });
176
+ }
177
+ }
50
178
  slideChangeHandler() {
51
- this.caseStudiesSlides.on('slideChange', () => {
52
- const visibleSlide = this.caseStudiesSlides.slides[this.caseStudiesSlides.activeIndex];
53
- const tagName = visibleSlide.querySelector('ptc-text-copy-with-background').shadowRoot;
54
- const content = tagName.querySelector('.card-wrap');
55
- const parent = tagName.querySelector('.card-wrap').parentNode;
56
- parent.removeChild(content);
57
- parent.appendChild(content);
58
- });
179
+ if (this.caseStudiesSlides) {
180
+ this.caseStudiesSlides.on('slideChange', () => {
181
+ var _a;
182
+ const activeIndex = this.caseStudiesSlides.activeIndex;
183
+ this.setSelectedTab(activeIndex);
184
+ const visibleSlide = this.caseStudiesSlides.slides[activeIndex];
185
+ const tagName = (_a = visibleSlide.querySelector('ptc-text-copy-with-background')) === null || _a === void 0 ? void 0 : _a.shadowRoot;
186
+ if (tagName) {
187
+ const content = tagName.querySelector('.card-wrap');
188
+ const parent = content === null || content === void 0 ? void 0 : content.parentNode;
189
+ if (parent && content) {
190
+ parent.removeChild(content);
191
+ parent.appendChild(content);
192
+ }
193
+ }
194
+ });
195
+ }
59
196
  }
60
197
  renderSlides(slideName, wrapperName) {
61
198
  const slidesList = Array.from(this.hostElement.querySelectorAll('.' + slideName));
@@ -65,17 +202,20 @@ export class PtcCaseStudiesSlider {
65
202
  const cloneNode = node.cloneNode(true);
66
203
  swiperWrapper.appendChild(cloneNode);
67
204
  node.remove;
68
- const imageElement = node.querySelector('img');
205
+ cloneNode.addEventListener('keydown', (event) => this.handleKeyDown(event));
206
+ cloneNode.addEventListener('click', () => this.onClick(index));
207
+ const imageElement = cloneNode.querySelector('img');
69
208
  if (imageElement) {
70
209
  imageElement.addEventListener('click', () => {
71
- this.caseStudiesSlides.slideTo(index); // Change the slide to the corresponding index
210
+ var _a;
211
+ (_a = this.caseStudiesSlides) === null || _a === void 0 ? void 0 : _a.slideTo(index); // Change the slide to the corresponding index
72
212
  });
73
213
  }
74
214
  });
75
215
  }
76
216
  }
77
217
  render() {
78
- return (h(Host, null, h("div", { class: "ptc-container" }, h("div", { class: "case-studies-thumbs", ref: el => this.caeStudiesThumbRef = el }, h("span", { class: "hide" }, h("slot", { name: 'thumb-slides' })), h("div", { class: 'swiper-wrapper swiper-wrapper-thumbs' }))), h("div", { class: "case-studies-slides", ref: el => this.caseStudiesSlidesRef = el }, h("span", { class: "hide" }, h("slot", { name: 'content-slides' })), h("div", { class: 'swiper-wrapper swiper-wrapper-content' }), h("div", { class: "swiper-pagination", ref: el => this.paginationRef = el }))));
218
+ return (h(Host, null, h("div", { class: "ptc-container" }, h("div", { class: "case-studies-thumbs swiper", ref: el => this.caeStudiesThumbRef = el }, h("span", { class: "hide" }, h("slot", { name: 'thumb-slides' })), h("div", { class: 'swiper-wrapper swiper-wrapper-thumbs' }))), h("div", { class: "case-studies-slides swiper", ref: el => this.caseStudiesSlidesRef = el }, h("span", { class: "hide" }, h("slot", { name: 'content-slides' })), h("div", { class: 'swiper-wrapper swiper-wrapper-content' }), h("div", { class: "swiper-pagination", ref: el => this.paginationRef = el }))));
79
219
  }
80
220
  static get is() { return "ptc-case-studies-slider"; }
81
221
  static get encapsulation() { return "shadow"; }
@@ -89,5 +229,14 @@ export class PtcCaseStudiesSlider {
89
229
  "$": ["ptc-case-studies-slider.css"]
90
230
  };
91
231
  }
232
+ static get states() {
233
+ return {
234
+ "tabs": {},
235
+ "tabPanels": {},
236
+ "activeTabIndex": {},
237
+ "firstTab": {},
238
+ "lastTab": {}
239
+ };
240
+ }
92
241
  static get elementRef() { return "hostElement"; }
93
242
  }
@@ -98,6 +98,7 @@ export class PtcCollapseList {
98
98
  newItem.target = z.linkTarget;
99
99
  newItem.title = z.linkTitle;
100
100
  newItem.text = z.facetDisplay;
101
+ newItem.id = generateUUID();
101
102
  }
102
103
  else {
103
104
  newItem.id = generateUUID();
@@ -322,7 +323,7 @@ export class PtcCollapseList {
322
323
  let renderLevel = (arr, level, searchOptions) => {
323
324
  let levelClass = `level-${level}`;
324
325
  return (h("ul", null, searchOptions &&
325
- h("li", { class: "search-box-wrapper" }, h("div", { class: "search-box" }, h("input", { class: "search-box", type: "text", placeholder: searchOptions.placeholder, onKeyUp: (e) => { this.onItemFilterSearchUpdate(e); }, onBlur: (e) => { this.onItemFilterSearchUpdate(e); } }))), arr.map((z) => {
326
+ h("li", { class: "search-box-wrapper" }, h("div", { class: "search-box" }, h("input", { class: "search-box", id: "searchBoxId", type: "text", placeholder: searchOptions.placeholder, onKeyUp: (e) => { this.onItemFilterSearchUpdate(e); }, onBlur: (e) => { this.onItemFilterSearchUpdate(e); } }))), arr.map((z) => {
326
327
  let expandable = false;
327
328
  let selectable = false;
328
329
  let icon;
@@ -368,15 +369,15 @@ export class PtcCollapseList {
368
369
  };
369
370
  let tooltip = level == 1 ? item.tooltip : undefined;
370
371
  if (item.isExternalLink) {
371
- return (h("a", { href: item.href, target: item.target, title: item.title }, icon, item.text, renderToolTip(tooltip)));
372
+ return (h("a", { href: item.href, id: item.id, target: item.target, title: item.title }, icon, item.text, renderToolTip(tooltip)));
372
373
  }
373
374
  else if ((!expandable && selectable) || (expandable && !selectable)) {
374
- return (h("a", { href: "#", title: item.text, onClick: clickEvent }, icon, item.text, renderToolTip(tooltip)));
375
+ return (h("a", { href: "#", id: item.id, title: item.text, onClick: clickEvent }, icon, item.text, renderToolTip(tooltip)));
375
376
  }
376
377
  else {
377
378
  return [
378
- h("a", { class: "expander-icon", href: "#", onClick: (e) => { this.onExpandClick(e, false); } }, icon),
379
- h("a", { href: "#", title: item.text, onClick: (e) => { this.onItemLinkClick(e, item.id); } }, item.text),
379
+ h("a", { class: "expander-icon", href: "#", id: item.id, onClick: (e) => { this.onExpandClick(e, false); } }, icon),
380
+ h("a", { href: "#", title: item.text, id: item.id, onClick: (e) => { this.onItemLinkClick(e, item.id); } }, item.text),
380
381
  renderToolTip(tooltip)
381
382
  ];
382
383
  }
@@ -385,7 +386,7 @@ export class PtcCollapseList {
385
386
  if (!this.showSearchBar) {
386
387
  return (h(Host, null, h("div", { class: "container" }, h("ptc-title", { type: 'h2', "title-size": "medium", "title-weight": "w-6", "text-align": 'left', upperline: "no-upperline" }, this.header), renderLevel(this.data, 1))));
387
388
  }
388
- return (h(Host, null, h("div", { class: "container" }, h("ptc-title", { type: 'h2', "title-size": "medium", "title-weight": "w-6", "text-align": 'left', upperline: "no-upperline" }, this.header), h("div", { class: "search-box" }, h("input", { type: "text", placeholder: this.placeholderText, onKeyUp: (e) => { this.onInputUpdated(e); } })), renderLevel(this.data, 1))));
389
+ return (h(Host, null, h("div", { class: "container" }, h("ptc-title", { type: 'h2', "title-size": "medium", "title-weight": "w-6", "text-align": 'left', upperline: "no-upperline" }, this.header), h("div", { class: "search-box" }, h("input", { type: "text", id: "searchBoxId", placeholder: this.placeholderText, onKeyUp: (e) => { this.onInputUpdated(e); } })), renderLevel(this.data, 1))));
389
390
  }
390
391
  async removeSelectedItem(value) {
391
392
  let item = this.getItemByValue(value);
@@ -232,4 +232,12 @@ ptc-link, ptc-square-card,
232
232
 
233
233
  .show .dropdown-container {
234
234
  display: inline-block;
235
+ }
236
+
237
+ dropdown-item:focus-visible {
238
+ outline: none;
239
+ }
240
+ dropdown-item:focus-visible .dropdown-item {
241
+ border-radius: var(--ptc-border-radius-standard);
242
+ outline: 5px solid var(--keyboard-nav-outline);
235
243
  }
@@ -1,6 +1,9 @@
1
1
  import { h } from '@stencil/core';
2
2
  export class PtcEllipsisDropdown {
3
3
  constructor() {
4
+ this.menuitemNodes = [];
5
+ this.firstMenuitem = false;
6
+ this.lastMenuitem = false;
4
7
  this.dataItems = [];
5
8
  this.selectedTab = undefined;
6
9
  this.isDropdownOpen = false;
@@ -8,6 +11,7 @@ export class PtcEllipsisDropdown {
8
11
  this.isIPad = undefined;
9
12
  this.dropdownType = "default";
10
13
  }
14
+ //firstChars = [];
11
15
  dropdownToggle(e) {
12
16
  e.currentTarget.classList.toggle("show");
13
17
  this.isDropdownOpen = e.currentTarget.classList.contains("show");
@@ -26,20 +30,146 @@ export class PtcEllipsisDropdown {
26
30
  this.isMobile = window.innerWidth < 768;
27
31
  this.isIPad = window.innerWidth < 992 || screen.width < 992;
28
32
  }
33
+ onEscClicked() {
34
+ var _a;
35
+ let container = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.ptc-ellipsis-dropdown');
36
+ //this.host.focus();
37
+ if (container) {
38
+ container.classList.remove('show');
39
+ this.isDropdownOpen = false;
40
+ }
41
+ }
29
42
  componentWillLoad() {
30
43
  this.isMobile = window.innerWidth < 768;
31
44
  this.isIPad = window.innerWidth < 992 || screen.width < 992;
32
45
  }
46
+ onMenuitemKeydown(event) {
47
+ var tgt = event.currentTarget, key = event.key, flag = false;
48
+ if (event.ctrlKey || event.altKey || event.metaKey) {
49
+ return;
50
+ }
51
+ if (event.shiftKey) {
52
+ if (event.key === 'Tab') {
53
+ }
54
+ }
55
+ else {
56
+ switch (key) {
57
+ case 'Up':
58
+ case 'ArrowUp':
59
+ this.setFocusToPreviousMenuitem(tgt);
60
+ flag = true;
61
+ break;
62
+ case 'ArrowDown':
63
+ case 'Down':
64
+ this.setFocusToNextMenuitem(tgt);
65
+ flag = true;
66
+ break;
67
+ case 'Home':
68
+ case 'PageUp':
69
+ this.setFocusToFirstMenuitem();
70
+ flag = true;
71
+ break;
72
+ case 'End':
73
+ case 'PageDown':
74
+ this.setFocusToLastMenuitem();
75
+ flag = true;
76
+ break;
77
+ case 'Tab':
78
+ this.onEscClicked();
79
+ break;
80
+ default:
81
+ break;
82
+ }
83
+ }
84
+ if (flag) {
85
+ event.stopPropagation();
86
+ event.preventDefault();
87
+ }
88
+ }
89
+ setFocusToMenuitem(newMenuitem) {
90
+ this.menuitemNodes.forEach(function (item) {
91
+ if (item === newMenuitem) {
92
+ item.tabIndex = 0;
93
+ newMenuitem.focus();
94
+ }
95
+ else {
96
+ item.tabIndex = -1;
97
+ }
98
+ });
99
+ }
100
+ setFocusToFirstMenuitem() {
101
+ this.setFocusToMenuitem(this.firstMenuitem);
102
+ }
103
+ setFocusToLastMenuitem() {
104
+ this.setFocusToMenuitem(this.lastMenuitem);
105
+ }
106
+ setFocusToPreviousMenuitem(currentMenuitem) {
107
+ var newMenuitem, index;
108
+ if (currentMenuitem === this.firstMenuitem) {
109
+ newMenuitem = this.lastMenuitem;
110
+ }
111
+ else {
112
+ index = this.menuitemNodes.indexOf(currentMenuitem);
113
+ newMenuitem = this.menuitemNodes[index - 1];
114
+ }
115
+ this.setFocusToMenuitem(newMenuitem);
116
+ return newMenuitem;
117
+ }
118
+ setFocusToNextMenuitem(currentMenuitem) {
119
+ var newMenuitem, index;
120
+ if (currentMenuitem === this.lastMenuitem) {
121
+ newMenuitem = this.firstMenuitem;
122
+ }
123
+ else {
124
+ index = this.menuitemNodes.indexOf(currentMenuitem);
125
+ newMenuitem = this.menuitemNodes[index + 1];
126
+ }
127
+ this.setFocusToMenuitem(newMenuitem);
128
+ return newMenuitem;
129
+ }
130
+ componentDidLoad() {
131
+ setTimeout(() => {
132
+ this.menuitems = this.host.shadowRoot.querySelectorAll('dropdown-item');
133
+ for (var i = 0; i < this.menuitems.length; i++) {
134
+ var menuitem = this.menuitems[i];
135
+ this.menuitemNodes.push(menuitem);
136
+ menuitem.tabIndex = -1;
137
+ menuitem.addEventListener('keydown', this.onMenuitemKeydown.bind(this));
138
+ if (!this.firstMenuitem) {
139
+ this.firstMenuitem = menuitem;
140
+ }
141
+ this.lastMenuitem = menuitem;
142
+ }
143
+ }, 100);
144
+ const ellp = this.host.shadowRoot.querySelector('.ptc-ellipsis-dropdown');
145
+ this.host.addEventListener('keydown', (event) => {
146
+ // Open dropdown on 'Enter' key press
147
+ if (event.key === 'Enter') {
148
+ ellp.click();
149
+ }
150
+ if (event.key === 'ArrowDown') {
151
+ this.host.shadowRoot.querySelectorAll('dropdown-item')[0].focus();
152
+ }
153
+ });
154
+ if (this.isMobile || (this.isIPad && this.dropdownType === 'tab-with-banner')) {
155
+ this.host.setAttribute('tabindex', '0');
156
+ }
157
+ }
33
158
  render() {
34
159
  let activeTab = this.dataItems.find(z => z.isSelected == true);
35
160
  let isActive = false;
36
161
  if (activeTab) {
37
162
  isActive = true;
38
163
  }
39
- return (h("div", { class: this.dropdownType == 'tab-with-banner' ? "ptc-ellipsis-dropdown tab-with-banner" : "ptc-ellipsis-dropdown default", onClick: (e) => this.dropdownToggle(e) }, (this.isMobile || (this.isIPad && this.dropdownType === 'tab-with-banner')) ? (h("div", { class: 'mob-drop' }, h("span", { class: 'opt-name' }, this.dataItems.map((item) => item.isSelected ? item.text : '')), h("svg", { width: "12", height: "9", viewBox: "0 0 12 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M1 1.65723L5.94975 6.60697L10.8995 1.65723", stroke: "#00890B", "stroke-width": "2", "stroke-linecap": "round" })))) : (h("div", { class: isActive || this.isDropdownOpen ? "ellipsis-icon active" : "ellipsis-icon" }, h("icon-asset", { type: "ptc", size: "xxx-small", name: "ellipsis", color: isActive || this.isDropdownOpen ? 'white' : 'black' }))), h("div", { class: "dropdown-container" }, h("slot", { name: "dropdown" }), this.dataItems.map(dataItem => {
164
+ return (h("div", { class: this.dropdownType == 'tab-with-banner' ? "ptc-ellipsis-dropdown tab-with-banner" : "ptc-ellipsis-dropdown default", onClick: (e) => this.dropdownToggle(e) }, (this.isMobile || (this.isIPad && this.dropdownType === 'tab-with-banner')) ? (h("div", { class: 'mob-drop' }, h("span", { class: 'opt-name' }, this.dataItems.map((item) => item.isSelected ? item.text : '')), h("svg", { width: "12", height: "9", viewBox: "0 0 12 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M1 1.65723L5.94975 6.60697L10.8995 1.65723", stroke: "#00890B", "stroke-width": "2", "stroke-linecap": "round" })))) : (h("div", { class: isActive || this.isDropdownOpen ? "ellipsis-icon active" : "ellipsis-icon" }, h("icon-asset", { type: "ptc", size: "xxx-small", name: "ellipsis", color: isActive || this.isDropdownOpen ? 'white' : 'black' }))), h("div", { class: "dropdown-container", role: "menu", "aria-labelledby": "menubutton1" }, h("slot", { name: "dropdown" }), this.dataItems.map((dataItem) => {
40
165
  let activeClass = dataItem.value == this.selectedTab ? 'active' : '';
41
166
  let activeDropdown = dataItem.isSelected ? 'selected-drop' : '';
42
- return (h("dropdown-item", { class: activeClass + activeDropdown + 'mf-listen' }, h("span", { onClick: (e) => {
167
+ return (h("dropdown-item", { role: "menuitem", class: activeClass + activeDropdown + 'mf-listen', onKeyDown: (e) => {
168
+ if (e.key === 'Enter') {
169
+ e.preventDefault();
170
+ this.onItemSelected(dataItem);
171
+ }
172
+ } }, h("span", { onClick: (e) => {
43
173
  e.preventDefault();
44
174
  this.onItemSelected(dataItem);
45
175
  } }, dataItem.text)));
@@ -155,6 +285,12 @@ export class PtcEllipsisDropdown {
155
285
  "target": "window",
156
286
  "capture": false,
157
287
  "passive": true
288
+ }, {
289
+ "name": "escClicked",
290
+ "method": "onEscClicked",
291
+ "target": "window",
292
+ "capture": false,
293
+ "passive": false
158
294
  }];
159
295
  }
160
296
  }
@@ -1259,6 +1259,13 @@ a:focus-visible {
1259
1259
 
1260
1260
  .hp-adjustments {
1261
1261
  background-color: var(--color-black);
1262
+ height: auto;
1263
+ min-height: 640px !important;
1264
+ }
1265
+ @media (min-height: 640px) {
1266
+ .hp-adjustments {
1267
+ min-height: 72vh !important;
1268
+ }
1262
1269
  }
1263
1270
  .hp-adjustments .div1 {
1264
1271
  grid-area: 1/1/3/2;
@@ -1292,11 +1299,6 @@ a:focus-visible {
1292
1299
  opacity: 0;
1293
1300
  }
1294
1301
 
1295
- @media screen and (min-width: 992.01px) {
1296
- .hp-adjustments {
1297
- height: 90vh;
1298
- }
1299
- }
1300
1302
  .div1 {
1301
1303
  grid-area: 1/1/2/2;
1302
1304
  min-height: 300px;
@@ -193,7 +193,11 @@ ptc-tab-list.tab-with-banner .tabs-header-container {
193
193
  }
194
194
  }
195
195
  .ellipsis-btn.active {
196
- display: block;
196
+ display: inline-block;
197
+ }
198
+ .ellipsis-btn:focus-visible {
199
+ border-radius: var(--ptc-border-radius-standard);
200
+ outline: 5px solid var(--keyboard-nav-outline);
197
201
  }
198
202
 
199
203
  tab-header {