初始化

This commit is contained in:
yuding
2025-12-24 19:02:34 +08:00
parent 4b5eb78bbb
commit 04a5e74284
51 changed files with 8576 additions and 5334 deletions

165
dist/index.d.ts vendored
View File

@@ -27,6 +27,10 @@ declare class BimButtonGroup implements IBimComponent {
* 应用样式到容器
*/
private applyStyles;
/**
* 设置主题的primary颜色用于边框等
*/
private setPrimaryColor;
/**
* 设置主题颜色
* 只会应用到没有被用户自定义的颜色属性上
@@ -52,6 +56,11 @@ declare class BimButtonGroup implements IBimComponent {
*/
setBtnActive(id: string, active?: boolean): void;
private handleClick;
/**
* 互斥关闭同范围内的其它已激活按钮,并触发它们的 onClick
* @param button 当前被激活的按钮
*/
private deactivateExclusiveSiblings;
private handleMouseEnter;
private handleMouseLeave;
private showDropdown;
@@ -179,6 +188,9 @@ export declare class BimEngine extends EventEmitter {
rightKey: RightKeyManager | null;
propertyPanel: PropertyPanelManager | null;
measure: MeasureDialogManager | null;
sectionPlane: SectionPlaneDialogManager | null;
sectionAxis: SectionAxisDialogManager | null;
sectionBox: SectionBoxDialogManager | null;
constructor(container: HTMLElement | string, options?: {
locale?: LocaleType;
theme?: ThemeType;
@@ -269,6 +281,18 @@ export declare interface ButtonConfig {
label: string;
icon?: string;
keepActive?: boolean;
/**
* 是否互斥(开关互斥)
*
* 行为说明:
* - 当按钮从“未激活”切换到“激活”时,如果该按钮开启了 exclusive
* 会自动关闭同互斥范围内的其它已激活按钮,并触发它们的 onClick用于执行关闭逻辑
* - 一级按钮:互斥范围 = 同 groupId 下的一级按钮
* - 二级按钮:互斥范围 = 同 groupId 且同 parentId 下的二级按钮
*
* 注意:该能力通常与 keepActive 搭配使用。
*/
exclusive?: boolean;
isActive?: boolean;
disabled?: boolean;
onClick?: (button: OptButton) => void;
@@ -717,10 +741,11 @@ declare class MeasureDialogManager extends BimComponent {
*/
switchMode(mode: MeasureMode): void;
/**
* 设置测量结果(由外部注入,仅用于显示
* 设置测量结果(推荐使用的新方法名
* 说明:内部直接调用 MeasurePanel.setResult()
* @param result 测量结果;传 null 表示清空
*/
setResult(result: MeasureResult | null): void;
setMeasureResult(result: MeasureResult | null): void;
/**
* 获取测量配置(单位/精度)
* - 如果面板存在:返回面板当前配置
@@ -914,6 +939,142 @@ declare class RightKeyManager extends BimComponent {
private handleContextMenu;
}
/**
* 轴向类型
*/
declare type SectionAxis = 'x' | 'y' | 'z';
/**
* 轴向剖切弹窗管理器
*/
declare class SectionAxisDialogManager extends BimComponent {
private dialogId;
private dialog;
private panel;
constructor(engine: BimEngine);
init(): void;
/**
* 显示弹窗
*/
show(): void;
/**
* 隐藏弹窗
*/
hide(): void;
/**
* 获取隐藏状态
*/
getHiddenState(): boolean;
/**
* 设置隐藏状态
*/
setHiddenState(isHidden: boolean): void;
/**
* 获取当前激活的轴向
*/
getActiveAxis(): SectionAxis;
/**
* 设置激活的轴向
*/
setActiveAxis(axis: SectionAxis): void;
/**
* 销毁弹窗和面板
*/
destroy(): void;
}
/**
* 剖切盒轴向范围
*/
declare interface SectionBoxAxisRange {
/** 最小值0-100的百分比 */
min: number;
/** 最大值0-100的百分比 */
max: number;
}
/**
* 剖切盒弹窗管理器
*/
declare class SectionBoxDialogManager extends BimComponent {
private dialogId;
private dialog;
private panel;
constructor(engine: BimEngine);
init(): void;
/**
* 显示弹窗
*/
show(): void;
/**
* 隐藏弹窗
*/
hide(): void;
/**
* 获取隐藏状态
*/
getHiddenState(): boolean;
/**
* 设置隐藏状态
*/
setHiddenState(isHidden: boolean): void;
/**
* 获取反向状态
*/
getReversedState(): boolean;
/**
* 设置反向状态
*/
setReversedState(isReversed: boolean): void;
/**
* 获取范围值
*/
getRange(): SectionBoxRange | null;
/**
* 设置范围值
*/
setRange(range: Partial<SectionBoxRange>): void;
/**
* 销毁弹窗和面板
*/
destroy(): void;
}
/**
* 剖切盒范围数据
*/
declare interface SectionBoxRange {
/** X轴范围 */
x: SectionBoxAxisRange;
/** Y轴范围 */
y: SectionBoxAxisRange;
/** Z轴范围 */
z: SectionBoxAxisRange;
}
/**
* 拾取面剖切弹窗管理器
*/
declare class SectionPlaneDialogManager extends BimComponent {
private dialogId;
private dialog;
private panel;
constructor(engine: BimEngine);
init(): void;
/**
* 显示拾取面剖切弹窗
*/
show(): void;
/**
* 隐藏弹窗
*/
hide(): void;
/**
* 销毁弹窗
*/
destroy(): void;
}
/**
* 全局主题配置接口
* 定义系统通用的语义化颜色