@yueglobal/vue-ui 1.1.3 → 1.1.4
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/index.mjs +1 -1
- package/index.umd.js +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -8484,7 +8484,7 @@ function Nv(e, A, t, n, i, r) {
|
|
|
8484
8484
|
_: 1
|
|
8485
8485
|
}, 16);
|
|
8486
8486
|
}
|
|
8487
|
-
const Wv = /* @__PURE__ */ le(Fv, [["render", Nv]]), Gv = "https://gd.singlewindow.cn/", Tv = "https://gdin.com.cn/szgw-libs/translate.min.js?elementId=gw_translate", yv = {
|
|
8487
|
+
const Wv = /* @__PURE__ */ le(Fv, [["render", Nv]]), Gv = "https://gd.singlewindow.cn/", Tv = "https://www.gdin.com.cn/szgw-libs/translate.min.js?elementId=gw_translate", yv = {
|
|
8488
8488
|
name: "RightContent",
|
|
8489
8489
|
components: {
|
|
8490
8490
|
SingleWindowIcon: Wv
|
package/index.umd.js
CHANGED
|
@@ -101,4 +101,4 @@ For more detail, please visit: ${r}
|
|
|
101
101
|
M652.1,474.7H325.5l0,0c-20.6,0-37.3,16.7-37.3,37.3c0,20.6,16.7,37.3,37.3,37.3h313.8l-35.4,35.4c-14.6,14.6-14.6,38.2,0,52.8\r
|
|
102
102
|
s38.2,14.6,52.8,0L762.1,532c0,0,0,0,0,0c14.6-14.6,14.5-38.2,0-52.7L656.7,373.7c-14.6-14.6-38.2-14.6-52.8,0\r
|
|
103
103
|
c-14.6,14.6-14.6,38.2,0,52.8L652.1,474.7L652.1,474.7z M512,885c-206,0-373-167-373-373s167-373,373-373s373,167,373,373\r
|
|
104
|
-
S718,885,512,885L512,885z`},null,-1)])]))]),_:1},16)}const hl=U(ml,[["render",Cl]]),Xl="https://gd.singlewindow.cn/",Ll="https://gdin.com.cn/szgw-libs/translate.min.js?elementId=gw_translate",zl={name:"RightContent",components:{SingleWindowIcon:hl},props:{content:Object,onLocaleChange:Function},data(){return{singleWindowUrl:Xl}},computed:{normalizedContent(){if(!this.content)return null;const e=t.isProxy(this.content)?t.toRaw(this.content):this.content;return t.markRaw(e)}},mounted(){this.initTranslateScript()},beforeDestroy(){window.szTranslate&&window.szTranslate.off("locale",this.onLocaleChange)},methods:{initTranslateScript(){const e=()=>{window.szTranslate&&window.szTranslate.on("locale",this.onLocaleChange),setTimeout(()=>{var n,A;if(window.szTranslate){const i=((A=(n=window.szTranslate).value)==null?void 0:A.call(n))??"cn";this.onLocaleChange({locale:i})}},200)};Qw("translate.min.js")?window.szTranslate&&(window.szTranslate.init({element:document.getElementById("gw_translate")}),e()):Kw(Ll).then(()=>{setTimeout(()=>{e()},1e3)})}}},Fl={class:"yue-flex yue-page-header-right-content"},Ol=["href"],Nl={key:0};function jl(e,n,A,i,r,f){const a=t.resolveComponent("SingleWindowIcon");return t.openBlock(),t.createElementBlock("div",Fl,[t.createElementVNode("a",{href:r.singleWindowUrl,target:"_blank",rel:"noopener noreferrer",class:"yue-flex link"},[n[0]||(n[0]=t.createElementVNode("span",null,"单一窗口",-1)),t.createVNode(a)],8,Ol),n[1]||(n[1]=t.createElementVNode("div",{class:"vr"},null,-1)),n[2]||(n[2]=t.createElementVNode("div",{id:"gw_translate"},null,-1)),f.normalizedContent?(t.openBlock(),t.createElementBlock("div",Nl,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(f.normalizedContent)))])):t.createCommentVNode("",!0)])}const Wl=U(zl,[["render",jl]]),Tl=["href"],Gl=["src"],yl=["src"],Zl=t.defineComponent({__name:"index",props:{activeLabel:{},width:{default:"80%"},backgroundColor:{default:"#fff"},menuItems:{},pageTitle:{},pageIcon:{},breadcrumbs:{},routes:{},pathname:{},onRouteChange:{},rightContent:{},onLocaleChange:{},subMenuLayout:{},logo:{},unitLogo:{}},setup(e){const n=e,A=t.computed(()=>{var k,x;return!!n.pageTitle||((k=n.breadcrumbs)==null?void 0:k.length)>0||((x=n.menuItems)==null?void 0:x.length)>0}),i=t.computed(()=>n.backgroundColor==="transparent"?"rgba(255, 255, 255, 0.15)":n.backgroundColor),r=t.computed(()=>({backgroundColor:i.value})),f=t.computed(()=>{const{pageIcon:k,pageTitle:x,activeLabel:b}=n;let m=x,O=k,z;const N=Yw();let L;if(b&&(L=N.find(h=>(h==null?void 0:h.label)===b)),!L&&x&&(L=N.find(h=>(h==null?void 0:h.label)===x)),!L){const{origin:h,pathname:Y}=window.location,V=h+Y;L=N.find(W=>!!(W!=null&&W.key)&&V.startsWith(`${W.key}`))}return L&&(m||(m=L.label),O||(O=L.icon),z=L.key),{title:m,icon:O,key:z}}),a=t.ref("cn"),o=t.ref(null),s=t.ref(null),c=t.ref(null),u=t.ref(null);let l=null;function d(k){var x;(x=n.onLocaleChange)==null||x.call(n,k),a.value=k==null?void 0:k.locale,console.log("==> ",k)}const v={cn:xr,hk:xr,us:aw},P=t.computed(()=>n.logo?n.logo:v[a.value]||v.us),w=t.computed(()=>{if(u.value!==null)return`${u.value}px`}),I=t.computed(()=>{if(w.value)return{width:w.value,maxWidth:w.value,flex:`0 0 ${w.value}`}});function g(k){return(k==null?void 0:k.getBoundingClientRect().width)||0}function S(){u.value=vA(g(o.value),[g(s.value),g(c.value)])}function B(){typeof ResizeObserver>"u"||(l==null||l.disconnect(),l=new ResizeObserver(()=>{S()}),[o.value,s.value,c.value].forEach(k=>{k&&(l==null||l.observe(k))}))}async function E(){await t.nextTick(),S(),B()}return t.onMounted(()=>{E(),window.addEventListener("resize",S)}),t.watch(()=>n.width,()=>{E()}),t.watch(()=>n.rightContent,()=>{E()}),t.watch(a,()=>{E()}),t.onBeforeUnmount(()=>{l==null||l.disconnect(),window.removeEventListener("resize",S)}),(k,x)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{style:t.normalizeStyle({backgroundColor:i.value,height:`${80+(A.value?60:0)}px`})},null,4),t.createElementVNode("div",{class:"yue-page-header",style:t.normalizeStyle(r.value)},[t.createElementVNode("div",{ref_key:"topbarRef",ref:o,class:"yue-page-header-topbar yue-flex",style:t.normalizeStyle({width:e.width})},[t.createElementVNode("a",{ref_key:"titleBarRef",ref:s,href:t.unref($),class:"yue-flex title-bar"},[t.createElementVNode("img",{src:e.unitLogo||t.unref(fw),alt:"",class:"unit-logo"},null,8,Gl),t.createElementVNode("img",{src:P.value,alt:"",class:"logo"},null,8,yl)],8,Tl),t.createElementVNode("div",{class:"menus-bar",style:t.normalizeStyle(I.value)},[t.createVNode(tl,{"module-data":f.value,"has-second-menu":A.value,locale:a.value,width:w.value},null,8,["module-data","has-second-menu","locale","width"])],4),t.createElementVNode("div",{ref_key:"rightContentRef",ref:c,class:"right-content-wrap"},[t.createVNode(Wl,{content:e.rightContent,"on-locale-change":d},null,8,["content"])],512)],4),A.value?(t.openBlock(),t.createBlock(xl,{key:0,width:e.width,"module-data":f.value,breadcrumbs:e.breadcrumbs,routes:e.routes,pathname:e.pathname,"menu-items":e.menuItems,subMenuLayout:e.subMenuLayout,"on-route-change":e.onRouteChange,locale:a.value},null,8,["width","module-data","breadcrumbs","routes","pathname","menu-items","subMenuLayout","on-route-change","locale"])):t.createCommentVNode("",!0)],4)]))}});he.YuePageFooter=rw,he.YuePageHeader=Zl,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
|
|
104
|
+
S718,885,512,885L512,885z`},null,-1)])]))]),_:1},16)}const hl=U(ml,[["render",Cl]]),Xl="https://gd.singlewindow.cn/",Ll="https://www.gdin.com.cn/szgw-libs/translate.min.js?elementId=gw_translate",zl={name:"RightContent",components:{SingleWindowIcon:hl},props:{content:Object,onLocaleChange:Function},data(){return{singleWindowUrl:Xl}},computed:{normalizedContent(){if(!this.content)return null;const e=t.isProxy(this.content)?t.toRaw(this.content):this.content;return t.markRaw(e)}},mounted(){this.initTranslateScript()},beforeDestroy(){window.szTranslate&&window.szTranslate.off("locale",this.onLocaleChange)},methods:{initTranslateScript(){const e=()=>{window.szTranslate&&window.szTranslate.on("locale",this.onLocaleChange),setTimeout(()=>{var n,A;if(window.szTranslate){const i=((A=(n=window.szTranslate).value)==null?void 0:A.call(n))??"cn";this.onLocaleChange({locale:i})}},200)};Qw("translate.min.js")?window.szTranslate&&(window.szTranslate.init({element:document.getElementById("gw_translate")}),e()):Kw(Ll).then(()=>{setTimeout(()=>{e()},1e3)})}}},Fl={class:"yue-flex yue-page-header-right-content"},Ol=["href"],Nl={key:0};function jl(e,n,A,i,r,f){const a=t.resolveComponent("SingleWindowIcon");return t.openBlock(),t.createElementBlock("div",Fl,[t.createElementVNode("a",{href:r.singleWindowUrl,target:"_blank",rel:"noopener noreferrer",class:"yue-flex link"},[n[0]||(n[0]=t.createElementVNode("span",null,"单一窗口",-1)),t.createVNode(a)],8,Ol),n[1]||(n[1]=t.createElementVNode("div",{class:"vr"},null,-1)),n[2]||(n[2]=t.createElementVNode("div",{id:"gw_translate"},null,-1)),f.normalizedContent?(t.openBlock(),t.createElementBlock("div",Nl,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(f.normalizedContent)))])):t.createCommentVNode("",!0)])}const Wl=U(zl,[["render",jl]]),Tl=["href"],Gl=["src"],yl=["src"],Zl=t.defineComponent({__name:"index",props:{activeLabel:{},width:{default:"80%"},backgroundColor:{default:"#fff"},menuItems:{},pageTitle:{},pageIcon:{},breadcrumbs:{},routes:{},pathname:{},onRouteChange:{},rightContent:{},onLocaleChange:{},subMenuLayout:{},logo:{},unitLogo:{}},setup(e){const n=e,A=t.computed(()=>{var k,x;return!!n.pageTitle||((k=n.breadcrumbs)==null?void 0:k.length)>0||((x=n.menuItems)==null?void 0:x.length)>0}),i=t.computed(()=>n.backgroundColor==="transparent"?"rgba(255, 255, 255, 0.15)":n.backgroundColor),r=t.computed(()=>({backgroundColor:i.value})),f=t.computed(()=>{const{pageIcon:k,pageTitle:x,activeLabel:b}=n;let m=x,O=k,z;const N=Yw();let L;if(b&&(L=N.find(h=>(h==null?void 0:h.label)===b)),!L&&x&&(L=N.find(h=>(h==null?void 0:h.label)===x)),!L){const{origin:h,pathname:Y}=window.location,V=h+Y;L=N.find(W=>!!(W!=null&&W.key)&&V.startsWith(`${W.key}`))}return L&&(m||(m=L.label),O||(O=L.icon),z=L.key),{title:m,icon:O,key:z}}),a=t.ref("cn"),o=t.ref(null),s=t.ref(null),c=t.ref(null),u=t.ref(null);let l=null;function d(k){var x;(x=n.onLocaleChange)==null||x.call(n,k),a.value=k==null?void 0:k.locale,console.log("==> ",k)}const v={cn:xr,hk:xr,us:aw},P=t.computed(()=>n.logo?n.logo:v[a.value]||v.us),w=t.computed(()=>{if(u.value!==null)return`${u.value}px`}),I=t.computed(()=>{if(w.value)return{width:w.value,maxWidth:w.value,flex:`0 0 ${w.value}`}});function g(k){return(k==null?void 0:k.getBoundingClientRect().width)||0}function S(){u.value=vA(g(o.value),[g(s.value),g(c.value)])}function B(){typeof ResizeObserver>"u"||(l==null||l.disconnect(),l=new ResizeObserver(()=>{S()}),[o.value,s.value,c.value].forEach(k=>{k&&(l==null||l.observe(k))}))}async function E(){await t.nextTick(),S(),B()}return t.onMounted(()=>{E(),window.addEventListener("resize",S)}),t.watch(()=>n.width,()=>{E()}),t.watch(()=>n.rightContent,()=>{E()}),t.watch(a,()=>{E()}),t.onBeforeUnmount(()=>{l==null||l.disconnect(),window.removeEventListener("resize",S)}),(k,x)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{style:t.normalizeStyle({backgroundColor:i.value,height:`${80+(A.value?60:0)}px`})},null,4),t.createElementVNode("div",{class:"yue-page-header",style:t.normalizeStyle(r.value)},[t.createElementVNode("div",{ref_key:"topbarRef",ref:o,class:"yue-page-header-topbar yue-flex",style:t.normalizeStyle({width:e.width})},[t.createElementVNode("a",{ref_key:"titleBarRef",ref:s,href:t.unref($),class:"yue-flex title-bar"},[t.createElementVNode("img",{src:e.unitLogo||t.unref(fw),alt:"",class:"unit-logo"},null,8,Gl),t.createElementVNode("img",{src:P.value,alt:"",class:"logo"},null,8,yl)],8,Tl),t.createElementVNode("div",{class:"menus-bar",style:t.normalizeStyle(I.value)},[t.createVNode(tl,{"module-data":f.value,"has-second-menu":A.value,locale:a.value,width:w.value},null,8,["module-data","has-second-menu","locale","width"])],4),t.createElementVNode("div",{ref_key:"rightContentRef",ref:c,class:"right-content-wrap"},[t.createVNode(Wl,{content:e.rightContent,"on-locale-change":d},null,8,["content"])],512)],4),A.value?(t.openBlock(),t.createBlock(xl,{key:0,width:e.width,"module-data":f.value,breadcrumbs:e.breadcrumbs,routes:e.routes,pathname:e.pathname,"menu-items":e.menuItems,subMenuLayout:e.subMenuLayout,"on-route-change":e.onRouteChange,locale:a.value},null,8,["width","module-data","breadcrumbs","routes","pathname","menu-items","subMenuLayout","on-route-change","locale"])):t.createCommentVNode("",!0)],4)]))}});he.YuePageFooter=rw,he.YuePageHeader=Zl,Object.defineProperty(he,Symbol.toStringTag,{value:"Module"})});
|