feat(clipping): implement hide/recover toggle for all section dialogs

Update all three section dialogs to support hide/show toggle:

SectionAxisDialogManager:
- onHideToggle now calls hideSection()/recoverSection()

SectionBoxDialogManager:
- onHideToggle now calls hideSection()/recoverSection()

SectionPlanePanel:
- Add isHidden state tracking
- Change onHide to onHideToggle(isHidden)
- Add setHiddenState/getHiddenState methods
- Update button to toggle active state

SectionPlaneDialogManager:
- Switch to onHideToggle callback
- Call hideSection()/recoverSection() based on toggle state

Behavior: Click hide button to hide section, click again to recover.
This commit is contained in:
yuding
2026-02-02 16:36:17 +08:00
parent 41abd9ed67
commit 4a09d52283
44 changed files with 17877 additions and 10807 deletions

View File

@@ -14,6 +14,8 @@ export class SectionPlanePanel implements IBimComponent {
public element: HTMLElement;
private options: SectionPlanePanelOptions;
private isHidden: boolean = false;
// DOM 引用
private hideBtn!: HTMLButtonElement;
private reverseBtn!: HTMLButtonElement;
@@ -28,9 +30,23 @@ export class SectionPlanePanel implements IBimComponent {
constructor(options: SectionPlanePanelOptions = {}) {
this.options = options;
this.isHidden = options.defaultHidden ?? false;
this.element = this.createDom();
}
public setHiddenState(isHidden: boolean): void {
this.isHidden = isHidden;
this.updateButtonStates();
}
public getHiddenState(): boolean {
return this.isHidden;
}
private updateButtonStates(): void {
this.hideBtn?.classList.toggle('active', this.isHidden);
}
/**
* 初始化组件
*/
@@ -105,9 +121,9 @@ export class SectionPlanePanel implements IBimComponent {
'hide',
getIcon('隐藏'),
() => {
if (this.options.onHide) {
this.options.onHide();
}
this.isHidden = !this.isHidden;
this.updateButtonStates();
this.options.onHideToggle?.(this.isHidden);
}
);