@triptease/tt-navbar 0.0.33 → 0.0.34
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/src/TtNavbar.js +5 -0
- package/dist/src/TtNavbar.js.map +1 -1
- package/dist/test/tt-navbar.test.js +8 -0
- package/dist/test/tt-navbar.test.js.map +1 -1
- package/dist/web/Routes.js +1 -1
- package/dist/web/TtNavbar.js +5 -1
- package/dist/web/TtNavbar.js.map +2 -2
- package/dist/web/index.js +5 -1
- package/dist/web/index.js.map +2 -2
- package/dist/web/styles.js +1 -1
- package/dist/web/triptease-logo.js +1 -1
- package/dist/web/tt-navbar.js +5 -1
- package/dist/web/tt-navbar.js.map +2 -2
- package/dist/web/urlMappings.js +1 -1
- package/package.json +1 -1
- package/src/TtNavbar.ts +6 -0
- package/test/tt-navbar.test.ts +14 -0
package/dist/web/urlMappings.js
CHANGED
package/package.json
CHANGED
package/src/TtNavbar.ts
CHANGED
|
@@ -141,6 +141,12 @@ export class TtNavbar extends LitElement {
|
|
|
141
141
|
if (bestMatch) {
|
|
142
142
|
bestMatch.classList.add('current-page');
|
|
143
143
|
bestMatch.setAttribute('aria-current', 'page');
|
|
144
|
+
|
|
145
|
+
// Auto-expand parent details if the active link is within a collapsible section
|
|
146
|
+
const parentDetails = bestMatch.closest('details');
|
|
147
|
+
if (parentDetails) {
|
|
148
|
+
parentDetails.setAttribute('open', '');
|
|
149
|
+
}
|
|
144
150
|
} else {
|
|
145
151
|
console.error(`No matching nav link found for path: ${currentPath}`);
|
|
146
152
|
}
|
package/test/tt-navbar.test.ts
CHANGED
|
@@ -345,4 +345,18 @@ describe('TtNavbar', () => {
|
|
|
345
345
|
await expect(getComputedStyle(navbar).getPropertyValue('--nav-bar-width').trim()).to.equal('fit-content');
|
|
346
346
|
|
|
347
347
|
});
|
|
348
|
+
|
|
349
|
+
it('should expand the details when the current page is within that section', async () => {
|
|
350
|
+
// eslint-disable-next-line no-restricted-globals
|
|
351
|
+
history.pushState({}, '', `/parity/${CLIENT_KEY}`);
|
|
352
|
+
|
|
353
|
+
const navbar = await fixture<TtNavbar>(
|
|
354
|
+
`<tt-navbar client-key=${CLIENT_KEY}></tt-navbar>`
|
|
355
|
+
);
|
|
356
|
+
|
|
357
|
+
const marketInsightsDetails = navbar.shadowRoot!.querySelector('#market-insights') as HTMLDetailsElement;
|
|
358
|
+
|
|
359
|
+
expect(marketInsightsDetails).to.exist;
|
|
360
|
+
expect(marketInsightsDetails.open).to.be.true;
|
|
361
|
+
})
|
|
348
362
|
});
|