@mcwv/base
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -5,5 +5,16 @@ export function BasePlugin(components) { | ||
install: vm => { | ||
Object.values(components).forEach(component => | ||
vm.component(component.name, component), | ||
); | ||
Object.entries(components).forEach(([key, component]) => { | ||
const name = key.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase(); | ||
// eslint-disable-next-line no-unused-vars | ||
const [pfx, ...rest] = name.split('-'); | ||
const mdcName = ['mdc', ...rest].join('-'); | ||
const mcwName = ['mcw', ...rest].join('-'); | ||
const definition = vm.extend(component); | ||
vm.component(mcwName, definition); | ||
vm.component(mdcName, definition); | ||
}); | ||
}, | ||
@@ -10,0 +21,0 @@ components, |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.base=e():(t.mcwv=t.mcwv||{},t.mcwv.base=e())}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([,function(t,e,n){"use strict";n.r(e);var o=n(10);n.d(e,"applyPassive",function(){return o.a});var i=n(2);n.d(e,"BasePlugin",function(){return i.a});var s=n(9);n.d(e,"CustomButton",function(){return s.a}),n.d(e,"CustomButtonMixin",function(){return s.b});var r=n(6);n.d(e,"emitCustomEvent",function(){return r.a});var u=n(7);n.d(e,"CustomLink",function(){return u.a}),n.d(e,"CustomLinkMixin",function(){return u.b});var c=n(4);n.d(e,"DispatchEventMixin",function(){return c.a});var a=n(8);n.d(e,"DispatchFocusMixin",function(){return a.a});var l=n(5);n.d(e,"VMAUniqueIdMixin",function(){return l.a})},function(t,e,n){"use strict";function o(t){return{version:"__VERSION__",install:e=>{Object.values(t).forEach(t=>e.component(t.name,t))},components:t}}n.d(e,"a",function(){return o})},,function(t,e,n){"use strict";n.d(e,"a",function(){return o});const o={props:{event:String,"event-target":Object,"event-args":Array},methods:{dispatchEvent(t){if(t&&this.$emit(t.type,t),this.event){const t=this.eventTarget||this.$root,e=this.eventArgs||[];t.$emit(this.event,...e)}}},computed:{listeners(){return{...this.$listeners,click:t=>this.dispatchEvent(t)}}}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});const o=Math.floor(Math.random()*Math.floor(268435456)).toString()+"-",i={beforeCreate(){this.vma_uid_=o+this._uid}}},function(t,e,n){"use strict";function o(t,e,n,o=!1){let i;"function"==typeof CustomEvent?i=new CustomEvent(e,{detail:n,bubbles:o}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,o,!1,n),t.dispatchEvent(i)}n.d(e,"a",function(){return o})},function(t,e,n){"use strict";n.d(e,"a",function(){return o}),n.d(e,"b",function(){return i});const o={name:"custom-link",functional:!0,props:{tag:{type:String,default:"a"},link:Object},render(t,{data:e,children:n,props:{link:o,tag:i},parent:{$router:s,$root:r}}){let u;return o&&s?(u=r.$options.components.RouterLink,e.props={tag:i,...o},e.on.click&&(e.nativeOn={click:e.on.click})):u=i,t(u,e,n)}},i={props:{to:[String,Object],exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String},computed:{link(){return this.to&&{to:this.to,exact:this.exact,append:this.append,replace:this.replace,activeClass:this.activeClass,exactActiveClass:this.exactActiveClass}}},components:{CustomLink:o}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});const o={data:()=>({hasFocus:!1}),methods:{onMouseDown(){this._active=!0},onMouseUp(){this._active=!1},onFocusEvent(){setTimeout(()=>this.dispatchFocusEvent(),0)},onBlurEvent(){this._active||setTimeout(()=>this.dispatchFocusEvent(),0)},dispatchFocusEvent(){const t=this.$el===document.activeElement||this.$el.contains(document.activeElement);t!=this.hasFocus&&(this.$emit(t?"focus":"blur"),this.hasFocus=t)}},mounted(){this.$el.addEventListener("focusin",this.onFocusEvent),this.$el.addEventListener("focusout",this.onBlurEvent),this.$el.addEventListener("mousedown",this.onMouseDown),this.$el.addEventListener("mouseup",this.onMouseUp)},beforeDestroy(){this.$el.removeEventListener("focusin",this.onFocusEvent),this.$el.removeEventListener("focusout",this.onBlurEvent),this.$el.removeEventListener("mousedown",this.onMouseDown),this.$el.removeEventListener("mouseup",this.onMouseUp)}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o}),n.d(e,"b",function(){return i});const o={name:"custom-button",functional:!0,props:{link:Object},render(t,{children:e,data:n,props:{link:o,tag:i},parent:{$router:s,$root:r}}){let u;return o&&s?(u=r.$options.components.RouterLink,n.props={tag:i,...o},n.attrs.role="button",n.on.click&&(n.nativeOn={click:n.on.click})):n.attrs&&n.attrs.href?(u="a",n.attrs.role="button"):u="button",t(u,n,e)}},i={props:{href:String,disabled:Boolean,to:[String,Object],exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String},computed:{link(){return this.to&&{to:this.to,exact:this.exact,append:this.append,replace:this.replace,activeClass:this.activeClass,exactActiveClass:this.exactActiveClass}}},components:{CustomButton:o}}},function(t,e,n){"use strict";let o;function i(t=window,e=!1){if(void 0===o||e){let e=!1;try{t.document.addEventListener("test",null,{get passive(){return e={passive:!0}}})}catch(t){}o=e}return o}n.d(e,"a",function(){return i})}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.base=e():(t.mcwv=t.mcwv||{},t.mcwv.base=e())}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";n.r(e);var o=n(10);n.d(e,"applyPassive",function(){return o.a});var i=n(2);n.d(e,"BasePlugin",function(){return i.a});var s=n(11);n.d(e,"CustomButton",function(){return s.a}),n.d(e,"CustomButtonMixin",function(){return s.b});var r=n(7);n.d(e,"emitCustomEvent",function(){return r.a});var u=n(8);n.d(e,"CustomLink",function(){return u.a}),n.d(e,"CustomLinkMixin",function(){return u.b});var c=n(4);n.d(e,"DispatchEventMixin",function(){return c.a});var a=n(9);n.d(e,"DispatchFocusMixin",function(){return a.a});var l=n(5);n.d(e,"VMAUniqueIdMixin",function(){return l.a})},,function(t,e,n){"use strict";function o(t){return{version:"__VERSION__",install:e=>{Object.entries(t).forEach(([t,n])=>{const o=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),[i,...s]=o.split("-"),r=["mdc",...s].join("-"),u=["mcw",...s].join("-"),c=e.extend(n);e.component(u,c),e.component(r,c)})},components:t}}n.d(e,"a",function(){return o})},,function(t,e,n){"use strict";n.d(e,"a",function(){return o});const o={props:{event:String,"event-target":Object,"event-args":Array},methods:{dispatchEvent(t){if(t&&this.$emit(t.type,t),this.event){const t=this.eventTarget||this.$root,e=this.eventArgs||[];t.$emit(this.event,...e)}}},computed:{listeners(){return{...this.$listeners,click:t=>this.dispatchEvent(t)}}}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});const o=Math.floor(Math.random()*Math.floor(268435456)).toString()+"-",i={beforeCreate(){this.vma_uid_=o+this._uid}}},,function(t,e,n){"use strict";function o(t,e,n,o=!1){let i;"function"==typeof CustomEvent?i=new CustomEvent(e,{detail:n,bubbles:o}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,o,!1,n),t.dispatchEvent(i)}n.d(e,"a",function(){return o})},function(t,e,n){"use strict";n.d(e,"a",function(){return o}),n.d(e,"b",function(){return i});const o={name:"custom-link",functional:!0,props:{tag:{type:String,default:"a"},link:Object},render(t,{data:e,children:n,props:{link:o,tag:i},parent:{$router:s,$root:r}}){let u;return o&&s?(u=r.$options.components.RouterLink,e.props={tag:i,...o},e.on.click&&(e.nativeOn={click:e.on.click})):u=i,t(u,e,n)}},i={props:{to:[String,Object],exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String},computed:{link(){return this.to&&{to:this.to,exact:this.exact,append:this.append,replace:this.replace,activeClass:this.activeClass,exactActiveClass:this.exactActiveClass}}},components:{CustomLink:o}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});const o={data:()=>({hasFocus:!1}),methods:{onMouseDown(){this._active=!0},onMouseUp(){this._active=!1},onFocusEvent(){setTimeout(()=>this.dispatchFocusEvent(),0)},onBlurEvent(){this._active||setTimeout(()=>this.dispatchFocusEvent(),0)},dispatchFocusEvent(){const t=this.$el===document.activeElement||this.$el.contains(document.activeElement);t!=this.hasFocus&&(this.$emit(t?"focus":"blur"),this.hasFocus=t)}},mounted(){this.$el.addEventListener("focusin",this.onFocusEvent),this.$el.addEventListener("focusout",this.onBlurEvent),this.$el.addEventListener("mousedown",this.onMouseDown),this.$el.addEventListener("mouseup",this.onMouseUp)},beforeDestroy(){this.$el.removeEventListener("focusin",this.onFocusEvent),this.$el.removeEventListener("focusout",this.onBlurEvent),this.$el.removeEventListener("mousedown",this.onMouseDown),this.$el.removeEventListener("mouseup",this.onMouseUp)}}},function(t,e,n){"use strict";let o;function i(t=window,e=!1){if(void 0===o||e){let e=!1;try{t.document.addEventListener("test",null,{get passive(){return e={passive:!0}}})}catch(t){}o=e}return o}n.d(e,"a",function(){return i})},function(t,e,n){"use strict";n.d(e,"a",function(){return o}),n.d(e,"b",function(){return i});const o={name:"custom-button",functional:!0,props:{link:Object},render(t,{children:e,data:n,props:{link:o,tag:i},parent:{$router:s,$root:r}}){let u;return o&&s?(u=r.$options.components.RouterLink,n.props={tag:i,...o},n.attrs.role="button",n.on.click&&(n.nativeOn={click:n.on.click})):n.attrs&&n.attrs.href?(u="a",n.attrs.role="button"):u="button",t(u,n,e)}},i={props:{href:String,disabled:Boolean,to:[String,Object],exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String},computed:{link(){return this.to&&{to:this.to,exact:this.exact,append:this.append,replace:this.replace,activeClass:this.activeClass,exactActiveClass:this.exactActiveClass}}},components:{CustomButton:o}}}])}); | ||
//# sourceMappingURL=mcwv.base.min.js.map |
{ | ||
"name": "@mcwv/base", | ||
"description": "The set of base classes for Vue material componnents", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"license": "MIT", | ||
@@ -13,3 +13,3 @@ "main": "dist/mcwv.base.min.js", | ||
"sideEffects": false, | ||
"gitHead": "18ce29b68e90ce14bdc0f9e9e579904a9968cfd2" | ||
"gitHead": "01c129112cab2a105f8f0b44bda616813bce6a04" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32637
284