@syncfusion/ej2-vue-base 31.2.2 → 31.2.10
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/.eslintrc.json +2 -0
- package/README.md +1 -1
- package/dist/ej2-vue-base.umd.min.js +0 -9
- package/dist/global/ej2-vue-base.min.js +0 -9
- package/dist/global/index.d.ts +0 -9
- package/package.json +16 -83
- package/dist/ts/component-base.d.ts +0 -30
- package/dist/ts/component-base.ts +0 -568
- package/dist/ts/index.d.ts +0 -6
- package/dist/ts/index.ts +0 -6
- package/dist/ts/template.d.ts +0 -8
- package/dist/ts/template.ts +0 -361
- package/dist/ts/vue-types.d.ts +0 -15
package/.eslintrc.json
CHANGED
|
@@ -39,6 +39,8 @@
|
|
|
39
39
|
"security/detect-pseudoRandomBytes":"error",
|
|
40
40
|
"security/detect-new-buffer":"error",
|
|
41
41
|
"security/detect-bidi-characters":"error",
|
|
42
|
+
"no-prototype-builtins": "warn",
|
|
43
|
+
"no-extend-native": ["warn"],
|
|
42
44
|
"@typescript-eslint/no-inferrable-types": "off",
|
|
43
45
|
"@typescript-eslint/ban-types": ["warn", {
|
|
44
46
|
"types": {
|
package/README.md
CHANGED
|
@@ -77,5 +77,5 @@ Check the license detail [here](https://github.com/syncfusion/ej2-vue-ui-compone
|
|
|
77
77
|
|
|
78
78
|
Check the changelog [here](https://ej2.syncfusion.com/vue/documentation/release-notes?utm_source=npm&utm_campaign=ej2-vue-base)
|
|
79
79
|
|
|
80
|
-
© Copyright
|
|
80
|
+
© Copyright 2024 Syncfusion, Inc. All Rights Reserved.
|
|
81
81
|
The Syncfusion Essential Studio license and copyright applies to this distribution.
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* filename: ej2-vue-base.umd.min.js
|
|
3
|
-
* version : 31.2.2
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
-
* Use of this code is subject to the terms of our license.
|
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
-
* applicable laws.
|
|
9
|
-
*/
|
|
10
1
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","vue","@syncfusion/ej2-base"],t):t((e=e||self).ej={},e.Vue,e.ej2Base)}(this,function(e,t,M){"use strict";function n(e){return k?N.extend(e):N.defineComponent(e)}var t=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[""+n]=e[""+n]);return t.default=e,t}(t),k=!(2<parseInt(t.version,10)),N=k?t.default.default||t.default:t,t=t.h,s=n({name:"ComponentBase",data:function(){return{tagMapper:{},tagNameMapper:{},hasInjectedModules:!1,hasChildDirective:!1,childDirObjects:"",propKeys:{},isDecorator:!1}},created:function(){var n=this;if(this.ej2Instance&&(this.ej2Instances=this.isVue3?N.toRaw(this.ej2Instance):this.ej2Instance),this.propKeys){for(var e=this,t=0,s=this.propKeys;t<s.length;t++)!function(t){e.ej2Instances.addEventListener(t,function(e){n.$emit(t,e)})}(s[t]);var r=M.getValue("$root.$options.provide",this),i=M.getValue("$parent.$options.provide",this),i=M.isNullOrUndefined(i)?M.getValue("$.parent.provides",this):i;if(this.hasInjectedModules&&!k){var a=[];r&&r.managed?(this.isDecorator=!0,a=this.getInjectedServices()||[]):r?a=r[this.ej2Instances.getModuleName()]||[]:i&&(a=this.getInjectedServices()||[]);for(var o=0,p=this.ej2Instances.getInjectedModules()||[];o<p.length;o++){var l=p[o];-1===a.indexOf(l)&&a.push(l)}this.ej2Instances.injectedModules=a}}},mounted:function(){var e=this.$el?this.$el.querySelectorAll("div.e-directive"):null;if(!k&&e)for(var t=0;t<e.length;t++){var n=e[parseInt(t.toString(),10)];n.parentElement&&n.parentElement.removeChild(n)}this.ej2Instances.isVue=!0,this.ej2Instances.isVue3=this.isVue3,(this.ej2Instances.vueInstance=this).isVue3&&(this.ej2Instances.ej2Instances=this.ej2Instances,this.ej2Instances.referModels=this.models,this.setModelValue()),this.ej2Instances.appendTo(this.$el)},updated:function(){this.updated()},beforeDestroy:function(){this.destroyComponent()},beforeUnmount:function(){this.destroyComponent()},methods:{setModelValue:function(){var e;M.isNullOrUndefined(this.modelValue)&&M.isNullOrUndefined(this.$attrs.modelValue)||(e=(this.models.toString().match(/checked|value/)||[])[0],M.isNullOrUndefined(e))||(this.ej2Instances[""+e]=(M.isNullOrUndefined(this.modelValue)?this.$attrs:this).modelValue)},updated:function(){var e,t;this.isVue3&&this.setModelValue(),this.hasChildDirective&&(this.fetchChildPropValues(e={}),t=JSON.stringify(e),this.childDirObjects!==t)&&(this.childDirObjects=t,this.assignValueToWrapper(e,!1))},getInjectedServices:function(){var e,t=[];if(this.$root&&this.isDecorator?e=M.getValue("$root.$options.provide",this):this.$vnode?e=M.getValue("$vnode.context.$options.provide",this):this.$parent&&(e=M.getValue("$parent.$options.provide",this)),e=M.isNullOrUndefined(e)&&!M.isNullOrUndefined(this.$)?M.getValue("$.parent.provides",this):e){var n=e;if("function"==typeof e)if(e.managed){var s=e.managed,r=Object.keys(s),i=void 0;this.$root&&this.isDecorator?i=Object.keys(this.$root):this.$vnode?i=Object.keys(this.$vnode.context):this.$parent&&(i=Object.keys(this.$parent));for(var a=0;a<r.length;a++)for(var o=0;o<i.length;o++)-1!==i[parseInt(o.toString(),10)].indexOf(r[parseInt(a.toString(),10)])&&(this.$root&&this.isDecorator?s[r[parseInt(o.toString(),10)]]=this.$root[i[parseInt(a.toString(),10)]]:this.$vnode?s[r[parseInt(a.toString(),10)]]=this.$vnode.context[i[parseInt(o.toString(),10)]]:this.$parent&&(s[r[parseInt(a.toString(),10)]]=this.$parent[i[parseInt(o.toString(),10)]]),n=s)}else this.$vnode?n=this.$vnode.context.$options.provide():this.$parent&&(n=this.$parent.$options.provide());t=n[this.ej2Instances.getModuleName()]||[]}return this.isDecorator=!1,t},destroyComponent:function(){this.ej2Instances.destroy(),this.$el.style.visibility="hidden",this.clearTemplate()},destroyPortals:function(e){if(e){if(M.getValue("__vue__.$destroy",e))e.__vue__.$destroy();else if(!k&&e._vnode)try{N.render(null,e)}catch(e){}e.innerHTML&&(e.innerHTML="")}},bindProperties:function(){for(var e={},t=0,n=this.propKeys;t<n.length;t++){var s=n[t];M.isNullOrUndefined(this[""+s])?!this[0]||M.isNullOrUndefined(this[0][0])||M.isNullOrUndefined(this[0][0][""+s])||(e[""+s]=this[0][0][""+s]):e[""+s]=this[""+s]}if(this.hasChildDirective&&this.fetchChildPropValues(e),this.hasInjectedModules){for(var r=this.getInjectedServices()||[],i=0,a=this.ej2Instances.getInjectedModules()||[];i<a.length;i++){var o=a[i];-1===r.indexOf(o)&&r.push(o)}this.ej2Instances.injectedModules=r}this.assignValueToWrapper(e)},assignValueToWrapper:function(e,t){this.ej2Instances.setProperties(M.extend({},{},e,!0),!!M.isNullOrUndefined(t)||t)},fetchChildPropValues:function(e){var t={};if(this.isVue3){var n=void 0;if(this[0]&&this[0][1].slots.default?n=this[0][1].slots.default():this&&this.$&&this.$.slots&&this.$.slots.default&&(n=this.$.slots.default()),!n)return;for(var s,r,i,a,o=0;o<n.length;o++)!n[parseInt(o.toString(),10)].type.methods&&"e-seriescollection"!==n[parseInt(o.toString(),10)].type||(s="e-seriescollection"===n[parseInt(o.toString(),10)].type?"series-collection":n[parseInt(o.toString(),10)].type.methods.getTag().replace("e-",""),r=this.resolveArrayDirectives(n[parseInt(o.toString(),10)].children,s),a=s.split("-"),i=this.ej2Instances.getModuleName().toLowerCase(),a=(a=1<a.length&&-1<i.indexOf(a[0])?a[1]:a[0]).replace(i,""),a=this.tagNameMapper["e-"+s]?this.tagNameMapper["e-"+s].replace("e-",""):a,"splitter"===i&&"panes"===a?a="paneSettings":"bulletchart"===i&&"range"===a?a="ranges":"schedule"===i&&"header"===a&&(a="headerRows"),t[""+a]=r[""+s])}else t=this.getDirectiveValues(this.$slots.default,this.tagMapper||{},this.tagNameMapper||{});this.childDirObjects||(this.childDirObjects=JSON.stringify(t));for(var p=0,l=Object.keys(t);p<l.length;p++){var c=l[p];e[""+c]=t[""+c]}},resolveArrayDirectives:function(e,i){var a,t=[];t=(t=e.default?e.default():e).flatMap(function(e){return Array.isArray(e.children)?e.children:e});for(var o={},p=(o[""+i]=[],this),n=0,s=t;n<s.length;n++)!function(n){var s={},e=n.type.methods?n.type.methods.getTag():i;if(n.children){var t;if((a=p.resolveComplexDirs(n.children,p.tagMapper["e-"+i],e)).length)s=a;else for(var r=0;r<Object.keys(a).length;r++)t=Object.keys(a)[parseInt(r.toString(),10)],s[""+t]=a[""+t]}n.props&&Object.keys(n.props).forEach(function(e){var t=e.replace(/-[a-z]/g,function(e){return e[1].toUpperCase()});t&&(s[""+t]=n.props[""+e])}),/[s]\b/.test(e)&&a&&(!/[s]\b/.test(i)||a.length)?Array.isArray(s)?s.forEach(function(e){o[""+i].push(e)}):o[""+i].push(s):s&&0!==Object.keys(s).length&&o[""+i].push(s)}(s[n]);return o},resolveComplexDirs:function(e,n,s){for(var r,i=[],i=e.default?e.default():e,a={},o=this,t=0,p=i;t<p.length;t++)!function(t){var e=void 0;n[""+s]&&(e=(e=Object.keys(n[""+s]).find(function(e){return n[""+s][""+e]===t.type.methods.getTag().replace(/[s]\b/,"")}))||t.type.methods.getTag(),e=(o.tagNameMapper[""+e]||e).replace("e-",""),"diagram"===o.ej2Instances.getModuleName().toLowerCase())&&-1!==e.indexOf("annotations")&&(e="annotations"),t.children&&(r=o.resolveComplexInnerDirs(t.children,n[""+s],t.type.methods.getTag()),a[""+e]||(a[""+e]=[]),1<r.length?a[""+e]=r:a[""+e].push(r)),t.props&&(t.props=o.getCamelCaseProps(t.props)),1<i.length?(a=0!==Object.keys(a).length||a.length?a:[],t.props&&a.push(t.props)):a=t.props?Object.assign(a,t.props):a}(p[t]);return a},resolveComplexInnerDirs:function(e,t,n){for(var s,r=1<(s=e.default?e.default():e).length?[]:{},i=0,a=s;i<a.length;i++){var o=a[i],p=null,l=o.type.methods.getTag(),l=(this.tagNameMapper[""+l]||l).replace("e-","");o.children&&(p=this.resolveMultilevelComplexInnerDirs(o.children,t[""+n],o.type.methods.getTag()),/[s]\b/.test(l)||1<s.length?/[s]\b/.test(l)?(r[""+l]=r[""+l]||[],p.length?r[""+l]=p:r[""+l].push(p)):p&&!o.props&&r.push(p):r=p||r),o.props&&(o.props=this.getCamelCaseProps(o.props)),1<s.length&&o.props?p?(p=o.props?Object.assign(p,o.props):p,r.push(p)):0<=r.length?r.push(o.props):r=o.props?Object.assign(r,o.props):r:r=o.props?Object.assign(r,o.props):r}return r},resolveMultilevelComplexInnerDirs:function(e,t,n){for(var s=1<(e=e.default?e.default():e).length?[]:{},r=0,i=e;r<i.length;r++){var a=i[r],o=null,p=a.type.methods.getTag(),p=(this.tagNameMapper[""+p]||p).replace("e-","");a.children&&(o=this.resolveComplexInnerDirs(a.children,t[""+n],a.type.methods.getTag())),a.props&&(a.props=this.getCamelCaseProps(a.props)),/[s]\b/.test(p)?(s[""+p]=s[""+p]||[],o.length?s[""+p]=o:s[""+p].push(o),a.props&&s[""+p].push(a.props)):(s=o,s=a.props?Object.assign(s,a.props):s)}return s},getDirectiveValues:function(e,t,n){var s=Object.keys(t),r={};if(e)for(var i=0,a=e;i<a.length;i++){var o=a[i],p=o.componentOptions;if(p&&p.children&&this.getTagName(p)||"e-seriescollection"===o.tag&&o.children){var l=p?this.getTagName(p):o.tag;if(-1!==s.indexOf(l="e-seriescollection"===l?"e-seriesCollection":l)){var c=n[""+l]||l;r[c.replace("e-","")]=[];for(var d=0,h=(p||o).children;d<h.length;d++){var u=h[d],u=this.getVNodeValue(u,t[""+l],n);0!==Object.keys(u).length&&r[c.replace("e-","")].push(u)}}}}return r},getMultiLevelDirValue:function(e,t,n){for(var s={},r=0,i=e;r<i.length;r++){var a=i[r],o=void 0,p=void 0;if(a.componentOptions?(o=this.getTagName(a.componentOptions),a.componentOptions.children&&(p=a.componentOptions.children)):"e-markersettings"!==a.tag&&"e-markersetting"!==a.tag||!a.children||(o="e-markersettings"===a.tag?"e-markerSettings":"e-markerSetting",p=a.children),o){var l=n[""+o]||o;if(s[l.replace("e-","")]=[],p)for(var c=0,d=p;c<d.length;c++){var h=d[c],h=this.getVNodeValue(h,t[""+o],n);0!==Object.keys(h).length&&s[l.replace("e-","")].push(h)}}}return s},getVNodeValue:function(e,t,n){var s,r,i={};return(e.componentOptions||("e-markersettings"===e.tag||"e-markersetting"===e.tag)&&e.context)&&(s=void 0,s=e.componentOptions?this.getTagName(e.componentOptions):"e-markersettings"===e.tag?"e-markerSettings":"e-markerSetting",r=e.data,"string"==typeof t&&s===t&&r?i=r.attrs?this.getCamelCaseProps(r.attrs):this.getCamelCaseProps(r):"object"==typeof t&&(e.componentOptions.children&&-1!==Object.keys(t).indexOf(s)?i=this.getMultiLevelDirValue(e.componentOptions.children,t[""+s],n):!e.children||-1===Object.keys(t).indexOf(s)||"e-markersettings"!==s&&"e-markersetting"!==s||(i=this.getMultiLevelDirValue(e.children,t[""+s],n)),r)&&r.attrs&&(i=M.extend(i,this.getCamelCaseProps(r.attrs)))),i},getCamelCaseProps:function(e){for(var t={},n=0,s=Object.keys(e);n<s.length;n++){var r=s[n];t[r.replace(/-[a-z]/g,function(e){return e[1].toUpperCase()})]=e[""+r]}return t},dataBind:function(){this.ej2Instances.dataBind()},setProperties:function(e,t){return this.ej2Instances.setProperties(e,t)},getTagName:function(e){var t=e.tag,n=e.Ctor;return t=!t&&n&&n.extendOptions&&n.extendOptions.methods&&n.extendOptions.methods.getTag?e.Ctor.extendOptions.methods.getTag():t}}});k||M.setProxyToRaw(N.toRaw);var S=function(){return(S=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},T=M.getTemplateEngine();function r(x,V){var D=this;return function(e,t,n,s,r){var i;if(t){var a=t.vueInstance&&t.vueInstance.plugins?{plugins:t.vueInstance.plugins}:{},o=t.vueInstance||(r&&r.vueInstance?r.vueInstance:null),p=M.getUniqueID("templateParentDiv"),l=M.getUniqueID("templateDiv"),p=M.createElement("div",{id:p,innerHTML:'<div id="'+l+'"></div>'});if(document.body.appendChild(p),!k&&("string"==typeof x||x.prototype&&x.prototype.CSPTemplate&&"function"==typeof x)){var c=function(e,t,n){if(e||n&&n.vueInstance)return function e(t,n){{if(t&&t[""+n])return t;if(t&&t.default){var s=t.default();s=s.flatMap(function(e){return Array.isArray(e.children)?e.children:e});for(var r=0;r<s.length;r++){var i=e(s[parseInt(r.toString(),10)].children,n);if(i)return i}}}return}((n&&n.vueInstance?n.vueInstance:e).$slots,t)}(t.vueInstance,x,r);if(!c)return M.detach(p),T(x,V)(e);var d=N.createVNode({render:function(){return c[""+x]({data:e})}},a);p.innerHTML="",_(d,t.vueInstance,r),N.render(d,p),i=p.childNodes,o&&(($=o.templateCollection)||(o.templateCollection={},$=o.templateCollection),n)&&($[""+n]||($[""+n]=[]),$[""+n].push(p))}else if(k)if("string"==typeof x||x.prototype&&x.prototype.CSPTemplate&&"function"==typeof x){var h=function(e,t,n){if(e||n&&n.vueInstance)return function e(t,n){if(!t)return;var s=t.$slots;var r=t.$scopedSlots;var i=t.scopedSlots;var a=t.children;{if(r&&r[""+n])return r;if(s&&s.default){for(var o=s.default,p=0;p<o.length;p++)if(l=e(P(o[parseInt(p.toString(),10)]),n))return l}else{if(i&&i[""+n])return i;if(a)for(var l,p=0;p<a.length;p++)if(l=e(P(a[parseInt(p.toString(),10)]),n))return l}}return}(n&&n.vueInstance?n.vueInstance:e,t)}(t.vueInstance,x,r);if(!h)return M.detach(p),T(x,V)(e);var u={},f=function(e){e.$parent&&f(e.$parent),e._provided&&0<Object.keys(e._provided).length&&(u=S({},u,e._provided))},g=t.vueInstance||(r&&r.vueInstance?r.vueInstance:null);g&&f(g),new N({provide:S({},u),render:function(){return h[""+x]({data:e})}}).$mount("#"+l),i=p.childNodes,g&&(($=g.templateCollection)||(g.templateCollection={},$=g.templateCollection),n)&&($[""+n]||($[""+n]=[]),$[""+n].push(i[0]))}else{var g=(j=x.call(D,{})).template,v=M.getValue("template.propsData",j),m={data:{data:M.extend(j.data||{},e)},parent:t.vueInstance};v&&(g=j.template.extends,m.propsData=v),(g="function"!=typeof g?N.extend(g):g).options.setup&&(m.propsData=Object.assign(m.propsData||{},e)),new g(m).$mount("#"+l),i=p.childNodes,m.parent=null,o&&(($=o.templateCollection)||(o.templateCollection={},$=o.templateCollection),n)&&($[""+n]||($[""+n]=[]),$[""+n].push(i[0]))}else{var j,I,g=j=x.call(D,{}),v=M.getValue("template.propsData",j),y={data:{data:M.extend(j.data||{},e)},parent:t.vueInstance},O=(g.template||(g.template=g[Object.keys(g)[0]]),void 0);if(g.template.extends?O=g.template.extends._context.components.template:(O=g.template._context.components[x.name])||(l=Object.keys(g.template._context.components)[0],O=g.template._context.components[""+l]),v)I=O.setup?Object.assign({},v):Object.assign(O.data(),v);else if(I=O.setup?Object.assign({},y.data):Object.assign(O.data(),y.data),O.components)for(var C=0,b=Object.keys(O.components)||[];C<b.length;C++)!function(e){var t=O.components[""+e];t&&t.data&&(t.__data||(t.__data=t.data),t.data=function(e){return Object.assign(t.__data.call(e),y.data)})}(b[C]);O.setup&&(a=Object.assign(a,e)),O.data=function(){return I};var $,d=N.createVNode(O,a);p.innerHTML="",_(d,t.vueInstance,r),N.render(d,p),i=p.childNodes,y.parent=null,o&&(($=o.templateCollection)||(o.templateCollection={},$=o.templateCollection),n)&&($[""+n]||($[""+n]=[]),$[""+n].push(p))}M.detach(p)}return i||[]}}function _(e,t,n){var s,r,t=t||(n&&n.vueInstance?n.vueInstance:null);t&&(e.appContext=t.$.appContext,s={},(r=function(e){e.$&&e.$.parent&&r(e.$.parent),e.provides&&0<Object.keys(e.provides).length&&(s=S({},s,e.provides))})(t),e.appContext.provides)&&(e.appContext.provides=S({},e.appContext.provides,s))}function P(e){var t=e.componentOptions&&e.componentOptions.children?e.componentOptions:e.data||"e-markersettings"!==e.tag&&"e-markersetting"!==e.tag?e.data:e;return e.componentInstance||t}M.setTemplateEngine({compile:r}),e.ComponentBase=s,e.aVue=N,e.compile=r,e.getProps=function(n){if((n=void 0===n?{}:n).props)for(var e=0,t=n.props;e<t.length;e++)!function(t){(n.newprops||(n.newprops={}))[""+t]={},(n.watch||(n.watch={}))[""+t]=function(e){this.ej2Instances[""+t]=e,this.dataBind&&"DateRangePickerComponent"!==n.name&&this.dataBind()}}(t[e]);return[n.newprops,n.watch]},e.gh=t,e.isExecute=k,e.vueDefineComponent=n,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
2
|
//# sourceMappingURL=ej2-vue-base.umd.min.js.map
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* filename: ej2-vue-base.min.js
|
|
3
|
-
* version : 31.2.2
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
-
* Use of this code is subject to the terms of our license.
|
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
-
* applicable laws.
|
|
9
|
-
*/
|
|
10
1
|
this.ej=this.ej||{},this.ej.vuebase=function(e,t,n){"use strict";function s(e){if(void 0===e&&(e={}),e.props)for(var t=0,n=e.props;t<n.length;t++)!function(t){(e.newprops||(e.newprops={}))[""+t]={},(e.watch||(e.watch={}))[""+t]=function(n){this.ej2Instances[""+t]=n,this.dataBind&&"DateRangePickerComponent"!==e.name&&this.dataBind()}}(n[t]);return[e.newprops,e.watch]}function r(e,t){var s=this;return function(r,o,p,c,h){var g;if(o){var f=o.vueInstance&&o.vueInstance.plugins?{plugins:o.vueInstance.plugins}:{},v=o.vueInstance?o.vueInstance:h&&h.vueInstance?h.vueInstance:null,j=n.getUniqueID("templateParentDiv"),O=n.getUniqueID("templateDiv"),y=n.createElement("div",{id:j,innerHTML:'<div id="'+O+'"></div>'});if(document.body.appendChild(y),!d&&("string"==typeof e||e.prototype&&e.prototype.CSPTemplate&&"function"==typeof e)){var C=l(o.vueInstance,e,h);if(!C)return n.detach(y),I(e,t)(r);E=u.createVNode({render:function(){return C[""+e]({data:r})}},f);y.innerHTML="",i(E,o.vueInstance,h),u.render(E,y),g=y.childNodes,v&&((S=v.templateCollection)||(v.templateCollection={},S=v.templateCollection),p&&(S[""+p]||(S[""+p]=[]),S[""+p].push(y))),n.detach(y)}else if(d)if("string"==typeof e||e.prototype&&e.prototype.CSPTemplate&&"function"==typeof e){var $=a(o.vueInstance,e,h);if(!$)return n.detach(y),I(e,t)(r);var b={},V=function(e){e.$parent&&V(e.$parent),e._provided&&Object.keys(e._provided).length>0&&(b=m({},b,e._provided))},x=o.vueInstance?o.vueInstance:h&&h.vueInstance?h.vueInstance:null;x&&V(x),new u({provide:m({},b),render:function(){return $[""+e]({data:r})}}).$mount("#"+O),g=y.childNodes,x&&((S=x.templateCollection)||(x.templateCollection={},S=x.templateCollection),p&&(S[""+p]||(S[""+p]=[]),S[""+p].push(g[0]))),n.detach(y)}else{var M=e.call(s,{}),N=M.template,D=n.getValue("template.propsData",M),k={data:{data:n.extend(M.data||{},r)},parent:o.vueInstance};if(D&&(N=M.template.extends,k.propsData=D),"function"!=typeof N&&(N=u.extend(N)),N.options.setup&&(k.propsData=Object.assign(k.propsData||{},r)),new N(k).$mount("#"+O),g=y.childNodes,k.parent=null,v){var S=v.templateCollection;S||(v.templateCollection={},S=v.templateCollection),p&&(S[""+p]||(S[""+p]=[]),S[""+p].push(g[0]))}n.detach(y)}else{var T=M=e.call(s,{}),D=n.getValue("template.propsData",M),_={data:{data:n.extend(M.data||{},r)},parent:o.vueInstance};T.template||(T.template=T[Object.keys(T)[0]]);var P=void 0;if(T.template.extends)P=T.template.extends._context.components.template;else if(!(P=T.template._context.components[e.name])){var w=Object.keys(T.template._context.components)[0];P=T.template._context.components[""+w]}var U;if(D)U=P.setup?Object.assign({},D):Object.assign(P.data(),D);else if(U=P.setup?Object.assign({},_.data):Object.assign(P.data(),_.data),P.components)for(var L=0,A=Object.keys(P.components)||[];L<A.length;L++)!function(e){var t=P.components[""+e];t&&t.data&&(t.__data||(t.__data=t.data),t.data=function(e){return Object.assign(t.__data.call(e),_.data)})}(A[L]);P.setup&&(f=Object.assign(f,r)),P.data=function(){return U};var E=u.createVNode(P,f);y.innerHTML="",i(E,o.vueInstance,h),u.render(E,y),g=y.childNodes,_.parent=null,v&&((S=v.templateCollection)||(v.templateCollection={},S=v.templateCollection),p&&(S[""+p]||(S[""+p]=[]),S[""+p].push(y))),n.detach(y)}}return g||[]}}function i(e,t,n){var s=t||(n&&n.vueInstance?n.vueInstance:null);if(s){e.appContext=s.$.appContext;var r={},i=function(e){e.$&&e.$.parent&&i(e.$.parent),e.provides&&Object.keys(e.provides).length>0&&(r=m({},r,e.provides))};i(s),e.appContext.provides&&(e.appContext.provides=m({},e.appContext.provides,r))}}function a(e,t,n){if(e||n&&n.vueInstance)return o(n&&n.vueInstance?n.vueInstance:e,t)}function o(e,t){if(e){var n=e.$slots,s=e.$scopedSlots,r=e.scopedSlots,i=e.children;if(s&&s[""+t])return s;if(n&&n.default){for(var a=n.default,l=0;l<a.length;l++)if(c=o(p(a[parseInt(l.toString(),10)]),t))return c}else{if(r&&r[""+t])return r;if(i)for(l=0;l<i.length;l++){var c=o(p(i[parseInt(l.toString(),10)]),t);if(c)return c}}}}function p(e){var t=e.componentOptions&&e.componentOptions.children?e.componentOptions:e.data||"e-markersettings"!==e.tag&&"e-markersetting"!==e.tag?e.data:e;return e.componentInstance?e.componentInstance:t}function l(e,t,n){if(e||n&&n.vueInstance)return c(n&&n.vueInstance?n.vueInstance.$slots:e.$slots,t)}function c(e,t){if(e&&e[""+t])return e;if(e&&e.default){var n=e.default();n=n.flatMap(function(e){return Array.isArray(e.children)?e.children:e});for(var s=0;s<n.length;s++){var r=c(n[parseInt(s.toString(),10)].children,t);if(r)return r}}}var h=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[""+n]=e[""+n]);return t.default=e,t}(t),d=!(parseInt(h.version,10)>2),u=d?h.default.default?h.default.default:h.default:h,g=h.h,f=function(e){return d?u.extend(e):u.defineComponent(e)},v=f({name:"ComponentBase",data:function(){return{tagMapper:{},tagNameMapper:{},hasInjectedModules:!1,hasChildDirective:!1,childDirObjects:"",propKeys:{},isDecorator:!1}},created:function(){var e=this;if(this.ej2Instance&&(this.ej2Instances=this.isVue3?u.toRaw(this.ej2Instance):this.ej2Instance),this.propKeys){for(var t=this,s=0,r=this.propKeys;s<r.length;s++)!function(n){t.ej2Instances.addEventListener(n,function(t){e.$emit(n,t)})}(r[s]);var i=n.getValue("$root.$options.provide",this),a=n.getValue("$parent.$options.provide",this);if(a=n.isNullOrUndefined(a)?n.getValue("$.parent.provides",this):a,this.hasInjectedModules&&!d){var o=[];i&&i.managed?(this.isDecorator=!0,o=this.getInjectedServices()||[]):i?o=i[this.ej2Instances.getModuleName()]||[]:a&&(o=this.getInjectedServices()||[]);for(var p=0,l=this.ej2Instances.getInjectedModules()||[];p<l.length;p++){var c=l[p];-1===o.indexOf(c)&&o.push(c)}this.ej2Instances.injectedModules=o}}},mounted:function(){var e=this.$el?this.$el.querySelectorAll("div.e-directive"):null;if(!d&&e)for(var t=0;t<e.length;t++){var n=e[parseInt(t.toString(),10)];n.parentElement&&n.parentElement.removeChild(n)}this.ej2Instances.isVue=!0,this.ej2Instances.isVue3=this.isVue3,this.ej2Instances.vueInstance=this,this.isVue3&&(this.ej2Instances.ej2Instances=this.ej2Instances,this.ej2Instances.referModels=this.models,this.setModelValue()),this.ej2Instances.appendTo(this.$el)},updated:function(){this.updated()},beforeDestroy:function(){this.destroyComponent()},beforeUnmount:function(){this.destroyComponent()},methods:{setModelValue:function(){if(!n.isNullOrUndefined(this.modelValue)||!n.isNullOrUndefined(this.$attrs.modelValue)){var e=(this.models.toString().match(/checked|value/)||[])[0];n.isNullOrUndefined(e)||(this.ej2Instances[""+e]=n.isNullOrUndefined(this.modelValue)?this.$attrs.modelValue:this.modelValue)}},updated:function(){if(this.isVue3&&this.setModelValue(),this.hasChildDirective){var e={};this.fetchChildPropValues(e);var t=JSON.stringify(e);this.childDirObjects!==t&&(this.childDirObjects=t,this.assignValueToWrapper(e,!1))}},getInjectedServices:function(){var e,t=[];if(this.$root&&this.isDecorator?e=n.getValue("$root.$options.provide",this):this.$vnode?e=n.getValue("$vnode.context.$options.provide",this):this.$parent&&(e=n.getValue("$parent.$options.provide",this)),n.isNullOrUndefined(e)&&!n.isNullOrUndefined(this.$)&&(e=n.getValue("$.parent.provides",this)),e){var s=e;if("function"==typeof e)if(e.managed){var r=e.managed,i=Object.keys(r),a=void 0;this.$root&&this.isDecorator?a=Object.keys(this.$root):this.$vnode?a=Object.keys(this.$vnode.context):this.$parent&&(a=Object.keys(this.$parent));for(var o=0;o<i.length;o++)for(var p=0;p<a.length;p++)-1!==a[parseInt(p.toString(),10)].indexOf(i[parseInt(o.toString(),10)])&&(this.$root&&this.isDecorator?r[i[parseInt(p.toString(),10)]]=this.$root[a[parseInt(o.toString(),10)]]:this.$vnode?r[i[parseInt(o.toString(),10)]]=this.$vnode.context[a[parseInt(p.toString(),10)]]:this.$parent&&(r[i[parseInt(o.toString(),10)]]=this.$parent[a[parseInt(p.toString(),10)]]),s=r)}else this.$vnode?s=this.$vnode.context.$options.provide():this.$parent&&(s=this.$parent.$options.provide());t=s[this.ej2Instances.getModuleName()]||[]}return this.isDecorator=!1,t},destroyComponent:function(){this.ej2Instances.destroy(),this.$el.style.visibility="hidden",this.clearTemplate()},destroyPortals:function(e){if(e){if(n.getValue("__vue__.$destroy",e))e.__vue__.$destroy();else if(!d&&e._vnode)try{u.render(null,e)}catch(e){}e.innerHTML&&(e.innerHTML="")}},bindProperties:function(){for(var e={},t=0,s=this.propKeys;t<s.length;t++){var r=s[t];n.isNullOrUndefined(this[""+r])?!this[0]||n.isNullOrUndefined(this[0][0])||n.isNullOrUndefined(this[0][0][""+r])||(e[""+r]=this[0][0][""+r]):e[""+r]=this[""+r]}if(this.hasChildDirective&&this.fetchChildPropValues(e),this.hasInjectedModules){for(var i=this.getInjectedServices()||[],a=0,o=this.ej2Instances.getInjectedModules()||[];a<o.length;a++){var p=o[a];-1===i.indexOf(p)&&i.push(p)}this.ej2Instances.injectedModules=i}this.assignValueToWrapper(e)},assignValueToWrapper:function(e,t){this.ej2Instances.setProperties(n.extend({},{},e,!0),!!n.isNullOrUndefined(t)||t)},fetchChildPropValues:function(e){var t={};if(this.isVue3){var n=void 0;if(this[0]&&this[0][1].slots.default?n=this[0][1].slots.default():this&&this.$&&this.$.slots&&this.$.slots.default&&(n=this.$.slots.default()),!n)return;for(var s=0;s<n.length;s++)if(n[parseInt(s.toString(),10)].type.methods||"e-seriescollection"===n[parseInt(s.toString(),10)].type){var r="e-seriescollection"===n[parseInt(s.toString(),10)].type?"series-collection":n[parseInt(s.toString(),10)].type.methods.getTag().replace("e-",""),i=this.resolveArrayDirectives(n[parseInt(s.toString(),10)].children,r),a=r.split("-"),o=this.ej2Instances.getModuleName().toLowerCase(),p=a.length>1&&o.indexOf(a[0])>-1?a[1]:a[0];p=p.replace(o,""),p=this.tagNameMapper["e-"+r]?this.tagNameMapper["e-"+r].replace("e-",""):p,"splitter"===o&&"panes"===p?p="paneSettings":"bulletchart"===o&&"range"===p?p="ranges":"schedule"===o&&"header"===p&&(p="headerRows"),t[""+p]=i[""+r]}}else t=this.getDirectiveValues(this.$slots.default,this.tagMapper||{},this.tagNameMapper||{});this.childDirObjects||(this.childDirObjects=JSON.stringify(t));for(var l=0,c=Object.keys(t);l<c.length;l++){var h=c[l];e[""+h]=t[""+h]}},resolveArrayDirectives:function(e,t){var n,s=[];s=(s=e.default?e.default():e).flatMap(function(e){return Array.isArray(e.children)?e.children:e});var r={};r[""+t]=[];for(var i=this,a=0,o=s;a<o.length;a++)!function(e){var s={},a=e.type.methods?e.type.methods.getTag():t;if(e.children){var o=void 0;if((n=i.resolveComplexDirs(e.children,i.tagMapper["e-"+t],a)).length)s=n;else for(var p=0;p<Object.keys(n).length;p++)o=Object.keys(n)[parseInt(p.toString(),10)],s[""+o]=n[""+o]}e.props&&Object.keys(e.props).forEach(function(t){var n=t.replace(/-[a-z]/g,function(e){return e[1].toUpperCase()});n&&(s[""+n]=e.props[""+t])}),/[s]\b/.test(a)&&n&&(!/[s]\b/.test(t)||n.length)?Array.isArray(s)?s.forEach(function(e){r[""+t].push(e)}):r[""+t].push(s):s&&0!==Object.keys(s).length&&r[""+t].push(s)}(o[a]);return r},resolveComplexDirs:function(e,t,n){for(var s,r=[],i={},a=this,o=0,p=r=e.default?e.default():e;o<p.length;o++)!function(e){var o=void 0;t[""+n]&&(o=(o=Object.keys(t[""+n]).find(function(s){return t[""+n][""+s]===e.type.methods.getTag().replace(/[s]\b/,"")}))||e.type.methods.getTag(),o=(a.tagNameMapper[""+o]?a.tagNameMapper[""+o]:o).replace("e-",""),"diagram"===a.ej2Instances.getModuleName().toLowerCase()&&-1!==o.indexOf("annotations")&&(o="annotations")),e.children&&(s=a.resolveComplexInnerDirs(e.children,t[""+n],e.type.methods.getTag()),i[""+o]||(i[""+o]=[]),s.length>1?i[""+o]=s:i[""+o].push(s)),e.props&&(e.props=a.getCamelCaseProps(e.props)),r.length>1?(i=0!==Object.keys(i).length||i.length?i:[],e.props&&i.push(e.props)):i=e.props?Object.assign(i,e.props):i}(p[o]);return i},resolveComplexInnerDirs:function(e,t,n){for(var s=[],r=(s=e.default?e.default():e).length>1?[]:{},i=0,a=s;i<a.length;i++){var o=a[i],p=null,l=o.type.methods.getTag();l=(this.tagNameMapper[""+l]?this.tagNameMapper[""+l]:l).replace("e-",""),o.children&&(p=this.resolveMultilevelComplexInnerDirs(o.children,t[""+n],o.type.methods.getTag()),/[s]\b/.test(l)||s.length>1?/[s]\b/.test(l)?(r[""+l]=r[""+l]?r[""+l]:[],p.length?r[""+l]=p:r[""+l].push(p)):p&&!o.props&&r.push(p):r=p||r),o.props&&(o.props=this.getCamelCaseProps(o.props)),s.length>1&&o.props?p?(p=o.props?Object.assign(p,o.props):p,r.push(p)):r.length>=0?r.push(o.props):r=o.props?Object.assign(r,o.props):r:r=o.props?Object.assign(r,o.props):r}return r},resolveMultilevelComplexInnerDirs:function(e,t,n){for(var s=[],r=(s=e.default?e.default():e).length>1?[]:{},i=0,a=s;i<a.length;i++){var o=a[i],p=null,l=o.type.methods.getTag();l=(this.tagNameMapper[""+l]?this.tagNameMapper[""+l]:l).replace("e-",""),o.children&&(p=this.resolveComplexInnerDirs(o.children,t[""+n],o.type.methods.getTag())),o.props&&(o.props=this.getCamelCaseProps(o.props)),/[s]\b/.test(l)?(r[""+l]=r[""+l]?r[""+l]:[],p.length?r[""+l]=p:r[""+l].push(p),o.props&&r[""+l].push(o.props)):(r=p,r=o.props?Object.assign(r,o.props):r)}return r},getDirectiveValues:function(e,t,n){var s=Object.keys(t),r={};if(e)for(var i=0,a=e;i<a.length;i++){var o=a[i],p=o.componentOptions;if(p&&p.children&&this.getTagName(p)||"e-seriescollection"===o.tag&&o.children){var l=p?this.getTagName(p):o.tag;if(l="e-seriescollection"===l?"e-seriesCollection":l,-1!==s.indexOf(l)){var c=n[""+l]?n[""+l]:l;r[c.replace("e-","")]=[];for(var h=0,d=p?p.children:o.children;h<d.length;h++){var u=d[h],g=this.getVNodeValue(u,t[""+l],n);0!==Object.keys(g).length&&r[c.replace("e-","")].push(g)}}}}return r},getMultiLevelDirValue:function(e,t,n){for(var s={},r=0,i=e;r<i.length;r++){var a=i[r],o=void 0,p=void 0;if(a.componentOptions?(o=this.getTagName(a.componentOptions),a.componentOptions.children&&(p=a.componentOptions.children)):"e-markersettings"!==a.tag&&"e-markersetting"!==a.tag||!a.children||(o="e-markersettings"===a.tag?"e-markerSettings":"e-markerSetting",p=a.children),o){var l=n[""+o]?n[""+o]:o;if(s[l.replace("e-","")]=[],p)for(var c=0,h=p;c<h.length;c++){var d=h[c],u=this.getVNodeValue(d,t[""+o],n);0!==Object.keys(u).length&&s[l.replace("e-","")].push(u)}}}return s},getVNodeValue:function(e,t,s){var r={};if(e.componentOptions||("e-markersettings"===e.tag||"e-markersetting"===e.tag)&&e.context){var i=void 0;i=e.componentOptions?this.getTagName(e.componentOptions):"e-markersettings"===e.tag?"e-markerSettings":"e-markerSetting";var a=e.data;"string"==typeof t&&i===t&&a?r=a.attrs?this.getCamelCaseProps(a.attrs):this.getCamelCaseProps(a):"object"==typeof t&&(e.componentOptions.children&&-1!==Object.keys(t).indexOf(i)?r=this.getMultiLevelDirValue(e.componentOptions.children,t[""+i],s):!e.children||-1===Object.keys(t).indexOf(i)||"e-markersettings"!==i&&"e-markersetting"!==i||(r=this.getMultiLevelDirValue(e.children,t[""+i],s)),a&&a.attrs&&(r=n.extend(r,this.getCamelCaseProps(a.attrs))))}return r},getCamelCaseProps:function(e){for(var t={},n=0,s=Object.keys(e);n<s.length;n++){var r=s[n];t[r.replace(/-[a-z]/g,function(e){return e[1].toUpperCase()})]=e[""+r]}return t},dataBind:function(){this.ej2Instances.dataBind()},setProperties:function(e,t){return this.ej2Instances.setProperties(e,t)},getTagName:function(e){var t=e.tag,n=e.Ctor;return!t&&n&&n.extendOptions&&n.extendOptions.methods&&n.extendOptions.methods.getTag&&(t=e.Ctor.extendOptions.methods.getTag()),t}}});d||n.setProxyToRaw(u.toRaw);var m=function(){return(m=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e}).apply(this,arguments)},I=n.getTemplateEngine();return n.setTemplateEngine({compile:r}),e.ComponentBase=v,e.aVue=u,e.compile=r,e.getProps=s,e.gh=g,e.isExecute=d,e.vueDefineComponent=f,e}({},Vue,ej.base),this.ejs=ej;
|
|
11
2
|
//# sourceMappingURL=ej2-vue-base.min.js.map
|
package/dist/global/index.d.ts
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* filename: index.d.ts
|
|
3
|
-
* version : 31.2.2
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
-
* Use of this code is subject to the terms of our license.
|
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
-
* applicable laws.
|
|
9
|
-
*/
|
|
10
1
|
import * as _vuebase from '@syncfusion/ej2-vue-base';
|
|
11
2
|
|
|
12
3
|
export declare namespace ej {
|
package/package.json
CHANGED
|
@@ -1,79 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-T2snTPAIABEGBL1AgFYWC5qE4lE/DMQzSoRcs7CKJiSeyGbjxsaO1XR1bvdKin7dHpkv1USwDIhnhDvFJ7b4fg==",
|
|
6
|
-
"_location": "/@syncfusion/ej2-vue-base",
|
|
7
|
-
"_phantomChildren": {},
|
|
8
|
-
"_requested": {
|
|
9
|
-
"type": "range",
|
|
10
|
-
"registry": true,
|
|
11
|
-
"raw": "@syncfusion/ej2-vue-base@*",
|
|
12
|
-
"name": "@syncfusion/ej2-vue-base",
|
|
13
|
-
"escapedName": "@syncfusion%2fej2-vue-base",
|
|
14
|
-
"scope": "@syncfusion",
|
|
15
|
-
"rawSpec": "*",
|
|
16
|
-
"saveSpec": null,
|
|
17
|
-
"fetchSpec": "*"
|
|
18
|
-
},
|
|
19
|
-
"_requiredBy": [
|
|
20
|
-
"/",
|
|
21
|
-
"/@syncfusion/ej2-vue-barcode-generator",
|
|
22
|
-
"/@syncfusion/ej2-vue-blockeditor",
|
|
23
|
-
"/@syncfusion/ej2-vue-buttons",
|
|
24
|
-
"/@syncfusion/ej2-vue-calendars",
|
|
25
|
-
"/@syncfusion/ej2-vue-charts",
|
|
26
|
-
"/@syncfusion/ej2-vue-circulargauge",
|
|
27
|
-
"/@syncfusion/ej2-vue-diagrams",
|
|
28
|
-
"/@syncfusion/ej2-vue-documenteditor",
|
|
29
|
-
"/@syncfusion/ej2-vue-dropdowns",
|
|
30
|
-
"/@syncfusion/ej2-vue-filemanager",
|
|
31
|
-
"/@syncfusion/ej2-vue-gantt",
|
|
32
|
-
"/@syncfusion/ej2-vue-grids",
|
|
33
|
-
"/@syncfusion/ej2-vue-heatmap",
|
|
34
|
-
"/@syncfusion/ej2-vue-image-editor",
|
|
35
|
-
"/@syncfusion/ej2-vue-inplace-editor",
|
|
36
|
-
"/@syncfusion/ej2-vue-inputs",
|
|
37
|
-
"/@syncfusion/ej2-vue-interactive-chat",
|
|
38
|
-
"/@syncfusion/ej2-vue-kanban",
|
|
39
|
-
"/@syncfusion/ej2-vue-layouts",
|
|
40
|
-
"/@syncfusion/ej2-vue-lineargauge",
|
|
41
|
-
"/@syncfusion/ej2-vue-lists",
|
|
42
|
-
"/@syncfusion/ej2-vue-maps",
|
|
43
|
-
"/@syncfusion/ej2-vue-multicolumn-combobox",
|
|
44
|
-
"/@syncfusion/ej2-vue-navigations",
|
|
45
|
-
"/@syncfusion/ej2-vue-notifications",
|
|
46
|
-
"/@syncfusion/ej2-vue-pdfviewer",
|
|
47
|
-
"/@syncfusion/ej2-vue-pivotview",
|
|
48
|
-
"/@syncfusion/ej2-vue-popups",
|
|
49
|
-
"/@syncfusion/ej2-vue-progressbar",
|
|
50
|
-
"/@syncfusion/ej2-vue-querybuilder",
|
|
51
|
-
"/@syncfusion/ej2-vue-ribbon",
|
|
52
|
-
"/@syncfusion/ej2-vue-richtexteditor",
|
|
53
|
-
"/@syncfusion/ej2-vue-schedule",
|
|
54
|
-
"/@syncfusion/ej2-vue-splitbuttons",
|
|
55
|
-
"/@syncfusion/ej2-vue-spreadsheet",
|
|
56
|
-
"/@syncfusion/ej2-vue-treegrid",
|
|
57
|
-
"/@syncfusion/ej2-vue-treemap"
|
|
58
|
-
],
|
|
59
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-vue-base/-/ej2-vue-base-31.1.1.tgz",
|
|
60
|
-
"_shasum": "25f048b496272c10e8dd2401914a38897e2837a9",
|
|
61
|
-
"_spec": "@syncfusion/ej2-vue-base@*",
|
|
62
|
-
"_where": "D:\\SF3992\\WFH\\Nexus\\release",
|
|
63
|
-
"author": {
|
|
64
|
-
"name": "Syncfusion Inc."
|
|
65
|
-
},
|
|
66
|
-
"bugs": {
|
|
67
|
-
"url": "https://github.com/syncfusion/ej2-vue-ui-components/issues"
|
|
68
|
-
},
|
|
69
|
-
"bundleDependencies": false,
|
|
70
|
-
"dependencies": {
|
|
71
|
-
"@syncfusion/ej2-base": "~31.2.2"
|
|
72
|
-
},
|
|
73
|
-
"deprecated": false,
|
|
2
|
+
"name": "@syncfusion/ej2-vue-base",
|
|
3
|
+
"version": "31.2.10",
|
|
74
4
|
"description": "A common package of Essential JS 2 base Vue libraries, methods and class definitions",
|
|
75
|
-
"
|
|
76
|
-
"
|
|
5
|
+
"author": "Syncfusion Inc.",
|
|
6
|
+
"license": "SEE LICENSE IN license",
|
|
77
7
|
"keywords": [
|
|
78
8
|
"ej2",
|
|
79
9
|
"syncfusion",
|
|
@@ -85,22 +15,25 @@
|
|
|
85
15
|
"library",
|
|
86
16
|
"ej2-vue-base"
|
|
87
17
|
],
|
|
88
|
-
"license": "SEE LICENSE IN license",
|
|
89
|
-
"main": "./dist/ej2-vue-base.umd.min.js",
|
|
90
|
-
"module": "./index.js",
|
|
91
|
-
"name": "@syncfusion/ej2-vue-base",
|
|
92
18
|
"repository": {
|
|
93
19
|
"type": "git",
|
|
94
|
-
"url": "
|
|
20
|
+
"url": "https://github.com/syncfusion/ej2-vue-ui-components.git"
|
|
95
21
|
},
|
|
22
|
+
"homepage": "https://www.syncfusion.com/vue-components",
|
|
23
|
+
"main": "./dist/ej2-vue-base.umd.min.js",
|
|
24
|
+
"module": "./index.js",
|
|
25
|
+
"readme": "ReadMe.md",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@syncfusion/ej2-base": "~31.2.5"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {},
|
|
96
30
|
"scripts": {
|
|
97
|
-
"
|
|
31
|
+
"test": "gulp ci-test",
|
|
98
32
|
"compile": "gulp ci-compile",
|
|
99
|
-
"
|
|
33
|
+
"ci-publish": "gulp ci-publish",
|
|
100
34
|
"es-lint-config": "npx tslint-to-eslint-config --config .eslintrc.json --tslint ./tslint.json",
|
|
101
|
-
"
|
|
35
|
+
"es-lint": "eslint -c .eslintrc.json --ext .ts ./src/**"
|
|
102
36
|
},
|
|
103
37
|
"typings": "index.d.ts",
|
|
104
|
-
"version": "31.2.2",
|
|
105
38
|
"sideEffects": true
|
|
106
39
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export declare const isExecute: boolean;
|
|
2
|
-
export declare const aVue: any;
|
|
3
|
-
export declare const gh: any;
|
|
4
|
-
export declare const vueDefineComponent: Function;
|
|
5
|
-
declare type ComponentBaseType = {
|
|
6
|
-
getInjectedServices(): Object[];
|
|
7
|
-
updated(): void;
|
|
8
|
-
bindProperties(): void;
|
|
9
|
-
assignValueToWrapper(option: Object, silent?: boolean): void;
|
|
10
|
-
fetchChildPropValues(childOption: Object): void;
|
|
11
|
-
getDirectiveValues(tagDirectives: any, tagMapper: {
|
|
12
|
-
[key: string]: Object;
|
|
13
|
-
}, tagNameMapper: Object): Object;
|
|
14
|
-
getMultiLevelDirValue(tagDirectories: any, tagKey: string | Object, tagNameMapper: Object): Object;
|
|
15
|
-
getVNodeValue(tagDirective: any, tagKey: string | Object, tagNameMapper: Object): Object;
|
|
16
|
-
/**
|
|
17
|
-
* convert kebab case directive props to camel case
|
|
18
|
-
*/
|
|
19
|
-
getCamelCaseProps(props: Object): Object;
|
|
20
|
-
dataBind(): void;
|
|
21
|
-
};
|
|
22
|
-
export declare const ComponentBase: ComponentBaseType;
|
|
23
|
-
/**
|
|
24
|
-
* Collect public property values for the Vue component.
|
|
25
|
-
*
|
|
26
|
-
* @param {any} options - represents props object.
|
|
27
|
-
* @returns {any} array of props object and `watchobject` respectively.
|
|
28
|
-
*/
|
|
29
|
-
export declare function getProps(options?: any): any;
|
|
30
|
-
export {};
|
|
@@ -1,568 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
/**
|
|
3
|
-
* Vue Component Base
|
|
4
|
-
*/
|
|
5
|
-
import * as Vue from 'vue';
|
|
6
|
-
import { isNullOrUndefined, extend, getValue, setProxyToRaw } from '@syncfusion/ej2-base';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Clone the Vue compiler instance.
|
|
10
|
-
*
|
|
11
|
-
* @param {any} obj - representes the Vue compiler.
|
|
12
|
-
* @returns {any} cloned object of Vue compiler.
|
|
13
|
-
*/
|
|
14
|
-
function _interopRequireWildcard(obj: any): any { if (obj && obj.__esModule) { return obj; } else { const newObj: any = {}; if (obj != null) { for (const key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[`${key}`] = obj[`${key}`]; } } } newObj.default = obj; return newObj; } }
|
|
15
|
-
|
|
16
|
-
const curVue: any = _interopRequireWildcard(Vue);
|
|
17
|
-
export const isExecute: boolean = (parseInt(curVue['version'], 10) > 2) ? false : true;
|
|
18
|
-
export const aVue: any = !isExecute ? curVue : (curVue['default']['default'] ? curVue['default']['default'] : curVue['default']);
|
|
19
|
-
export const gh: any = curVue['h'];
|
|
20
|
-
|
|
21
|
-
export const vueDefineComponent: Function = (options: Object): any => { return !isExecute ? aVue['defineComponent'](options) : aVue['extend'](options); };
|
|
22
|
-
|
|
23
|
-
type ComponentBaseType = {
|
|
24
|
-
getInjectedServices(): Object[];
|
|
25
|
-
updated(): void;
|
|
26
|
-
bindProperties(): void;
|
|
27
|
-
assignValueToWrapper(option: Object, silent?: boolean): void;
|
|
28
|
-
fetchChildPropValues(childOption: Object): void;
|
|
29
|
-
getDirectiveValues(tagDirectives: any, tagMapper: {
|
|
30
|
-
[key: string]: Object;
|
|
31
|
-
}, tagNameMapper: Object): Object;
|
|
32
|
-
getMultiLevelDirValue(tagDirectories: any, tagKey: string | Object, tagNameMapper: Object): Object;
|
|
33
|
-
getVNodeValue(tagDirective: any, tagKey: string | Object, tagNameMapper: Object): Object;
|
|
34
|
-
/**
|
|
35
|
-
* convert kebab case directive props to camel case
|
|
36
|
-
*/
|
|
37
|
-
getCamelCaseProps(props: Object): Object;
|
|
38
|
-
dataBind(): void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const ComponentBase: ComponentBaseType = vueDefineComponent({
|
|
42
|
-
name: 'ComponentBase',
|
|
43
|
-
data(): Object {
|
|
44
|
-
return {
|
|
45
|
-
tagMapper: {} as any,
|
|
46
|
-
tagNameMapper: {} as any,
|
|
47
|
-
hasInjectedModules: false as boolean,
|
|
48
|
-
hasChildDirective: false as boolean,
|
|
49
|
-
childDirObjects: '' as string,
|
|
50
|
-
propKeys: {} as any,
|
|
51
|
-
isDecorator: false as boolean
|
|
52
|
-
};
|
|
53
|
-
},
|
|
54
|
-
created(): void {
|
|
55
|
-
if (this.ej2Instance) {
|
|
56
|
-
this.ej2Instances = this.isVue3 ? aVue.toRaw(this.ej2Instance) : this.ej2Instance;
|
|
57
|
-
}
|
|
58
|
-
if (!this.propKeys) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
for (const prop of this.propKeys) {
|
|
62
|
-
this.ej2Instances.addEventListener(prop, (args: object) => {
|
|
63
|
-
this.$emit(prop, args);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
const injectables: any = getValue('$root.$options.provide', this);
|
|
67
|
-
let vueInjectables: any = getValue('$parent.$options.provide', this);
|
|
68
|
-
vueInjectables = !isNullOrUndefined(vueInjectables) ? vueInjectables : getValue('$.parent.provides', this);
|
|
69
|
-
if (this.hasInjectedModules && !isExecute) {
|
|
70
|
-
let prevModule: Object[] = [];
|
|
71
|
-
if (injectables && injectables.managed) {
|
|
72
|
-
this.isDecorator = true;
|
|
73
|
-
prevModule = this.getInjectedServices() || [];
|
|
74
|
-
} else if (injectables) {
|
|
75
|
-
prevModule = injectables[this.ej2Instances.getModuleName()] || [];
|
|
76
|
-
} else if (vueInjectables) {
|
|
77
|
-
prevModule = this.getInjectedServices() || [];
|
|
78
|
-
}
|
|
79
|
-
const curModule: Object[] = this.ej2Instances.getInjectedModules() || [];
|
|
80
|
-
for (const mod of curModule) {
|
|
81
|
-
if (prevModule.indexOf(mod) === -1) {
|
|
82
|
-
prevModule.push(mod);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
this.ej2Instances.injectedModules = prevModule;
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
mounted(): void {
|
|
89
|
-
const cusEle: any = this.$el ? this.$el.querySelectorAll('div.e-directive') : null;
|
|
90
|
-
if (!isExecute && cusEle) {
|
|
91
|
-
for (let i: number = 0; i < cusEle.length; i++) {
|
|
92
|
-
const cusElement: HTMLElement = cusEle[parseInt(i.toString(), 10)];
|
|
93
|
-
if (cusElement.parentElement) { cusElement.parentElement.removeChild(cusElement); }
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
this.ej2Instances.isVue = true;
|
|
97
|
-
this.ej2Instances.isVue3 = this.isVue3;
|
|
98
|
-
this.ej2Instances.vueInstance = this;
|
|
99
|
-
if (this.isVue3) {
|
|
100
|
-
this.ej2Instances.ej2Instances = this.ej2Instances;
|
|
101
|
-
this.ej2Instances.referModels = this.models;
|
|
102
|
-
this.setModelValue();
|
|
103
|
-
}
|
|
104
|
-
this.ej2Instances.appendTo(this.$el);
|
|
105
|
-
},
|
|
106
|
-
updated(): void {
|
|
107
|
-
this.updated();
|
|
108
|
-
},
|
|
109
|
-
beforeDestroy(): void {
|
|
110
|
-
this.destroyComponent();
|
|
111
|
-
},
|
|
112
|
-
beforeUnmount(): void {
|
|
113
|
-
this.destroyComponent();
|
|
114
|
-
},
|
|
115
|
-
methods: {
|
|
116
|
-
setModelValue(): void {
|
|
117
|
-
if (!isNullOrUndefined(this.modelValue) || !isNullOrUndefined(this.$attrs.modelValue)) {
|
|
118
|
-
const key: string[] = this.models.toString().match(/checked|value/) || [];
|
|
119
|
-
const propKey: string = key[0];
|
|
120
|
-
if (!isNullOrUndefined(propKey)) {
|
|
121
|
-
this.ej2Instances[`${propKey}`] = !isNullOrUndefined(this.modelValue) ? this.modelValue : this.$attrs.modelValue;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
updated(): void {
|
|
126
|
-
if (this.isVue3) {
|
|
127
|
-
this.setModelValue();
|
|
128
|
-
}
|
|
129
|
-
if (this.hasChildDirective) {
|
|
130
|
-
const childKey: Object = {};
|
|
131
|
-
this.fetchChildPropValues(childKey);
|
|
132
|
-
const curChildDir: string = JSON.stringify(childKey);
|
|
133
|
-
if (this.childDirObjects !== curChildDir) {
|
|
134
|
-
this.childDirObjects = curChildDir;
|
|
135
|
-
this.assignValueToWrapper(childKey, false);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
getInjectedServices(): Object[] {
|
|
140
|
-
let ret: Object[] = []; let provide: any;
|
|
141
|
-
if (this.$root && this.isDecorator) {
|
|
142
|
-
provide = getValue('$root.$options.provide', this);
|
|
143
|
-
} else if (this.$vnode) {
|
|
144
|
-
provide = getValue('$vnode.context.$options.provide', this);
|
|
145
|
-
} else if (this.$parent) {
|
|
146
|
-
provide = getValue('$parent.$options.provide', this);
|
|
147
|
-
}
|
|
148
|
-
if (isNullOrUndefined(provide) && !isNullOrUndefined(this.$)) {
|
|
149
|
-
provide = getValue('$.parent.provides', this);
|
|
150
|
-
}
|
|
151
|
-
if (provide) {
|
|
152
|
-
let injectables: any = provide;
|
|
153
|
-
if (typeof provide === 'function') {
|
|
154
|
-
if (provide.managed) {
|
|
155
|
-
const pKey: Object = provide.managed;
|
|
156
|
-
const pValue: string[] = Object.keys(pKey);
|
|
157
|
-
let key: string[];
|
|
158
|
-
if (this.$root && this.isDecorator) {
|
|
159
|
-
key = Object.keys(this.$root);
|
|
160
|
-
} else if (this.$vnode) {
|
|
161
|
-
key = Object.keys(this.$vnode.context);
|
|
162
|
-
} else if (this.$parent) {
|
|
163
|
-
key = Object.keys(this.$parent);
|
|
164
|
-
}
|
|
165
|
-
for (let i: number = 0; i < pValue.length; i++) {
|
|
166
|
-
for (let j: number = 0; j < key.length; j++) {
|
|
167
|
-
if ((key[parseInt(j.toString(), 10)].indexOf(pValue[parseInt(i.toString(), 10)])) !== -1) {
|
|
168
|
-
if (this.$root && this.isDecorator) {
|
|
169
|
-
pKey[pValue[parseInt(j.toString(), 10)]] = this.$root[key[parseInt(i.toString(), 10)]];
|
|
170
|
-
} else if (this.$vnode) {
|
|
171
|
-
pKey[pValue[parseInt(i.toString(), 10)]] = this.$vnode.context[key[parseInt(j.toString(), 10)]];
|
|
172
|
-
} else if (this.$parent) {
|
|
173
|
-
pKey[pValue[parseInt(i.toString(), 10)]] = this.$parent[key[parseInt(j.toString(), 10)]];
|
|
174
|
-
}
|
|
175
|
-
injectables = pKey;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
else if (this.$vnode) {
|
|
181
|
-
injectables = this.$vnode.context.$options.provide();
|
|
182
|
-
} else if (this.$parent) {
|
|
183
|
-
injectables = this.$parent.$options.provide();
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
ret = injectables[this.ej2Instances.getModuleName()] || [];
|
|
187
|
-
}
|
|
188
|
-
this.isDecorator = false;
|
|
189
|
-
return ret;
|
|
190
|
-
},
|
|
191
|
-
destroyComponent(): void {
|
|
192
|
-
this.ej2Instances.destroy();
|
|
193
|
-
(this.$el as any).style.visibility = 'hidden';
|
|
194
|
-
this.clearTemplate();
|
|
195
|
-
},
|
|
196
|
-
destroyPortals(element?: any): void {
|
|
197
|
-
if (element) {
|
|
198
|
-
const destroy: any = getValue('__vue__.$destroy', element);
|
|
199
|
-
if (destroy) {
|
|
200
|
-
element.__vue__.$destroy();
|
|
201
|
-
} else if (!isExecute && element._vnode) {
|
|
202
|
-
try { aVue.render(null, element); }
|
|
203
|
-
catch (e) { /* Handle error */ }
|
|
204
|
-
}
|
|
205
|
-
if (element.innerHTML) {
|
|
206
|
-
element.innerHTML = '';
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
bindProperties(): void {
|
|
211
|
-
const options: Object = {};
|
|
212
|
-
for (const prop of this.propKeys) {
|
|
213
|
-
if (!isNullOrUndefined(this[`${prop}`])) {
|
|
214
|
-
options[`${prop}`] = this[`${prop}`];
|
|
215
|
-
}
|
|
216
|
-
else if (this[0] && !isNullOrUndefined(this[0][0]) && !isNullOrUndefined(this[0][0][`${prop}`])) {
|
|
217
|
-
options[`${prop}`] = this[0][0][`${prop}`];
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
if (this.hasChildDirective) {
|
|
221
|
-
this.fetchChildPropValues(options);
|
|
222
|
-
}
|
|
223
|
-
if (this.hasInjectedModules) {
|
|
224
|
-
|
|
225
|
-
const prevModule: Object[] = this.getInjectedServices() || [];
|
|
226
|
-
const curModule: Object[] = this.ej2Instances.getInjectedModules() || [];
|
|
227
|
-
for (const mod of curModule) {
|
|
228
|
-
if (prevModule.indexOf(mod) === -1) {
|
|
229
|
-
prevModule.push(mod);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
this.ej2Instances.injectedModules = prevModule;
|
|
233
|
-
}
|
|
234
|
-
this.assignValueToWrapper(options);
|
|
235
|
-
},
|
|
236
|
-
assignValueToWrapper(option: Object, silent?: boolean): void {
|
|
237
|
-
this.ej2Instances.setProperties(extend({}, {}, option, true), isNullOrUndefined(silent as any) ? true : silent);
|
|
238
|
-
},
|
|
239
|
-
fetchChildPropValues(childOption: Object): void {
|
|
240
|
-
let dirProps: Object = {};
|
|
241
|
-
if (!this.isVue3) {
|
|
242
|
-
dirProps = this.getDirectiveValues(this.$slots.default, this.tagMapper || {}, this.tagNameMapper || {});
|
|
243
|
-
} else {
|
|
244
|
-
let propRef: any;
|
|
245
|
-
if (this[0] && this[0][1].slots.default) {
|
|
246
|
-
propRef = this[0][1].slots.default();
|
|
247
|
-
}
|
|
248
|
-
else if (this && this.$ && this.$.slots && this.$.slots.default) {
|
|
249
|
-
propRef = this.$.slots.default();
|
|
250
|
-
}
|
|
251
|
-
if (propRef) {
|
|
252
|
-
for (let i: number = 0; i < propRef.length; i++) {
|
|
253
|
-
if (propRef[parseInt(i.toString(), 10)].type.methods || propRef[parseInt(i.toString(), 10)].type === 'e-seriescollection') {
|
|
254
|
-
const key: string = propRef[parseInt(i.toString(), 10)].type === 'e-seriescollection' ? 'series-collection' :
|
|
255
|
-
propRef[parseInt(i.toString(), 10)].type.methods.getTag().replace('e-', '');
|
|
256
|
-
const ref: any = this.resolveArrayDirectives(propRef[parseInt(i.toString(), 10)].children, key);
|
|
257
|
-
const spKeys: any = key.split('-');
|
|
258
|
-
const controlName: string = this.ej2Instances.getModuleName().toLowerCase();
|
|
259
|
-
let keyRef: string = (spKeys.length > 1 && controlName.indexOf(spKeys[0]) > -1) ? spKeys[1] : spKeys[0];
|
|
260
|
-
keyRef = keyRef.replace(controlName, '');
|
|
261
|
-
keyRef = this.tagNameMapper['e-' + key] ? this.tagNameMapper['e-' + key].replace('e-', '') : keyRef;
|
|
262
|
-
if (controlName === 'splitter' && keyRef === 'panes') {
|
|
263
|
-
keyRef = 'paneSettings';
|
|
264
|
-
} else if (controlName === 'bulletchart' && keyRef === 'range') {
|
|
265
|
-
keyRef = 'ranges';
|
|
266
|
-
} else if (controlName === 'schedule' && keyRef === 'header') {
|
|
267
|
-
keyRef = 'headerRows';
|
|
268
|
-
}
|
|
269
|
-
dirProps[`${keyRef}`] = ref[`${key}`];
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
} else {
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
if (!this.childDirObjects) {
|
|
277
|
-
this.childDirObjects = JSON.stringify(dirProps);
|
|
278
|
-
}
|
|
279
|
-
for (const dirProp of Object.keys(dirProps)) {
|
|
280
|
-
childOption[`${dirProp}`] = dirProps[`${dirProp}`];
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
resolveArrayDirectives(slots: any, tagName: any): any {
|
|
284
|
-
let slot: any = [];
|
|
285
|
-
let innerDirValues: any;
|
|
286
|
-
slot = slots.default ? slots.default() : slots;
|
|
287
|
-
slot = slot.flatMap((item: any) => Array.isArray(item.children) ? item.children : item);
|
|
288
|
-
const items: any = {};
|
|
289
|
-
items[`${tagName}`] = [];
|
|
290
|
-
for (const childSlot of slot) {
|
|
291
|
-
let tempObj: any = {};
|
|
292
|
-
const tagRef: any = childSlot.type.methods ? childSlot.type.methods.getTag() : tagName;
|
|
293
|
-
if (childSlot.children) {
|
|
294
|
-
let key: string;
|
|
295
|
-
innerDirValues = this.resolveComplexDirs(childSlot.children, this.tagMapper['e-' + tagName], tagRef);
|
|
296
|
-
if (innerDirValues.length) {
|
|
297
|
-
tempObj = innerDirValues;
|
|
298
|
-
} else {
|
|
299
|
-
for (let i: number = 0; i < Object.keys(innerDirValues).length; i++) {
|
|
300
|
-
key = Object.keys(innerDirValues)[parseInt(i.toString(), 10)];
|
|
301
|
-
tempObj[`${key}`] = innerDirValues[`${key}`];
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
if (childSlot.props) {
|
|
306
|
-
Object.keys(childSlot.props).forEach((key: string) => {
|
|
307
|
-
const propName: string = key.replace(/-[a-z]/g, (e: any) => { return e[1].toUpperCase(); });
|
|
308
|
-
if (propName) {
|
|
309
|
-
tempObj[`${propName}`] = childSlot.props[`${key}`];
|
|
310
|
-
}
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
if (((/[s]\b/).test(tagRef) && innerDirValues) && (!(/[s]\b/).test(tagName) || innerDirValues.length)) {
|
|
314
|
-
if (Array.isArray(tempObj)) { tempObj.forEach((item: any) => { items[`${tagName}`].push(item); }); } else { items[`${tagName}`].push(tempObj); }
|
|
315
|
-
}
|
|
316
|
-
else if (tempObj && Object.keys(tempObj).length !== 0) {
|
|
317
|
-
items[`${tagName}`].push(tempObj);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
return items;
|
|
321
|
-
},
|
|
322
|
-
resolveComplexDirs(slots: any, tagObject: any, tagName: string): any {
|
|
323
|
-
let slot: any = [];
|
|
324
|
-
let innerDirValues: any;
|
|
325
|
-
slot = slots.default ? slots.default() : slots;
|
|
326
|
-
let items: any = {};
|
|
327
|
-
for (const childSlot of slot) {
|
|
328
|
-
let tagRef: any;
|
|
329
|
-
let tag: any;
|
|
330
|
-
if (tagObject[`${tagName}`]) {
|
|
331
|
-
tagRef = Object.keys(tagObject[`${tagName}`]);
|
|
332
|
-
tag = tagRef.find(
|
|
333
|
-
(key: any) =>
|
|
334
|
-
tagObject[`${tagName}`][`${key}`] ===
|
|
335
|
-
childSlot.type.methods.getTag().replace(/[s]\b/, '')
|
|
336
|
-
);
|
|
337
|
-
tag = tag ? tag : childSlot.type.methods.getTag();
|
|
338
|
-
tag = (this.tagNameMapper[`${tag}`] ? this.tagNameMapper[`${tag}`] : tag).replace('e-', '');
|
|
339
|
-
if (this.ej2Instances.getModuleName().toLowerCase() === 'diagram' && tag.indexOf('annotations') !== -1) {
|
|
340
|
-
tag = 'annotations';
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
if (childSlot.children) {
|
|
344
|
-
innerDirValues = this.resolveComplexInnerDirs(childSlot.children, tagObject[`${tagName}`], childSlot.type.methods.getTag());
|
|
345
|
-
if (!items[`${tag}`]) {
|
|
346
|
-
items[`${tag}`] = [];
|
|
347
|
-
}
|
|
348
|
-
if (innerDirValues.length > 1) {
|
|
349
|
-
items[`${tag}`] = innerDirValues;
|
|
350
|
-
} else {
|
|
351
|
-
items[`${tag}`].push(innerDirValues);
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
if (childSlot.props) {
|
|
355
|
-
childSlot.props = this.getCamelCaseProps(childSlot.props);
|
|
356
|
-
}
|
|
357
|
-
if (slot.length > 1) {
|
|
358
|
-
items = Object.keys(items).length === 0 && !items.length ? [] : items;
|
|
359
|
-
if (childSlot.props) { items.push(childSlot.props); }
|
|
360
|
-
}
|
|
361
|
-
else {
|
|
362
|
-
items = childSlot.props ? (<any>Object).assign(items, childSlot.props) : items;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
return items;
|
|
366
|
-
},
|
|
367
|
-
resolveComplexInnerDirs(slots: any, tagObject: any, tagName: string): any {
|
|
368
|
-
let slot: any = [];
|
|
369
|
-
slot = slots.default ? slots.default() : slots;
|
|
370
|
-
let items: any = slot.length > 1 ? [] : {};
|
|
371
|
-
for (const childSlot of slot) {
|
|
372
|
-
let innerDirValues: any = null;
|
|
373
|
-
let tag: string = childSlot.type.methods.getTag();
|
|
374
|
-
tag = (this.tagNameMapper[`${tag}`] ? this.tagNameMapper[`${tag}`] : tag).replace('e-', '');
|
|
375
|
-
if (childSlot.children) {
|
|
376
|
-
innerDirValues = this.resolveMultilevelComplexInnerDirs(childSlot.children, tagObject[`${tagName}`], childSlot.type.methods.getTag());
|
|
377
|
-
if ((/[s]\b/).test(tag) || slot.length > 1) {
|
|
378
|
-
if ((/[s]\b/).test(tag)) {
|
|
379
|
-
items[`${tag}`] = !items[`${tag}`] ? [] : items[`${tag}`];
|
|
380
|
-
if (innerDirValues.length) {
|
|
381
|
-
items[`${tag}`] = innerDirValues;
|
|
382
|
-
} else { items[`${tag}`].push(innerDirValues); }
|
|
383
|
-
} else if (innerDirValues && !childSlot.props) {
|
|
384
|
-
items.push(innerDirValues);
|
|
385
|
-
}
|
|
386
|
-
} else {
|
|
387
|
-
items = innerDirValues ? innerDirValues : items;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
if (childSlot.props) {
|
|
391
|
-
childSlot.props = this.getCamelCaseProps(childSlot.props);
|
|
392
|
-
}
|
|
393
|
-
if (slot.length > 1 && childSlot.props) {
|
|
394
|
-
if (innerDirValues) {
|
|
395
|
-
innerDirValues = childSlot.props ? (<any>Object).assign(innerDirValues, childSlot.props) : innerDirValues;
|
|
396
|
-
items.push(innerDirValues);
|
|
397
|
-
}
|
|
398
|
-
else if (items.length >= 0) {
|
|
399
|
-
items.push(childSlot.props);
|
|
400
|
-
} else {
|
|
401
|
-
items = childSlot.props ? (<any>Object).assign(items, childSlot.props) : items;
|
|
402
|
-
}
|
|
403
|
-
} else {
|
|
404
|
-
items = childSlot.props ? (<any>Object).assign(items, childSlot.props) : items;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
return items;
|
|
408
|
-
},
|
|
409
|
-
resolveMultilevelComplexInnerDirs(slots: any, tagObject: any, tagName: string): any {
|
|
410
|
-
let slot: any = [];
|
|
411
|
-
slot = slots.default ? slots.default() : slots;
|
|
412
|
-
let items: any = slot.length > 1 ? [] : {};
|
|
413
|
-
for (const childSlot of slot) {
|
|
414
|
-
let innerDirValues: any = null;
|
|
415
|
-
let tag: string = childSlot.type.methods.getTag();
|
|
416
|
-
tag = (this.tagNameMapper[`${tag}`] ? this.tagNameMapper[`${tag}`] : tag).replace('e-', '');
|
|
417
|
-
if (childSlot.children) {
|
|
418
|
-
innerDirValues = this.resolveComplexInnerDirs(childSlot.children, tagObject[`${tagName}`], childSlot.type.methods.getTag());
|
|
419
|
-
}
|
|
420
|
-
if (childSlot.props) {
|
|
421
|
-
childSlot.props = this.getCamelCaseProps(childSlot.props);
|
|
422
|
-
}
|
|
423
|
-
if ((/[s]\b/).test(tag)) {
|
|
424
|
-
items[`${tag}`] = !items[`${tag}`] ? [] : items[`${tag}`];
|
|
425
|
-
if (innerDirValues.length) {
|
|
426
|
-
items[`${tag}`] = innerDirValues;
|
|
427
|
-
} else { items[`${tag}`].push(innerDirValues); }
|
|
428
|
-
if (childSlot.props) { items[`${tag}`].push(childSlot.props); }
|
|
429
|
-
} else {
|
|
430
|
-
items = innerDirValues;
|
|
431
|
-
items = childSlot.props ? (<any>Object).assign(items, childSlot.props) : items;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
return items;
|
|
435
|
-
},
|
|
436
|
-
getDirectiveValues(tagDirectives: any, tagMapper: { [key: string]: Object }, tagNameMapper: Object): Object {
|
|
437
|
-
const keyTags: string[] = Object.keys(tagMapper);
|
|
438
|
-
const dir: Object = {};
|
|
439
|
-
if (tagDirectives) {
|
|
440
|
-
for (const tagDirective of tagDirectives) {
|
|
441
|
-
const tagCompOption: any = tagDirective.componentOptions;
|
|
442
|
-
if (tagCompOption && tagCompOption.children && this.getTagName(tagCompOption) ||
|
|
443
|
-
(tagDirective.tag === 'e-seriescollection' && tagDirective.children)) {
|
|
444
|
-
let dirTag: string = tagCompOption ? this.getTagName(tagCompOption) : tagDirective.tag;
|
|
445
|
-
dirTag = (dirTag === 'e-seriescollection') ? 'e-seriesCollection' : dirTag;
|
|
446
|
-
if (keyTags.indexOf(dirTag) !== -1) {
|
|
447
|
-
const tagName: string = tagNameMapper[`${dirTag}`] ? tagNameMapper[`${dirTag}`] : dirTag;
|
|
448
|
-
dir[tagName.replace('e-', '')] = [];
|
|
449
|
-
const children: any = tagCompOption ? tagCompOption.children : tagDirective.children;
|
|
450
|
-
for (const tagDirChild of children) {
|
|
451
|
-
const retObj: Object = this.getVNodeValue(tagDirChild, tagMapper[`${dirTag}`], tagNameMapper);
|
|
452
|
-
if (Object.keys(retObj).length !== 0) {
|
|
453
|
-
dir[tagName.replace('e-', '')].push(retObj);
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
return dir;
|
|
461
|
-
},
|
|
462
|
-
getMultiLevelDirValue(tagDirectories: any, tagKey: string | Object, tagNameMapper: Object): Object {
|
|
463
|
-
const mulObj: Object = {};
|
|
464
|
-
for (const tagDir of tagDirectories) {
|
|
465
|
-
let key: string;
|
|
466
|
-
let children: any;
|
|
467
|
-
if (tagDir.componentOptions) {
|
|
468
|
-
key = this.getTagName(tagDir.componentOptions);
|
|
469
|
-
if (tagDir.componentOptions.children) {
|
|
470
|
-
children = tagDir.componentOptions.children;
|
|
471
|
-
}
|
|
472
|
-
} else if ((tagDir.tag === 'e-markersettings' || tagDir.tag === 'e-markersetting') && tagDir.children) {
|
|
473
|
-
key = (tagDir.tag === 'e-markersettings') ? 'e-markerSettings' : 'e-markerSetting';
|
|
474
|
-
children = tagDir.children;
|
|
475
|
-
}
|
|
476
|
-
if (key) {
|
|
477
|
-
const tagName: string = tagNameMapper[`${key}`] ? tagNameMapper[`${key}`] : key;
|
|
478
|
-
mulObj[tagName.replace('e-', '')] = [];
|
|
479
|
-
if (children) {
|
|
480
|
-
for (const tagDirChild of children) {
|
|
481
|
-
const mulLevObj: Object = this.getVNodeValue(tagDirChild, tagKey[`${key}`], tagNameMapper);
|
|
482
|
-
if (Object.keys(mulLevObj).length !== 0) {
|
|
483
|
-
mulObj[tagName.replace('e-', '')].push(mulLevObj);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
return mulObj;
|
|
490
|
-
},
|
|
491
|
-
getVNodeValue(tagDirective: any, tagKey: string | Object, tagNameMapper: Object): Object {
|
|
492
|
-
let ret: Object = {};
|
|
493
|
-
if (tagDirective.componentOptions || ((tagDirective.tag === 'e-markersettings' || tagDirective.tag === 'e-markersetting') && tagDirective.context)) {
|
|
494
|
-
let dirTag: string;
|
|
495
|
-
if (tagDirective.componentOptions) {
|
|
496
|
-
dirTag = this.getTagName(tagDirective.componentOptions);
|
|
497
|
-
} else {
|
|
498
|
-
dirTag = (tagDirective.tag === 'e-markersettings') ? 'e-markerSettings' : 'e-markerSetting';
|
|
499
|
-
}
|
|
500
|
-
const tagData: any = tagDirective.data;
|
|
501
|
-
if (typeof tagKey === 'string' && dirTag === tagKey && tagData) {
|
|
502
|
-
ret = tagData.attrs ? this.getCamelCaseProps(tagData.attrs) : this.getCamelCaseProps(tagData);
|
|
503
|
-
} else if (typeof tagKey === 'object') {
|
|
504
|
-
if (tagDirective.componentOptions.children && (Object.keys(tagKey).indexOf(dirTag) !== -1)) {
|
|
505
|
-
ret = this.getMultiLevelDirValue(tagDirective.componentOptions.children, tagKey[`${dirTag}`], tagNameMapper);
|
|
506
|
-
} else if (tagDirective.children && (Object.keys(tagKey).indexOf(dirTag) !== -1) && (dirTag === 'e-markersettings' || dirTag === 'e-markersetting')) {
|
|
507
|
-
ret = this.getMultiLevelDirValue(tagDirective.children, tagKey[`${dirTag}`], tagNameMapper);
|
|
508
|
-
}
|
|
509
|
-
if (tagData && tagData.attrs) {
|
|
510
|
-
ret = extend(ret, this.getCamelCaseProps(tagData.attrs));
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
return ret;
|
|
515
|
-
},
|
|
516
|
-
/**
|
|
517
|
-
* convert kebab case directive props to camel case.
|
|
518
|
-
*
|
|
519
|
-
* @param {Object} props - Objects in kebab case directive props.
|
|
520
|
-
* @returns {Object} Object converted into camel case directive props.
|
|
521
|
-
*/
|
|
522
|
-
getCamelCaseProps(props: Object): Object {
|
|
523
|
-
const retProps: Object = {};
|
|
524
|
-
for (const prop of Object.keys(props)) {
|
|
525
|
-
retProps[prop.replace(/-[a-z]/g, (e: any) => { return e[1].toUpperCase(); })] = props[`${prop}`];
|
|
526
|
-
}
|
|
527
|
-
return retProps;
|
|
528
|
-
},
|
|
529
|
-
dataBind(): void {
|
|
530
|
-
this.ej2Instances.dataBind();
|
|
531
|
-
},
|
|
532
|
-
setProperties(arg: Object, muteOnChange?: boolean): void {
|
|
533
|
-
return this.ej2Instances.setProperties(arg, muteOnChange);
|
|
534
|
-
},
|
|
535
|
-
getTagName(options: any): string | undefined {
|
|
536
|
-
let tag: any = options.tag;
|
|
537
|
-
const optCtor: any = options.Ctor;
|
|
538
|
-
if (!tag && optCtor && optCtor.extendOptions && optCtor.extendOptions.methods && optCtor.extendOptions.methods.getTag) {
|
|
539
|
-
tag = options.Ctor.extendOptions.methods.getTag();
|
|
540
|
-
}
|
|
541
|
-
return tag;
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
});
|
|
545
|
-
|
|
546
|
-
/**
|
|
547
|
-
* Collect public property values for the Vue component.
|
|
548
|
-
*
|
|
549
|
-
* @param {any} options - represents props object.
|
|
550
|
-
* @returns {any} array of props object and `watchobject` respectively.
|
|
551
|
-
*/
|
|
552
|
-
export function getProps(options: any = {}): any {
|
|
553
|
-
if (options.props) {
|
|
554
|
-
for (const prop of options.props) {
|
|
555
|
-
(options.newprops || (options.newprops = {}))[`${prop}`] = {};
|
|
556
|
-
(options.watch || (options.watch = {}))[`${prop}`] = function (newVal: Object): void { // watch it
|
|
557
|
-
this.ej2Instances[`${prop}`] = newVal;
|
|
558
|
-
if (this.dataBind && (options.name !== 'DateRangePickerComponent')) {
|
|
559
|
-
this.dataBind();
|
|
560
|
-
}
|
|
561
|
-
};
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
return [options.newprops, options.watch];
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
if (!isExecute) { setProxyToRaw(aVue.toRaw); }
|
|
568
|
-
|
package/dist/ts/index.d.ts
DELETED
package/dist/ts/index.ts
DELETED
package/dist/ts/template.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compiler function that convert the template property to DOM element.
|
|
3
|
-
*
|
|
4
|
-
* @param {any} templateElement - represents value of the template property from the component.
|
|
5
|
-
* @param {Object} helper - represents helper object to utilize on template compilation.
|
|
6
|
-
* @returns {NodeList} template element that append to the component.
|
|
7
|
-
*/
|
|
8
|
-
export declare function compile(templateElement: any, helper?: Object): (data: Object | JSON, component?: any, propName?: any, element?: any, root?: any) => Object;
|
package/dist/ts/template.ts
DELETED
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types */
|
|
2
|
-
import { setTemplateEngine, getTemplateEngine, getUniqueID, createElement, detach, extend, getValue } from '@syncfusion/ej2-base';
|
|
3
|
-
import { aVue as Vue, isExecute } from './component-base';
|
|
4
|
-
|
|
5
|
-
const stringCompiler: (template: string, helper?: object) => (data: Object | JSON) => string = getTemplateEngine();
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Compiler function that convert the template property to DOM element.
|
|
9
|
-
*
|
|
10
|
-
* @param {any} templateElement - represents value of the template property from the component.
|
|
11
|
-
* @param {Object} helper - represents helper object to utilize on template compilation.
|
|
12
|
-
* @returns {NodeList} template element that append to the component.
|
|
13
|
-
*/
|
|
14
|
-
export function compile(
|
|
15
|
-
templateElement: any,
|
|
16
|
-
helper?: Object
|
|
17
|
-
): (data: Object | JSON, component?: any, propName?: any, element?: any, root?: any) => Object {
|
|
18
|
-
return (data: any, context: any, propName: any, element: any, root: any): any => {
|
|
19
|
-
let returnEle: any;
|
|
20
|
-
if (context) {
|
|
21
|
-
let plugins: any = context.vueInstance && context.vueInstance.plugins ? { plugins: context.vueInstance.plugins } : {};
|
|
22
|
-
const vueInstance: any = context.vueInstance ? context.vueInstance :
|
|
23
|
-
((root && root.vueInstance) ? root.vueInstance : null);
|
|
24
|
-
const pid: string = getUniqueID('templateParentDiv');
|
|
25
|
-
const id: string = getUniqueID('templateDiv');
|
|
26
|
-
const ele: HTMLElement = createElement('div', {
|
|
27
|
-
id: pid,
|
|
28
|
-
innerHTML: '<div id="' + id + '"></div>'
|
|
29
|
-
});
|
|
30
|
-
document.body.appendChild(ele);
|
|
31
|
-
if (!isExecute && (typeof templateElement === 'string' || (templateElement.prototype && templateElement.prototype.CSPTemplate && typeof templateElement === 'function'))) {
|
|
32
|
-
const vueSlot: any = getCurrentVueSlot(context.vueInstance, templateElement, root);
|
|
33
|
-
if (vueSlot) {
|
|
34
|
-
// Compilation for Vue 3 slot template
|
|
35
|
-
const app: any = Vue.createVNode({
|
|
36
|
-
render(): any {
|
|
37
|
-
return vueSlot[`${templateElement}`]({ data: data });
|
|
38
|
-
}
|
|
39
|
-
}, plugins);
|
|
40
|
-
ele.innerHTML = '';
|
|
41
|
-
// Get values for Vue 3 slot template
|
|
42
|
-
getValues(app, context.vueInstance, root);
|
|
43
|
-
Vue.render(app, ele);
|
|
44
|
-
returnEle = ele.childNodes;
|
|
45
|
-
if (vueInstance) {
|
|
46
|
-
let templateInstance: any = vueInstance.templateCollection;
|
|
47
|
-
if (!templateInstance) {
|
|
48
|
-
vueInstance.templateCollection = {};
|
|
49
|
-
templateInstance = vueInstance.templateCollection;
|
|
50
|
-
}
|
|
51
|
-
if (propName) {
|
|
52
|
-
if (!templateInstance[`${propName}`]) {
|
|
53
|
-
templateInstance[`${propName}`] = [];
|
|
54
|
-
}
|
|
55
|
-
templateInstance[`${propName}`].push(ele);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
detach(ele);
|
|
59
|
-
} else {
|
|
60
|
-
// Compilation for Vue 3 string template
|
|
61
|
-
detach(ele);
|
|
62
|
-
return stringCompiler(templateElement, helper)(data);
|
|
63
|
-
}
|
|
64
|
-
} else if (!isExecute) {
|
|
65
|
-
// Compilation for Vue 3 functional template
|
|
66
|
-
const tempObj: any = templateElement.call(this, {});
|
|
67
|
-
const object: any = tempObj;
|
|
68
|
-
const propsData: any = getValue('template.propsData', tempObj);
|
|
69
|
-
const dataObj: any = {
|
|
70
|
-
data: { data: extend(tempObj.data || {}, data) },
|
|
71
|
-
parent: context.vueInstance
|
|
72
|
-
};
|
|
73
|
-
if (!object.template) {
|
|
74
|
-
object.template = object[Object.keys(object)[0]];
|
|
75
|
-
}
|
|
76
|
-
let templateCompRef: any;
|
|
77
|
-
if (object.template.extends) {
|
|
78
|
-
templateCompRef = object.template.extends._context.components.template;
|
|
79
|
-
} else {
|
|
80
|
-
templateCompRef = object.template._context.components[templateElement.name];
|
|
81
|
-
if (!templateCompRef) {
|
|
82
|
-
const key: any = Object.keys(object.template._context.components)[0];
|
|
83
|
-
templateCompRef = object.template._context.components[`${key}`];
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
let tempRef: any;
|
|
87
|
-
if (propsData) {
|
|
88
|
-
if (templateCompRef.setup) {
|
|
89
|
-
tempRef = (<any>Object).assign({}, propsData);
|
|
90
|
-
} else {
|
|
91
|
-
tempRef = (<any>Object).assign(templateCompRef.data(), propsData);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
if (templateCompRef.setup) {
|
|
96
|
-
tempRef = (<any>Object).assign({}, dataObj.data);
|
|
97
|
-
} else {
|
|
98
|
-
tempRef = (<any>Object).assign(templateCompRef.data(), dataObj.data);
|
|
99
|
-
}
|
|
100
|
-
if (templateCompRef.components) {
|
|
101
|
-
const objkeys: any = Object.keys(templateCompRef.components) || [];
|
|
102
|
-
for (const objstring of objkeys) {
|
|
103
|
-
const intComponent: any = templateCompRef.components[`${objstring}`];
|
|
104
|
-
if (intComponent && intComponent.data) {
|
|
105
|
-
if (!intComponent.__data) { intComponent.__data = intComponent.data; }
|
|
106
|
-
intComponent.data = function (proxy: any): Object {
|
|
107
|
-
return (Object as any).assign(intComponent.__data.call(proxy), dataObj.data);
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (templateCompRef.setup) {
|
|
114
|
-
plugins = (<any>Object).assign(plugins, data);
|
|
115
|
-
}
|
|
116
|
-
templateCompRef.data = function (): any { return tempRef; };
|
|
117
|
-
const app: any = Vue.createVNode(templateCompRef, plugins);
|
|
118
|
-
ele.innerHTML = '';
|
|
119
|
-
// Get values for Vue 3 functional template
|
|
120
|
-
getValues(app, context.vueInstance, root);
|
|
121
|
-
Vue.render(app, ele);
|
|
122
|
-
returnEle = ele.childNodes;
|
|
123
|
-
dataObj.parent = null;
|
|
124
|
-
if (vueInstance) {
|
|
125
|
-
let templateInstance: any = vueInstance.templateCollection;
|
|
126
|
-
if (!templateInstance) {
|
|
127
|
-
vueInstance.templateCollection = {};
|
|
128
|
-
templateInstance = vueInstance.templateCollection;
|
|
129
|
-
}
|
|
130
|
-
if (propName) {
|
|
131
|
-
if (!templateInstance[`${propName}`]) {
|
|
132
|
-
templateInstance[`${propName}`] = [];
|
|
133
|
-
}
|
|
134
|
-
templateInstance[`${propName}`].push(ele);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
detach(ele);
|
|
138
|
-
} else if (typeof templateElement === 'string' || (templateElement.prototype && templateElement.prototype.CSPTemplate && typeof templateElement === 'function')) {
|
|
139
|
-
const vueSlot: any = getVueSlot(context.vueInstance, templateElement, root);
|
|
140
|
-
if (vueSlot) {
|
|
141
|
-
// Get provide values for Vue 2 slot template
|
|
142
|
-
let provided: any = {};
|
|
143
|
-
const getProvideValues: any = (vueinstance: any) => {
|
|
144
|
-
if (vueinstance['$parent']) { getProvideValues(vueinstance.$parent); }
|
|
145
|
-
if (vueinstance['_provided'] && Object.keys(vueinstance['_provided']).length > 0) {
|
|
146
|
-
provided = { ...provided, ...vueinstance._provided };
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
const vueInstance: any = context.vueInstance ? context.vueInstance :
|
|
150
|
-
((root && root.vueInstance) ? root.vueInstance : null);
|
|
151
|
-
if (vueInstance) {
|
|
152
|
-
getProvideValues(vueInstance);
|
|
153
|
-
}
|
|
154
|
-
// Compilation for Vue 2 slot template
|
|
155
|
-
const vueTemplate: any = new Vue({
|
|
156
|
-
provide: { ...provided },
|
|
157
|
-
render(): any {
|
|
158
|
-
return vueSlot[`${templateElement}`]({ data: data });
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
vueTemplate.$mount('#' + id);
|
|
162
|
-
returnEle = ele.childNodes;
|
|
163
|
-
if (vueInstance) {
|
|
164
|
-
let templateInstance: any = vueInstance.templateCollection;
|
|
165
|
-
if (!templateInstance) {
|
|
166
|
-
vueInstance.templateCollection = {};
|
|
167
|
-
templateInstance = vueInstance.templateCollection;
|
|
168
|
-
}
|
|
169
|
-
if (propName) {
|
|
170
|
-
if (!templateInstance[`${propName}`]) {
|
|
171
|
-
templateInstance[`${propName}`] = [];
|
|
172
|
-
}
|
|
173
|
-
templateInstance[`${propName}`].push(returnEle[0]);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
detach(ele);
|
|
177
|
-
} else {
|
|
178
|
-
// Compilation for Vue 2 string template
|
|
179
|
-
detach(ele);
|
|
180
|
-
return stringCompiler(templateElement, helper)(data);
|
|
181
|
-
}
|
|
182
|
-
} else {
|
|
183
|
-
// Compilation for Vue 2 functional template
|
|
184
|
-
const tempObj: any = templateElement.call(this, {});
|
|
185
|
-
let templateFunction: any = tempObj.template;
|
|
186
|
-
const propsData: any = getValue('template.propsData', tempObj);
|
|
187
|
-
const dataObj: any = {
|
|
188
|
-
data: { data: extend(tempObj.data || {}, data) },
|
|
189
|
-
parent: context.vueInstance
|
|
190
|
-
};
|
|
191
|
-
if (propsData) {
|
|
192
|
-
templateFunction = tempObj.template.extends;
|
|
193
|
-
dataObj.propsData = propsData;
|
|
194
|
-
}
|
|
195
|
-
if (typeof templateFunction !== 'function') {
|
|
196
|
-
templateFunction = Vue.extend(templateFunction);
|
|
197
|
-
}
|
|
198
|
-
if (templateFunction.options.setup) {
|
|
199
|
-
dataObj.propsData = (<any>Object).assign(dataObj.propsData || {}, data);
|
|
200
|
-
}
|
|
201
|
-
const templateVue: any = new templateFunction(dataObj);
|
|
202
|
-
// let templateVue = new Vue(tempObj.template);
|
|
203
|
-
// templateVue.$data.data = extend(tempObj.data, data);
|
|
204
|
-
templateVue.$mount('#' + id);
|
|
205
|
-
returnEle = ele.childNodes;
|
|
206
|
-
dataObj.parent = null;
|
|
207
|
-
if (vueInstance) {
|
|
208
|
-
let templateInstance: any = vueInstance.templateCollection;
|
|
209
|
-
if (!templateInstance) {
|
|
210
|
-
vueInstance.templateCollection = {};
|
|
211
|
-
templateInstance = vueInstance.templateCollection;
|
|
212
|
-
}
|
|
213
|
-
if (propName) {
|
|
214
|
-
if (!templateInstance[`${propName}`]) {
|
|
215
|
-
templateInstance[`${propName}`] = [];
|
|
216
|
-
}
|
|
217
|
-
templateInstance[`${propName}`].push(returnEle[0]);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
detach(ele);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return returnEle || [];
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
setTemplateEngine({ compile: compile as any });
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Collect values from the app instance.
|
|
231
|
-
*
|
|
232
|
-
* @param {any} app - represents global application instance
|
|
233
|
-
* @param {any} cInstance - represents Vue component instance
|
|
234
|
-
* @param {any} root - represents parent component instance
|
|
235
|
-
* @returns {void}
|
|
236
|
-
*/
|
|
237
|
-
function getValues(app: any, cInstance: any, root: any): void {
|
|
238
|
-
const vueInstance: any = cInstance ? cInstance : ((root && root.vueInstance) ? root.vueInstance : null);
|
|
239
|
-
if (!vueInstance) {
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
// Get globally defined variables.
|
|
243
|
-
app['appContext'] = vueInstance['$']['appContext'];
|
|
244
|
-
// Get provide value from child component.
|
|
245
|
-
let provided: any = {};
|
|
246
|
-
const getProvideValue: any = (vueinstance: any) => {
|
|
247
|
-
if (vueinstance['$'] && vueinstance['$']['parent']) { getProvideValue(vueinstance.$.parent); }
|
|
248
|
-
if (vueinstance['provides'] && Object.keys(vueinstance['provides']).length > 0) {
|
|
249
|
-
provided = { ...provided, ...vueinstance.provides };
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
getProvideValue(vueInstance);
|
|
253
|
-
if (app['appContext']['provides']) {
|
|
254
|
-
app.appContext.provides = { ...app.appContext.provides, ...provided };
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Get the Vue2 slot template from the root or current Vue component.
|
|
260
|
-
*
|
|
261
|
-
* @param {any} vueInstance - represents parent Vue instance.
|
|
262
|
-
* @param {any} templateElement - represents component property value
|
|
263
|
-
* @param {any} root - represents root Vue instance
|
|
264
|
-
* @returns {any} template Vue instance
|
|
265
|
-
*/
|
|
266
|
-
function getVueSlot(vueInstance: any, templateElement: any, root: any): any {
|
|
267
|
-
if (!vueInstance && !(root && root.vueInstance)) {
|
|
268
|
-
return undefined;
|
|
269
|
-
}
|
|
270
|
-
const instance: any = (root && root.vueInstance) ? root.vueInstance : vueInstance;
|
|
271
|
-
return getVueChildSlot(instance, templateElement);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Get the Vue2 nested slot template from the root or current Vue component.
|
|
276
|
-
*
|
|
277
|
-
* @param {any} vueInstance - represents parent Vue instance.
|
|
278
|
-
* @param {any} templateElement - represents component property value
|
|
279
|
-
* @returns {any} nested template Vue instance
|
|
280
|
-
*/
|
|
281
|
-
function getVueChildSlot(vueInstance: any, templateElement: any): any {
|
|
282
|
-
if (!vueInstance) {
|
|
283
|
-
return undefined;
|
|
284
|
-
}
|
|
285
|
-
const slots: any = vueInstance.$slots;
|
|
286
|
-
const scopedSlots: any = vueInstance.$scopedSlots;
|
|
287
|
-
const vSlots: any = vueInstance.scopedSlots;
|
|
288
|
-
const children: any = vueInstance.children;
|
|
289
|
-
if (scopedSlots && scopedSlots[`${templateElement}`]) {
|
|
290
|
-
return scopedSlots;
|
|
291
|
-
} else if (slots && slots.default) {
|
|
292
|
-
const childSlots: any = slots.default;
|
|
293
|
-
for (let i: number = 0; i < childSlots.length; i++) {
|
|
294
|
-
const slot: any = getVueChildSlot(getSlot(childSlots[parseInt(i.toString(), 10)]), templateElement);
|
|
295
|
-
if (slot) {
|
|
296
|
-
return slot;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
} else if (vSlots && vSlots[`${templateElement}`]) {
|
|
300
|
-
return vSlots;
|
|
301
|
-
} else if (children) {
|
|
302
|
-
for (let i: number = 0; i < children.length; i++) {
|
|
303
|
-
const slot: any = getVueChildSlot(getSlot(children[parseInt(i.toString(), 10)]), templateElement);
|
|
304
|
-
if (slot) {
|
|
305
|
-
return slot;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
return undefined;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Collect the component slot directive instance.
|
|
314
|
-
*
|
|
315
|
-
* @param {any} vnode - represents Vue components slot instance.
|
|
316
|
-
* @returns {any} the slot instance of the directive.
|
|
317
|
-
*/
|
|
318
|
-
function getSlot(vnode: any): any {
|
|
319
|
-
const slot: any = (vnode.componentOptions && vnode.componentOptions.children) ? vnode.componentOptions :
|
|
320
|
-
(!vnode.data && (vnode.tag === 'e-markersettings' || vnode.tag === 'e-markersetting')) ? vnode : vnode.data;
|
|
321
|
-
return vnode.componentInstance ? vnode.componentInstance : slot;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Get the Vue3 slot template from the root or current Vue component.
|
|
326
|
-
*
|
|
327
|
-
* @param {any} vueInstance - represents parent Vue instance.
|
|
328
|
-
* @param {any} templateElement - represents component property value
|
|
329
|
-
* @param {any} root - represents root Vue instance
|
|
330
|
-
* @returns {any} slot template instance
|
|
331
|
-
*/
|
|
332
|
-
function getCurrentVueSlot(vueInstance: any, templateElement: any, root: any): any {
|
|
333
|
-
if (!vueInstance && !(root && root.vueInstance)) {
|
|
334
|
-
return undefined;
|
|
335
|
-
}
|
|
336
|
-
const slots: any = (root && root.vueInstance) ? root.vueInstance.$slots : vueInstance.$slots;
|
|
337
|
-
return getChildVueSlot(slots, templateElement);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Get the Vue3 nested slot template from the root or current Vue component.
|
|
342
|
-
*
|
|
343
|
-
* @param {any} slots - represents slot instance.
|
|
344
|
-
* @param {any} templateElement - represents component property value
|
|
345
|
-
* @returns {any} nested template Vue instance
|
|
346
|
-
*/
|
|
347
|
-
function getChildVueSlot(slots: any, templateElement: any): any {
|
|
348
|
-
if (slots && slots[`${templateElement}`]) {
|
|
349
|
-
return slots;
|
|
350
|
-
} else if (slots && slots.default) {
|
|
351
|
-
let childSlots: any = slots.default();
|
|
352
|
-
childSlots = childSlots.flatMap((item: any) => Array.isArray(item.children) ? item.children : item);
|
|
353
|
-
for (let i: number = 0; i < childSlots.length; i++) {
|
|
354
|
-
const slot: any = getChildVueSlot(childSlots[parseInt(i.toString(), 10)].children, templateElement);
|
|
355
|
-
if (slot) {
|
|
356
|
-
return slot;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
return undefined;
|
|
361
|
-
}
|
package/dist/ts/vue-types.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import Vue, { VueConstructor } from 'vue';
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import { DefineComponent } from 'vue';
|
|
5
|
-
|
|
6
|
-
interface CommonProps {
|
|
7
|
-
isLazyUpdate?: Boolean,
|
|
8
|
-
plugins?: any[]
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
export type DefineVueComponent<Props> = typeof Vue.compile extends (template: string) => Function ? DefineComponent<Props & CommonProps, any, {}, {}, {}, {}, {}, {}, string, Props & CommonProps, Props & CommonProps, {}> : VueConstructor<Vue<{}, Props & CommonProps>>;
|
|
13
|
-
|
|
14
|
-
//@ts-ignore
|
|
15
|
-
export type DefineVueDirective<Props> = typeof Vue.compile extends (template: string) => Function ? DefineComponent<Props, any, {}, {}, {}, {}, {}, {}, string, Props, Props, {}> : VueConstructor<Vue<{}, Props>>;
|