@slipmatio/ui
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -20,2 +20,4 @@ import { defineComponent, pushScopeId, popScopeId, openBlock, createBlock, createVNode, createTextVNode, toDisplayString, withScopeId } from 'vue'; | ||
changedBy() { | ||
var _message$amount; | ||
const { | ||
@@ -25,3 +27,3 @@ message | ||
if (!message.action) return 'initialized'; | ||
return `${message?.action} ${message.amount ?? ''}`.trim(); | ||
return `${message === null || message === void 0 ? void 0 : message.action} ${(_message$amount = message.amount) !== null && _message$amount !== void 0 ? _message$amount : ''}`.trim(); | ||
} | ||
@@ -28,0 +30,0 @@ |
@@ -1,1 +0,1 @@ | ||
var Ui=function(e){"use strict";var t=e.defineComponent({name:"UiSample",data:()=>({counter:5,initCounter:5,message:{action:null,amount:null}}),computed:{changedBy(){const{message:e}=this;return e.action?`${e?.action} ${e.amount??""}`.trim():"initialized"}},methods:{increment(e){const t="number"!=typeof e?1:e;this.counter+=t,this.message.action="incremented by",this.message.amount=t},decrement(e){const t="number"!=typeof e?1:e;this.counter-=t,this.message.action="decremented by",this.message.amount=t},reset(){this.counter=this.initCounter,this.message.action="reset",this.message.amount=null}}});const n=e.withScopeId("data-v-8445b280");e.pushScopeId("data-v-8445b280");const o={class:"ui-sample"},i=e.createTextVNode(".");e.popScopeId();const a=n(((t,n,a,c,r,s)=>(e.openBlock(),e.createBlock("div",o,[e.createVNode("p",null,[e.createTextVNode("The counter was "+e.toDisplayString(t.changedBy)+" to ",1),e.createVNode("b",null,e.toDisplayString(t.counter),1),i]),e.createVNode("button",{onClick:n[1]||(n[1]=(...e)=>t.increment(...e))}," Click +1 "),e.createVNode("button",{onClick:n[2]||(n[2]=(...e)=>t.decrement(...e))}," Click -1 "),e.createVNode("button",{onClick:n[3]||(n[3]=e=>t.increment(5))}," Click +5 "),e.createVNode("button",{onClick:n[4]||(n[4]=e=>t.decrement(5))}," Click -5 "),e.createVNode("button",{onClick:n[5]||(n[5]=(...e)=>t.reset(...e))}," Reset ")]))));!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.ui-sample[data-v-8445b280] {\n display: block;\n width: 400px;\n margin: 25px auto;\n border: 1px solid #ccc;\n background: #eaeaea;\n text-align: center;\n padding: 25px;\n}\n.ui-sample p[data-v-8445b280] {\n margin: 0 0 1em;\n}\n"),t.render=a,t.__scopeId="data-v-8445b280";var c=e.defineComponent({props:{icon:{type:String,required:!1}},data:()=>({isPrimary:!1,isSecondary:!1,buttonType:"button"}),created(){void 0!==this.$attrs.primary?this.isPrimary=!0:void 0!==this.$attrs.secondary&&(this.isSecondary=!0),void 0!==this.$attrs.submit&&(this.buttonType="submit")}});c.render=function(t,n,o,i,a,c){return e.openBlock(),e.createBlock("button",null,"DEMO")};var r=Object.freeze({__proto__:null,UiSample:t,DemoButton:c});const s=function(e){Object.entries(r).forEach((([t,n])=>{e.component(t,n)}))};var d=Object.freeze({__proto__:null,default:s,UiSample:t,DemoButton:c});return Object.entries(d).forEach((([e,t])=>{if("default"!==e){s[e]=t}})),s}(Vue); | ||
var Ui=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=[],r=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))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,r=new Array(t);n<t;n++)r[n]=e[n];return r}var r=e.defineComponent({name:"UiSample",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}}}),o=e.withScopeId("data-v-8445b280");e.pushScopeId("data-v-8445b280");var i={class:"ui-sample"},a=e.createTextVNode(".");e.popScopeId();var c=o((function(t,n,r,o,c,u){return e.openBlock(),e.createBlock("div",i,[e.createVNode("p",null,[e.createTextVNode("The counter was "+e.toDisplayString(t.changedBy)+" to ",1),e.createVNode("b",null,e.toDisplayString(t.counter),1),a]),e.createVNode("button",{onClick:n[1]||(n[1]=function(){return t.increment.apply(t,arguments)})}," Click +1 "),e.createVNode("button",{onClick:n[2]||(n[2]=function(){return t.decrement.apply(t,arguments)})}," Click -1 "),e.createVNode("button",{onClick:n[3]||(n[3]=function(e){return t.increment(5)})}," Click +5 "),e.createVNode("button",{onClick:n[4]||(n[4]=function(e){return t.decrement(5)})}," Click -5 "),e.createVNode("button",{onClick:n[5]||(n[5]=function(){return t.reset.apply(t,arguments)})}," Reset ")])}));!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.ui-sample[data-v-8445b280] {\n display: block;\n width: 400px;\n margin: 25px auto;\n border: 1px solid #ccc;\n background: #eaeaea;\n text-align: center;\n padding: 25px;\n}\n.ui-sample p[data-v-8445b280] {\n margin: 0 0 1em;\n}\n"),r.render=c,r.__scopeId="data-v-8445b280";var u=e.defineComponent({props:{icon:{type:String,required:!1}},data:function(){return{isPrimary:!1,isSecondary:!1,buttonType:"button"}},created:function(){void 0!==this.$attrs.primary?this.isPrimary=!0:void 0!==this.$attrs.secondary&&(this.isSecondary=!0),void 0!==this.$attrs.submit&&(this.buttonType="submit")}});u.render=function(t,n,r,o,i,a){return e.openBlock(),e.createBlock("button",null,"DEMO")};var s=Object.freeze({__proto__:null,UiSample:r,DemoButton:u}),l=function(e){Object.entries(s).forEach((function(n){var r=t(n,2),o=r[0],i=r[1];e.component(o,i)}))},d=Object.freeze({__proto__:null,default:l,UiSample:r,DemoButton:u});return Object.entries(d).forEach((function(e){var n=t(e,2),r=n[0],o=n[1];"default"!==r&&(l[r]=o)})),l}(Vue); |
@@ -1,6 +0,59 @@ | ||
'use strict';var vue=require('vue');var script = /*#__PURE__*/vue.defineComponent({ | ||
'use strict';var vue=require('vue');function _slicedToArray(arr, i) { | ||
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); | ||
} | ||
function _arrayWithHoles(arr) { | ||
if (Array.isArray(arr)) return arr; | ||
} | ||
function _iterableToArrayLimit(arr, i) { | ||
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; | ||
var _arr = []; | ||
var _n = true; | ||
var _d = false; | ||
var _e = undefined; | ||
try { | ||
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { | ||
_arr.push(_s.value); | ||
if (i && _arr.length === i) break; | ||
} | ||
} catch (err) { | ||
_d = true; | ||
_e = err; | ||
} finally { | ||
try { | ||
if (!_n && _i["return"] != null) _i["return"](); | ||
} finally { | ||
if (_d) throw _e; | ||
} | ||
} | ||
return _arr; | ||
} | ||
function _unsupportedIterableToArray(o, minLen) { | ||
if (!o) return; | ||
if (typeof o === "string") return _arrayLikeToArray(o, minLen); | ||
var n = Object.prototype.toString.call(o).slice(8, -1); | ||
if (n === "Object" && o.constructor) n = o.constructor.name; | ||
if (n === "Map" || n === "Set") return Array.from(o); | ||
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); | ||
} | ||
function _arrayLikeToArray(arr, len) { | ||
if (len == null || len > arr.length) len = arr.length; | ||
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | ||
return arr2; | ||
} | ||
function _nonIterableRest() { | ||
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | ||
}var script = /*#__PURE__*/vue.defineComponent({ | ||
name: 'UiSample', | ||
// vue component name | ||
data() { | ||
data: function data() { | ||
return { | ||
@@ -15,16 +68,16 @@ counter: 5, | ||
}, | ||
computed: { | ||
changedBy: function changedBy() { | ||
var _message$amount; | ||
computed: { | ||
changedBy() { | ||
const { | ||
message | ||
} = this; | ||
var _ref = this, | ||
message = _ref.message; | ||
if (!message.action) return 'initialized'; | ||
return `${message?.action} ${message.amount ?? ''}`.trim(); | ||
return "".concat(message === null || message === void 0 ? void 0 : message.action, " ").concat((_message$amount = message.amount) !== null && _message$amount !== void 0 ? _message$amount : '').trim(); | ||
} | ||
}, | ||
methods: { | ||
increment(arg) { | ||
const amount = typeof arg !== 'number' ? 1 : arg; | ||
increment: function increment(arg) { | ||
var amount = typeof arg !== 'number' ? 1 : arg; | ||
this.counter += amount; | ||
@@ -34,5 +87,4 @@ this.message.action = 'incremented by'; | ||
}, | ||
decrement(arg) { | ||
const amount = typeof arg !== 'number' ? 1 : arg; | ||
decrement: function decrement(arg) { | ||
var amount = typeof arg !== 'number' ? 1 : arg; | ||
this.counter -= amount; | ||
@@ -42,4 +94,3 @@ this.message.action = 'decremented by'; | ||
}, | ||
reset() { | ||
reset: function reset() { | ||
this.counter = this.initCounter; | ||
@@ -49,29 +100,38 @@ this.message.action = 'reset'; | ||
} | ||
} | ||
});const _withId = /*#__PURE__*/vue.withScopeId("data-v-8445b280"); | ||
});var _withId = /*#__PURE__*/vue.withScopeId("data-v-8445b280"); | ||
vue.pushScopeId("data-v-8445b280"); | ||
const _hoisted_1 = { | ||
var _hoisted_1 = { | ||
class: "ui-sample" | ||
}; | ||
const _hoisted_2 = /*#__PURE__*/vue.createTextVNode("."); | ||
var _hoisted_2 = /*#__PURE__*/vue.createTextVNode("."); | ||
vue.popScopeId(); | ||
const render = /*#__PURE__*/_withId((_ctx, _cache, $props, $setup, $data, $options) => { | ||
var render = /*#__PURE__*/_withId(function (_ctx, _cache, $props, $setup, $data, $options) { | ||
return vue.openBlock(), vue.createBlock("div", _hoisted_1, [vue.createVNode("p", null, [vue.createTextVNode("The counter was " + vue.toDisplayString(_ctx.changedBy) + " to ", 1 | ||
/* TEXT */ | ||
), vue.createVNode("b", null, vue.toDisplayString(_ctx.counter), 1), _hoisted_2]), vue.createVNode("button", { | ||
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.increment(...args)) | ||
onClick: _cache[1] || (_cache[1] = function () { | ||
return _ctx.increment.apply(_ctx, arguments); | ||
}) | ||
}, " Click +1 "), vue.createVNode("button", { | ||
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.decrement(...args)) | ||
onClick: _cache[2] || (_cache[2] = function () { | ||
return _ctx.decrement.apply(_ctx, arguments); | ||
}) | ||
}, " Click -1 "), vue.createVNode("button", { | ||
onClick: _cache[3] || (_cache[3] = $event => _ctx.increment(5)) | ||
onClick: _cache[3] || (_cache[3] = function ($event) { | ||
return _ctx.increment(5); | ||
}) | ||
}, " Click +5 "), vue.createVNode("button", { | ||
onClick: _cache[4] || (_cache[4] = $event => _ctx.decrement(5)) | ||
onClick: _cache[4] || (_cache[4] = function ($event) { | ||
return _ctx.decrement(5); | ||
}) | ||
}, " Click -5 "), vue.createVNode("button", { | ||
onClick: _cache[5] || (_cache[5] = (...args) => _ctx.reset(...args)) | ||
onClick: _cache[5] || (_cache[5] = function () { | ||
return _ctx.reset.apply(_ctx, arguments); | ||
}) | ||
}, " Reset ")]); | ||
@@ -112,4 +172,3 @@ });function styleInject(css, ref) { | ||
}, | ||
data() { | ||
data: function data() { | ||
return { | ||
@@ -121,4 +180,3 @@ isPrimary: false, | ||
}, | ||
created() { | ||
created: function created() { | ||
if (this.$attrs.primary !== undefined) { | ||
@@ -134,22 +192,26 @@ this.isPrimary = true; | ||
} | ||
});function render$1(_ctx, _cache, $props, $setup, $data, $options) { | ||
return vue.openBlock(), vue.createBlock("button", null, "DEMO"); | ||
}script$1.render = render$1;/* eslint-disable import/prefer-default-export */var components=/*#__PURE__*/Object.freeze({__proto__:null,UiSample: script,DemoButton: script$1});// Import vue components | ||
}script$1.render = render$1;/* eslint-disable import/prefer-default-export */var components=/*#__PURE__*/Object.freeze({__proto__:null,UiSample: script,DemoButton: script$1});var install = function installUi(app) { | ||
Object.entries(components).forEach(function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
componentName = _ref2[0], | ||
component = _ref2[1]; | ||
const install = function installUi(app) { | ||
Object.entries(components).forEach(([componentName, component]) => { | ||
app.component(componentName, component); | ||
}); | ||
}; // Create module definition for Vue.use() | ||
var components$1=/*#__PURE__*/Object.freeze({__proto__:null,'default': install,UiSample: script,DemoButton: script$1});// iife/cjs usage extends esm default export - so import it all | ||
// only expose one global var, with component exports exposed as properties of | ||
var components$1=/*#__PURE__*/Object.freeze({__proto__:null,'default': install,UiSample: script,DemoButton: script$1});// only expose one global var, with component exports exposed as properties of | ||
// that global var (eg. plugin.component) | ||
Object.entries(components$1).forEach(([componentName, component]) => { | ||
Object.entries(components$1).forEach(function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
componentName = _ref2[0], | ||
component = _ref2[1]; | ||
if (componentName !== 'default') { | ||
const key = componentName; | ||
const val = component; | ||
var key = componentName; | ||
var val = component; | ||
install[key] = val; | ||
} | ||
});module.exports=install; |
{ | ||
"name": "@slipmatio/ui", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Common UI components for Slipmat.io projects", | ||
@@ -35,3 +35,3 @@ "author": { | ||
"scripts": { | ||
"rebuild": "scripts/rebuild.sh", | ||
"rebuild": "bash scripts/rebuild.sh", | ||
"dev": "vue-cli-service serve dev/serve.ts", | ||
@@ -64,6 +64,6 @@ "serve": "vue-cli-service serve dev/serve.ts", | ||
"minimist": "^1.2.5", | ||
"rollup": "^2.34.0", | ||
"rollup": "^2.30.0", | ||
"rollup-plugin-postcss": "^3.1.8", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"rollup-plugin-vue": "^6.0.0-beta.11", | ||
"rollup-plugin-vue": "^6.0.0-beta.10", | ||
"typescript": "^4.1.2", | ||
@@ -70,0 +70,0 @@ "vue": "^3.0.0" |
@@ -36,1 +36,5 @@ # Slipmat.io UI Components | ||
### Publishing | ||
``` | ||
yarn publish --new-version "0.0.2" --access public | ||
``` |
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
20977
324
40