@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
@@ -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 {
@@ -6,6 +6,10 @@ export class PtcTabList {
6
6
  this.isMobile = undefined;
7
7
  this.isMobileTabWithBanner = undefined;
8
8
  this.selectedValue = undefined;
9
+ this.dropdownItemsCount = 0;
10
+ }
11
+ closeDropdown() {
12
+ this.escClicked.emit();
9
13
  }
10
14
  componentWillLoad() {
11
15
  this.isMobile = window.innerWidth < 768;
@@ -16,6 +20,14 @@ export class PtcTabList {
16
20
  this.calculateHeaderTabsRendering();
17
21
  /*const [group] = this.tabGroup;
18
22
  this.selectGroup(group);*/
23
+ this.ellipsisDropdown = this.host.querySelector('ptc-ellipsis-dropdown');
24
+ this.ellipsisDropdown.addEventListener('keydown', this.onKeydown.bind(this));
25
+ const tabsHeaderEl = Array.from(this.host.querySelectorAll('tab-header'));
26
+ tabsHeaderEl.forEach((tab, i) => {
27
+ if ((tabsHeaderEl.length - this.dropdownItemsCount) == (i + 1)) {
28
+ this.lastVisibleTab = tab;
29
+ }
30
+ });
19
31
  }
20
32
  onSelectedTab(event) {
21
33
  let self = this;
@@ -23,6 +35,14 @@ export class PtcTabList {
23
35
  event.detail.then(res => {
24
36
  if (group.header.name === res.name) {
25
37
  self.selectGroup(group);
38
+ // Set the selected tab's tabindex to 0
39
+ group.header.el.setAttribute('tabindex', '0');
40
+ // Focus the selected tab
41
+ group.header.el.focus();
42
+ }
43
+ else {
44
+ // Set other tabs' tabindex to -1
45
+ group.header.el.setAttribute('tabindex', '-1');
26
46
  }
27
47
  });
28
48
  });
@@ -70,6 +90,7 @@ export class PtcTabList {
70
90
  if (activateDropDown) {
71
91
  dropdown.classList.add('active');
72
92
  dropdown.dataItems = hiddenTabs.reverse();
93
+ this.dropdownItemsCount = dropdown.dataItems.length;
73
94
  }
74
95
  else {
75
96
  dropdown.classList.remove('active');
@@ -90,7 +111,7 @@ export class PtcTabList {
90
111
  if (headerCount === tabsHeaderEl.length) {
91
112
  headerComplete = true;
92
113
  }
93
- headerData.push(res);
114
+ headerData.push(Object.assign(Object.assign({}, res), { el }));
94
115
  }));
95
116
  this.tabsHeader = headerData;
96
117
  const tabsContentEl = Array.from(this.host.querySelectorAll('tab-content'));
@@ -116,6 +137,92 @@ export class PtcTabList {
116
137
  self.selectGroup(group);
117
138
  }
118
139
  }, 3100); // Increased time interval from 100 to 3100 to fix the preload skeleton issue
140
+ tabsHeaderEl.forEach((header, index) => {
141
+ // console.log(header);
142
+ header.setAttribute('id', 'tab-' + (index + 1));
143
+ header.setAttribute('role', 'tab');
144
+ header.setAttribute('aria-selected', index === 0 ? 'true' : 'false');
145
+ header.setAttribute('tabindex', index === 0 ? '0' : '-1'); // Set tabindex based on index
146
+ header.setAttribute('aria-controls', 'tab-panel-' + (index + 1));
147
+ header.addEventListener('keydown', this.onKeydown.bind(this));
148
+ if (!this.firstTab) {
149
+ this.firstTab = header;
150
+ }
151
+ this.lastTab = header;
152
+ });
153
+ tabsContentEl.forEach((panel, index) => {
154
+ panel.setAttribute('id', 'tabpanel-' + (index + 1));
155
+ panel.setAttribute('role', 'tabpanel');
156
+ panel.setAttribute('aria-labelledby', 'tab-' + (index + 1));
157
+ });
158
+ }
159
+ moveFocusToTab(currentTab) {
160
+ currentTab.focus();
161
+ }
162
+ moveFocusToPreviousTab(currentTab) {
163
+ if (currentTab === this.firstTab || currentTab == this.ellipsisDropdown) {
164
+ this.ellipsisDropdown.setAttribute('tabindex', '-1');
165
+ if (this.dropdownItemsCount == 0) {
166
+ this.moveFocusToTab(this.lastTab);
167
+ }
168
+ else if (currentTab == this.ellipsisDropdown) {
169
+ this.moveFocusToTab(this.lastVisibleTab);
170
+ }
171
+ else {
172
+ this.ellipsisDropdown.setAttribute('tabindex', '0');
173
+ this.ellipsisDropdown.focus();
174
+ }
175
+ }
176
+ else {
177
+ const index = this.tabsHeader.findIndex(tab => tab.el === currentTab);
178
+ this.moveFocusToTab(this.tabsHeader[index - 1].el);
179
+ }
180
+ }
181
+ moveFocusToNextTab(currentTab) {
182
+ this.ellipsisDropdown.setAttribute('tabindex', '-1');
183
+ if (currentTab === this.lastTab || currentTab === this.lastVisibleTab) {
184
+ if (this.dropdownItemsCount == 0) {
185
+ this.moveFocusToTab(this.firstTab);
186
+ }
187
+ else {
188
+ this.ellipsisDropdown.setAttribute('tabindex', '0');
189
+ this.ellipsisDropdown.focus();
190
+ }
191
+ }
192
+ else {
193
+ const index = this.tabsHeader.findIndex(tab => tab.el === currentTab);
194
+ this.moveFocusToTab(this.tabsHeader[index + 1].el);
195
+ }
196
+ }
197
+ onKeydown(event) {
198
+ const currentTab = event.currentTarget;
199
+ let flag = false;
200
+ switch (event.key) {
201
+ case 'ArrowLeft':
202
+ this.moveFocusToPreviousTab(currentTab);
203
+ flag = true;
204
+ break;
205
+ case 'ArrowRight':
206
+ this.moveFocusToNextTab(currentTab);
207
+ flag = true;
208
+ break;
209
+ case 'Escape':
210
+ this.closeDropdown();
211
+ flag = true;
212
+ break;
213
+ }
214
+ if (flag) {
215
+ event.stopPropagation();
216
+ event.preventDefault();
217
+ }
218
+ }
219
+ async toggleTabGroup(name) {
220
+ let self = this;
221
+ this.tabGroup.forEach(group => {
222
+ if (group.header.name === name) {
223
+ self.selectGroup(group);
224
+ }
225
+ });
119
226
  }
120
227
  selectGroup(group) {
121
228
  let self = this;
@@ -178,7 +285,8 @@ export class PtcTabList {
178
285
  return {
179
286
  "isMobile": {},
180
287
  "isMobileTabWithBanner": {},
181
- "selectedValue": {}
288
+ "selectedValue": {},
289
+ "dropdownItemsCount": {}
182
290
  };
183
291
  }
184
292
  static get events() {
@@ -197,8 +305,46 @@ export class PtcTabList {
197
305
  "resolved": "any",
198
306
  "references": {}
199
307
  }
308
+ }, {
309
+ "method": "escClicked",
310
+ "name": "escClicked",
311
+ "bubbles": true,
312
+ "cancelable": true,
313
+ "composed": true,
314
+ "docs": {
315
+ "tags": [],
316
+ "text": ""
317
+ },
318
+ "complexType": {
319
+ "original": "any",
320
+ "resolved": "any",
321
+ "references": {}
322
+ }
200
323
  }];
201
324
  }
325
+ static get methods() {
326
+ return {
327
+ "toggleTabGroup": {
328
+ "complexType": {
329
+ "signature": "(name: string) => Promise<void>",
330
+ "parameters": [{
331
+ "tags": [],
332
+ "text": ""
333
+ }],
334
+ "references": {
335
+ "Promise": {
336
+ "location": "global"
337
+ }
338
+ },
339
+ "return": "Promise<void>"
340
+ },
341
+ "docs": {
342
+ "text": "",
343
+ "tags": []
344
+ }
345
+ }
346
+ };
347
+ }
202
348
  static get elementRef() { return "host"; }
203
349
  static get listeners() {
204
350
  return [{
@@ -46,12 +46,13 @@ export class PtcValueLedLayout {
46
46
  }
47
47
  });
48
48
  }
49
- handleScroll() {
50
- const activeListItem = this.hostElement.shadowRoot.querySelector('.vl-list-wrap ul li.active');
51
- if (activeListItem) {
52
- activeListItem.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'start' });
53
- }
54
- }
49
+ // @Listen('scroll', { target: 'window' })
50
+ // handleScroll() {
51
+ // const activeListItem = this.hostElement.shadowRoot.querySelector('.vl-list-wrap ul li.active');
52
+ // if (activeListItem) {
53
+ // activeListItem.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'start' });
54
+ // }
55
+ // }
55
56
  handleWheel( /*event: WheelEvent*/) {
56
57
  //console.log(event);
57
58
  this.setActiveItem();
@@ -275,12 +276,6 @@ export class PtcValueLedLayout {
275
276
  static get elementRef() { return "hostElement"; }
276
277
  static get listeners() {
277
278
  return [{
278
- "name": "scroll",
279
- "method": "handleScroll",
280
- "target": "window",
281
- "capture": false,
282
- "passive": true
283
- }, {
284
279
  "name": "wheel",
285
280
  "method": "handleWheel",
286
281
  "target": "window",
@@ -54,18 +54,11 @@ ptc-link, ptc-square-card,
54
54
  }
55
55
  }
56
56
 
57
- .tab-content {
58
- display: none;
59
- }
60
57
  .tab-content p, .tab-content ul, .tab-content ol, .tab-content span, .tab-content h1, .tab-content h2, .tab-content h3, .tab-content h4, .tab-content h5, .tab-content h6 {
61
58
  max-width: 720px;
62
59
  font-weight: var(--ptc-font-weight-normal);
63
60
  }
64
61
 
65
- .tab-content-selected {
66
- display: block;
67
- }
68
-
69
62
  .tab-content h3 {
70
63
  font-size: var(--ptc-font-size-medium);
71
64
  font-weight: var(--ptc-font-weight-bold);
@@ -4,6 +4,9 @@ export class TabContent {
4
4
  this.name = undefined;
5
5
  this.isSelected = false;
6
6
  }
7
+ componentWillLoad() {
8
+ this.parentReference = this.el.closest('ptc-tab-list');
9
+ }
7
10
  async getChild() {
8
11
  return {
9
12
  select: this.select.bind(this),
@@ -17,12 +20,18 @@ export class TabContent {
17
20
  select() {
18
21
  this.isSelected = true;
19
22
  }
23
+ beforeMatch() {
24
+ this.parentReference.toggleTabGroup(this.name);
25
+ }
20
26
  render() {
21
27
  const classes = {
22
28
  'tab-content': true,
23
29
  'tab-content-selected': this.isSelected
24
30
  };
25
- return (h("div", { class: classes }, h("slot", null)));
31
+ const hidden = (this.isSelected ? false : 'until-found');
32
+ return (
33
+ //@ts-ignore
34
+ h("div", { class: classes, hidden: hidden, onBeforeMatch: () => { this.beforeMatch(); } }, h("slot", null)));
26
35
  }
27
36
  static get is() { return "tab-content"; }
28
37
  static get originalStyleUrls() {
@@ -81,4 +90,5 @@ export class TabContent {
81
90
  }
82
91
  };
83
92
  }
93
+ static get elementRef() { return "el"; }
84
94
  }
@@ -93,6 +93,18 @@ ptc-link, ptc-square-card,
93
93
  color: var(--color-gray-10);
94
94
  }
95
95
 
96
+ tab-header:focus-visible {
97
+ outline: none;
98
+ }
99
+ tab-header:focus-visible .tab-header {
100
+ border-radius: var(--ptc-border-radius-standard);
101
+ outline: 5px solid var(--keyboard-nav-outline);
102
+ transition: none;
103
+ }
104
+ tab-header:focus-visible .tab-header::after {
105
+ background-color: var(--keyboard-nav-outline);
106
+ }
107
+
96
108
  .tab-header-selected {
97
109
  color: var(--color-gray-10);
98
110
  font-weight: var(--ptc-font-weight-bold);
@@ -51,6 +51,11 @@ export class TabHeader {
51
51
  }
52
52
  componentDidLoad() {
53
53
  this.updateMaxLength(window.innerWidth);
54
+ this.el.addEventListener('keydown', (event) => {
55
+ if (event.key === 'Enter') {
56
+ this.onClick();
57
+ }
58
+ });
54
59
  }
55
60
  render() {
56
61
  const classes = {
@@ -171,6 +176,7 @@ export class TabHeader {
171
176
  }
172
177
  };
173
178
  }
179
+ static get elementRef() { return "el"; }
174
180
  static get listeners() {
175
181
  return [{
176
182
  "name": "resize",