v3.6.2
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-01-04 - 3.6.2 - fix(wcc-sidebar)
|
||||||
|
use sidebar's internal .menu element for scroll management and expose scrollableContainer getter
|
||||||
|
|
||||||
|
- Add public scrollableContainer getter to wcc-sidebar that returns the .menu element for external scroll control
|
||||||
|
- Update wcc-dashboard to query wcc-sidebar as WccSidebar and attach scroll listeners to sidebar.scrollableContainer instead of the host element
|
||||||
|
- Restore sidebar scroll position by setting scrollTop on the scrollableContainer when applying saved positions
|
||||||
|
- TypeScript casting added to avoid nullable/implicit any issues when querying the sidebar element
|
||||||
|
|
||||||
## 2026-01-04 - 3.6.1 - fix(wcc-sidebar)
|
## 2026-01-04 - 3.6.1 - fix(wcc-sidebar)
|
||||||
sort sidebar items alphabetically and unify grouped and ungrouped items for consistent ordering
|
sort sidebar items alphabetically and unify grouped and ungrouped items for consistent ordering
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@design.estate/dees-wcctools",
|
"name": "@design.estate/dees-wcctools",
|
||||||
"version": "3.6.1",
|
"version": "3.6.2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.",
|
"description": "A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-wcctools',
|
name: '@design.estate/dees-wcctools',
|
||||||
version: '3.6.1',
|
version: '3.6.2',
|
||||||
description: 'A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.'
|
description: 'A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import './wcc-properties.js';
|
|||||||
import { type TTheme } from './wcc-properties.js';
|
import { type TTheme } from './wcc-properties.js';
|
||||||
import { breakpoints } from '@design.estate/dees-domtools';
|
import { breakpoints } from '@design.estate/dees-domtools';
|
||||||
import { WccFrame } from './wcc-frame.js';
|
import { WccFrame } from './wcc-frame.js';
|
||||||
|
import { WccSidebar } from './wcc-sidebar.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get filtered and sorted items from a section
|
* Get filtered and sorted items from a section
|
||||||
@@ -491,10 +492,10 @@ export class WccDashboard extends DeesElement {
|
|||||||
if (this.scrollListenersAttached) {
|
if (this.scrollListenersAttached) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wccFrame = await this.wccFrame;
|
const wccFrame = await this.wccFrame;
|
||||||
const wccSidebar = this.shadowRoot.querySelector('wcc-sidebar');
|
const wccSidebar = this.shadowRoot.querySelector('wcc-sidebar') as WccSidebar | null;
|
||||||
|
|
||||||
if (wccFrame) {
|
if (wccFrame) {
|
||||||
// The frame element itself is the scrollable container
|
// The frame element itself is the scrollable container
|
||||||
wccFrame.addEventListener('scroll', () => {
|
wccFrame.addEventListener('scroll', () => {
|
||||||
@@ -505,11 +506,14 @@ export class WccDashboard extends DeesElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (wccSidebar) {
|
if (wccSidebar) {
|
||||||
// The sidebar element itself is the scrollable container
|
// Use the sidebar's scrollable container (.menu element)
|
||||||
wccSidebar.addEventListener('scroll', () => {
|
const scrollContainer = wccSidebar.scrollableContainer;
|
||||||
this.sidebarScrollY = wccSidebar.scrollTop;
|
if (scrollContainer) {
|
||||||
this.debouncedScrollUpdate();
|
scrollContainer.addEventListener('scroll', () => {
|
||||||
});
|
this.sidebarScrollY = scrollContainer.scrollTop;
|
||||||
|
this.debouncedScrollUpdate();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -555,18 +559,21 @@ export class WccDashboard extends DeesElement {
|
|||||||
if (this.scrollPositionsApplied) {
|
if (this.scrollPositionsApplied) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wccFrame = await this.wccFrame;
|
const wccFrame = await this.wccFrame;
|
||||||
const wccSidebar = this.shadowRoot.querySelector('wcc-sidebar');
|
const wccSidebar = this.shadowRoot.querySelector('wcc-sidebar') as WccSidebar | null;
|
||||||
|
|
||||||
if (wccFrame && this.frameScrollY > 0) {
|
if (wccFrame && this.frameScrollY > 0) {
|
||||||
// The frame element itself is the scrollable container
|
// The frame element itself is the scrollable container
|
||||||
wccFrame.scrollTop = this.frameScrollY;
|
wccFrame.scrollTop = this.frameScrollY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wccSidebar && this.sidebarScrollY > 0) {
|
if (wccSidebar && this.sidebarScrollY > 0) {
|
||||||
// The sidebar element itself is the scrollable container
|
// Use the sidebar's scrollable container (.menu element)
|
||||||
wccSidebar.scrollTop = this.sidebarScrollY;
|
const scrollContainer = wccSidebar.scrollableContainer;
|
||||||
|
if (scrollContainer) {
|
||||||
|
scrollContainer.scrollTop = this.sidebarScrollY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.scrollPositionsApplied = true;
|
this.scrollPositionsApplied = true;
|
||||||
|
|||||||
@@ -50,6 +50,13 @@ export class WccSidebar extends DeesElement {
|
|||||||
|
|
||||||
private sectionsInitialized = false;
|
private sectionsInitialized = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the scrollable container element (.menu) for external scroll management
|
||||||
|
*/
|
||||||
|
public get scrollableContainer(): HTMLElement | null {
|
||||||
|
return this.shadowRoot?.querySelector('.menu') as HTMLElement | null;
|
||||||
|
}
|
||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet" />
|
<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet" />
|
||||||
|
|||||||
Reference in New Issue
Block a user