@ptcwebops/ptcw-design 6.4.11 → 6.4.12-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/blogs-search-section.cjs.entry.js +4 -1
- package/dist/cjs/buying-option-card.cjs.entry.js +1 -1
- package/dist/cjs/buying-option-cards-slider.cjs.entry.js +15 -8
- package/dist/cjs/{component-35540bfb.js → component-6a178a16.js} +2643 -832
- package/dist/cjs/dynamic-box-bundle.cjs.entry.js +3 -1
- package/dist/cjs/featured-list.cjs.entry.js +1 -1
- package/dist/cjs/homepage-toggled-content.cjs.entry.js +3 -1
- package/dist/cjs/innovator-toggle-container.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/modal-form-example.cjs.entry.js +109 -0
- package/dist/cjs/ptc-announcement.cjs.entry.js +2 -1
- package/dist/cjs/ptc-bio-card.cjs.entry.js +1 -1
- package/dist/cjs/ptc-button.cjs.entry.js +1 -1
- package/dist/cjs/ptc-card-bottom_2.cjs.entry.js +3 -17
- package/dist/cjs/ptc-card-content.cjs.entry.js +1 -7
- package/dist/cjs/ptc-card_2.cjs.entry.js +5 -4
- package/dist/cjs/ptc-case-studies-slider.cjs.entry.js +1 -1
- package/dist/cjs/ptc-close-icon_2.cjs.entry.js +24 -24
- package/dist/cjs/ptc-data-lookup.cjs.entry.js +1 -2
- package/dist/cjs/ptc-featured-list.cjs.entry.js +1 -1
- package/dist/cjs/ptc-filter-level-theater.cjs.entry.js +1 -1
- package/dist/cjs/{ptc-form-checkbox_2.cjs.entry.js → ptc-form-checkbox_4.cjs.entry.js} +723 -5
- package/dist/cjs/ptc-img.cjs.entry.js +87 -7
- package/dist/cjs/ptc-jumbotron.cjs.entry.js +11 -5
- package/dist/cjs/ptc-modal-quiz.cjs.entry.js +4 -1
- package/dist/cjs/ptc-para.cjs.entry.js +1 -1
- package/dist/cjs/ptc-picture.cjs.entry.js +0 -17
- package/dist/cjs/ptc-podcast-card.cjs.entry.js +1 -1
- package/dist/cjs/ptc-preloader.cjs.entry.js +1 -1
- package/dist/cjs/ptc-previous-url.cjs.entry.js +11 -2
- package/dist/cjs/ptc-pricing-packaging-table.cjs.entry.js +25 -9
- package/dist/cjs/ptc-pricing-tabs.cjs.entry.js +1 -1
- package/dist/cjs/ptc-product-card.cjs.entry.js +1 -1
- package/dist/cjs/ptc-product-category.cjs.entry.js +1 -1
- package/dist/cjs/ptc-product-highlight-card.cjs.entry.js +1 -1
- package/dist/cjs/ptc-readmore-char.cjs.entry.js +1 -1
- package/dist/cjs/ptc-readmore-v3.cjs.entry.js +1 -1
- package/dist/cjs/ptc-subnav-v2.cjs.entry.js +147 -247
- package/dist/cjs/ptc-tooltip-v2.cjs.entry.js +1 -1
- package/dist/cjs/ptc-value-led-speed-bump.cjs.entry.js +1 -1
- package/dist/cjs/ptc-white-paper.cjs.entry.js +19 -9
- package/dist/cjs/ptcw-design.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/buying-option-card/buying-option-card.css +2 -0
- package/dist/collection/components/buying-option-cards-slider/buying-option-cards-slider.css +9 -35
- package/dist/collection/components/buying-option-cards-slider/buying-option-cards-slider.js +14 -7
- package/dist/collection/components/dynamic-box-bundle/dynamic-box-bundle.js +3 -1
- package/dist/collection/components/icon-asset/media/designer-v6.0.7.svg +30 -2
- package/dist/collection/components/innovator-toggle-container/innovator-toggle-container.css +24 -0
- package/dist/collection/components/organism-bundles/blogs-search-section/blogs-search-section.js +4 -1
- package/dist/collection/components/organism-bundles/bundle-featured-list/featured-list.css +24 -0
- package/dist/collection/components/organism-bundles/form/modal-from-example/modal-form-example.css +26 -0
- package/dist/collection/components/organism-bundles/form/modal-from-example/modal-form-example.js +114 -0
- package/dist/collection/components/organism-bundles/homepage-toggled-content/homepage-toggled-content.js +3 -1
- package/dist/collection/components/ptc-announcement/ptc-announcement.js +2 -1
- package/dist/collection/components/ptc-bio-card/ptc-bio-card.css +24 -0
- package/dist/collection/components/ptc-button/ptc-button.css +0 -2
- package/dist/collection/components/ptc-card-content/ptc-card-content.css +3 -45
- package/dist/collection/components/ptc-card-content/ptc-card-content.js +2 -26
- package/dist/collection/components/ptc-card-wrapper/ptc-card-wrapper.js +3 -17
- package/dist/collection/components/ptc-case-studies-slider/ptc-case-studies-slider.css +24 -0
- package/dist/collection/components/ptc-featured-list/ptc-featured-list.css +24 -0
- package/dist/collection/components/ptc-filter-level-theater/ptc-filter-level-theater.css +24 -0
- package/dist/collection/components/ptc-img/ptc-img.css +76 -0
- package/dist/collection/components/ptc-img/ptc-img.js +132 -7
- package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.css +26 -3
- package/dist/collection/components/ptc-jumbotron/ptc-jumbotron.js +28 -4
- package/dist/collection/components/ptc-modal/ptc-modal.css +5 -0
- package/dist/collection/components/ptc-modal/ptc-modal.js +25 -25
- package/dist/collection/components/ptc-modal-quiz/ptc-modal-quiz.js +4 -1
- package/dist/collection/components/ptc-para/ptc-para.css +3 -0
- package/dist/collection/components/ptc-para/ptc-para.js +2 -2
- package/dist/collection/components/ptc-picture/ptc-picture.js +0 -40
- package/dist/collection/components/ptc-podcast-card/ptc-podcast-card.css +24 -0
- package/dist/collection/components/ptc-preloader/ptc-preloader.css +147 -111
- package/dist/collection/components/ptc-preloader/ptc-preloader.js +1 -1
- package/dist/collection/components/ptc-preloader-section/ptc-preloader-section.css +1 -2
- package/dist/collection/components/ptc-preloader-section/ptc-preloader-section.js +4 -3
- package/dist/collection/components/ptc-previous-url/ptc-previous-url.css +16 -0
- package/dist/collection/components/ptc-previous-url/ptc-previous-url.js +28 -1
- package/dist/collection/components/ptc-pricing-packaging-table/ptc-pricing-packaging-table.js +25 -9
- package/dist/collection/components/ptc-pricing-tabs/ptc-pricing-tabs.js +1 -1
- package/dist/collection/components/ptc-product-card/ptc-product-card.css +24 -0
- package/dist/collection/components/ptc-product-category/ptc-product-category.css +24 -0
- package/dist/collection/components/ptc-product-highlight-card/ptc-product-highlight-card.css +24 -0
- package/dist/collection/components/ptc-readmore-char/ptc-readmore-char.css +24 -0
- package/dist/collection/components/ptc-readmore-v3/ptc-readmore-v3.css +24 -0
- package/dist/collection/components/ptc-subnav-v2/ptc-subnav-v2.css +110 -115
- package/dist/collection/components/ptc-subnav-v2/ptc-subnav-v2.js +150 -248
- package/dist/collection/components/ptc-textfield/ptc-textfield.js +3 -5
- package/dist/collection/components/ptc-tooltip-v2/ptc-tooltip-v2.css +24 -0
- package/dist/collection/components/ptc-value-led-speed-bump/ptc-value-led-speed-bump.css +24 -0
- package/dist/collection/components/ptc-white-paper/ptc-white-paper.css +27 -3
- package/dist/collection/components/ptc-white-paper/ptc-white-paper.js +18 -8
- package/dist/collection/stories/organisms/eSupport/CaseTracker/preview.stories.js +45 -0
- package/dist/collection/stories/organisms/eSupport/SupportArticle/preview.stories.js +47 -0
- package/dist/collection/stories/organisms/eSupport/SupportPage/preview.stories.js +157 -0
- package/dist/collection/stories/organisms/ptc/Subanv New/preview.stories.js +338 -0
- package/dist/collection/stories/ptc-subnav-v2/ptc-subnav-v2.stories.js +0 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +496 -390
- package/dist/esm/blogs-search-section.entry.js +4 -1
- package/dist/esm/buying-option-card.entry.js +1 -1
- package/dist/esm/buying-option-cards-slider.entry.js +15 -8
- package/dist/esm/{component-8c53e377.js → component-80f298b4.js} +2592 -793
- package/dist/esm/dynamic-box-bundle.entry.js +3 -1
- package/dist/esm/featured-list.entry.js +1 -1
- package/dist/esm/homepage-toggled-content.entry.js +3 -1
- package/dist/esm/innovator-toggle-container.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/modal-form-example.entry.js +105 -0
- package/dist/esm/ptc-announcement.entry.js +2 -1
- package/dist/esm/ptc-bio-card.entry.js +1 -1
- package/dist/esm/ptc-button.entry.js +1 -1
- package/dist/esm/ptc-card-bottom_2.entry.js +3 -17
- package/dist/esm/ptc-card-content.entry.js +1 -7
- package/dist/esm/ptc-card_2.entry.js +5 -4
- package/dist/esm/ptc-case-studies-slider.entry.js +1 -1
- package/dist/esm/ptc-close-icon_2.entry.js +24 -24
- package/dist/esm/ptc-data-lookup.entry.js +1 -2
- package/dist/esm/ptc-featured-list.entry.js +1 -1
- package/dist/esm/ptc-filter-level-theater.entry.js +1 -1
- package/dist/esm/{ptc-form-checkbox_2.entry.js → ptc-form-checkbox_4.entry.js} +722 -6
- package/dist/esm/ptc-img.entry.js +87 -7
- package/dist/esm/ptc-jumbotron.entry.js +11 -5
- package/dist/esm/ptc-modal-quiz.entry.js +4 -1
- package/dist/esm/ptc-para.entry.js +1 -1
- package/dist/esm/ptc-picture.entry.js +0 -17
- package/dist/esm/ptc-podcast-card.entry.js +1 -1
- package/dist/esm/ptc-preloader.entry.js +1 -1
- package/dist/esm/ptc-previous-url.entry.js +11 -2
- package/dist/esm/ptc-pricing-packaging-table.entry.js +25 -9
- package/dist/esm/ptc-pricing-tabs.entry.js +1 -1
- package/dist/esm/ptc-product-card.entry.js +1 -1
- package/dist/esm/ptc-product-category.entry.js +1 -1
- package/dist/esm/ptc-product-highlight-card.entry.js +1 -1
- package/dist/esm/ptc-readmore-char.entry.js +1 -1
- package/dist/esm/ptc-readmore-v3.entry.js +1 -1
- package/dist/esm/ptc-subnav-v2.entry.js +147 -247
- package/dist/esm/ptc-tooltip-v2.entry.js +1 -1
- package/dist/esm/ptc-value-led-speed-bump.entry.js +1 -1
- package/dist/esm/ptc-white-paper.entry.js +19 -9
- package/dist/esm/ptcw-design.js +1 -1
- package/dist/ptcw-design/media/designer-v6.0.7.svg +30 -2
- package/dist/ptcw-design/{p-614b66d8.entry.js → p-0451b768.entry.js} +1 -1
- package/dist/ptcw-design/p-04891836.entry.js +1 -0
- package/dist/ptcw-design/p-17b8281a.entry.js +1 -0
- package/dist/ptcw-design/p-187ef77b.entry.js +1 -0
- package/dist/ptcw-design/p-2670ac97.entry.js +1 -0
- package/dist/ptcw-design/p-2c8faf9a.entry.js +1 -0
- package/dist/ptcw-design/{p-4b41fe4e.entry.js → p-312c41b8.entry.js} +1 -1
- package/dist/ptcw-design/p-32bec5ef.entry.js +1 -0
- package/dist/ptcw-design/p-349f43d5.entry.js +1 -0
- package/dist/ptcw-design/p-390c0dee.entry.js +1 -0
- package/dist/ptcw-design/p-3b40bfbf.entry.js +68 -0
- package/dist/ptcw-design/p-502f534b.entry.js +1 -0
- package/dist/ptcw-design/p-53a96796.entry.js +1 -0
- package/dist/ptcw-design/p-672a349f.js +336 -0
- package/dist/ptcw-design/p-6f9f55b3.entry.js +1 -0
- package/dist/ptcw-design/{p-365646b8.entry.js → p-7218fe2c.entry.js} +1 -1
- package/dist/ptcw-design/{p-2a3c8a30.entry.js → p-7235425a.entry.js} +1 -1
- package/dist/ptcw-design/p-74097f89.entry.js +1 -0
- package/dist/ptcw-design/{p-af9912b6.entry.js → p-7834cfee.entry.js} +1 -1
- package/dist/ptcw-design/p-799afee5.entry.js +1 -0
- package/dist/ptcw-design/p-7fe4d383.entry.js +1 -0
- package/dist/ptcw-design/p-8fb48953.entry.js +1 -0
- package/dist/ptcw-design/p-96f346c4.entry.js +1 -0
- package/dist/ptcw-design/{p-db882e62.entry.js → p-9da57f76.entry.js} +1 -1
- package/dist/ptcw-design/p-b06bc0a1.entry.js +1 -0
- package/dist/ptcw-design/{p-121a9ef6.entry.js → p-b0a16f1a.entry.js} +1 -1
- package/dist/ptcw-design/p-b684ca9d.entry.js +1 -0
- package/dist/ptcw-design/p-c09a8288.entry.js +1 -0
- package/dist/ptcw-design/p-cb0e3ec2.entry.js +1 -0
- package/dist/ptcw-design/p-de960790.entry.js +1 -0
- package/dist/ptcw-design/p-e3a6ed56.entry.js +1 -0
- package/dist/ptcw-design/p-ef870202.entry.js +1 -0
- package/dist/ptcw-design/{p-f0958536.entry.js → p-f010c07f.entry.js} +1 -1
- package/dist/ptcw-design/p-f6b70f68.entry.js +1 -0
- package/dist/ptcw-design/ptcw-design.css +4 -3
- package/dist/ptcw-design/ptcw-design.esm.js +1 -1
- package/dist/types/components/organism-bundles/form/modal-from-example/modal-form-example.d.ts +25 -0
- package/dist/types/components/ptc-card-content/ptc-card-content.d.ts +1 -2
- package/dist/types/components/ptc-img/ptc-img.d.ts +29 -1
- package/dist/types/components/ptc-jumbotron/ptc-jumbotron.d.ts +4 -0
- package/dist/types/components/ptc-modal/ptc-modal.d.ts +1 -1
- package/dist/types/components/ptc-para/ptc-para.d.ts +1 -1
- package/dist/types/components/ptc-picture/ptc-picture.d.ts +0 -2
- package/dist/types/components/ptc-previous-url/ptc-previous-url.d.ts +2 -0
- package/dist/types/components/ptc-subnav-v2/ptc-subnav-v2.d.ts +6 -32
- package/dist/types/components.d.ts +53 -11
- package/package.json +1 -1
- package/readme.md +5 -1
- package/dist/cjs/component-1b8ad4d2.js +0 -1819
- package/dist/cjs/ptc-multi-select_2.cjs.entry.js +0 -730
- package/dist/collection/stories/organisms/ptc/Subnav New/preview.stories.js +0 -360
- package/dist/esm/component-9beac35b.js +0 -1802
- package/dist/esm/ptc-multi-select_2.entry.js +0 -725
- package/dist/ptcw-design/p-009fbf1f.entry.js +0 -1
- package/dist/ptcw-design/p-00e21489.entry.js +0 -1
- package/dist/ptcw-design/p-14ba0f06.entry.js +0 -1
- package/dist/ptcw-design/p-1a853854.entry.js +0 -1
- package/dist/ptcw-design/p-1f15239e.entry.js +0 -1
- package/dist/ptcw-design/p-1f356fcf.entry.js +0 -1
- package/dist/ptcw-design/p-2bfd8371.entry.js +0 -1
- package/dist/ptcw-design/p-2e6e2a9d.entry.js +0 -1
- package/dist/ptcw-design/p-3ed4a7ed.entry.js +0 -1
- package/dist/ptcw-design/p-56a73429.entry.js +0 -1
- package/dist/ptcw-design/p-80ee97a2.entry.js +0 -1
- package/dist/ptcw-design/p-850a6205.entry.js +0 -1
- package/dist/ptcw-design/p-8aeb229a.entry.js +0 -1
- package/dist/ptcw-design/p-8ef0e26e.entry.js +0 -68
- package/dist/ptcw-design/p-9493dfa0.entry.js +0 -1
- package/dist/ptcw-design/p-95efe7ee.entry.js +0 -1
- package/dist/ptcw-design/p-98426799.js +0 -203
- package/dist/ptcw-design/p-98844b50.js +0 -134
- package/dist/ptcw-design/p-a9533f9c.entry.js +0 -1
- package/dist/ptcw-design/p-b44f4fb1.entry.js +0 -1
- package/dist/ptcw-design/p-b5e849da.entry.js +0 -1
- package/dist/ptcw-design/p-b89136c6.entry.js +0 -1
- package/dist/ptcw-design/p-c42e9110.entry.js +0 -1
- package/dist/ptcw-design/p-cad4b517.entry.js +0 -1
- package/dist/ptcw-design/p-e976a798.entry.js +0 -1
- package/dist/ptcw-design/p-f13c7959.entry.js +0 -1
- package/dist/ptcw-design/p-f3d3c161.entry.js +0 -1
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class PtcSubnavV2 {
|
|
3
3
|
constructor() {
|
|
4
|
-
this.cachedNavItems = null;
|
|
5
|
-
this.isSticky = false;
|
|
6
|
-
this.originalTop = 0;
|
|
7
|
-
this.placeholderElement = null;
|
|
8
|
-
this.measurementElement = null;
|
|
9
4
|
this.handleClickOutside = (event) => {
|
|
10
|
-
|
|
5
|
+
const target = event.target;
|
|
6
|
+
if (!this.el.contains(target)) {
|
|
11
7
|
this.showOverflowMenu = false;
|
|
12
8
|
}
|
|
13
9
|
};
|
|
14
10
|
this.handleKeyDown = (event) => {
|
|
15
|
-
|
|
11
|
+
// Handle Escape key to close dropdowns
|
|
16
12
|
if (event.key === "Escape" && this.showOverflowMenu) {
|
|
17
13
|
this.showOverflowMenu = false;
|
|
18
|
-
|
|
14
|
+
// Return focus to the button that opened the menu
|
|
15
|
+
if (this.overflowButton) {
|
|
16
|
+
this.overflowButton.focus();
|
|
17
|
+
}
|
|
19
18
|
}
|
|
20
19
|
};
|
|
21
20
|
this.handleScroll = () => {
|
|
@@ -45,81 +44,23 @@ export class PtcSubnavV2 {
|
|
|
45
44
|
// Only update if different from current active
|
|
46
45
|
if (activeSection !== this.currentActive) {
|
|
47
46
|
this.currentActive = activeSection;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const rect = this.el.getBoundingClientRect();
|
|
55
|
-
this.originalTop = rect.top + window.scrollY;
|
|
56
|
-
};
|
|
57
|
-
this.handleStickyScroll = () => {
|
|
58
|
-
// Throttle sticky scroll events for better performance
|
|
59
|
-
if (this.stickyScrollTimeout) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
this.stickyScrollTimeout = window.setTimeout(() => {
|
|
63
|
-
var _a;
|
|
64
|
-
const scrollY = window.scrollY;
|
|
65
|
-
// Check if we should make the subnav sticky
|
|
66
|
-
const shouldBeSticky = scrollY >= this.originalTop;
|
|
67
|
-
if (shouldBeSticky && !this.isSticky) {
|
|
68
|
-
// Store the original height before making it fixed
|
|
69
|
-
const originalHeight = this.el.offsetHeight;
|
|
70
|
-
// Create placeholder element to maintain space
|
|
71
|
-
this.placeholderElement = document.createElement("div");
|
|
72
|
-
this.placeholderElement.style.height = `${originalHeight}px`;
|
|
73
|
-
this.placeholderElement.style.width = "100%";
|
|
74
|
-
this.placeholderElement.style.pointerEvents = "none";
|
|
75
|
-
// Insert placeholder before the subnav
|
|
76
|
-
(_a = this.el.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(this.placeholderElement, this.el);
|
|
77
|
-
// Add transition class for smooth animation
|
|
78
|
-
this.el.classList.add("sticky-transition");
|
|
79
|
-
// Apply fixed positioning with smooth transition
|
|
80
|
-
this.el.style.position = "fixed";
|
|
81
|
-
this.el.style.top = "0";
|
|
82
|
-
this.el.style.left = "0";
|
|
83
|
-
this.el.style.right = "0";
|
|
84
|
-
this.el.style.width = "100%";
|
|
85
|
-
this.el.style.zIndex = "105";
|
|
86
|
-
this.el.style.transform = "translateY(0)";
|
|
87
|
-
this.isSticky = true;
|
|
88
|
-
}
|
|
89
|
-
else if (!shouldBeSticky && this.isSticky) {
|
|
90
|
-
// Remove transition class and reset transform
|
|
91
|
-
this.el.classList.remove("sticky-transition");
|
|
92
|
-
this.el.style.transform = "";
|
|
93
|
-
// Remove fixed positioning and restore original position
|
|
94
|
-
this.el.style.position = "";
|
|
95
|
-
this.el.style.top = "";
|
|
96
|
-
this.el.style.left = "";
|
|
97
|
-
this.el.style.right = "";
|
|
98
|
-
this.el.style.width = "";
|
|
99
|
-
this.el.style.zIndex = "";
|
|
100
|
-
this.isSticky = false;
|
|
101
|
-
// Remove placeholder element
|
|
102
|
-
if (this.placeholderElement) {
|
|
103
|
-
this.placeholderElement.remove();
|
|
104
|
-
this.placeholderElement = null;
|
|
47
|
+
// Update mobile selected item if in mobile mode
|
|
48
|
+
if (this.isMobile) {
|
|
49
|
+
const activeItem = navItems.find((item) => item.id === activeSection);
|
|
50
|
+
if (activeItem) {
|
|
51
|
+
this.selectedMobileItem = activeItem;
|
|
52
|
+
}
|
|
105
53
|
}
|
|
106
54
|
}
|
|
107
|
-
this.
|
|
55
|
+
this.scrollThrottleTimeout = null;
|
|
108
56
|
}, 16); // ~60fps throttling
|
|
109
57
|
};
|
|
110
58
|
this.handleResize = () => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
else if (this.placeholderElement) {
|
|
117
|
-
// Update placeholder height if sticky and resized
|
|
118
|
-
const currentHeight = this.el.offsetHeight;
|
|
119
|
-
this.placeholderElement.style.height = `${currentHeight}px`;
|
|
120
|
-
// Update originalTop based on placeholder position (layout may have changed)
|
|
121
|
-
const placeholderRect = this.placeholderElement.getBoundingClientRect();
|
|
122
|
-
this.originalTop = placeholderRect.top + window.scrollY;
|
|
59
|
+
if (this.navContainer) {
|
|
60
|
+
// Add a small delay to ensure DOM has been updated
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
this.calculateVisibleItems();
|
|
63
|
+
}, 10);
|
|
123
64
|
}
|
|
124
65
|
};
|
|
125
66
|
this.setupIntersectionObserver = () => {
|
|
@@ -156,6 +97,13 @@ export class PtcSubnavV2 {
|
|
|
156
97
|
const sectionId = mostVisibleSection.target.id;
|
|
157
98
|
if (sectionId && sectionId !== this.currentActive) {
|
|
158
99
|
this.currentActive = sectionId;
|
|
100
|
+
// Update mobile selected item if in mobile mode
|
|
101
|
+
if (this.isMobile) {
|
|
102
|
+
const activeItem = navItems.find((item) => item.id === sectionId);
|
|
103
|
+
if (activeItem) {
|
|
104
|
+
this.selectedMobileItem = activeItem;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
159
107
|
}
|
|
160
108
|
}
|
|
161
109
|
}, 100); // Increased debounce time for better performance
|
|
@@ -172,76 +120,80 @@ export class PtcSubnavV2 {
|
|
|
172
120
|
}
|
|
173
121
|
});
|
|
174
122
|
};
|
|
175
|
-
this.setupResizeObserver = () => {
|
|
176
|
-
// Observe the parent element for layout changes
|
|
177
|
-
this.resizeObserver = new ResizeObserver(() => {
|
|
178
|
-
// Recalculate sticky position when parent layout changes
|
|
179
|
-
if (!this.isSticky) {
|
|
180
|
-
this.initializeStickyPosition();
|
|
181
|
-
}
|
|
182
|
-
else if (this.placeholderElement) {
|
|
183
|
-
// If sticky, update originalTop based on placeholder position
|
|
184
|
-
const placeholderRect = this.placeholderElement.getBoundingClientRect();
|
|
185
|
-
this.originalTop = placeholderRect.top + window.scrollY;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
// Observe the element's parent or the element itself
|
|
189
|
-
if (this.el.parentElement) {
|
|
190
|
-
this.resizeObserver.observe(this.el.parentElement);
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
123
|
this.extractNavItemsFromSlots = () => {
|
|
124
|
+
// Look for slot content with nav-items in the light DOM
|
|
194
125
|
const slotElement = this.el.querySelector('[slot="nav-items"]');
|
|
195
|
-
if (
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
})
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
126
|
+
if (slotElement) {
|
|
127
|
+
const links = slotElement.querySelectorAll("a");
|
|
128
|
+
const items = Array.from(links)
|
|
129
|
+
.map((link) => {
|
|
130
|
+
var _a, _b;
|
|
131
|
+
return ({
|
|
132
|
+
id: ((_a = link.getAttribute("href")) === null || _a === void 0 ? void 0 : _a.substring(1)) || "",
|
|
133
|
+
label: ((_b = link.textContent) === null || _b === void 0 ? void 0 : _b.trim()) || "",
|
|
134
|
+
title: link.getAttribute("title") || "",
|
|
135
|
+
trackerId: link.getAttribute("tracker-id") || "",
|
|
136
|
+
});
|
|
137
|
+
})
|
|
138
|
+
.filter((item) => item.id && item.label);
|
|
139
|
+
if (items.length > 0) {
|
|
140
|
+
return items;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
210
144
|
};
|
|
211
145
|
this.getNavItems = () => {
|
|
212
|
-
// Return cached items if available
|
|
213
|
-
if (this.cachedNavItems) {
|
|
214
|
-
return this.cachedNavItems;
|
|
215
|
-
}
|
|
216
146
|
// Extract navigation items from slots (SEO-friendly approach)
|
|
217
147
|
const slotItems = this.extractNavItemsFromSlots();
|
|
218
148
|
if (slotItems) {
|
|
219
|
-
this.cachedNavItems = slotItems;
|
|
220
149
|
return slotItems;
|
|
221
150
|
}
|
|
222
151
|
// If navItems prop is provided, parse and use it (fallback)
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
152
|
+
if (this.navItems && this.navItems.trim()) {
|
|
153
|
+
try {
|
|
154
|
+
const parsedItems = JSON.parse(this.navItems);
|
|
155
|
+
// Validate that it's an array with proper structure
|
|
156
|
+
if (Array.isArray(parsedItems) && parsedItems.length > 0) {
|
|
157
|
+
// Ensure each item has required properties
|
|
158
|
+
const validItems = parsedItems.filter((item) => item &&
|
|
159
|
+
typeof item.id === "string" &&
|
|
160
|
+
typeof item.label === "string");
|
|
161
|
+
if (validItems.length > 0) {
|
|
162
|
+
return validItems;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
console.warn("Invalid navItems JSON provided to ptc-subnav-v2:", error);
|
|
168
|
+
}
|
|
227
169
|
}
|
|
228
170
|
// Return empty array if no navigation items found
|
|
229
171
|
console.warn("No navigation items found in slots or props for ptc-subnav-v2");
|
|
230
172
|
return [];
|
|
231
173
|
};
|
|
174
|
+
this.calculateMobileDropdownItems = () => {
|
|
175
|
+
const navItems = this.getNavItems();
|
|
176
|
+
// Handle case where no navigation items are found
|
|
177
|
+
if (navItems.length === 0) {
|
|
178
|
+
this.mobileDropdownItems = [];
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const currentItem = this.selectedMobileItem || {
|
|
182
|
+
id: this.currentActive,
|
|
183
|
+
};
|
|
184
|
+
// Filter out the currently selected item from all nav items
|
|
185
|
+
this.mobileDropdownItems = navItems.filter((item) => item.id !== currentItem.id);
|
|
186
|
+
};
|
|
232
187
|
this.hasActiveOverflowItem = () => {
|
|
233
188
|
return this.overflowItems.some((item) => item.id === this.currentActive);
|
|
234
189
|
};
|
|
235
|
-
this.hasSubnavMenuRightContent = () => {
|
|
236
|
-
const slotElement = this.el.querySelector('[slot="subnav-menu-right"]');
|
|
237
|
-
return Boolean(slotElement === null || slotElement === void 0 ? void 0 : slotElement.children.length);
|
|
238
|
-
};
|
|
239
190
|
this.calculateVisibleItems = () => {
|
|
240
191
|
const navItems = this.getNavItems();
|
|
241
192
|
// Handle case where no navigation items are found
|
|
242
193
|
if (navItems.length === 0) {
|
|
243
194
|
this.visibleItems = [];
|
|
244
195
|
this.overflowItems = [];
|
|
196
|
+
this.selectedMobileItem = null;
|
|
245
197
|
return;
|
|
246
198
|
}
|
|
247
199
|
// Check if we're in mobile mode (below 767px)
|
|
@@ -255,6 +207,7 @@ export class PtcSubnavV2 {
|
|
|
255
207
|
// On mobile, show only the current active item
|
|
256
208
|
const activeItem = navItems.find((item) => item.id === this.currentActive) ||
|
|
257
209
|
navItems[0];
|
|
210
|
+
this.selectedMobileItem = activeItem;
|
|
258
211
|
this.visibleItems = [activeItem];
|
|
259
212
|
this.overflowItems = navItems.filter((item) => item.id !== activeItem.id);
|
|
260
213
|
}
|
|
@@ -275,21 +228,19 @@ export class PtcSubnavV2 {
|
|
|
275
228
|
}
|
|
276
229
|
let visibleCount = 0;
|
|
277
230
|
let totalWidth = 0;
|
|
278
|
-
// Create
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
document.body.appendChild(this.measurementElement);
|
|
288
|
-
}
|
|
231
|
+
// Create temporary elements to measure width
|
|
232
|
+
const tempContainer = document.createElement("div");
|
|
233
|
+
tempContainer.style.position = "absolute";
|
|
234
|
+
tempContainer.style.visibility = "hidden";
|
|
235
|
+
tempContainer.style.whiteSpace = "nowrap";
|
|
236
|
+
tempContainer.style.fontSize = "14px";
|
|
237
|
+
tempContainer.style.fontWeight = "700";
|
|
238
|
+
tempContainer.style.padding = "20px 0 17px 0";
|
|
239
|
+
document.body.appendChild(tempContainer);
|
|
289
240
|
for (let i = 0; i < navItems.length; i++) {
|
|
290
241
|
const item = navItems[i];
|
|
291
|
-
|
|
292
|
-
const itemWidth =
|
|
242
|
+
tempContainer.textContent = item.label;
|
|
243
|
+
const itemWidth = tempContainer.offsetWidth + 32; // 32px for gap
|
|
293
244
|
if (totalWidth + itemWidth <= availableWidth) {
|
|
294
245
|
totalWidth += itemWidth;
|
|
295
246
|
visibleCount++;
|
|
@@ -298,6 +249,7 @@ export class PtcSubnavV2 {
|
|
|
298
249
|
break;
|
|
299
250
|
}
|
|
300
251
|
}
|
|
252
|
+
document.body.removeChild(tempContainer);
|
|
301
253
|
this.visibleItems = navItems.slice(0, visibleCount);
|
|
302
254
|
this.overflowItems = navItems.slice(visibleCount);
|
|
303
255
|
}
|
|
@@ -306,27 +258,19 @@ export class PtcSubnavV2 {
|
|
|
306
258
|
};
|
|
307
259
|
this.toggleOverflowMenu = () => {
|
|
308
260
|
this.showOverflowMenu = !this.showOverflowMenu;
|
|
309
|
-
// After opening, measure and decide alignment to avoid viewport overflow
|
|
310
|
-
if (!this.showOverflowMenu) {
|
|
311
|
-
return;
|
|
312
|
-
}
|
|
313
|
-
requestAnimationFrame(() => {
|
|
314
|
-
const container = this.overflowMenuContainer;
|
|
315
|
-
const dropdown = this.overflowDropdownEl;
|
|
316
|
-
if (!container || !dropdown)
|
|
317
|
-
return;
|
|
318
|
-
const containerRect = container.getBoundingClientRect();
|
|
319
|
-
// Default positioning is right: -2px inside container
|
|
320
|
-
const dropdownWidth = dropdown.offsetWidth || 0;
|
|
321
|
-
const rightEdge = containerRect.right + 2;
|
|
322
|
-
const leftEdge = rightEdge - dropdownWidth;
|
|
323
|
-
// If left edge would be off the viewport, flip to left aligned
|
|
324
|
-
this.overflowDropdownAlignLeft = leftEdge < 8; // keep a small gutter
|
|
325
|
-
});
|
|
326
261
|
};
|
|
327
262
|
this.handleNavClick = (event, section) => {
|
|
328
263
|
event.preventDefault();
|
|
329
264
|
this.currentActive = section;
|
|
265
|
+
// Update mobile selected item if in mobile mode
|
|
266
|
+
if (this.isMobile) {
|
|
267
|
+
const navItems = this.getNavItems();
|
|
268
|
+
const activeItem = navItems.find((item) => item.id === section);
|
|
269
|
+
if (activeItem) {
|
|
270
|
+
this.selectedMobileItem = activeItem;
|
|
271
|
+
this.calculateMobileDropdownItems();
|
|
272
|
+
}
|
|
273
|
+
}
|
|
330
274
|
// Set manual navigation flag to prevent intersection observer from overriding
|
|
331
275
|
this.isManualNavigation = true;
|
|
332
276
|
// Clear any existing manual navigation timeout
|
|
@@ -344,19 +288,12 @@ export class PtcSubnavV2 {
|
|
|
344
288
|
composed: true,
|
|
345
289
|
});
|
|
346
290
|
this.el.dispatchEvent(customEvent);
|
|
347
|
-
// Smooth scroll to section if it exists
|
|
291
|
+
// Smooth scroll to section if it exists
|
|
348
292
|
const targetElement = document.querySelector(`#${section}`);
|
|
349
293
|
if (targetElement) {
|
|
350
|
-
|
|
351
|
-
const navHeight = this.el.offsetHeight;
|
|
352
|
-
// Calculate the target position with offset
|
|
353
|
-
const targetPosition = targetElement.getBoundingClientRect().top +
|
|
354
|
-
window.scrollY -
|
|
355
|
-
navHeight;
|
|
356
|
-
// Smooth scroll to the adjusted position
|
|
357
|
-
window.scrollTo({
|
|
358
|
-
top: targetPosition,
|
|
294
|
+
targetElement.scrollIntoView({
|
|
359
295
|
behavior: "smooth",
|
|
296
|
+
block: "start",
|
|
360
297
|
});
|
|
361
298
|
}
|
|
362
299
|
};
|
|
@@ -366,113 +303,75 @@ export class PtcSubnavV2 {
|
|
|
366
303
|
this.visibleItems = [];
|
|
367
304
|
this.overflowItems = [];
|
|
368
305
|
this.showOverflowMenu = false;
|
|
369
|
-
this.
|
|
306
|
+
this.containerWidth = 0;
|
|
370
307
|
this.isMobile = false;
|
|
308
|
+
this.selectedMobileItem = null;
|
|
371
309
|
this.isManualNavigation = false;
|
|
310
|
+
this.mobileDropdownItems = [];
|
|
372
311
|
}
|
|
373
312
|
componentWillLoad() {
|
|
374
313
|
this.currentActive = this.activeSection;
|
|
314
|
+
// Initialize selected mobile item with the current active section
|
|
315
|
+
const navItems = this.getNavItems();
|
|
316
|
+
if (navItems.length > 0) {
|
|
317
|
+
this.selectedMobileItem =
|
|
318
|
+
navItems.find((item) => item.id === this.activeSection) ||
|
|
319
|
+
navItems[0];
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
this.selectedMobileItem = null;
|
|
323
|
+
}
|
|
324
|
+
this.calculateMobileDropdownItems();
|
|
375
325
|
}
|
|
376
326
|
componentDidLoad() {
|
|
377
|
-
|
|
378
|
-
this.handleResize();
|
|
379
|
-
this.addEventListeners();
|
|
380
|
-
this.setupIntersectionObserver();
|
|
381
|
-
this.setupResizeObserver();
|
|
382
|
-
this.initializeStickyPosition();
|
|
383
|
-
}
|
|
384
|
-
bindEventHandlers() {
|
|
327
|
+
// Bind the functions once
|
|
385
328
|
this.boundHandleResize = this.handleResize.bind(this);
|
|
386
329
|
this.boundHandleClickOutside = this.handleClickOutside.bind(this);
|
|
387
330
|
this.boundHandleScroll = this.handleScroll.bind(this);
|
|
388
331
|
this.boundHandleKeyDown = this.handleKeyDown.bind(this);
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
332
|
+
// Recalculate navigation items in case slots are used
|
|
333
|
+
this.calculateMobileDropdownItems();
|
|
334
|
+
this.handleResize();
|
|
392
335
|
window.addEventListener("resize", this.boundHandleResize);
|
|
393
336
|
document.addEventListener("click", this.boundHandleClickOutside);
|
|
394
337
|
document.addEventListener("keydown", this.boundHandleKeyDown);
|
|
338
|
+
// Setup intersection observer for scroll-based active state
|
|
339
|
+
this.setupIntersectionObserver();
|
|
340
|
+
// Add scroll listener as fallback
|
|
395
341
|
window.addEventListener("scroll", this.boundHandleScroll, {
|
|
396
342
|
passive: true,
|
|
397
343
|
});
|
|
398
|
-
window.addEventListener("scroll", this.boundHandleStickyScroll, {
|
|
399
|
-
passive: true,
|
|
400
|
-
});
|
|
401
344
|
}
|
|
402
345
|
disconnectedCallback() {
|
|
403
|
-
this.removeEventListeners();
|
|
404
|
-
this.cleanupTimeouts();
|
|
405
|
-
this.cleanupIntersectionObserver();
|
|
406
|
-
this.cleanupResizeObserver();
|
|
407
|
-
this.cleanupElements();
|
|
408
|
-
}
|
|
409
|
-
removeEventListeners() {
|
|
410
346
|
window.removeEventListener("resize", this.boundHandleResize);
|
|
411
347
|
document.removeEventListener("click", this.boundHandleClickOutside);
|
|
412
348
|
document.removeEventListener("keydown", this.boundHandleKeyDown);
|
|
413
349
|
window.removeEventListener("scroll", this.boundHandleScroll);
|
|
414
|
-
|
|
415
|
-
}
|
|
416
|
-
cleanupTimeouts() {
|
|
417
|
-
if (this.scrollTimeout)
|
|
418
|
-
clearTimeout(this.scrollTimeout);
|
|
419
|
-
if (this.scrollThrottleTimeout)
|
|
420
|
-
clearTimeout(this.scrollThrottleTimeout);
|
|
421
|
-
if (this.manualNavigationTimeout)
|
|
422
|
-
clearTimeout(this.manualNavigationTimeout);
|
|
423
|
-
if (this.stickyScrollTimeout)
|
|
424
|
-
clearTimeout(this.stickyScrollTimeout);
|
|
425
|
-
}
|
|
426
|
-
cleanupIntersectionObserver() {
|
|
350
|
+
// Clean up intersection observer
|
|
427
351
|
if (this.intersectionObserver) {
|
|
428
352
|
this.intersectionObserver.disconnect();
|
|
429
353
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
this.resizeObserver.disconnect();
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
cleanupElements() {
|
|
437
|
-
if (this.placeholderElement) {
|
|
438
|
-
this.placeholderElement.remove();
|
|
439
|
-
this.placeholderElement = null;
|
|
440
|
-
}
|
|
441
|
-
if (this.measurementElement) {
|
|
442
|
-
this.measurementElement.remove();
|
|
443
|
-
this.measurementElement = null;
|
|
354
|
+
// Clean up scroll timeout
|
|
355
|
+
if (this.scrollTimeout) {
|
|
356
|
+
clearTimeout(this.scrollTimeout);
|
|
444
357
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
if (!((_a = this.navItems) === null || _a === void 0 ? void 0 : _a.trim()))
|
|
449
|
-
return null;
|
|
450
|
-
try {
|
|
451
|
-
const parsedItems = JSON.parse(this.navItems);
|
|
452
|
-
if (Array.isArray(parsedItems) && parsedItems.length > 0) {
|
|
453
|
-
const validItems = parsedItems.filter((item) => Boolean(item &&
|
|
454
|
-
typeof item.id === "string" &&
|
|
455
|
-
typeof item.label === "string"));
|
|
456
|
-
return validItems.length > 0 ? validItems : null;
|
|
457
|
-
}
|
|
358
|
+
// Clean up scroll throttle timeout
|
|
359
|
+
if (this.scrollThrottleTimeout) {
|
|
360
|
+
clearTimeout(this.scrollThrottleTimeout);
|
|
458
361
|
}
|
|
459
|
-
|
|
460
|
-
|
|
362
|
+
// Clean up manual navigation timeout
|
|
363
|
+
if (this.manualNavigationTimeout) {
|
|
364
|
+
clearTimeout(this.manualNavigationTimeout);
|
|
461
365
|
}
|
|
462
|
-
return null;
|
|
463
366
|
}
|
|
464
367
|
render() {
|
|
368
|
+
var _a, _b;
|
|
465
369
|
const navItems = this.getNavItems();
|
|
466
|
-
const hasRightContent = this.hasSubnavMenuRightContent();
|
|
467
|
-
const selectedMobileItem = this.isMobile
|
|
468
|
-
? navItems.find((item) => item.id === this.currentActive) ||
|
|
469
|
-
navItems[0]
|
|
470
|
-
: null;
|
|
471
370
|
// If no navigation items, don't render the navigation
|
|
472
371
|
if (navItems.length === 0) {
|
|
473
|
-
return (h(Host, null, h("div", { class:
|
|
372
|
+
return (h(Host, null, h("div", { class: "subnav-container" }, h("div", { class: "subnav-menu-right" }, h("slot", { name: "subnav-menu-right" })))));
|
|
474
373
|
}
|
|
475
|
-
return (h(Host, null, h("div", { class:
|
|
374
|
+
return (h(Host, null, h("div", { class: "subnav-container" }, h("nav", { class: "subnav-menu-left", role: "navigation", "aria-label": "Sub navigation", ref: (el) => (this.navContainer = el) }, this.isMobile ? (
|
|
476
375
|
// Mobile layout - dropdown with arrows
|
|
477
376
|
h("div", { class: "mobile-dropdown-container" }, h("button", { class: "mobile-dropdown-button", onClick: this.toggleOverflowMenu, onKeyDown: (e) => {
|
|
478
377
|
if (e.key === "Enter" ||
|
|
@@ -480,31 +379,32 @@ export class PtcSubnavV2 {
|
|
|
480
379
|
e.preventDefault();
|
|
481
380
|
this.toggleOverflowMenu();
|
|
482
381
|
}
|
|
483
|
-
}, "aria-expanded": this.showOverflowMenu, "aria-haspopup": "true", "aria-label": `${(selectedMobileItem === null ||
|
|
484
|
-
"Select Section"), h("span", { class: `mobile-arrow ${this.showOverflowMenu ? "rotated" : ""}`, "aria-hidden": "true" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", "aria-hidden": "true" }, h("path", { d: "M1 1.5L5.94975 6.44975L10.8995 1.5", stroke: "#00890B", "stroke-width": "2", "stroke-linecap": "round" })))), this.showOverflowMenu && (h("ul", { class: "mobile-dropdown", role: "menu", "aria-label": "Navigation sections" },
|
|
485
|
-
|
|
382
|
+
}, "aria-expanded": this.showOverflowMenu, "aria-haspopup": "true", "aria-label": `${((_a = this.selectedMobileItem) === null || _a === void 0 ? void 0 : _a.label) || "Select Section"} - Choose navigation section`, "tracker-id": "mobile-dropdown-button", ref: (el) => (this.overflowButton = el) }, h("span", { class: "mobile-selected-item" }, ((_b = this.selectedMobileItem) === null || _b === void 0 ? void 0 : _b.label) ||
|
|
383
|
+
"Select Section"), h("span", { class: `mobile-arrow ${this.showOverflowMenu ? "rotated" : ""}`, "aria-hidden": "true" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", "aria-hidden": "true" }, h("path", { d: "M1 1.5L5.94975 6.44975L10.8995 1.5", stroke: "#00890B", "stroke-width": "2", "stroke-linecap": "round" })))), this.showOverflowMenu && (h("ul", { class: "mobile-dropdown", role: "menu", "aria-label": "Navigation sections" }, this.mobileDropdownItems.map((item) => (h("li", { key: item.id }, h("a", { href: `#${item.id}`, class: `mobile-dropdown-item mf-listen ${this
|
|
384
|
+
.currentActive ===
|
|
486
385
|
item.id
|
|
487
386
|
? "active"
|
|
488
|
-
: ""}`, role: "menuitem", "aria-current": this
|
|
387
|
+
: ""}`, role: "menuitem", "aria-current": this
|
|
388
|
+
.currentActive ===
|
|
489
389
|
item.id
|
|
490
390
|
? "page"
|
|
491
|
-
: undefined,
|
|
391
|
+
: undefined, "tracker-id": item.trackerId ||
|
|
392
|
+
`mobile-nav-${item.id}`, title: item.title || "", onClick: (e) => {
|
|
492
393
|
this.handleNavClick(e, item.id);
|
|
493
394
|
this.showOverflowMenu = false;
|
|
494
395
|
} }, item.label)))))))) : (
|
|
495
396
|
// Desktop layout - original behavior
|
|
496
|
-
h("ul", { class: "desktop-menu" }, this.visibleItems.map((item) => (h("li", { key: item.id, class: "mf-listen", id: item.trackerId || `nav-${item.id}` }, h("a", { href: `#${item.id}`, class: this.currentActive === item.id
|
|
397
|
+
h("ul", { class: "desktop-menu" }, this.visibleItems.map((item) => (h("li", { key: item.id, class: "mf-listen", "tracker-id": item.trackerId || `nav-${item.id}` }, h("a", { href: `#${item.id}`, class: this.currentActive === item.id
|
|
497
398
|
? "active"
|
|
498
399
|
: "", title: item.title || "", onClick: (e) => this.handleNavClick(e, item.id), "aria-current": this.currentActive === item.id
|
|
499
400
|
? "page"
|
|
500
|
-
: undefined }, item.label)))), this.overflowItems.length > 0 && (h("li", { class: "overflow-menu-container mf-listen", id: "overflow-menu"
|
|
401
|
+
: undefined }, item.label)))), this.overflowItems.length > 0 && (h("li", { class: "overflow-menu-container mf-listen", "tracker-id": "overflow-menu" }, h("button", { class: `overflow-button ${this.hasActiveOverflowItem() ? "selected-active" : ""}`, onClick: this.toggleOverflowMenu, onKeyDown: (e) => {
|
|
501
402
|
if (e.key === "Enter" ||
|
|
502
403
|
e.key === " ") {
|
|
503
404
|
e.preventDefault();
|
|
504
405
|
this.toggleOverflowMenu();
|
|
505
406
|
}
|
|
506
|
-
}, "aria-expanded": this.showOverflowMenu, "aria-haspopup": "true", "aria-label": "Show more navigation items", "tracker-id": "overflow-button", ref: (el) => (this.overflowButton = el) }, h("span", { class: "overflow-dots", "aria-hidden": "true" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", "aria-hidden": "true" }, h("circle", { cx: "1.25", cy: "5", r: "1.25", fill: "#617480" }), h("circle", { cx: "5", cy: "5", r: "1.25", fill: "#617480" }), h("circle", { cx: "8.75", cy: "5", r: "1.25", fill: "#617480" })))), this.showOverflowMenu && (h("div", { class:
|
|
507
|
-
el) }, this.overflowItems.map((item) => (h("a", { key: item.id, href: `#${item.id}`, class: `mf-listen ${this
|
|
407
|
+
}, "aria-expanded": this.showOverflowMenu, "aria-haspopup": "true", "aria-label": "Show more navigation items", "tracker-id": "overflow-button", ref: (el) => (this.overflowButton = el) }, h("span", { class: "overflow-dots", "aria-hidden": "true" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", "aria-hidden": "true" }, h("circle", { cx: "1.25", cy: "5", r: "1.25", fill: "#617480" }), h("circle", { cx: "5", cy: "5", r: "1.25", fill: "#617480" }), h("circle", { cx: "8.75", cy: "5", r: "1.25", fill: "#617480" })))), this.showOverflowMenu && (h("div", { class: "overflow-dropdown", role: "menu", "aria-label": "Additional navigation sections" }, this.overflowItems.map((item) => (h("a", { key: item.id, href: `#${item.id}`, class: `mf-listen ${this
|
|
508
408
|
.currentActive ===
|
|
509
409
|
item.id
|
|
510
410
|
? "active"
|
|
@@ -516,7 +416,7 @@ export class PtcSubnavV2 {
|
|
|
516
416
|
.currentActive ===
|
|
517
417
|
item.id
|
|
518
418
|
? "page"
|
|
519
|
-
: undefined }, item.label)))))))))),
|
|
419
|
+
: undefined }, item.label)))))))))), h("div", { class: "subnav-menu-right" }, h("slot", { name: "subnav-menu-right" })))));
|
|
520
420
|
}
|
|
521
421
|
static get is() { return "ptc-subnav-v2"; }
|
|
522
422
|
static get encapsulation() { return "shadow"; }
|
|
@@ -576,9 +476,11 @@ export class PtcSubnavV2 {
|
|
|
576
476
|
"visibleItems": {},
|
|
577
477
|
"overflowItems": {},
|
|
578
478
|
"showOverflowMenu": {},
|
|
579
|
-
"
|
|
479
|
+
"containerWidth": {},
|
|
580
480
|
"isMobile": {},
|
|
581
|
-
"
|
|
481
|
+
"selectedMobileItem": {},
|
|
482
|
+
"isManualNavigation": {},
|
|
483
|
+
"mobileDropdownItems": {}
|
|
582
484
|
};
|
|
583
485
|
}
|
|
584
486
|
static get elementRef() { return "el"; }
|
|
@@ -204,15 +204,13 @@ export class PtcTextfield {
|
|
|
204
204
|
this.helpertext = await this.getValidationMessage("tel");
|
|
205
205
|
}
|
|
206
206
|
else if (!this.iti.isValidNumber()) {
|
|
207
|
-
this.helpertext =
|
|
208
|
-
await this.getValidationMessage("validtel");
|
|
207
|
+
this.helpertext = await this.getValidationMessage("validtel");
|
|
209
208
|
}
|
|
210
209
|
}
|
|
211
210
|
}
|
|
212
211
|
else if (this.fieldId === "confirm-email") {
|
|
213
212
|
if (!this.matchStatus && !!this.customInput.value) {
|
|
214
|
-
this.helpertext =
|
|
215
|
-
await this.getValidationMessage("confirmemail");
|
|
213
|
+
this.helpertext = await this.getValidationMessage("confirmemail");
|
|
216
214
|
}
|
|
217
215
|
}
|
|
218
216
|
}
|
|
@@ -568,7 +566,7 @@ export class PtcTextfield {
|
|
|
568
566
|
"type": "unknown",
|
|
569
567
|
"mutable": false,
|
|
570
568
|
"complexType": {
|
|
571
|
-
"original": "(\r\n\t\tinput: HTMLInputElement | HTMLTextAreaElement
|
|
569
|
+
"original": "(\r\n\t\tinput: HTMLInputElement | HTMLTextAreaElement\r\n\t) => string",
|
|
572
570
|
"resolved": "(input: HTMLInputElement | HTMLTextAreaElement) => string",
|
|
573
571
|
"references": {
|
|
574
572
|
"HTMLInputElement": {
|