diff --git a/dist/vue-components.esm.js b/dist/vue-components.esm.js index 17918b4..82c1b3b 100644 --- a/dist/vue-components.esm.js +++ b/dist/vue-components.esm.js @@ -350,7 +350,7 @@ var script$2 = { props: { items: { type: Array, - default: () => [] + default: [] } }, methods: { @@ -406,8 +406,8 @@ var __vue_staticRenderFns__$2 = [function () { const __vue_inject_styles__$2 = function (inject) { if (!inject) return; - inject("data-v-b53a47c8_0", { - source: "table[data-v-b53a47c8]{border-collapse:collapse;text-align:center;table-layout:auto;width:100%}thead[data-v-b53a47c8]{color:#fff;background-color:#b7adff}th[data-v-b53a47c8]{padding:1rem .7rem;text-align:center}tr[data-v-b53a47c8]{box-shadow:0 0 1px 0 rgba(0,0,0,.2)}td[data-v-b53a47c8]{padding:1rem .7rem;text-align:center}", + inject("data-v-2aea4b48_0", { + source: "table[data-v-2aea4b48]{border-collapse:collapse;text-align:center;table-layout:auto;width:100%}thead[data-v-2aea4b48]{color:#fff;background-color:#b7adff}th[data-v-2aea4b48]{padding:1rem .7rem;text-align:center}tr[data-v-2aea4b48]{box-shadow:0 0 1px 0 rgba(0,0,0,.2)}td[data-v-2aea4b48]{padding:1rem .7rem;text-align:center}", map: undefined, media: undefined }); @@ -415,7 +415,7 @@ const __vue_inject_styles__$2 = function (inject) { /* scoped */ -const __vue_scope_id__$2 = "data-v-b53a47c8"; +const __vue_scope_id__$2 = "data-v-2aea4b48"; /* module identifier */ const __vue_module_identifier__$2 = undefined; diff --git a/dist/vue-components.min.js b/dist/vue-components.min.js index 6f7dd19..0997a2b 100644 --- a/dist/vue-components.min.js +++ b/dist/vue-components.min.js @@ -1 +1 @@ -var VueComponents=function(e){"use strict";function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],o=!0,i=!1,r=void 0;try{for(var a,c=e[Symbol.iterator]();!(o=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);o=!0);}catch(e){i=!0,r=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw r}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);nfunction(e,t){const n=i?t.media||"default":e,o=c[n]||(c[n]={ids:new Set,styles:[]});if(!o.ids.has(e)){o.ids.add(e);let n=t.source;if(t.map&&(n+="\n/*# sourceURL="+t.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),o.element||(o.element=document.createElement("style"),o.element.type="text/css",t.media&&o.element.setAttribute("media",t.media),void 0===a&&(a=document.head||document.getElementsByTagName("head")[0]),a.appendChild(o.element)),"styleSheet"in o.element)o.styles.push(n),o.element.styleSheet.cssText=o.styles.filter(Boolean).join("\n");else{const e=o.ids.size-1,t=document.createTextNode(n),i=o.element.childNodes;i[e]&&o.element.removeChild(i[e]),i.length?o.element.insertBefore(t,i[e]):o.element.appendChild(t)}}}(e,t)}let a;const c={};var s=o({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vue-components-sample"},[n("p",[e._v("The counter was "+e._s(e.changedBy)+" to "),n("b",[e._v(e._s(e.counter))]),e._v(".")]),e._v(" "),n("button",{on:{click:e.increment}},[e._v("\n Click +1\n ")]),e._v(" "),n("button",{on:{click:e.decrement}},[e._v("\n Click -1\n ")]),e._v(" "),n("button",{on:{click:function(t){return e.increment(5)}}},[e._v("\n Click +5\n ")]),e._v(" "),n("button",{on:{click:function(t){return e.decrement(5)}}},[e._v("\n Click -5\n ")]),e._v(" "),n("button",{on:{click:e.reset}},[e._v("\n Reset\n ")])])},staticRenderFns:[]},(function(e){e&&e("data-v-2315a943_0",{source:".vue-components-sample[data-v-2315a943]{display:block;width:400px;margin:25px auto;border:1px solid #ccc;background:#eaeaea;text-align:center;padding:25px}.vue-components-sample p[data-v-2315a943]{margin:0 0 1em}",map:void 0,media:void 0})}),{name:"VueComponentsSample",data:function(){return{counter:5,initCounter:5,message:{action:null,amount:null}}},computed:{changedBy:function(){var e,t=this.message;return t.action?"".concat(null==t?void 0:t.action," ").concat(null!==(e=t.amount)&&void 0!==e?e:"").trim():"initialized"}},methods:{increment:function(e){var t="number"!=typeof e?1:e;this.counter+=t,this.message.action="incremented by",this.message.amount=t},decrement:function(e){var t="number"!=typeof e?1:e;this.counter-=t,this.message.action="decremented by",this.message.amount=t},reset:function(){this.counter=this.initCounter,this.message.action="reset",this.message.amount=null}}},"data-v-2315a943",!1,void 0,!1,r,void 0,void 0),d=o({render:function(){var e=this.$createElement;return(this._self._c||e)("button",{staticClass:"btn-cta",on:{click:this.click}},[this._v(this._s(this.text))])},staticRenderFns:[]},(function(e){e&&e("data-v-3f68e6aa_0",{source:".btn-cta{background-color:#d0d0d5;border-width:3px;border-color:#1b1b32;border-radius:0;border-style:solid;color:#1b1b32;display:block;margin-bottom:0;font-weight:400;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;white-space:nowrap;padding:6px 12px;font-size:18px;line-height:1.42857143}.btn-cta:active:hover,.btn-cta:focus,.btn-cta:hover{background-color:#1b1b32;border-width:3px;border-color:#000;background-image:none;color:#f5f6f7}",map:void 0,media:void 0})}),{name:"VueButton",props:{text:{type:String,default:"Enter Button Text Here"}},methods:{click:function(){console.log("inside vue button"),console.log(this),this.$emit("clicked")}},data:function(){}},void 0,!1,void 0,!1,r,void 0,void 0),l=o({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("table",[e._m(0),e._v(" "),n("tbody",[e.items.length?e._e():n("tr",[n("td",{attrs:{colspan:"3"}},[e._v("Nothing to display")])]),e._v(" "),e._l(e.items,(function(t){return n("tr",{key:t.id,on:{click:function(n){return e.onClick(t)}}},[n("td",[e._v(e._s(t.name))]),e._v(" "),n("td",[e._v(e._s(t.age))]),e._v(" "),n("td",[e._v(e._s(t.job))])])}))],2)])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("thead",[t("tr",[t("th",[this._v("Name")]),this._v(" "),t("th",[this._v("Age")]),this._v(" "),t("th",[this._v("Occupation")])])])}]},(function(e){e&&e("data-v-b53a47c8_0",{source:"table[data-v-b53a47c8]{border-collapse:collapse;text-align:center;table-layout:auto;width:100%}thead[data-v-b53a47c8]{color:#fff;background-color:#b7adff}th[data-v-b53a47c8]{padding:1rem .7rem;text-align:center}tr[data-v-b53a47c8]{box-shadow:0 0 1px 0 rgba(0,0,0,.2)}td[data-v-b53a47c8]{padding:1rem .7rem;text-align:center}",map:void 0,media:void 0})}),{name:"VueTable",props:{items:{type:Array,default:function(){return[]}}},methods:{onClick:function(e){console.log(e),this.$emit("row-clicked",{item:e})}},data:function(){}},"data-v-b53a47c8",!1,void 0,!1,r,void 0,void 0),u=Object.freeze({__proto__:null,VueComponentsSample:s,VueButton:d,VueTable:l}),m=function(e){m.installed||(m.installed=!0,Object.entries(u).forEach((function(n){var o=t(n,2),i=o[0],r=o[1];e.component(i,r)})))},f={install:m},p=null;return"undefined"!=typeof window?p=window.Vue:"undefined"!=typeof global&&(p=global.Vue),p&&p.use(f),e.VueButton=d,e.VueComponentsSample=s,e.VueTable=l,e.default=f,e}({}); \ No newline at end of file +var VueComponents=function(e){"use strict";function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],o=!0,i=!1,a=void 0;try{for(var r,c=e[Symbol.iterator]();!(o=(r=c.next()).done)&&(n.push(r.value),!t||n.length!==t);o=!0);}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);nfunction(e,t){const n=i?t.media||"default":e,o=c[n]||(c[n]={ids:new Set,styles:[]});if(!o.ids.has(e)){o.ids.add(e);let n=t.source;if(t.map&&(n+="\n/*# sourceURL="+t.map.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),o.element||(o.element=document.createElement("style"),o.element.type="text/css",t.media&&o.element.setAttribute("media",t.media),void 0===r&&(r=document.head||document.getElementsByTagName("head")[0]),r.appendChild(o.element)),"styleSheet"in o.element)o.styles.push(n),o.element.styleSheet.cssText=o.styles.filter(Boolean).join("\n");else{const e=o.ids.size-1,t=document.createTextNode(n),i=o.element.childNodes;i[e]&&o.element.removeChild(i[e]),i.length?o.element.insertBefore(t,i[e]):o.element.appendChild(t)}}}(e,t)}let r;const c={};var s=o({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vue-components-sample"},[n("p",[e._v("The counter was "+e._s(e.changedBy)+" to "),n("b",[e._v(e._s(e.counter))]),e._v(".")]),e._v(" "),n("button",{on:{click:e.increment}},[e._v("\n Click +1\n ")]),e._v(" "),n("button",{on:{click:e.decrement}},[e._v("\n Click -1\n ")]),e._v(" "),n("button",{on:{click:function(t){return e.increment(5)}}},[e._v("\n Click +5\n ")]),e._v(" "),n("button",{on:{click:function(t){return e.decrement(5)}}},[e._v("\n Click -5\n ")]),e._v(" "),n("button",{on:{click:e.reset}},[e._v("\n Reset\n ")])])},staticRenderFns:[]},(function(e){e&&e("data-v-2315a943_0",{source:".vue-components-sample[data-v-2315a943]{display:block;width:400px;margin:25px auto;border:1px solid #ccc;background:#eaeaea;text-align:center;padding:25px}.vue-components-sample p[data-v-2315a943]{margin:0 0 1em}",map:void 0,media:void 0})}),{name:"VueComponentsSample",data:function(){return{counter:5,initCounter:5,message:{action:null,amount:null}}},computed:{changedBy:function(){var e,t=this.message;return t.action?"".concat(null==t?void 0:t.action," ").concat(null!==(e=t.amount)&&void 0!==e?e:"").trim():"initialized"}},methods:{increment:function(e){var t="number"!=typeof e?1:e;this.counter+=t,this.message.action="incremented by",this.message.amount=t},decrement:function(e){var t="number"!=typeof e?1:e;this.counter-=t,this.message.action="decremented by",this.message.amount=t},reset:function(){this.counter=this.initCounter,this.message.action="reset",this.message.amount=null}}},"data-v-2315a943",!1,void 0,!1,a,void 0,void 0),d=o({render:function(){var e=this.$createElement;return(this._self._c||e)("button",{staticClass:"btn-cta",on:{click:this.click}},[this._v(this._s(this.text))])},staticRenderFns:[]},(function(e){e&&e("data-v-3f68e6aa_0",{source:".btn-cta{background-color:#d0d0d5;border-width:3px;border-color:#1b1b32;border-radius:0;border-style:solid;color:#1b1b32;display:block;margin-bottom:0;font-weight:400;text-align:center;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;white-space:nowrap;padding:6px 12px;font-size:18px;line-height:1.42857143}.btn-cta:active:hover,.btn-cta:focus,.btn-cta:hover{background-color:#1b1b32;border-width:3px;border-color:#000;background-image:none;color:#f5f6f7}",map:void 0,media:void 0})}),{name:"VueButton",props:{text:{type:String,default:"Enter Button Text Here"}},methods:{click:function(){console.log("inside vue button"),console.log(this),this.$emit("clicked")}},data:function(){}},void 0,!1,void 0,!1,a,void 0,void 0),l=o({render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("table",[e._m(0),e._v(" "),n("tbody",[e.items.length?e._e():n("tr",[n("td",{attrs:{colspan:"3"}},[e._v("Nothing to display")])]),e._v(" "),e._l(e.items,(function(t){return n("tr",{key:t.id,on:{click:function(n){return e.onClick(t)}}},[n("td",[e._v(e._s(t.name))]),e._v(" "),n("td",[e._v(e._s(t.age))]),e._v(" "),n("td",[e._v(e._s(t.job))])])}))],2)])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("thead",[t("tr",[t("th",[this._v("Name")]),this._v(" "),t("th",[this._v("Age")]),this._v(" "),t("th",[this._v("Occupation")])])])}]},(function(e){e&&e("data-v-2aea4b48_0",{source:"table[data-v-2aea4b48]{border-collapse:collapse;text-align:center;table-layout:auto;width:100%}thead[data-v-2aea4b48]{color:#fff;background-color:#b7adff}th[data-v-2aea4b48]{padding:1rem .7rem;text-align:center}tr[data-v-2aea4b48]{box-shadow:0 0 1px 0 rgba(0,0,0,.2)}td[data-v-2aea4b48]{padding:1rem .7rem;text-align:center}",map:void 0,media:void 0})}),{name:"VueTable",props:{items:{type:Array,default:[]}},methods:{onClick:function(e){console.log(e),this.$emit("row-clicked",{item:e})}},data:function(){}},"data-v-2aea4b48",!1,void 0,!1,a,void 0,void 0),u=Object.freeze({__proto__:null,VueComponentsSample:s,VueButton:d,VueTable:l}),m=function(e){m.installed||(m.installed=!0,Object.entries(u).forEach((function(n){var o=t(n,2),i=o[0],a=o[1];e.component(i,a)})))},f={install:m},p=null;return"undefined"!=typeof window?p=window.Vue:"undefined"!=typeof global&&(p=global.Vue),p&&p.use(f),e.VueButton=d,e.VueComponentsSample=s,e.VueTable=l,e.default=f,e}({}); \ No newline at end of file diff --git a/dist/vue-components.ssr.js b/dist/vue-components.ssr.js index 8e69f4f..2118a23 100644 --- a/dist/vue-components.ssr.js +++ b/dist/vue-components.ssr.js @@ -342,9 +342,7 @@ var script$2 = { props: { items: { type: Array, - default: function _default() { - return []; - } + default: [] } }, methods: { @@ -367,8 +365,8 @@ var __vue_render__$2 = function __vue_render__() { var _c = _vm._self._c || _h; - return _c('table', [_vm._ssrNode("Name Age Occupation " + (!_vm.items.length ? "Nothing to display" : "") + " " + _vm._ssrList(_vm.items, function (item) { - return "" + _vm._ssrEscape(_vm._s(item.name)) + " " + _vm._ssrEscape(_vm._s(item.age)) + " " + _vm._ssrEscape(_vm._s(item.job)) + ""; + return _c('table', [_vm._ssrNode("Name Age Occupation " + (!_vm.items.length ? "Nothing to display" : "") + " " + _vm._ssrList(_vm.items, function (item) { + return "" + _vm._ssrEscape(_vm._s(item.name)) + " " + _vm._ssrEscape(_vm._s(item.age)) + " " + _vm._ssrEscape(_vm._s(item.job)) + ""; }) + "")]); }; @@ -377,8 +375,8 @@ var __vue_staticRenderFns__$2 = []; var __vue_inject_styles__$2 = function __vue_inject_styles__(inject) { if (!inject) return; - inject("data-v-b53a47c8_0", { - source: "table[data-v-b53a47c8]{border-collapse:collapse;text-align:center;table-layout:auto;width:100%}thead[data-v-b53a47c8]{color:#fff;background-color:#b7adff}th[data-v-b53a47c8]{padding:1rem .7rem;text-align:center}tr[data-v-b53a47c8]{box-shadow:0 0 1px 0 rgba(0,0,0,.2)}td[data-v-b53a47c8]{padding:1rem .7rem;text-align:center}", + inject("data-v-2aea4b48_0", { + source: "table[data-v-2aea4b48]{border-collapse:collapse;text-align:center;table-layout:auto;width:100%}thead[data-v-2aea4b48]{color:#fff;background-color:#b7adff}th[data-v-2aea4b48]{padding:1rem .7rem;text-align:center}tr[data-v-2aea4b48]{box-shadow:0 0 1px 0 rgba(0,0,0,.2)}td[data-v-2aea4b48]{padding:1rem .7rem;text-align:center}", map: undefined, media: undefined }); @@ -386,10 +384,10 @@ var __vue_inject_styles__$2 = function __vue_inject_styles__(inject) { /* scoped */ -var __vue_scope_id__$2 = "data-v-b53a47c8"; +var __vue_scope_id__$2 = "data-v-2aea4b48"; /* module identifier */ -var __vue_module_identifier__$2 = "data-v-b53a47c8"; +var __vue_module_identifier__$2 = "data-v-2aea4b48"; /* functional template */ var __vue_is_functional_template__$2 = false; diff --git a/package.json b/package.json index 6254ca6..1b2587f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-components", - "version": "0.0.6", + "version": "0.0.7", "description": "", "main": "dist/vue-components.ssr.js", diff --git a/src/lib-components/vue-table.vue b/src/lib-components/vue-table.vue index e891616..3e503e5 100644 --- a/src/lib-components/vue-table.vue +++ b/src/lib-components/vue-table.vue @@ -26,7 +26,7 @@ export default { props: { items: { type: Array, - default: () => [] + default: [] } }, methods: {