@ptcwebops/ptcw-design 5.8.9 → 5.9.1

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 (54) 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-collapse-list.cjs.entry.js +7 -6
  4. package/dist/cjs/ptc-ellipsis-dropdown.cjs.entry.js +128 -3
  5. package/dist/cjs/ptc-tab-list.cjs.entry.js +110 -2
  6. package/dist/cjs/ptc-value-led-layout.cjs.entry.js +7 -6
  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-collapse-list/ptc-collapse-list.js +7 -6
  11. package/dist/collection/components/ptc-ellipsis-dropdown/ptc-ellipsis-dropdown.css +8 -0
  12. package/dist/collection/components/ptc-ellipsis-dropdown/ptc-ellipsis-dropdown.js +138 -2
  13. package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.css +7 -5
  14. package/dist/collection/components/ptc-tab-list/ptc-tab-list.css +5 -1
  15. package/dist/collection/components/ptc-tab-list/ptc-tab-list.js +148 -2
  16. package/dist/collection/components/ptc-value-led-layout/ptc-value-led-layout.js +7 -12
  17. package/dist/collection/components/tab-content/tab-content.css +0 -7
  18. package/dist/collection/components/tab-content/tab-content.js +11 -1
  19. package/dist/collection/components/tab-header/tab-header.css +12 -0
  20. package/dist/collection/components/tab-header/tab-header.js +6 -0
  21. package/dist/custom-elements/index.js +275 -24
  22. package/dist/esm/blog-detail-content_21.entry.js +1 -1
  23. package/dist/esm/loader.js +1 -1
  24. package/dist/esm/ptc-collapse-list.entry.js +7 -6
  25. package/dist/esm/ptc-ellipsis-dropdown.entry.js +128 -3
  26. package/dist/esm/ptc-tab-list.entry.js +110 -2
  27. package/dist/esm/ptc-value-led-layout.entry.js +7 -6
  28. package/dist/esm/ptcw-design.js +1 -1
  29. package/dist/esm/tab-content.entry.js +13 -3
  30. package/dist/esm/tab-header.entry.js +8 -2
  31. package/dist/ptcw-design/p-2c2f895a.entry.js +1 -0
  32. package/dist/ptcw-design/p-37480ed1.entry.js +1 -0
  33. package/dist/ptcw-design/p-38a56ed6.entry.js +1 -0
  34. package/dist/ptcw-design/p-5441b0b9.entry.js +1 -0
  35. package/dist/ptcw-design/p-8038bf31.entry.js +1 -0
  36. package/dist/ptcw-design/p-849655f7.entry.js +1 -0
  37. package/dist/ptcw-design/p-f618e1d4.entry.js +1 -0
  38. package/dist/ptcw-design/ptcw-design.esm.js +1 -1
  39. package/dist/types/components/ptc-ellipsis-dropdown/ptc-ellipsis-dropdown.d.ts +12 -0
  40. package/dist/types/components/ptc-tab-list/ptc-tab-list.d.ts +12 -0
  41. package/dist/types/components/ptc-value-led-layout/ptc-value-led-layout.d.ts +0 -1
  42. package/dist/types/components/tab-content/tab-content.d.ts +4 -0
  43. package/dist/types/components/tab-header/tab-header.d.ts +1 -0
  44. package/dist/types/components.d.ts +2 -0
  45. package/dist/types/utils/interfaces.d.ts +2 -0
  46. package/package.json +1 -1
  47. package/readme.md +1 -1
  48. package/dist/ptcw-design/p-21a3fd97.entry.js +0 -1
  49. package/dist/ptcw-design/p-47c97f32.entry.js +0 -1
  50. package/dist/ptcw-design/p-5a96b4ce.entry.js +0 -1
  51. package/dist/ptcw-design/p-5d8333af.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-c642d666.entry.js +0 -1
@@ -1,11 +1,14 @@
1
1
  import { r as registerInstance, c as createEvent, h, g as getElement } from './index-c83db688.js';
2
2
 
3
- const ptcEllipsisDropdownCss = "h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}.ellipsis-icon{box-sizing:border-box;border:1px solid var(--color-gray-08);border-radius:2px;vertical-align:middle;height:18px;width:18px;text-align:center;display:flex;align-items:center;justify-content:center;transition:background-color var(--ptc-ease-out) var(--ptc-transition-medium), border-color var(--ptc-ease-out) var(--ptc-transition-medium)}.ellipsis-icon:hover{background-color:var(--color-gray-04);border-color:var(--color-gray-04)}.ellipsis-icon icon-asset{display:inline-block}.ellipsis-icon icon-asset svg{margin:0 auto;display:block;width:10px !important;height:10px !important}.ellipsis-icon.active{background-color:var(--color-green-07);border-color:var(--color-green-07)}.ellipsis-icon.active::after{content:\"\";width:32px;height:2px;display:inline-block;background-color:var(--color-green-07);position:absolute;bottom:-11px}@media only screen and (min-width: 1440px){.ellipsis-icon.active::after{bottom:-17px}}.ptc-ellipsis-dropdown{position:relative;display:inline-block;cursor:pointer;padding:2px 0 14px 0;border-bottom:2px solid var(--color-green-07);margin:0 1rem -1px 1rem;box-sizing:border-box}@media only screen and (min-width: 768px){.ptc-ellipsis-dropdown.default{padding:0px;border-bottom:none;margin:0;height:44px;width:44px;display:flex;justify-content:center;align-content:center;flex-wrap:wrap}}.ptc-ellipsis-dropdown.tab-with-banner{padding:0px 0 16px 0;margin:0 1rem -2.5px 1rem}@media only screen and (min-width: 992px){.ptc-ellipsis-dropdown.tab-with-banner{padding:0px 0px 1rem 0px;border-bottom:none;margin:0;height:100%;width:44px;display:flex;justify-content:center;align-content:center;flex-wrap:wrap}}.ptc-ellipsis-dropdown.tab-with-banner .ellipsis-icon.active::after{bottom:-2px}.ptc-ellipsis-dropdown.tab-with-banner .dropdown-container{display:none;margin-top:16px;box-shadow:0 6px 16px rgba(0, 0, 0, 0.24);border-radius:4px;position:absolute;z-index:1010;background:var(--color-white);padding:0.8rem 0;right:auto;left:0;min-width:max-content;width:100%}@media only screen and (min-width: 992px){.ptc-ellipsis-dropdown.tab-with-banner .dropdown-container{right:0;left:auto;top:50%;margin-top:22px}}.ptc-ellipsis-dropdown.tab-with-banner.show .dropdown-container{display:inline-block}@media only screen and (min-width: 1440px){.ptc-ellipsis-dropdown{height:34px;width:34px}}.ptc-ellipsis-dropdown .mob-drop{color:var(--color-gray-10);font-size:var(--ptc-font-size-small);font-weight:var(--ptc-font-weight-bold);line-height:var(--ptc-line-height-p);font-family:\"Raleway\";font-style:normal;display:flex;align-items:center}.ptc-ellipsis-dropdown .mob-drop svg{display:inline-block;vertical-align:middle;margin:4px 0px 0px 12px;min-width:12px}.dropdown-container{display:none;margin-top:16px;box-shadow:0 6px 16px rgba(0, 0, 0, 0.24);border-radius:4px;position:absolute;z-index:1010;background:var(--color-white);padding:0.8rem 0;right:auto;left:0;min-width:max-content;width:100%}@media only screen and (min-width: 768px){.dropdown-container{right:0;left:auto;margin-top:48px}}@media only screen and (min-width: 1440px){.dropdown-container{margin-top:45px}}.dropdown-container .selected-drop .dropdown-item span{position:relative;font-weight:var(--ptc-font-weight-bold)}.dropdown-container .selected-drop .dropdown-item span::before{content:\"\";width:2px;height:60%;background:var(--color-green-07);display:block;left:16px;position:absolute;top:20%}.show .dropdown-container{display:inline-block}";
3
+ const ptcEllipsisDropdownCss = "h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}.ellipsis-icon{box-sizing:border-box;border:1px solid var(--color-gray-08);border-radius:2px;vertical-align:middle;height:18px;width:18px;text-align:center;display:flex;align-items:center;justify-content:center;transition:background-color var(--ptc-ease-out) var(--ptc-transition-medium), border-color var(--ptc-ease-out) var(--ptc-transition-medium)}.ellipsis-icon:hover{background-color:var(--color-gray-04);border-color:var(--color-gray-04)}.ellipsis-icon icon-asset{display:inline-block}.ellipsis-icon icon-asset svg{margin:0 auto;display:block;width:10px !important;height:10px !important}.ellipsis-icon.active{background-color:var(--color-green-07);border-color:var(--color-green-07)}.ellipsis-icon.active::after{content:\"\";width:32px;height:2px;display:inline-block;background-color:var(--color-green-07);position:absolute;bottom:-11px}@media only screen and (min-width: 1440px){.ellipsis-icon.active::after{bottom:-17px}}.ptc-ellipsis-dropdown{position:relative;display:inline-block;cursor:pointer;padding:2px 0 14px 0;border-bottom:2px solid var(--color-green-07);margin:0 1rem -1px 1rem;box-sizing:border-box}@media only screen and (min-width: 768px){.ptc-ellipsis-dropdown.default{padding:0px;border-bottom:none;margin:0;height:44px;width:44px;display:flex;justify-content:center;align-content:center;flex-wrap:wrap}}.ptc-ellipsis-dropdown.tab-with-banner{padding:0px 0 16px 0;margin:0 1rem -2.5px 1rem}@media only screen and (min-width: 992px){.ptc-ellipsis-dropdown.tab-with-banner{padding:0px 0px 1rem 0px;border-bottom:none;margin:0;height:100%;width:44px;display:flex;justify-content:center;align-content:center;flex-wrap:wrap}}.ptc-ellipsis-dropdown.tab-with-banner .ellipsis-icon.active::after{bottom:-2px}.ptc-ellipsis-dropdown.tab-with-banner .dropdown-container{display:none;margin-top:16px;box-shadow:0 6px 16px rgba(0, 0, 0, 0.24);border-radius:4px;position:absolute;z-index:1010;background:var(--color-white);padding:0.8rem 0;right:auto;left:0;min-width:max-content;width:100%}@media only screen and (min-width: 992px){.ptc-ellipsis-dropdown.tab-with-banner .dropdown-container{right:0;left:auto;top:50%;margin-top:22px}}.ptc-ellipsis-dropdown.tab-with-banner.show .dropdown-container{display:inline-block}@media only screen and (min-width: 1440px){.ptc-ellipsis-dropdown{height:34px;width:34px}}.ptc-ellipsis-dropdown .mob-drop{color:var(--color-gray-10);font-size:var(--ptc-font-size-small);font-weight:var(--ptc-font-weight-bold);line-height:var(--ptc-line-height-p);font-family:\"Raleway\";font-style:normal;display:flex;align-items:center}.ptc-ellipsis-dropdown .mob-drop svg{display:inline-block;vertical-align:middle;margin:4px 0px 0px 12px;min-width:12px}.dropdown-container{display:none;margin-top:16px;box-shadow:0 6px 16px rgba(0, 0, 0, 0.24);border-radius:4px;position:absolute;z-index:1010;background:var(--color-white);padding:0.8rem 0;right:auto;left:0;min-width:max-content;width:100%}@media only screen and (min-width: 768px){.dropdown-container{right:0;left:auto;margin-top:48px}}@media only screen and (min-width: 1440px){.dropdown-container{margin-top:45px}}.dropdown-container .selected-drop .dropdown-item span{position:relative;font-weight:var(--ptc-font-weight-bold)}.dropdown-container .selected-drop .dropdown-item span::before{content:\"\";width:2px;height:60%;background:var(--color-green-07);display:block;left:16px;position:absolute;top:20%}.show .dropdown-container{display:inline-block}dropdown-item:focus-visible{outline:none}dropdown-item:focus-visible .dropdown-item{border-radius:var(--ptc-border-radius-standard);outline:5px solid var(--keyboard-nav-outline)}";
4
4
 
5
5
  const PtcEllipsisDropdown = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
8
  this.itemSelected = createEvent(this, "itemSelected", 7);
9
+ this.menuitemNodes = [];
10
+ this.firstMenuitem = false;
11
+ this.lastMenuitem = false;
9
12
  this.dataItems = [];
10
13
  this.selectedTab = undefined;
11
14
  this.isDropdownOpen = false;
@@ -13,6 +16,7 @@ const PtcEllipsisDropdown = class {
13
16
  this.isIPad = undefined;
14
17
  this.dropdownType = "default";
15
18
  }
19
+ //firstChars = [];
16
20
  dropdownToggle(e) {
17
21
  e.currentTarget.classList.toggle("show");
18
22
  this.isDropdownOpen = e.currentTarget.classList.contains("show");
@@ -31,20 +35,141 @@ const PtcEllipsisDropdown = class {
31
35
  this.isMobile = window.innerWidth < 768;
32
36
  this.isIPad = window.innerWidth < 992 || screen.width < 992;
33
37
  }
38
+ onEscClicked() {
39
+ var _a;
40
+ let container = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.ptc-ellipsis-dropdown');
41
+ //this.host.focus();
42
+ if (container) {
43
+ container.classList.remove('show');
44
+ this.isDropdownOpen = false;
45
+ }
46
+ }
34
47
  componentWillLoad() {
35
48
  this.isMobile = window.innerWidth < 768;
36
49
  this.isIPad = window.innerWidth < 992 || screen.width < 992;
37
50
  }
51
+ onMenuitemKeydown(event) {
52
+ var tgt = event.currentTarget, key = event.key, flag = false;
53
+ if (event.ctrlKey || event.altKey || event.metaKey) {
54
+ return;
55
+ }
56
+ if (event.shiftKey) ;
57
+ else {
58
+ switch (key) {
59
+ case 'Up':
60
+ case 'ArrowUp':
61
+ this.setFocusToPreviousMenuitem(tgt);
62
+ flag = true;
63
+ break;
64
+ case 'ArrowDown':
65
+ case 'Down':
66
+ this.setFocusToNextMenuitem(tgt);
67
+ flag = true;
68
+ break;
69
+ case 'Home':
70
+ case 'PageUp':
71
+ this.setFocusToFirstMenuitem();
72
+ flag = true;
73
+ break;
74
+ case 'End':
75
+ case 'PageDown':
76
+ this.setFocusToLastMenuitem();
77
+ flag = true;
78
+ break;
79
+ case 'Tab':
80
+ this.onEscClicked();
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
+ }
38
158
  render() {
39
159
  let activeTab = this.dataItems.find(z => z.isSelected == true);
40
160
  let isActive = false;
41
161
  if (activeTab) {
42
162
  isActive = true;
43
163
  }
44
- 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) => {
45
165
  let activeClass = dataItem.value == this.selectedTab ? 'active' : '';
46
166
  let activeDropdown = dataItem.isSelected ? 'selected-drop' : '';
47
- 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) => {
48
173
  e.preventDefault();
49
174
  this.onItemSelected(dataItem);
50
175
  } }, dataItem.text)));
@@ -1,15 +1,20 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c83db688.js';
2
2
 
3
- const ptcTabListCss = "h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}ptc-tab-list{display:block;position:relative;color:var(--color-gray-12)}ptc-tab-list.tab-with-banner{background-color:var(--color-white);padding:24px 16px 16px 16px;border-radius:4px}@media only screen and (min-width: 992px){ptc-tab-list.tab-with-banner{padding:24px}}ptc-tab-list.tab-with-banner .tabs-content{padding:16px 0 0 0}ptc-tab-list.tab-with-banner .tabs-content p:not(video-js p),ptc-tab-list.tab-with-banner .tabs-content span:not(video-js span),ptc-tab-list.tab-with-banner .tabs-content h1:not(video-js h1),ptc-tab-list.tab-with-banner .tabs-content h2:not(video-js h2),ptc-tab-list.tab-with-banner .tabs-content h3:not(video-js h3),ptc-tab-list.tab-with-banner .tabs-content h4:not(video-js h4),ptc-tab-list.tab-with-banner .tabs-content h5:not(video-js h5),ptc-tab-list.tab-with-banner .tabs-content h6:not(video-js h6),ptc-tab-list.tab-with-banner .tabs-content ul:not(video-js ul),ptc-tab-list.tab-with-banner .tabs-content li:not(video-js li),ptc-tab-list.tab-with-banner .tabs-content table:not(video-js table){color:var(--color-gray-12)}@media only screen and (min-width: 992px){ptc-tab-list.tab-with-banner .tabs-content{padding:24px 0 0 0}}@media only screen and (min-width: 992px){ptc-tab-list.tab-with-banner .tabs-header{align-items:stretch;padding-left:0rem;width:calc(100% - 44px);display:flex;justify-content:space-between;align-items:center;flex-direction:row;padding-right:0}ptc-tab-list.tab-with-banner tab-header{padding:0 16px;display:flex;align-items:center;flex:1 0 0;align-self:stretch;text-align:center;flex-direction:column;align-items:center}}ptc-tab-list.tab-with-banner .tab-header{padding:0 0 1rem 0}@media only screen and (min-width: 992px){ptc-tab-list.tab-with-banner .tab-header{min-width:200px;white-space:normal;height:100%;align-content:center;transition:var(--ptc-transition-medium) var(--ptc-ease-inout);-webkit-transition:var(--ptc-transition-medium) var(--ptc-ease-inout);-o-transition:var(--ptc-transition-medium) var(--ptc-ease-inout)}ptc-tab-list.tab-with-banner .tab-header:hover{color:var(--color-gray-10)}}@media (min-width: 1080px){ptc-tab-list.tab-with-banner .tab-header{min-width:230px}}@media only screen and (min-width: 1200px){ptc-tab-list.tab-with-banner .tab-header{min-width:200px}}@media only screen and (min-width: 1440px){ptc-tab-list.tab-with-banner .tab-header{min-width:175px}}ptc-tab-list.tab-with-banner .tabs-header-container{display:flex}.tabs-header-container{width:100%;border-bottom:2px solid var(--color-gray-02);position:relative}.tabs-header{display:flex;padding-left:1.5rem;padding-right:1.5rem;transition:opacity ease-out 250ms;opacity:0;width:90%}.tabs-header.active{opacity:1}.tabs-content{padding:40px 28px 28px;min-height:300px}.ellipsis-btn{display:none}@media only screen and (min-width: 768px){.ellipsis-btn.default{position:absolute;top:auto;right:0;bottom:9px}}@media only screen and (min-width: 1440px){.ellipsis-btn.default{bottom:15px}}@media only screen and (min-width: 1440px){.ellipsis-btn{bottom:15px}}.ellipsis-btn.active{display:block}tab-header{padding-right:48px}";
3
+ const ptcTabListCss = "h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{word-break:break-word;hyphens:manual;-webkit-hyphens:manual;-moz-hyphens:manual;-ms-hyphens:manual}@supports (hyphenate-limit-chars: 12 3 3){h1,h2,h3,h4,h5,h6,p,ul,li,ptc-subnav,ptc-tab-list,ptc-link,ptc-square-card,.hyphenate-text,ptc-footer{hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;hyphenate-limit-chars:12 3 3;hyphenate-limit-lines:2;hyphenate-limit-last:always;hyphenate-limit-zone:6%;-webkit-hyphens:auto;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;-webkit-hyphenate-limit-chars:12 3 3;-webkit-hyphenate-limit-lines:2;-moz-hyphens:auto;-moz-hyphenate-limit-chars:12 3 3;-moz-hyphenate-limit-lines:2;-ms-hyphens:auto;-ms-hyphenate-limit-chars:12 3 3;-ms-hyphenate-limit-lines:2}}ptc-tab-list{display:block;position:relative;color:var(--color-gray-12)}ptc-tab-list.tab-with-banner{background-color:var(--color-white);padding:24px 16px 16px 16px;border-radius:4px}@media only screen and (min-width: 992px){ptc-tab-list.tab-with-banner{padding:24px}}ptc-tab-list.tab-with-banner .tabs-content{padding:16px 0 0 0}ptc-tab-list.tab-with-banner .tabs-content p:not(video-js p),ptc-tab-list.tab-with-banner .tabs-content span:not(video-js span),ptc-tab-list.tab-with-banner .tabs-content h1:not(video-js h1),ptc-tab-list.tab-with-banner .tabs-content h2:not(video-js h2),ptc-tab-list.tab-with-banner .tabs-content h3:not(video-js h3),ptc-tab-list.tab-with-banner .tabs-content h4:not(video-js h4),ptc-tab-list.tab-with-banner .tabs-content h5:not(video-js h5),ptc-tab-list.tab-with-banner .tabs-content h6:not(video-js h6),ptc-tab-list.tab-with-banner .tabs-content ul:not(video-js ul),ptc-tab-list.tab-with-banner .tabs-content li:not(video-js li),ptc-tab-list.tab-with-banner .tabs-content table:not(video-js table){color:var(--color-gray-12)}@media only screen and (min-width: 992px){ptc-tab-list.tab-with-banner .tabs-content{padding:24px 0 0 0}}@media only screen and (min-width: 992px){ptc-tab-list.tab-with-banner .tabs-header{align-items:stretch;padding-left:0rem;width:calc(100% - 44px);display:flex;justify-content:space-between;align-items:center;flex-direction:row;padding-right:0}ptc-tab-list.tab-with-banner tab-header{padding:0 16px;display:flex;align-items:center;flex:1 0 0;align-self:stretch;text-align:center;flex-direction:column;align-items:center}}ptc-tab-list.tab-with-banner .tab-header{padding:0 0 1rem 0}@media only screen and (min-width: 992px){ptc-tab-list.tab-with-banner .tab-header{min-width:200px;white-space:normal;height:100%;align-content:center;transition:var(--ptc-transition-medium) var(--ptc-ease-inout);-webkit-transition:var(--ptc-transition-medium) var(--ptc-ease-inout);-o-transition:var(--ptc-transition-medium) var(--ptc-ease-inout)}ptc-tab-list.tab-with-banner .tab-header:hover{color:var(--color-gray-10)}}@media (min-width: 1080px){ptc-tab-list.tab-with-banner .tab-header{min-width:230px}}@media only screen and (min-width: 1200px){ptc-tab-list.tab-with-banner .tab-header{min-width:200px}}@media only screen and (min-width: 1440px){ptc-tab-list.tab-with-banner .tab-header{min-width:175px}}ptc-tab-list.tab-with-banner .tabs-header-container{display:flex}.tabs-header-container{width:100%;border-bottom:2px solid var(--color-gray-02);position:relative}.tabs-header{display:flex;padding-left:1.5rem;padding-right:1.5rem;transition:opacity ease-out 250ms;opacity:0;width:90%}.tabs-header.active{opacity:1}.tabs-content{padding:40px 28px 28px;min-height:300px}.ellipsis-btn{display:none}@media only screen and (min-width: 768px){.ellipsis-btn.default{position:absolute;top:auto;right:0;bottom:9px}}@media only screen and (min-width: 1440px){.ellipsis-btn.default{bottom:15px}}@media only screen and (min-width: 1440px){.ellipsis-btn{bottom:15px}}.ellipsis-btn.active{display:inline-block}.ellipsis-btn:focus-visible{border-radius:var(--ptc-border-radius-standard);outline:5px solid var(--keyboard-nav-outline)}tab-header{padding-right:48px}";
4
4
 
5
5
  const PtcTabList = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
8
  this.tabChange = createEvent(this, "tabChange", 7);
9
+ this.escClicked = createEvent(this, "escClicked", 7);
9
10
  this.type = undefined;
10
11
  this.isMobile = undefined;
11
12
  this.isMobileTabWithBanner = undefined;
12
13
  this.selectedValue = undefined;
14
+ this.dropdownItemsCount = 0;
15
+ }
16
+ closeDropdown() {
17
+ this.escClicked.emit();
13
18
  }
14
19
  componentWillLoad() {
15
20
  this.isMobile = window.innerWidth < 768;
@@ -20,6 +25,14 @@ const PtcTabList = class {
20
25
  this.calculateHeaderTabsRendering();
21
26
  /*const [group] = this.tabGroup;
22
27
  this.selectGroup(group);*/
28
+ this.ellipsisDropdown = this.host.querySelector('ptc-ellipsis-dropdown');
29
+ this.ellipsisDropdown.addEventListener('keydown', this.onKeydown.bind(this));
30
+ const tabsHeaderEl = Array.from(this.host.querySelectorAll('tab-header'));
31
+ tabsHeaderEl.forEach((tab, i) => {
32
+ if ((tabsHeaderEl.length - this.dropdownItemsCount) == (i + 1)) {
33
+ this.lastVisibleTab = tab;
34
+ }
35
+ });
23
36
  }
24
37
  onSelectedTab(event) {
25
38
  let self = this;
@@ -27,6 +40,14 @@ const PtcTabList = class {
27
40
  event.detail.then(res => {
28
41
  if (group.header.name === res.name) {
29
42
  self.selectGroup(group);
43
+ // Set the selected tab's tabindex to 0
44
+ group.header.el.setAttribute('tabindex', '0');
45
+ // Focus the selected tab
46
+ group.header.el.focus();
47
+ }
48
+ else {
49
+ // Set other tabs' tabindex to -1
50
+ group.header.el.setAttribute('tabindex', '-1');
30
51
  }
31
52
  });
32
53
  });
@@ -74,6 +95,7 @@ const PtcTabList = class {
74
95
  if (activateDropDown) {
75
96
  dropdown.classList.add('active');
76
97
  dropdown.dataItems = hiddenTabs.reverse();
98
+ this.dropdownItemsCount = dropdown.dataItems.length;
77
99
  }
78
100
  else {
79
101
  dropdown.classList.remove('active');
@@ -94,7 +116,7 @@ const PtcTabList = class {
94
116
  if (headerCount === tabsHeaderEl.length) {
95
117
  headerComplete = true;
96
118
  }
97
- headerData.push(res);
119
+ headerData.push(Object.assign(Object.assign({}, res), { el }));
98
120
  }));
99
121
  this.tabsHeader = headerData;
100
122
  const tabsContentEl = Array.from(this.host.querySelectorAll('tab-content'));
@@ -120,6 +142,92 @@ const PtcTabList = class {
120
142
  self.selectGroup(group);
121
143
  }
122
144
  }, 3100); // Increased time interval from 100 to 3100 to fix the preload skeleton issue
145
+ tabsHeaderEl.forEach((header, index) => {
146
+ // console.log(header);
147
+ header.setAttribute('id', 'tab-' + (index + 1));
148
+ header.setAttribute('role', 'tab');
149
+ header.setAttribute('aria-selected', index === 0 ? 'true' : 'false');
150
+ header.setAttribute('tabindex', index === 0 ? '0' : '-1'); // Set tabindex based on index
151
+ header.setAttribute('aria-controls', 'tab-panel-' + (index + 1));
152
+ header.addEventListener('keydown', this.onKeydown.bind(this));
153
+ if (!this.firstTab) {
154
+ this.firstTab = header;
155
+ }
156
+ this.lastTab = header;
157
+ });
158
+ tabsContentEl.forEach((panel, index) => {
159
+ panel.setAttribute('id', 'tabpanel-' + (index + 1));
160
+ panel.setAttribute('role', 'tabpanel');
161
+ panel.setAttribute('aria-labelledby', 'tab-' + (index + 1));
162
+ });
163
+ }
164
+ moveFocusToTab(currentTab) {
165
+ currentTab.focus();
166
+ }
167
+ moveFocusToPreviousTab(currentTab) {
168
+ if (currentTab === this.firstTab || currentTab == this.ellipsisDropdown) {
169
+ this.ellipsisDropdown.setAttribute('tabindex', '-1');
170
+ if (this.dropdownItemsCount == 0) {
171
+ this.moveFocusToTab(this.lastTab);
172
+ }
173
+ else if (currentTab == this.ellipsisDropdown) {
174
+ this.moveFocusToTab(this.lastVisibleTab);
175
+ }
176
+ else {
177
+ this.ellipsisDropdown.setAttribute('tabindex', '0');
178
+ this.ellipsisDropdown.focus();
179
+ }
180
+ }
181
+ else {
182
+ const index = this.tabsHeader.findIndex(tab => tab.el === currentTab);
183
+ this.moveFocusToTab(this.tabsHeader[index - 1].el);
184
+ }
185
+ }
186
+ moveFocusToNextTab(currentTab) {
187
+ this.ellipsisDropdown.setAttribute('tabindex', '-1');
188
+ if (currentTab === this.lastTab || currentTab === this.lastVisibleTab) {
189
+ if (this.dropdownItemsCount == 0) {
190
+ this.moveFocusToTab(this.firstTab);
191
+ }
192
+ else {
193
+ this.ellipsisDropdown.setAttribute('tabindex', '0');
194
+ this.ellipsisDropdown.focus();
195
+ }
196
+ }
197
+ else {
198
+ const index = this.tabsHeader.findIndex(tab => tab.el === currentTab);
199
+ this.moveFocusToTab(this.tabsHeader[index + 1].el);
200
+ }
201
+ }
202
+ onKeydown(event) {
203
+ const currentTab = event.currentTarget;
204
+ let flag = false;
205
+ switch (event.key) {
206
+ case 'ArrowLeft':
207
+ this.moveFocusToPreviousTab(currentTab);
208
+ flag = true;
209
+ break;
210
+ case 'ArrowRight':
211
+ this.moveFocusToNextTab(currentTab);
212
+ flag = true;
213
+ break;
214
+ case 'Escape':
215
+ this.closeDropdown();
216
+ flag = true;
217
+ break;
218
+ }
219
+ if (flag) {
220
+ event.stopPropagation();
221
+ event.preventDefault();
222
+ }
223
+ }
224
+ async toggleTabGroup(name) {
225
+ let self = this;
226
+ this.tabGroup.forEach(group => {
227
+ if (group.header.name === name) {
228
+ self.selectGroup(group);
229
+ }
230
+ });
123
231
  }
124
232
  selectGroup(group) {
125
233
  let self = this;
@@ -50,12 +50,13 @@ const PtcValueLedLayout = class {
50
50
  }
51
51
  });
52
52
  }
53
- handleScroll() {
54
- const activeListItem = this.hostElement.shadowRoot.querySelector('.vl-list-wrap ul li.active');
55
- if (activeListItem) {
56
- activeListItem.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'start' });
57
- }
58
- }
53
+ // @Listen('scroll', { target: 'window' })
54
+ // handleScroll() {
55
+ // const activeListItem = this.hostElement.shadowRoot.querySelector('.vl-list-wrap ul li.active');
56
+ // if (activeListItem) {
57
+ // activeListItem.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'start' });
58
+ // }
59
+ // }
59
60
  handleWheel( /*event: WheelEvent*/) {
60
61
  //console.log(event);
61
62
  this.setActiveItem();