@gct-paas/core-components 0.1.6-dev.6 → 0.1.6-dev.7
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/dist/loader.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as t,t as e}from"./types-u7a7rngw.js";import{cssLoader as r,getToken as n,useNamespace as o,useUserStore as i}from"@gct-paas/core";import{computed as a,createVNode as u,defineAsyncComponent as c,defineComponent as l,getCurrentInstance as s,h as f,mergeProps as p,nextTick as d,onMounted as h,onUnmounted as v,ref as y,resolveComponent as m,useAttrs as g,watch as w}from"vue";import{bus as b,destroyApp as E,preloadApp as O,setupApp as _,startApp as L}from"wujie";import{iconsNames as j}from"@gct-paas/platform-icons";import x from"@icon-park/vue-next/icons.json";var P,S=t=>"string"==typeof t,A=t=>{if(1===t.nodeType){if("script"===t.nodeName.toLowerCase())return!1;for(let e=0;e<t.attributes.length;e++){const r=t.attributes[e].name;if(S(r)&&0===r.toLowerCase().indexOf("on"))return!1}for(let e=0;e<t.childNodes.length;e++)if(!A(t.childNodes[e]))return!1}return!0},I=/* @__PURE__ */new Map,U=/* @__PURE__ */new Map;function N(t){return I.set(t,""),""}var M=t=>t?{"ion-color":!0,[`ion-color-${t}`]:!0}:null,C=/* @__PURE__ */l({name:"AssetsSvgIcon",props:{color:{type:String},flipRtl:{type:Boolean},src:{type:String,required:!0},size:{type:String},lazy:{type:Boolean,default:!1},sanitize:{type:Boolean,default:!0}},setup(t){const e=o("assets-svg-icon"),r=s();let n;const i=y(!1),u=y(void 0),c=y(!1),l=()=>{if("undefined"!=typeof window&&c.value&&t.src){const n=(e=t.src,S(e)&&((r=e=e.trim()).length>0&&/(\/|\.)/.test(r))?e:null);n&&(I.has(n)?u.value=I.get(n):((t,e)=>U.get(t)||("undefined"!=typeof fetch&&"undefined"!=typeof document?(t=>t.startsWith("data:image/svg+xml"))(t)&&(t=>-1!==t.indexOf(";utf8,"))(t)?Promise.resolve(function(t){P||(P=new DOMParser);const e=P.parseFromString(t,"text/html").querySelector("svg");if(e)return I.set(t,e.outerHTML),e.outerHTML;throw new Error(`Could not parse svg from ${t}`)}(t)):function(t,e){const r=fetch(t).then(r=>r.text().then(r=>{r&&!1!==e&&(r=(t=>{const e=document.createElement("div");e.innerHTML=t;for(let n=e.childNodes.length-1;n>=0;n--)"svg"!==e.childNodes[n].nodeName.toLowerCase()&&e.removeChild(e.childNodes[n]);const r=e.firstElementChild;if(r&&"svg"===r.nodeName.toLowerCase()){const t=r.getAttribute("class")||"";if(r.setAttribute("class",(t+" s-ion-icon").trim()),A(r))return e.innerHTML}return""})(r));const n=r||"";return I.set(t,n),n}).catch(()=>N(t))).catch(()=>N(t));return U.set(t,r),r}(t,e):Promise.resolve(N(t))))(n,t.sanitize).then(()=>{u.value=I.get(n)}),i.value=!0)}var e,r};return h(()=>{const e=null==r?void 0:r.vnode.el;e&&((e,r,o)=>{if(!Boolean("undefined"!=typeof window&&t.lazy&&window.IntersectionObserver))return o();const i=n=new window.IntersectionObserver(t=>{var e;(null===(e=t[0])||void 0===e?void 0:e.isIntersecting)&&(i.disconnect(),n=void 0,o())},{rootMargin:"50px"});i.observe(e)})(e,0,()=>{c.value=!0,l()}),d(()=>{i.value||l()})}),v(()=>{n&&(n.disconnect(),n=void 0)}),w(()=>t.src,()=>{l()}),{ns:e,svgContent:u,classes:a(()=>{const{flipRtl:n,size:o,color:i}=t,a=null==r?void 0:r.vnode.el,u=n;return{...M(i),[`icon-${o}`]:!!o,"flip-rtl":u,"icon-rtl":u&&(c=a,c&&""!==c.dir?"rtl"===c.dir.toLowerCase():"rtl"===(null===(l=document)||void 0===l?void 0:l.dir.toLowerCase())),[e.b()]:!0};var c,l})}},render(){const{svgContent:t,classes:e}=this;return u("div",{role:"img",class:e},["undefined"!=typeof window&&t?u("div",{class:"icon-inner",innerHTML:t},null):u("div",{class:"icon-inner"},null)])}});function k(t){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach(function(e){B(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function T(){T=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype);return o(a,"_invoke",{value:x(t,r,new I(n||[]))}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",d="suspendedYield",h="executing",v="completed",y={};function m(){}function g(){}function w(){}var b={};l(b,a,function(){return this});var E=Object.getPrototypeOf,O=E&&E(E(U([])));O&&O!==r&&n.call(O,a)&&(b=O);var _=w.prototype=m.prototype=Object.create(b);function L(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function j(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==k(s)&&n.call(s,"__await")?e.resolve(s.__await).then(function(t){r("next",t,a,u)},function(t){r("throw",t,a,u)}):e.resolve(s).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,u)})}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return i=i?i.then(o,o):o()}})}function x(e,r,n){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:d,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=/* @__PURE__ */new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=/* @__PURE__ */new TypeError("iterator result is not an object"),r.delegate=null,y)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function U(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(k(e)+" is not iterable")}return g.prototype=w,o(_,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,c,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},L(j.prototype),l(j.prototype,u,function(){return this}),e.AsyncIterator=j,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new j(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},L(_),l(_,c,"Generator"),l(_,a,function(){return this}),l(_,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=U,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:U(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function Q(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function B(t,e,r){return(e=function(t){var e=function(t){if("object"!=k(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=k(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==k(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var J=l({name:"WujieVue",props:{width:{type:String,default:""},height:{type:String,default:""},name:{type:String,default:""},loading:{type:HTMLElement,default:void 0},url:{type:String,default:""},sync:{type:Boolean,default:void 0},prefix:{type:Object,default:void 0},alive:{type:Boolean,default:void 0},props:{type:Object,default:void 0},attrs:{type:Object,default:void 0},replace:{type:Function,default:void 0},fetch:{type:Function,default:void 0},fiber:{type:Boolean,default:void 0},degrade:{type:Boolean,default:void 0},plugins:{type:Array,default:null},beforeLoad:{type:Function,default:null},beforeMount:{type:Function,default:null},afterMount:{type:Function,default:null},beforeUnmount:{type:Function,default:null},afterUnmount:{type:Function,default:null},activated:{type:Function,default:null},deactivated:{type:Function,default:null},loadError:{type:Function,default:null},style:{type:Object,default:void 0},iframeAddEventListeners:{type:Array,default:null},iframeOnEvents:{type:Array,default:null}},data:function(){return{startAppQueue:Promise.resolve()}},mounted:function(){var t=this;this.name&&(window.__WUJIE_QUEUE?window.__WUJIE_QUEUE[this.name]?this.startAppQueue=window.__WUJIE_QUEUE[this.name]:window.__WUJIE_QUEUE[this.name]=this.startAppQueue:window.__WUJIE_QUEUE=B({},this.name,this.startAppQueue)),b.$onAll(this.handleEmit),this.execStartApp(),this.$watch(function(){return t.name+t.url},function(){return t.execStartApp()})},methods:{handleEmit:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this.$emit.apply(this,[t].concat(r))},startApp:function(){var t,e=this;return(t=/* @__PURE__ */T().mark(function t(){return T().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,L({name:e.name,url:e.url,el:e.$refs.wujie,loading:e.loading,alive:e.alive,fetch:e.fetch,props:e.props,attrs:e.attrs,replace:e.replace,sync:e.sync,prefix:e.prefix,fiber:e.fiber,degrade:e.degrade,plugins:e.plugins,beforeLoad:e.beforeLoad,beforeMount:e.beforeMount,afterMount:e.afterMount,beforeUnmount:e.beforeUnmount,afterUnmount:e.afterUnmount,activated:e.activated,deactivated:e.deactivated,loadError:e.loadError,iframeAddEventListeners:e.iframeAddEventListeners,iframeOnEvents:e.iframeOnEvents});case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),console.log(t.t0);case 8:case"end":return t.stop()}},t,null,[[0,5]])}),function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Q(i,n,o,a,u,"next",t)}function u(t){Q(i,n,o,a,u,"throw",t)}a(void 0)})})()},execStartApp:function(){this.startAppQueue=this.startAppQueue.then(this.startApp),window.__WUJIE_QUEUE[this.name]=this.startAppQueue},destroy:function(){E(this.name)}},beforeDestroy:function(){b.$offAll(this.handleEmit)},render:function(){return f("div",{style:F({width:this.width,height:this.height},this.style),ref:"wujie"})}});J.setupApp=_,J.preloadApp=O,J.bus=b,J.destroyApp=E,J.install=function(t){t.component("WujieVue",J)};var{destroyApp:W}=J,G=/* @__PURE__ */l({name:"WuJieContainer",props:{wuJieName:{type:String,required:!0}},setup(t){const e=o("wujie-container"),r=g();function c(t){Object.defineProperty(t,"pSystem",{get:()=>window.System}),Object.defineProperty(t,"_gct",{get:()=>window._gct}),Object.defineProperty(t,"_api",{get:()=>window._api})}function l(t){console.debug("beforeMount System",t.System),console.debug("beforeMount _gct",t._gct),console.debug("beforeMount _api",t._api)}function s(t){console.debug("loadError",t.System)}const{userInfo:f}=i(),d=n(),h=a(()=>({appInfo:_gct.store.appInfo,userInfo:f,token:d,...r.props??{}}));return v(()=>{!0!==r.alive&&W(t.wuJieName)}),()=>u(m("wujieVue"),p({class:e.b(),name:t.wuJieName,beforeLoad:c,beforeMount:l,loadError:s},r,{props:h.value}),null)}}),z=y([]),D=a(()=>[{id:"IconAsset",name:"资产图标",children:z.value}].filter(t=>{var e;return null===(e=t.children)||void 0===e?void 0:e.length}));function H(){return{getIconAssetCats:async function(){if(z.value.length>0)return D.value;const t={assetsModule:"ICON"};return z.value=await Promise.all([_api.platform.category.getList(t),_api.platform.assets.getList(t)]).then(([t,r])=>null==t?void 0:t.map(t=>({id:`${t.id}`,name:t.name,icons:null==r?void 0:r.filter(e=>e.categoryId===t.id).map(t=>(Object.assign(t,{id:`${e.Asset}:${t.path}`,_filter_:[t.name]}),t))})).filter(t=>{var e;return null===(e=t.icons)||void 0===e?void 0:e.length})),D.value}}}var q=/* @__PURE__ */function(t){return t.Base="Base",t.Others="Others",t}(q||{}),R=y([]),V=a(()=>[{id:"IconPark",name:"IconPark",children:R.value}]);function Y(){return{getIconParkCats:function(){if(R.value.length>0)return V.value;const t=[];x.forEach(r=>{const n={...r,id:`${e.IconPark}:${r.name}`,_filter_:[...r.tag,r.title,r.name]};let o=t.find(t=>t.id===n.category);o?o.icons.push(n):(o={id:n.category,name:n.categoryCN,icons:[n]},t.push(o))});const r=t.filter(t=>t.id===q.Base),n=t.filter(t=>t.id===q.Others),o=t.filter(t=>![q.Base,q.Others].includes(t.id));return R.value=r.concat(o,n),V.value}}}var K=a(()=>[{id:"medicalCare",name:"医疗器械",icons:Z.value},{id:"IconPlatform",name:"平台图标",icons:X.value}]),X=a(()=>j.filter(t=>/^(icon-platform)/.test(t)).map(t=>{const r=t.replace(/icon-/g,"");return{id:`${e.Platform}:${r}`,name:r,_filter_:[r]}})),Z=a(()=>j.filter(t=>/^(icon-medicalCare)/.test(t)).map(t=>{const r=t.replace(/icon-/g,"");return{id:`${e.Platform}:${r}`,name:t.replace(/icon-medicalCare-/g,""),_filter_:[r]}}));function tt(){return{getIconPlatformCats:function(){return K.value}}}var et=c(()=>import("./IconNext-C8JnjNsP.js")),rt=!1;async function nt(e){rt||(rt=!0,e.component(C.name,C),e.component(t.name,t),e.component(G.name,G),e.component("IconNext",et))}var ot=new URL("./index.min.css",import.meta.url);r.load(ot.href);export{C as AssetsSvgIcon,e as IconNamespaceEnum,et as IconNext,t as SvgIcon,G as WuJieContainer,nt as coreComponentsCreateAppVue,H as useIconAsset,Y as useIconPark,tt as useIconPlatform};
|
|
1
|
+
import{n as t,t as e}from"./types-u7a7rngw.js";import{cssLoader as r,getToken as n,useNamespace as o,useUserStore as i}from"@gct-paas/core";import{computed as a,createVNode as u,defineAsyncComponent as c,defineComponent as l,getCurrentInstance as s,h as f,mergeProps as p,nextTick as d,onMounted as h,onUnmounted as v,ref as y,resolveComponent as m,useAttrs as g,watch as w}from"vue";import{bus as b,destroyApp as E,preloadApp as O,setupApp as L,startApp as _}from"wujie";import{iconsNames as x}from"@gct-paas/platform-icons";import j from"@icon-park/vue-next/icons.json";var P,A=t=>"string"==typeof t,I=t=>{if(1===t.nodeType){if("script"===t.nodeName.toLowerCase())return!1;for(let e=0;e<t.attributes.length;e++){const r=t.attributes[e].name;if(A(r)&&0===r.toLowerCase().indexOf("on"))return!1}for(let e=0;e<t.childNodes.length;e++)if(!I(t.childNodes[e]))return!1}return!0},S=/* @__PURE__ */new Map,U=/* @__PURE__ */new Map;function N(t){return S.set(t,""),""}var C=t=>t?{"ion-color":!0,[`ion-color-${t}`]:!0}:null,k=/* @__PURE__ */l({name:"AssetsSvgIcon",props:{color:{type:String},flipRtl:{type:Boolean},src:{type:String,required:!0},size:{type:String},lazy:{type:Boolean,default:!1},sanitize:{type:Boolean,default:!0}},setup(t){const e=o("assets-svg-icon"),r=s();let n;const i=y(!1),u=y(void 0),c=y(!1),l=()=>{if("undefined"!=typeof window&&c.value&&t.src){const n=(e=t.src,A(e)&&((r=e=e.trim()).length>0&&/(\/|\.)/.test(r))?e:null);n&&(S.has(n)?u.value=S.get(n):((t,e)=>U.get(t)||("undefined"!=typeof fetch&&"undefined"!=typeof document?(t=>t.startsWith("data:image/svg+xml"))(t)&&(t=>-1!==t.indexOf(";utf8,"))(t)?Promise.resolve(function(t){P||(P=new DOMParser);const e=P.parseFromString(t,"text/html").querySelector("svg");if(e)return S.set(t,e.outerHTML),e.outerHTML;throw new Error(`Could not parse svg from ${t}`)}(t)):function(t,e){const r=fetch(t).then(r=>r.text().then(r=>{r&&!1!==e&&(r=(t=>{const e=document.createElement("div");e.innerHTML=t;for(let n=e.childNodes.length-1;n>=0;n--)"svg"!==e.childNodes[n].nodeName.toLowerCase()&&e.removeChild(e.childNodes[n]);const r=e.firstElementChild;if(r&&"svg"===r.nodeName.toLowerCase()){const t=r.getAttribute("class")||"";if(r.setAttribute("class",(t+" s-ion-icon").trim()),I(r))return e.innerHTML}return""})(r));const n=r||"";return S.set(t,n),n}).catch(()=>N(t))).catch(()=>N(t));return U.set(t,r),r}(t,e):Promise.resolve(N(t))))(n,t.sanitize).then(()=>{u.value=S.get(n)}),i.value=!0)}var e,r};return h(()=>{const e=null==r?void 0:r.vnode.el;e&&((e,r,o)=>{if(!Boolean("undefined"!=typeof window&&t.lazy&&window.IntersectionObserver))return o();const i=n=new window.IntersectionObserver(t=>{var e;(null===(e=t[0])||void 0===e?void 0:e.isIntersecting)&&(i.disconnect(),n=void 0,o())},{rootMargin:"50px"});i.observe(e)})(e,0,()=>{c.value=!0,l()}),d(()=>{i.value||l()})}),v(()=>{n&&(n.disconnect(),n=void 0)}),w(()=>t.src,()=>{l()}),{ns:e,svgContent:u,classes:a(()=>{const{flipRtl:n,size:o,color:i}=t,a=null==r?void 0:r.vnode.el,u=n;return{...C(i),[`icon-${o}`]:!!o,"flip-rtl":u,"icon-rtl":u&&(c=a,c&&""!==c.dir?"rtl"===c.dir.toLowerCase():"rtl"===(null===(l=document)||void 0===l?void 0:l.dir.toLowerCase())),[e.b()]:!0};var c,l})}},render(){const{svgContent:t,classes:e}=this;return u("div",{role:"img",class:e},["undefined"!=typeof window&&t?u("div",{class:"icon-inner",innerHTML:t},null):u("div",{class:"icon-inner"},null)])}});function M(t){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(t)}function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function F(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach(function(e){B(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function T(){T=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype);return o(a,"_invoke",{value:j(t,r,new S(n||[]))}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",d="suspendedYield",h="executing",v="completed",y={};function m(){}function g(){}function w(){}var b={};l(b,a,function(){return this});var E=Object.getPrototypeOf,O=E&&E(E(U([])));O&&O!==r&&n.call(O,a)&&(b=O);var L=w.prototype=m.prototype=Object.create(b);function _(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function x(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==M(s)&&n.call(s,"__await")?e.resolve(s.__await).then(function(t){r("next",t,a,u)},function(t){r("throw",t,a,u)}):e.resolve(s).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,u)})}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e(function(e,o){r(t,n,e,o)})}return i=i?i.then(o,o):o()}})}function j(e,r,n){var o=p;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?v:d,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=/* @__PURE__ */new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):a:(r.method="throw",r.arg=/* @__PURE__ */new TypeError("iterator result is not an object"),r.delegate=null,y)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function U(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(M(e)+" is not iterable")}return g.prototype=w,o(L,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=l(w,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,c,"GeneratorFunction")),t.prototype=Object.create(L),t},e.awrap=function(t){return{__await:t}},_(x.prototype),l(x.prototype,u,function(){return this}),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(s(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then(function(t){return t.done?t.value:a.next()})},_(L),l(L,c,"Generator"),l(L,a,function(){return this}),l(L,"toString",function(){return"[object Generator]"}),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=U,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:U(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function Q(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function B(t,e,r){return(e=function(t){var e=function(t){if("object"!=M(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=M(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==M(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var J=l({name:"WujieVue",props:{width:{type:String,default:""},height:{type:String,default:""},name:{type:String,default:""},loading:{type:HTMLElement,default:void 0},url:{type:String,default:""},sync:{type:Boolean,default:void 0},prefix:{type:Object,default:void 0},alive:{type:Boolean,default:void 0},props:{type:Object,default:void 0},attrs:{type:Object,default:void 0},replace:{type:Function,default:void 0},fetch:{type:Function,default:void 0},fiber:{type:Boolean,default:void 0},degrade:{type:Boolean,default:void 0},plugins:{type:Array,default:null},beforeLoad:{type:Function,default:null},beforeMount:{type:Function,default:null},afterMount:{type:Function,default:null},beforeUnmount:{type:Function,default:null},afterUnmount:{type:Function,default:null},activated:{type:Function,default:null},deactivated:{type:Function,default:null},loadError:{type:Function,default:null},style:{type:Object,default:void 0},iframeAddEventListeners:{type:Array,default:null},iframeOnEvents:{type:Array,default:null}},data:function(){return{startAppQueue:Promise.resolve()}},mounted:function(){var t=this;this.name&&(window.__WUJIE_QUEUE?window.__WUJIE_QUEUE[this.name]?this.startAppQueue=window.__WUJIE_QUEUE[this.name]:window.__WUJIE_QUEUE[this.name]=this.startAppQueue:window.__WUJIE_QUEUE=B({},this.name,this.startAppQueue)),b.$onAll(this.handleEmit),this.execStartApp(),this.$watch(function(){return t.name+t.url},function(){return t.execStartApp()})},methods:{handleEmit:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this.$emit.apply(this,[t].concat(r))},startApp:function(){var t,e=this;return(t=/* @__PURE__ */T().mark(function t(){return T().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,_({name:e.name,url:e.url,el:e.$refs.wujie,loading:e.loading,alive:e.alive,fetch:e.fetch,props:e.props,attrs:e.attrs,replace:e.replace,sync:e.sync,prefix:e.prefix,fiber:e.fiber,degrade:e.degrade,plugins:e.plugins,beforeLoad:e.beforeLoad,beforeMount:e.beforeMount,afterMount:e.afterMount,beforeUnmount:e.beforeUnmount,afterUnmount:e.afterUnmount,activated:e.activated,deactivated:e.deactivated,loadError:e.loadError,iframeAddEventListeners:e.iframeAddEventListeners,iframeOnEvents:e.iframeOnEvents});case 3:t.next=8;break;case 5:t.prev=5,t.t0=t.catch(0),console.log(t.t0);case 8:case"end":return t.stop()}},t,null,[[0,5]])}),function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Q(i,n,o,a,u,"next",t)}function u(t){Q(i,n,o,a,u,"throw",t)}a(void 0)})})()},execStartApp:function(){this.startAppQueue=this.startAppQueue.then(this.startApp),window.__WUJIE_QUEUE[this.name]=this.startAppQueue},destroy:function(){E(this.name)}},beforeDestroy:function(){b.$offAll(this.handleEmit)},render:function(){return f("div",{style:F({width:this.width,height:this.height},this.style),ref:"wujie"})}});J.setupApp=L,J.preloadApp=O,J.bus=b,J.destroyApp=E,J.install=function(t){t.component("WujieVue",J)};var{destroyApp:W}=J,G=/* @__PURE__ */l({name:"WuJieContainer",props:{wuJieName:{type:String,required:!0}},setup(t){const e=o("wujie-container"),r=g();function c(t){Object.defineProperty(t,"_gct",{get:()=>window._gct}),Object.defineProperty(t,"_api",{get:()=>window._api})}function l(e){console.debug("loadError",t.wuJieName)}const{userInfo:s}=i(),f=a(()=>({appInfo:_gct.store.appInfo,userInfo:s,token:n(),...r.props??{}}));return v(()=>{!0!==r.alive&&W(t.wuJieName)}),()=>u(m("wujieVue"),p({class:e.b(),name:t.wuJieName,beforeLoad:c,loadError:l},r,{props:f.value}),null)}}),z=y([]),D=a(()=>[{id:"IconAsset",name:"资产图标",children:z.value}].filter(t=>{var e;return null===(e=t.children)||void 0===e?void 0:e.length}));function H(){return{getIconAssetCats:async function(){if(z.value.length>0)return D.value;const t={assetsModule:"ICON"};return z.value=await Promise.all([_api.platform.category.getList(t),_api.platform.assets.getList(t)]).then(([t,r])=>null==t?void 0:t.map(t=>({id:`${t.id}`,name:t.name,icons:null==r?void 0:r.filter(e=>e.categoryId===t.id).map(t=>(Object.assign(t,{id:`${e.Asset}:${t.path}`,_filter_:[t.name]}),t))})).filter(t=>{var e;return null===(e=t.icons)||void 0===e?void 0:e.length})),D.value}}}var q=/* @__PURE__ */function(t){return t.Base="Base",t.Others="Others",t}(q||{}),R=y([]),V=a(()=>[{id:"IconPark",name:"IconPark",children:R.value}]);function Y(){return{getIconParkCats:function(){if(R.value.length>0)return V.value;const t=[];j.forEach(r=>{const n={...r,id:`${e.IconPark}:${r.name}`,_filter_:[...r.tag,r.title,r.name]};let o=t.find(t=>t.id===n.category);o?o.icons.push(n):(o={id:n.category,name:n.categoryCN,icons:[n]},t.push(o))});const r=t.filter(t=>t.id===q.Base),n=t.filter(t=>t.id===q.Others),o=t.filter(t=>![q.Base,q.Others].includes(t.id));return R.value=r.concat(o,n),V.value}}}var K=a(()=>[{id:"medicalCare",name:"医疗器械",icons:Z.value},{id:"IconPlatform",name:"平台图标",icons:X.value}]),X=a(()=>x.filter(t=>/^(icon-platform)/.test(t)).map(t=>{const r=t.replace(/icon-/g,"");return{id:`${e.Platform}:${r}`,name:r,_filter_:[r]}})),Z=a(()=>x.filter(t=>/^(icon-medicalCare)/.test(t)).map(t=>{const r=t.replace(/icon-/g,"");return{id:`${e.Platform}:${r}`,name:t.replace(/icon-medicalCare-/g,""),_filter_:[r]}}));function tt(){return{getIconPlatformCats:function(){return K.value}}}var et=c(()=>import("./IconNext-C8JnjNsP.js")),rt=!1;function nt(e){rt||(rt=!0,e.component(k.name,k),e.component(t.name,t),e.component(G.name,G),e.component("IconNext",et))}var ot=new URL("./index.min.css",import.meta.url);r.load(ot.href);export{k as AssetsSvgIcon,e as IconNamespaceEnum,et as IconNext,t as SvgIcon,G as WuJieContainer,nt as coreComponentsCreateAppVue,H as useIconAsset,Y as useIconPark,tt as useIconPlatform};
|
package/es/create-app-vue.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ import { App } from 'vue';
|
|
|
4
4
|
*
|
|
5
5
|
* @export
|
|
6
6
|
* @param {App} app
|
|
7
|
-
* @return {*} {
|
|
7
|
+
* @return {*} {void}
|
|
8
8
|
*/
|
|
9
|
-
export declare function coreComponentsCreateAppVue(app: App):
|
|
9
|
+
export declare function coreComponentsCreateAppVue(app: App): void;
|
package/es/create-app-vue.mjs
CHANGED
|
@@ -9,9 +9,9 @@ var isRegistered = false;
|
|
|
9
9
|
*
|
|
10
10
|
* @export
|
|
11
11
|
* @param {App} app
|
|
12
|
-
* @return {*} {
|
|
12
|
+
* @return {*} {void}
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
function coreComponentsCreateAppVue(app) {
|
|
15
15
|
if (isRegistered) return;
|
|
16
16
|
isRegistered = true;
|
|
17
17
|
app.component(AssetsSvgIcon.name, AssetsSvgIcon);
|
|
@@ -14,9 +14,6 @@ var WuJieContainer = /* @__PURE__ */ defineComponent({
|
|
|
14
14
|
const ns = useNamespace("wujie-container");
|
|
15
15
|
const attr = useAttrs();
|
|
16
16
|
function beforeLoad(win) {
|
|
17
|
-
Object.defineProperty(win, "pSystem", { get: () => {
|
|
18
|
-
return window.System;
|
|
19
|
-
} });
|
|
20
17
|
Object.defineProperty(win, "_gct", { get: () => {
|
|
21
18
|
return window._gct;
|
|
22
19
|
} });
|
|
@@ -24,21 +21,15 @@ var WuJieContainer = /* @__PURE__ */ defineComponent({
|
|
|
24
21
|
return window._api;
|
|
25
22
|
} });
|
|
26
23
|
}
|
|
27
|
-
function
|
|
28
|
-
console.debug("
|
|
29
|
-
console.debug("beforeMount _gct", win._gct);
|
|
30
|
-
console.debug("beforeMount _api", win._api);
|
|
31
|
-
}
|
|
32
|
-
function loadError(win) {
|
|
33
|
-
console.debug("loadError", win.System);
|
|
24
|
+
function loadError(_win) {
|
|
25
|
+
console.debug("loadError", props.wuJieName);
|
|
34
26
|
}
|
|
35
27
|
const { userInfo } = useUserStore();
|
|
36
|
-
const token = getToken();
|
|
37
28
|
const _props = computed(() => {
|
|
38
29
|
return {
|
|
39
30
|
appInfo: _gct.store.appInfo,
|
|
40
31
|
userInfo,
|
|
41
|
-
token,
|
|
32
|
+
token: getToken(),
|
|
42
33
|
...attr.props ?? {}
|
|
43
34
|
};
|
|
44
35
|
});
|
|
@@ -51,7 +42,6 @@ var WuJieContainer = /* @__PURE__ */ defineComponent({
|
|
|
51
42
|
"class": ns.b(),
|
|
52
43
|
"name": props.wuJieName,
|
|
53
44
|
"beforeLoad": beforeLoad,
|
|
54
|
-
"beforeMount": beforeMount,
|
|
55
45
|
"loadError": loadError
|
|
56
46
|
}, attr, { "props": _props.value }), null);
|
|
57
47
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gct-paas/core-components",
|
|
3
|
-
"version": "0.1.6-dev.
|
|
3
|
+
"version": "0.1.6-dev.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "paas 平台核心组件包,不区分Web、Mobile、Pad等平台,包含一些基础组件",
|
|
6
6
|
"loader": "dist/loader.esm.min.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"author": "gct",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ant-design/icons-vue": "^6.1.0",
|
|
35
|
-
"@gct-paas/api": "^0.1.6-dev.
|
|
35
|
+
"@gct-paas/api": "^0.1.6-dev.5",
|
|
36
36
|
"@gct-paas/platform-icons": "^0.0.2",
|
|
37
37
|
"@icon-park/vue-next": "^1.4.2",
|
|
38
38
|
"@vueuse/core": "^14.1.0",
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"vue": "^3.5.30",
|
|
42
42
|
"wujie": "^1.0.29",
|
|
43
43
|
"wujie-vue3": "^1.0.29",
|
|
44
|
-
"@gct-paas/core": "0.1.6-dev.
|
|
45
|
-
"@gct-paas/scss": "0.1.6-dev.
|
|
44
|
+
"@gct-paas/core": "0.1.6-dev.7",
|
|
45
|
+
"@gct-paas/scss": "0.1.6-dev.7"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@gct-paas/api": "^0.1.6-dev.
|
|
48
|
+
"@gct-paas/api": "^0.1.6-dev.5",
|
|
49
49
|
"vant": ">=4",
|
|
50
50
|
"vue": ">=3",
|
|
51
|
-
"@gct-paas/core": "0.1.6-dev.
|
|
52
|
-
"@gct-paas/scss": "0.1.6-dev.
|
|
51
|
+
"@gct-paas/core": "0.1.6-dev.7",
|
|
52
|
+
"@gct-paas/scss": "0.1.6-dev.7"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"dev": "cross-env NODE_ENV=development vite build --watch --config vite.dev.config.ts",
|