- Refactor to delegate logic to and - Add for manager classes - Implement dynamic styling for Toolbar (color config, CSS vars) - Implement dynamic styling for Dialog (options, CSS vars) - Add example - Add documentation for Toolbar and Dialog - Update demo to showcase new styling features
9 lines
25 KiB
JavaScript
9 lines
25 KiB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.bim-engine-wrapper{position:relative;width:100%;height:100%;font-family:sans-serif;color:#333;padding:20px;background-color:#e16969;border-radius:8px;border:1px solid #e0e0e0;box-sizing:border-box}.bim-engine-opt-btn-container{position:absolute;bottom:20px;left:50%;transform:translate(-50%);z-index:100}:root{--bim-toolbar-bg: rgba(17, 17, 17, .88);--bim-btn-bg: transparent;--bim-btn-hover-bg: #444;--bim-btn-active-bg: rgba(255, 255, 255, .15);--bim-icon-color: #ccc;--bim-icon-active-color: #fff;--bim-btn-text-color: #ccc;--bim-btn-text-active-color: #fff}.toolbar-container{display:flex;align-items:center;max-width:100%;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.toolbar-container::-webkit-scrollbar{display:none}.opt-btn-group{overflow:hidden;display:flex;align-items:center;flex-shrink:0;background-color:var(--bim-toolbar-bg);border-radius:4px;padding:4px 8px}.has-divider{margin-right:16px}.opt-btn-wrapper{position:relative}.opt-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;width:50px;min-height:50px;padding:4px;cursor:pointer;background-color:var(--bim-btn-bg);color:var(--bim-icon-color);transition:all .2s;border-bottom:2px solid transparent}.opt-btn:hover{background-color:var(--bim-btn-hover-bg);color:var(--bim-icon-active-color)}.opt-btn.active{background-color:var(--bim-btn-active-bg);color:var(--bim-icon-active-color);border-bottom:2px solid #fff}.opt-btn.disabled{opacity:.5;cursor:not-allowed}.opt-btn-icon{width:32px;height:32px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.opt-btn-icon svg{width:100%;height:100%}.opt-btn-label{font-size:10px;margin-top:2px;color:var(--bim-btn-text-color)}.opt-btn:hover .opt-btn-label,.opt-btn.active .opt-btn-label{color:var(--bim-btn-text-active-color)}.opt-btn-arrow{font-size:8px;position:absolute;top:2px;right:2px;opacity:.6;transition:transform .2s ease}.opt-btn-arrow.rotated{transform:rotate(180deg)}.opt-btn.no-label .opt-btn-arrow{top:2px;right:2px}.opt-btn-dropdown{position:fixed;transform:translate(-50%,-100%);background-color:var(--bim-toolbar-bg);border-radius:4px;overflow:hidden;box-shadow:0 4px 12px #0000004d;min-width:50px;z-index:9999;display:flex;flex-direction:column}.opt-btn-dropdown-item{display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--bim-icon-color);cursor:pointer;transition:background .2s;white-space:nowrap;min-width:50px;min-height:50px;padding:4px;background-color:var(--bim-btn-bg)}.opt-btn-dropdown-item:hover{background-color:var(--bim-btn-hover-bg);color:var(--bim-icon-active-color)}.opt-btn-dropdown-item .opt-btn-icon.small{width:30px;height:30px;margin-right:0;margin-bottom:4px}.opt-btn-dropdown-item span{font-size:10px;color:var(--bim-btn-text-color)}.opt-btn-dropdown-item:hover span{color:var(--bim-btn-text-active-color)}.opt-btn.no-label .opt-btn-icon{width:32px;height:32px}:root{--bim-dialog-bg: rgba(17, 17, 17, .95);--bim-dialog-header-bg: #2a2a2a;--bim-dialog-title-color: #fff;--bim-dialog-text-color: #ccc;--bim-dialog-border-color: #444}.bim-dialog{position:absolute;background-color:var(--bim-dialog-bg);border:1px solid var(--bim-dialog-border-color);border-radius:6px;box-shadow:0 4px 12px #0000004d;display:flex;flex-direction:column;z-index:1000;color:var(--bim-dialog-title-color);overflow:hidden;min-width:200px;min-height:100px}.bim-dialog-header{height:32px;background-color:var(--bim-dialog-header-bg);display:flex;align-items:center;justify-content:space-between;padding:0 10px;cursor:default;-webkit-user-select:none;user-select:none;border-bottom:1px solid var(--bim-dialog-border-color);flex-shrink:0}.bim-dialog-header.draggable{cursor:move}.bim-dialog-title{font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--bim-dialog-title-color)}.bim-dialog-close{cursor:pointer;font-size:18px;color:#999;line-height:1;margin-left:8px}.bim-dialog-close:hover{color:#fff}.bim-dialog-content{flex:1;padding:10px;overflow:auto;font-size:14px;color:var(--bim-dialog-text-color)}.bim-dialog-resize-handle{position:absolute;width:10px;height:10px;bottom:0;right:0;cursor:se-resize;z-index:10}.bim-dialog-resize-handle:after{content:"";position:absolute;bottom:3px;right:3px;width:6px;height:6px;border-right:2px solid #666;border-bottom:2px solid #666}.bim-dialog-resize-handle:hover:after{border-color:#fff}.bim-info-dialog-content{padding:16px;font-family:sans-serif;color:#333}.bim-info-dialog-content h3{margin-top:0;margin-bottom:12px;border-bottom:1px solid #eee;padding-bottom:8px;color:#0078d4}.bim-info-dialog-content ul{list-style:none;padding:0;margin:0}.bim-info-dialog-content li{margin-bottom:8px;font-size:14px;display:flex}.bim-info-dialog-content li strong{width:80px;color:#555}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
(function(d,h){typeof exports=="object"&&typeof module<"u"?h(exports):typeof define=="function"&&define.amd?define(["exports"],h):(d=typeof globalThis<"u"?globalThis:d||self,h(d.LyzBimEngineSDK={}))})(this,(function(d){"use strict";class h{container;options;groups=[];activeBtnIds=new Set;btnRefs=new Map;dropdownElement=null;hoverTimeout=null;DEFAULT_ICON='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect></svg>';constructor(t){const o=typeof t.container=="string"?document.getElementById(t.container):t.container;if(!o)throw new Error("Container not found");this.container=o,this.options={showLabel:!0,visibility:{},...t},this.initContainer(),this.applyStyles()}initContainer(){this.container.innerHTML="",this.container.classList.add("toolbar-root")}applyStyles(){const t=this.container.style;this.options.backgroundColor&&t.setProperty("--bim-toolbar-bg",this.options.backgroundColor),this.options.btnBackgroundColor&&t.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&t.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&t.setProperty("--bim-btn-active-bg",this.options.btnActiveColor),this.options.iconColor&&t.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&t.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&t.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&t.setProperty("--bim-btn-text-active-color",this.options.textActiveColor)}setColors(t){this.options={...this.options,...t},this.applyStyles()}addGroup(t,o){if(this.groups.some(i=>i.id===t)){console.warn("Group "+t+" already exists");return}const e={id:t,buttons:[]};if(o){const i=this.groups.findIndex(n=>n.id===o);i!==-1?this.groups.splice(i,0,e):(console.warn(`Target group ${o} not found, appending ${t} to end.`),this.groups.push(e))}else this.groups.push(e)}addButton(t){const{groupId:o,parentId:e}=t;if(!o)throw new Error(`Button ${t.id} config must contain 'groupId'`);const i=this.groups.find(s=>s.id===o);if(!i)throw new Error(`Group ${o} not found. Please call addGroup first.`);const n={...t,children:t.children||[]};if(e){const s=this.findButton(i.buttons,e);if(!s)throw new Error(`Parent button ${e} not found in group ${o}`);s.children||(s.children=[]),s.children.push(n)}else i.buttons.push(n)}findButton(t,o){for(const e of t){if(e.id===o)return e;if(e.children){const i=this.findButton(e.children,o);if(i)return i}}}async init(){const{homeButton:t}=await Promise.resolve().then(()=>y),{locationButton:o}=await Promise.resolve().then(()=>B),{walkMenuButton:e}=await Promise.resolve().then(()=>T),{walkPersonButton:i}=await Promise.resolve().then(()=>E),{walkBirdButton:n}=await Promise.resolve().then(()=>x),{settingButton:s}=await Promise.resolve().then(()=>L),{infoButton:r}=await Promise.resolve().then(()=>k);this.addGroup("group-1"),this.addButton(t),this.addButton(e),this.addButton(i),this.addButton(n),this.addButton(o),this.addGroup("group-2"),this.addButton(s),this.addButton(r),this.render()}render(){this.container.innerHTML="",this.btnRefs.clear();const t=document.createElement("div");t.className="toolbar-container",this.groups.forEach((o,e)=>{const i=this.renderGroup(o,e,this.groups.length);t.appendChild(i)}),this.container.appendChild(t)}renderGroup(t,o,e){const i=document.createElement("div");return i.className="opt-btn-group",o<e-1&&i.classList.add("has-divider"),t.buttons.forEach(n=>{if(this.isVisible(n.id)){const s=this.renderButton(n);i.appendChild(s)}}),i}renderButton(t){const o=document.createElement("div");o.className="opt-btn-wrapper";const e=document.createElement("div");e.className="opt-btn",this.activeBtnIds.has(t.id)&&e.classList.add("active"),t.disabled&&e.classList.add("disabled"),this.options.showLabel||(e.classList.add("no-label"),t.label&&(e.title=t.label));const i=document.createElement("div");if(i.className="opt-btn-icon",i.innerHTML=this.getIcon(t.icon),e.appendChild(i),this.options.showLabel&&t.label){const n=document.createElement("span");n.className="opt-btn-label",n.textContent=t.label,e.appendChild(n)}if(t.children&&t.children.length>0){const n=document.createElement("span");n.className="opt-btn-arrow",n.textContent="▼",e.appendChild(n)}return e.addEventListener("click",()=>this.handleClick(t)),e.addEventListener("mouseenter",()=>this.handleMouseEnter(t,e)),e.addEventListener("mouseleave",()=>this.handleMouseLeave()),this.btnRefs.set(t.id,e),o.appendChild(e),o}handleClick(t){t.disabled||(!t.children||t.children.length===0)&&(t.keepActive&&(this.activeBtnIds.has(t.id)?this.activeBtnIds.delete(t.id):this.activeBtnIds.add(t.id),this.updateButtonState(t.id)),this.closeDropdown(),t.onClick&&t.onClick(t))}handleSubClick(t){t.keepActive&&(this.activeBtnIds.has(t.id)?this.activeBtnIds.delete(t.id):this.activeBtnIds.add(t.id),this.updateButtonState(t.id)),this.closeDropdown(),t.onClick&&t.onClick(t)}handleMouseEnter(t,o){if(this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=null),t.children&&t.children.length>0){this.showDropdown(t,o);const e=o.querySelector(".opt-btn-arrow");e&&e.classList.add("rotated")}else this.closeDropdown()}handleMouseLeave(){this.hoverTimeout=window.setTimeout(()=>{this.closeDropdown()},200)}showDropdown(t,o){if(this.closeDropdown(),!t.children)return;const e=document.createElement("div");e.className="opt-btn-dropdown";const i=e.style;this.options.backgroundColor&&i.setProperty("--bim-toolbar-bg",this.options.backgroundColor),this.options.btnBackgroundColor&&i.setProperty("--bim-btn-bg",this.options.btnBackgroundColor),this.options.btnHoverColor&&i.setProperty("--bim-btn-hover-bg",this.options.btnHoverColor),this.options.btnActiveColor&&i.setProperty("--bim-btn-active-bg",this.options.btnActiveColor),this.options.iconColor&&i.setProperty("--bim-icon-color",this.options.iconColor),this.options.iconActiveColor&&i.setProperty("--bim-icon-active-color",this.options.iconActiveColor),this.options.textColor&&i.setProperty("--bim-btn-text-color",this.options.textColor),this.options.textActiveColor&&i.setProperty("--bim-btn-text-active-color",this.options.textActiveColor);const n=o.getBoundingClientRect(),s=n.left+n.width/2;e.style.top=n.top-8+"px",e.style.left=s+"px",t.children.forEach(r=>{if(this.isVisible(r.id)){const l=this.renderDropdownItem(r);e.appendChild(l)}}),e.addEventListener("mouseenter",()=>{this.hoverTimeout&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=null)}),e.addEventListener("mouseleave",()=>this.handleMouseLeave()),document.body.appendChild(e),this.dropdownElement=e}renderDropdownItem(t){const o=document.createElement("div");o.className="opt-btn-dropdown-item";const e=document.createElement("div");if(e.className="opt-btn-icon small",e.innerHTML=this.getIcon(t.icon),o.appendChild(e),this.options.showLabel){const i=document.createElement("span");i.textContent=t.label,o.appendChild(i)}return o.addEventListener("click",i=>{i.stopPropagation(),this.handleSubClick(t)}),o}closeDropdown(){this.dropdownElement&&(this.dropdownElement.remove(),this.dropdownElement=null),this.btnRefs.forEach(t=>{const o=t.querySelector(".opt-btn-arrow");o&&o.classList.remove("rotated")})}updateButtonState(t){const o=this.btnRefs.get(t);o&&(this.activeBtnIds.has(t)?o.classList.add("active"):o.classList.remove("active"))}getIcon(t){return t||this.DEFAULT_ICON}updateButtonVisibility(t,o){this.options.visibility||(this.options.visibility={}),this.options.visibility[t]=o,this.render()}setShowLabel(t){this.options.showLabel=t,this.render()}setBackgroundColor(t){this.setColors({backgroundColor:t})}isVisible(t){return this.options.visibility?.[t]!==!1}destroy(){this.closeDropdown(),this.hoverTimeout&&clearTimeout(this.hoverTimeout),this.container.innerHTML="",this.btnRefs.clear(),this.activeBtnIds.clear(),this.groups=[]}}class f{optBtnGroups=null;container;constructor(t){this.container=t,this.init()}init(){this.optBtnGroups=new h({container:this.container,showLabel:!0}),this.optBtnGroups.init().catch(t=>{console.error("Failed to initialize OptBtnGroups:",t)})}addGroup(t,o){this.optBtnGroups?(this.optBtnGroups.addGroup(t,o),this.optBtnGroups.render()):console.warn("Toolbar not initialized yet.")}addButton(t){this.optBtnGroups?(this.optBtnGroups.addButton(t),this.optBtnGroups.render()):console.warn("Toolbar not initialized yet.")}setButtonVisibility(t,o){this.optBtnGroups?this.optBtnGroups.updateButtonVisibility(t,o):console.warn("Toolbar not initialized yet.")}setShowLabel(t){this.optBtnGroups?this.optBtnGroups.setShowLabel(t):console.warn("Toolbar not initialized yet.")}setVisible(t){this.container.style.display=t?"block":"none"}setBackgroundColor(t){this.optBtnGroups?this.optBtnGroups.setBackgroundColor(t):console.warn("Toolbar not initialized yet.")}setColors(t){this.optBtnGroups?this.optBtnGroups.setColors(t):console.warn("Toolbar not initialized yet.")}destroy(){this.optBtnGroups&&(this.optBtnGroups.destroy(),this.optBtnGroups=null)}}class b{element;options;container;header;contentArea;_isDestroyed=!1;constructor(t){this.options={title:"Dialog",width:300,height:"auto",position:"center",draggable:!0,resizable:!1,minWidth:200,minHeight:100,...t},this.container=t.container,this.element=this.createDom(),this.header=this.element.querySelector(".bim-dialog-header"),this.contentArea=this.element.querySelector(".bim-dialog-content"),this.init()}createDom(){const t=document.createElement("div");t.className="bim-dialog",this.options.id&&(t.id=this.options.id);const o=t.style;this.options.backgroundColor&&o.setProperty("--bim-dialog-bg",this.options.backgroundColor),this.options.headerBackgroundColor&&o.setProperty("--bim-dialog-header-bg",this.options.headerBackgroundColor),this.options.titleColor&&o.setProperty("--bim-dialog-title-color",this.options.titleColor),this.options.textColor&&o.setProperty("--bim-dialog-text-color",this.options.textColor),this.options.borderColor&&o.setProperty("--bim-dialog-border-color",this.options.borderColor),this.setSize(t,this.options.width,this.options.height);const e=document.createElement("div");e.className="bim-dialog-header",this.options.draggable&&e.classList.add("draggable");const i=document.createElement("span");i.className="bim-dialog-title",i.textContent=this.options.title||"";const n=document.createElement("span");n.className="bim-dialog-close",n.innerHTML="×",n.onclick=()=>this.close(),e.appendChild(i),e.appendChild(n);const s=document.createElement("div");if(s.className="bim-dialog-content",typeof this.options.content=="string"?s.innerHTML=this.options.content:this.options.content instanceof HTMLElement&&s.appendChild(this.options.content),t.appendChild(e),t.appendChild(s),this.options.resizable){const r=document.createElement("div");r.className="bim-dialog-resize-handle",t.appendChild(r)}return t}setSize(t,o,e){o!==void 0&&(t.style.width=typeof o=="number"?`${o}px`:o),e!==void 0&&(t.style.height=typeof e=="number"?`${e}px`:e)}init(){this.container.appendChild(this.element),this.initPosition(),this.options.draggable&&this.initDrag(),this.options.resizable&&this.initResize()}initPosition(){const t=this.options.position,o=this.element.getBoundingClientRect();let e=0,i=0;const n=this.container.clientWidth,s=this.container.clientHeight,r=o.width,l=o.height;if(typeof t=="object"&&"x"in t)e=t.x,i=t.y;else switch(t){case"center":e=(n-r)/2,i=(s-l)/2;break;case"top-left":e=0,i=0;break;case"top-center":e=(n-r)/2,i=0;break;case"top-right":e=n-r,i=0;break;case"left-center":e=0,i=(s-l)/2;break;case"right-center":e=n-r,i=(s-l)/2;break;case"bottom-left":e=0,i=s-l;break;case"bottom-center":e=(n-r)/2,i=s-l;break;case"bottom-right":e=n-r,i=s-l;break;default:e=(n-r)/2,i=(s-l)/2}e=Math.max(0,Math.min(e,n-r)),i=Math.max(0,Math.min(i,s-l)),this.element.style.left=`${e}px`,this.element.style.top=`${i}px`}initDrag(){let t=0,o=0,e=0,i=0;const n=l=>{l.preventDefault(),t=l.clientX,o=l.clientY,e=this.element.offsetLeft,i=this.element.offsetTop,document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)},s=l=>{const c=l.clientX-t,m=l.clientY-o;let p=e+c,u=i+m;const g=this.container.clientWidth-this.element.offsetWidth,M=this.container.clientHeight-this.element.offsetHeight;p=Math.max(0,Math.min(p,g)),u=Math.max(0,Math.min(u,M)),this.element.style.left=`${p}px`,this.element.style.top=`${u}px`},r=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r)};this.header.addEventListener("mousedown",n)}initResize(){const t=this.element.querySelector(".bim-dialog-resize-handle");if(!t)return;let o=0,e=0,i=0,n=0;const s=c=>{c.preventDefault(),c.stopPropagation(),o=c.clientX,e=c.clientY,i=this.element.offsetWidth,n=this.element.offsetHeight,document.addEventListener("mousemove",r),document.addEventListener("mouseup",l)},r=c=>{const m=c.clientX-o,p=c.clientY-e,u=Math.max(this.options.minWidth||100,i+m),g=Math.max(this.options.minHeight||50,n+p);this.element.style.width=`${u}px`,this.element.style.height=`${g}px`},l=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",l)};t.addEventListener("mousedown",s)}setContent(t){this.contentArea.innerHTML="",typeof t=="string"?this.contentArea.innerHTML=t:this.contentArea.appendChild(t)}close(){this._isDestroyed||(this.element.remove(),this._isDestroyed=!0,this.options.onClose&&this.options.onClose())}}class v{dialog;constructor(t){const o=document.createElement("div");o.className="bim-info-dialog-content";const e=document.createElement("h3");e.textContent="Model Information";const i=document.createElement("ul");i.innerHTML=`
|
|
<li><strong>Name:</strong> Sample Project</li>
|
|
<li><strong>Version:</strong> 1.0.0</li>
|
|
<li><strong>Date:</strong> ${new Date().toLocaleDateString()}</li>
|
|
<li><strong>Status:</strong> <span style="color: green;">Active</span></li>
|
|
`;const n=document.createElement("button");n.textContent="Update Status",n.style.marginTop="10px",n.onclick=()=>{alert("Status updated!")},o.appendChild(e),o.appendChild(i),o.appendChild(n),this.dialog=new b({container:t,title:"Project Info (Wrapped)",content:o,width:320,height:"auto",position:"center",resizable:!0,draggable:!0})}close(){this.dialog.close()}}class w{container;constructor(t){this.container=t}create(t){return new b({container:this.container,...t})}showInfoDialog(){new v(this.container)}}class C{container;wrapper=null;toolbar=null;dialog=null;constructor(t){const o=typeof t=="string"?document.getElementById(t):t;if(!o)throw new Error("Container not found");this.container=o,this.init()}init(){this.container.innerHTML="",this.wrapper=document.createElement("div"),this.wrapper.className="bim-engine-wrapper";const t=document.createElement("h1");t.textContent="BimEngine",t.className="bim-engine-title";const o=document.createElement("p");o.textContent="这是一个使用BIM-ENGINE。",o.className="bim-engine-desc";const e=document.createElement("div");e.id="opt-btn-groups",e.className="bim-engine-opt-btn-container",this.wrapper.appendChild(t),this.wrapper.appendChild(o),this.dialog=new w(this.wrapper),this.toolbar=new f(e);const i=document.createElement("button");i.textContent="打开测试弹窗",i.className="bim-engine-btn",i.onclick=()=>{this.dialog?.create({title:"测试弹窗",content:'<div style="padding: 10px;">这是一个 <b>可拖拽</b> 且 <b>可缩放</b> 的弹窗。<br><br>你可以尝试拖动标题栏,或者拖动右下角改变大小。</div>',width:300,height:400,position:"top-left",draggable:!0,resizable:!0})};const n=document.createElement("button");n.textContent="打开信息弹窗 (封装版)",n.className="bim-engine-btn",n.style.marginLeft="10px",n.onclick=()=>{this.dialog?.showInfoDialog()},this.wrapper.appendChild(i),this.wrapper.appendChild(n),this.wrapper.appendChild(e),this.container.appendChild(this.wrapper)}destroy(){this.toolbar&&(this.toolbar.destroy(),this.toolbar=null),this.dialog=null,this.container.innerHTML=""}}const y=Object.freeze(Object.defineProperty({__proto__:null,homeButton:{id:"home",groupId:"group-1",type:"button",label:"首页",icon:'<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M4 21V9l8-6l8 6v12h-6v-7h-4v7z"/></svg>',keepActive:!0,onClick:a=>{console.log("首页按钮被点击:",a.id)}}},Symbol.toStringTag,{value:"Module"})),B=Object.freeze(Object.defineProperty({__proto__:null,locationButton:{id:"location",groupId:"group-1",type:"button",label:"定位",icon:'<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M9 13h2v-2.75h2V13h2V8.25l-3-2l-3 2zm3 9q-4.025-3.425-6.012-6.362T4 10.2q0-3.75 2.413-5.975T12 2t5.588 2.225T20 10.2q0 2.5-1.987 5.438T12 22"/></svg>',keepActive:!1,onClick:a=>{console.log("定位按钮被点击:",a.id)}}},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null,walkMenuButton:{id:"walk",groupId:"group-1",type:"menu",label:"漫游",icon:'<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M9 22V8.775q-2.275-.6-3.637-2.512T4 2h2q0 2.075 1.338 3.538T10.75 7h2.5q.75 0 1.4.275t1.175.8L20.35 12.6l-1.4 1.4L15 10.05V22h-2v-6h-2v6zm3-16q-.825 0-1.412-.587T10 4t.588-1.412T12 2t1.413.588T14 4t-.587 1.413T12 6"/></svg>',keepActive:!0,onClick:a=>{console.log("漫游按钮被点击:",a.id)}}},Symbol.toStringTag,{value:"Module"})),E=Object.freeze(Object.defineProperty({__proto__:null,walkPersonButton:{id:"walk-person",groupId:"group-1",parentId:"walk",type:"button",label:"人视漫游",icon:'<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M9 22V8.775q-2.275-.6-3.637-2.512T4 2h2q0 2.075 1.338 3.538T10.75 7h2.5q.75 0 1.4.275t1.175.8L20.35 12.6l-1.4 1.4L15 10.05V22h-2v-6h-2v6zm3-16q-.825 0-1.412-.587T10 4t.588-1.412T12 2t1.413.588T14 4t-.587 1.413T12 6"/></svg>',onClick:a=>{console.log("人视漫游被点击:",a.id)}}},Symbol.toStringTag,{value:"Module"})),x=Object.freeze(Object.defineProperty({__proto__:null,walkBirdButton:{id:"walk-bird",groupId:"group-1",parentId:"walk",type:"button",label:"鸟瞰漫游",icon:'<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M9 22V8.775q-2.275-.6-3.637-2.512T4 2h2q0 2.075 1.338 3.538T10.75 7h2.5q.75 0 1.4.275t1.175.8L20.35 12.6l-1.4 1.4L15 10.05V22h-2v-6h-2v6zm3-16q-.825 0-1.412-.587T10 4t.588-1.412T12 2t1.413.588T14 4t-.587 1.413T12 6"/></svg>',onClick:a=>{console.log("鸟瞰漫游被点击:",a.id)}}},Symbol.toStringTag,{value:"Module"})),L=Object.freeze(Object.defineProperty({__proto__:null,settingButton:{id:"setting",groupId:"group-2",type:"button",label:"设置",icon:'<svg width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="m9.25 22l-.4-3.2q-.325-.125-.612-.3t-.563-.375L4.7 19.375l-2.75-4.75l2.575-1.95Q4.5 12.5 4.5 12.338v-.675q0-.163.025-.338L1.95 9.375l2.75-4.75l2.975 1.25q.275-.2.575-.375t.6-.3l.4-3.2h5.5l.4 3.2q.325.125.613.3t.562.375l2.975-1.25l2.75 4.75l-2.575 1.95q.025.175.025.338v.674q0 .163-.05.338l2.575 1.95l-2.75 4.75l-2.95-1.25q-.275.2-.575.375t-.6.3l-.4 3.2zM11 20h1.975l.35-2.65q.775-.2 1.438-.587t1.212-.938l2.475 1.025l.975-1.7l-2.15-1.625q.125-.35.175-.737T17.5 12t-.05-.787t-.175-.738l2.15-1.625l-.975-1.7l-2.475 1.05q-.55-.575-1.212-.962t-1.438-.588L13 4h-1.975l-.35 2.65q-.775.2-1.437.588t-1.213.937L5.55 7.15l-.975 1.7l2.15 1.6q-.125.375-.175.75t-.05.8q0 .4.05.775t.175.75l-2.15 1.625l.975 1.7l2.475-1.05q.55.575 1.213.963t1.437.587zm1.05-4.5q1.45 0 2.475-1.025T15.55 12t-1.025-2.475T12.05 8.5q-1.475 0-2.488 1.025T8.55 12t1.013 2.475T12.05 15.5M12 12"/></svg>',keepActive:!1,onClick:a=>{console.log("设置按钮被点击:",a.id)}}},Symbol.toStringTag,{value:"Module"})),k=Object.freeze(Object.defineProperty({__proto__:null,infoButton:{id:"info",groupId:"group-2",type:"button",label:"信息",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M12 7q.425 0 .713-.288T13 6t-.288-.712T12 5t-.712.288T11 6t.288.713T12 7m0 8q.425 0 .713-.288T13 14v-4q0-.425-.288-.712T12 9t-.712.288T11 10v4q0 .425.288.713T12 15m-6 3l-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18z"/></svg>',keepActive:!1,onClick:a=>{console.log("信息按钮被点击:",a.id)}}},Symbol.toStringTag,{value:"Module"}));d.BimEngine=C,d.OptBtnGroups=h,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
|
//# sourceMappingURL=bim-engine-sdk.umd.js.map
|