cleek 1.1.0

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.
@@ -0,0 +1,207 @@
1
+ import { defineComponent, openBlock, createElementBlock, createElementVNode, createTextVNode, toDisplayString, createCommentVNode, renderSlot } from 'vue';
2
+
3
+ var script$3 = /*#__PURE__*/defineComponent({
4
+ name: 'QuanticVueSample',
5
+
6
+ data() {
7
+ return {
8
+ counter: 5,
9
+ initCounter: 5,
10
+ message: {
11
+ action: null,
12
+ amount: null
13
+ }
14
+ };
15
+ },
16
+
17
+ computed: {
18
+ changedBy() {
19
+ const {
20
+ message
21
+ } = this;
22
+ if (!message.action) return 'initialized';
23
+ return `${message.action} ${message.amount || ''}`.trim();
24
+ }
25
+
26
+ },
27
+ methods: {
28
+ increment(arg) {
29
+ const amount = typeof arg !== 'number' ? 1 : arg;
30
+ this.counter += amount;
31
+ this.message.action = 'incremented by';
32
+ this.message.amount = amount;
33
+ },
34
+
35
+ decrement(arg) {
36
+ const amount = typeof arg !== 'number' ? 1 : arg;
37
+ this.counter -= amount;
38
+ this.message.action = 'decremented by';
39
+ this.message.amount = amount;
40
+ },
41
+
42
+ reset() {
43
+ this.counter = this.initCounter;
44
+ this.message.action = 'reset';
45
+ this.message.amount = null;
46
+ }
47
+
48
+ }
49
+ });
50
+
51
+ const _hoisted_1$3 = {
52
+ class: "quantic-vue-sample"
53
+ };
54
+
55
+ const _hoisted_2$3 = /*#__PURE__*/createTextVNode(".");
56
+
57
+ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
58
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [createElementVNode("p", null, [createTextVNode("The counter was " + toDisplayString(_ctx.changedBy) + " to ", 1), createElementVNode("b", null, toDisplayString(_ctx.counter), 1), _hoisted_2$3]), createElementVNode("button", {
59
+ onClick: _cache[0] || (_cache[0] = function () {
60
+ return _ctx.increment && _ctx.increment(...arguments);
61
+ })
62
+ }, " Click +1 "), createElementVNode("button", {
63
+ onClick: _cache[1] || (_cache[1] = function () {
64
+ return _ctx.decrement && _ctx.decrement(...arguments);
65
+ })
66
+ }, " Click -1 "), createElementVNode("button", {
67
+ onClick: _cache[2] || (_cache[2] = $event => _ctx.increment(5))
68
+ }, " Click +5 "), createElementVNode("button", {
69
+ onClick: _cache[3] || (_cache[3] = $event => _ctx.decrement(5))
70
+ }, " Click -5 "), createElementVNode("button", {
71
+ onClick: _cache[4] || (_cache[4] = function () {
72
+ return _ctx.reset && _ctx.reset(...arguments);
73
+ })
74
+ }, " Reset ")]);
75
+ }
76
+
77
+ function styleInject(css, ref) {
78
+ if ( ref === void 0 ) ref = {};
79
+ var insertAt = ref.insertAt;
80
+
81
+ if (!css || typeof document === 'undefined') { return; }
82
+
83
+ var head = document.head || document.getElementsByTagName('head')[0];
84
+ var style = document.createElement('style');
85
+ style.type = 'text/css';
86
+
87
+ if (insertAt === 'top') {
88
+ if (head.firstChild) {
89
+ head.insertBefore(style, head.firstChild);
90
+ } else {
91
+ head.appendChild(style);
92
+ }
93
+ } else {
94
+ head.appendChild(style);
95
+ }
96
+
97
+ if (style.styleSheet) {
98
+ style.styleSheet.cssText = css;
99
+ } else {
100
+ style.appendChild(document.createTextNode(css));
101
+ }
102
+ }
103
+
104
+ var css_248z$3 = "\n.quantic-vue-sample[data-v-e1d15920] {\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.quantic-vue-sample p[data-v-e1d15920] {\n margin: 0 0 1em;\n}\n";
105
+ styleInject(css_248z$3);
106
+
107
+ script$3.render = render$3;
108
+ script$3.__scopeId = "data-v-e1d15920";
109
+
110
+ var script$2 = {
111
+ props: {
112
+ label: {
113
+ type: String,
114
+ default: ''
115
+ }
116
+ }
117
+ };
118
+
119
+ const _hoisted_1$2 = {
120
+ key: 0
121
+ };
122
+ const _hoisted_2$2 = {
123
+ class: "btn-cta"
124
+ };
125
+
126
+ const _hoisted_3 = /*#__PURE__*/createTextVNode(" | button 7 ");
127
+
128
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
129
+ return openBlock(), createElementBlock("div", null, [$props.label ? (openBlock(), createElementBlock("label", _hoisted_1$2, toDisplayString($props.label), 1)) : createCommentVNode("", true), createElementVNode("button", _hoisted_2$2, [_hoisted_3, renderSlot(_ctx.$slots, "default")])]);
130
+ }
131
+
132
+ var css_248z$2 = "\n.btn-cta {\r\n background-color: #d0d0d5;\r\n border-width: 3px;\r\n border-color: #1b1b32;\r\n border-radius: 0;\r\n border-style: solid;\r\n color: #1b1b32;\r\n display: block;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n -ms-touch-action: manipulation;\r\n touch-action: manipulation;\r\n cursor: pointer;\r\n white-space: nowrap;\r\n padding: 6px 12px;\r\n font-size: 18px;\r\n line-height: 1.42857143;\n}\n.btn-cta:active:hover,\r\n.btn-cta:focus,\r\n.btn-cta:hover {\r\n background-color: #1b1b32;\r\n border-width: 3px;\r\n border-color: #000;\r\n background-image: none;\r\n color: #f5f6f7;\n}\r\n";
133
+ styleInject(css_248z$2);
134
+
135
+ script$2.render = render$2;
136
+
137
+ var script$1 = {
138
+ props: {
139
+ label: {
140
+ type: String,
141
+ default: ''
142
+ }
143
+ }
144
+ };
145
+
146
+ const _hoisted_1$1 = {
147
+ key: 0
148
+ };
149
+
150
+ const _hoisted_2$1 = /*#__PURE__*/createElementVNode("input", null, null, -1);
151
+
152
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
153
+ return openBlock(), createElementBlock("div", null, [$props.label ? (openBlock(), createElementBlock("label", _hoisted_1$1, toDisplayString($props.label), 1)) : createCommentVNode("", true), _hoisted_2$1]);
154
+ }
155
+
156
+ var css_248z$1 = "\n.btn-cta {\r\n background-color: #d0d0d5;\r\n border-width: 3px;\r\n border-color: #1b1b32;\r\n border-radius: 0;\r\n border-style: solid;\r\n color: #1b1b32;\r\n display: block;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n -ms-touch-action: manipulation;\r\n touch-action: manipulation;\r\n cursor: pointer;\r\n white-space: nowrap;\r\n padding: 6px 12px;\r\n font-size: 18px;\r\n line-height: 1.42857143;\n}\n.btn-cta:active:hover,\r\n.btn-cta:focus,\r\n.btn-cta:hover {\r\n background-color: #1b1b32;\r\n border-width: 3px;\r\n border-color: #000;\r\n background-image: none;\r\n color: #f5f6f7;\n}\r\n";
157
+ styleInject(css_248z$1);
158
+
159
+ script$1.render = render$1;
160
+
161
+ var script = {
162
+ props: {
163
+ label: {
164
+ type: String,
165
+ default: ''
166
+ }
167
+ }
168
+ };
169
+
170
+ const _hoisted_1 = {
171
+ key: 0
172
+ };
173
+
174
+ const _hoisted_2 = /*#__PURE__*/createElementVNode("textarea", null, null, -1);
175
+
176
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
177
+ return openBlock(), createElementBlock("div", null, [$props.label ? (openBlock(), createElementBlock("label", _hoisted_1, toDisplayString($props.label), 1)) : createCommentVNode("", true), _hoisted_2]);
178
+ }
179
+
180
+ var css_248z = "\n.btn-cta {\r\n background-color: #d0d0d5;\r\n border-width: 3px;\r\n border-color: #1b1b32;\r\n border-radius: 0;\r\n border-style: solid;\r\n color: #1b1b32;\r\n display: block;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n -ms-touch-action: manipulation;\r\n touch-action: manipulation;\r\n cursor: pointer;\r\n white-space: nowrap;\r\n padding: 6px 12px;\r\n font-size: 18px;\r\n line-height: 1.42857143;\n}\n.btn-cta:active:hover,\r\n.btn-cta:focus,\r\n.btn-cta:hover {\r\n background-color: #1b1b32;\r\n border-width: 3px;\r\n border-color: #000;\r\n background-image: none;\r\n color: #f5f6f7;\n}\r\n";
181
+ styleInject(css_248z);
182
+
183
+ script.render = render;
184
+
185
+ /* eslint-disable import/prefer-default-export */
186
+
187
+ var components = /*#__PURE__*/Object.freeze({
188
+ __proto__: null,
189
+ QuanticVueSample: script$3,
190
+ QvButton: script$2,
191
+ QvInputText: script$1,
192
+ QvTextarea: script
193
+ });
194
+
195
+ // Import vue components
196
+ console.log('ESTOY EN PACKAGE'); // install function executed by Vue.use()
197
+
198
+ const install = function installQuanticVue(app, options) {
199
+ console.log('arranco paquete');
200
+ console.log('options', options);
201
+ Object.entries(components).forEach(_ref => {
202
+ let [componentName, component] = _ref;
203
+ app.component(componentName, component);
204
+ });
205
+ }; // Create module definition for Vue.use()
206
+
207
+ export { script$3 as QuanticVueSample, script$2 as QvButton, script$1 as QvInputText, script as QvTextarea, install as default };
@@ -0,0 +1 @@
1
+ var QuanticVue=function(e){"use strict";function n(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,o,a=[],c=!0,l=!1;try{for(t=t.call(e);!(c=(r=t.next()).done)&&(a.push(r.value),!n||a.length!==n);c=!0);}catch(e){l=!0,o=e}finally{try{c||null==t.return||t.return()}finally{if(l)throw o}}return a}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);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 t(e,n)}(e,n)||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 t(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var r=e.defineComponent({name:"QuanticVueSample",data:function(){return{counter:5,initCounter:5,message:{action:null,amount:null}}},computed:{changedBy:function(){var e=this.message;return e.action?"".concat(e.action," ").concat(e.amount||"").trim():"initialized"}},methods:{increment:function(e){var n="number"!=typeof e?1:e;this.counter+=n,this.message.action="incremented by",this.message.amount=n},decrement:function(e){var n="number"!=typeof e?1:e;this.counter-=n,this.message.action="decremented by",this.message.amount=n},reset:function(){this.counter=this.initCounter,this.message.action="reset",this.message.amount=null}}}),o={class:"quantic-vue-sample"},a=e.createTextVNode(".");function c(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}c("\n.quantic-vue-sample[data-v-e1d15920] {\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.quantic-vue-sample p[data-v-e1d15920] {\n margin: 0 0 1em;\n}\n"),r.render=function(n,t,r,c,l,i){return e.openBlock(),e.createElementBlock("div",o,[e.createElementVNode("p",null,[e.createTextVNode("The counter was "+e.toDisplayString(n.changedBy)+" to ",1),e.createElementVNode("b",null,e.toDisplayString(n.counter),1),a]),e.createElementVNode("button",{onClick:t[0]||(t[0]=function(){return n.increment&&n.increment.apply(n,arguments)})}," Click +1 "),e.createElementVNode("button",{onClick:t[1]||(t[1]=function(){return n.decrement&&n.decrement.apply(n,arguments)})}," Click -1 "),e.createElementVNode("button",{onClick:t[2]||(t[2]=function(e){return n.increment(5)})}," Click +5 "),e.createElementVNode("button",{onClick:t[3]||(t[3]=function(e){return n.decrement(5)})}," Click -5 "),e.createElementVNode("button",{onClick:t[4]||(t[4]=function(){return n.reset&&n.reset.apply(n,arguments)})}," Reset ")])},r.__scopeId="data-v-e1d15920";var l={props:{label:{type:String,default:""}}},i={key:0},u={class:"btn-cta"},d=e.createTextVNode(" | button 7 ");c("\n.btn-cta {\r\n background-color: #d0d0d5;\r\n border-width: 3px;\r\n border-color: #1b1b32;\r\n border-radius: 0;\r\n border-style: solid;\r\n color: #1b1b32;\r\n display: block;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n -ms-touch-action: manipulation;\r\n touch-action: manipulation;\r\n cursor: pointer;\r\n white-space: nowrap;\r\n padding: 6px 12px;\r\n font-size: 18px;\r\n line-height: 1.42857143;\n}\n.btn-cta:active:hover,\r\n.btn-cta:focus,\r\n.btn-cta:hover {\r\n background-color: #1b1b32;\r\n border-width: 3px;\r\n border-color: #000;\r\n background-image: none;\r\n color: #f5f6f7;\n}\r\n"),l.render=function(n,t,r,o,a,c){return e.openBlock(),e.createElementBlock("div",null,[r.label?(e.openBlock(),e.createElementBlock("label",i,e.toDisplayString(r.label),1)):e.createCommentVNode("",!0),e.createElementVNode("button",u,[d,e.renderSlot(n.$slots,"default")])])};var s={props:{label:{type:String,default:""}}},p={key:0},b=e.createElementVNode("input",null,null,-1);c("\n.btn-cta {\r\n background-color: #d0d0d5;\r\n border-width: 3px;\r\n border-color: #1b1b32;\r\n border-radius: 0;\r\n border-style: solid;\r\n color: #1b1b32;\r\n display: block;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n -ms-touch-action: manipulation;\r\n touch-action: manipulation;\r\n cursor: pointer;\r\n white-space: nowrap;\r\n padding: 6px 12px;\r\n font-size: 18px;\r\n line-height: 1.42857143;\n}\n.btn-cta:active:hover,\r\n.btn-cta:focus,\r\n.btn-cta:hover {\r\n background-color: #1b1b32;\r\n border-width: 3px;\r\n border-color: #000;\r\n background-image: none;\r\n color: #f5f6f7;\n}\r\n"),s.render=function(n,t,r,o,a,c){return e.openBlock(),e.createElementBlock("div",null,[r.label?(e.openBlock(),e.createElementBlock("label",p,e.toDisplayString(r.label),1)):e.createCommentVNode("",!0),b])};var m={props:{label:{type:String,default:""}}},f={key:0},h=e.createElementVNode("textarea",null,null,-1);c("\n.btn-cta {\r\n background-color: #d0d0d5;\r\n border-width: 3px;\r\n border-color: #1b1b32;\r\n border-radius: 0;\r\n border-style: solid;\r\n color: #1b1b32;\r\n display: block;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n -ms-touch-action: manipulation;\r\n touch-action: manipulation;\r\n cursor: pointer;\r\n white-space: nowrap;\r\n padding: 6px 12px;\r\n font-size: 18px;\r\n line-height: 1.42857143;\n}\n.btn-cta:active:hover,\r\n.btn-cta:focus,\r\n.btn-cta:hover {\r\n background-color: #1b1b32;\r\n border-width: 3px;\r\n border-color: #000;\r\n background-image: none;\r\n color: #f5f6f7;\n}\r\n"),m.render=function(n,t,r,o,a,c){return e.openBlock(),e.createElementBlock("div",null,[r.label?(e.openBlock(),e.createElementBlock("label",f,e.toDisplayString(r.label),1)):e.createCommentVNode("",!0),h])};var g=Object.freeze({__proto__:null,QuanticVueSample:r,QvButton:l,QvInputText:s,QvTextarea:m});console.log("ESTOY EN PACKAGE");var y=function(e,t){console.log("arranco paquete"),console.log("options",t),Object.entries(g).forEach((function(t){var r=n(t,2),o=r[0],a=r[1];e.component(o,a)}))},v=Object.freeze({__proto__:null,default:y,QuanticVueSample:r,QvButton:l,QvInputText:s,QvTextarea:m});return Object.entries(v).forEach((function(e){var t=n(e,2),r=t[0],o=t[1];"default"!==r&&(y[r]=o)})),y}(Vue);
@@ -0,0 +1,231 @@
1
+ 'use strict';var vue=require('vue');function _slicedToArray(arr, i) {
2
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
3
+ }
4
+
5
+ function _arrayWithHoles(arr) {
6
+ if (Array.isArray(arr)) return arr;
7
+ }
8
+
9
+ function _iterableToArrayLimit(arr, i) {
10
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
11
+
12
+ if (_i == null) return;
13
+ var _arr = [];
14
+ var _n = true;
15
+ var _d = false;
16
+
17
+ var _s, _e;
18
+
19
+ try {
20
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
21
+ _arr.push(_s.value);
22
+
23
+ if (i && _arr.length === i) break;
24
+ }
25
+ } catch (err) {
26
+ _d = true;
27
+ _e = err;
28
+ } finally {
29
+ try {
30
+ if (!_n && _i["return"] != null) _i["return"]();
31
+ } finally {
32
+ if (_d) throw _e;
33
+ }
34
+ }
35
+
36
+ return _arr;
37
+ }
38
+
39
+ function _unsupportedIterableToArray(o, minLen) {
40
+ if (!o) return;
41
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
42
+ var n = Object.prototype.toString.call(o).slice(8, -1);
43
+ if (n === "Object" && o.constructor) n = o.constructor.name;
44
+ if (n === "Map" || n === "Set") return Array.from(o);
45
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
46
+ }
47
+
48
+ function _arrayLikeToArray(arr, len) {
49
+ if (len == null || len > arr.length) len = arr.length;
50
+
51
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
52
+
53
+ return arr2;
54
+ }
55
+
56
+ function _nonIterableRest() {
57
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
58
+ }var script$3 = /*#__PURE__*/vue.defineComponent({
59
+ name: 'QuanticVueSample',
60
+ // vue component name
61
+ data: function data() {
62
+ return {
63
+ counter: 5,
64
+ initCounter: 5,
65
+ message: {
66
+ action: null,
67
+ amount: null
68
+ }
69
+ };
70
+ },
71
+ computed: {
72
+ changedBy: function changedBy() {
73
+ var _ref = this,
74
+ message = _ref.message;
75
+
76
+ if (!message.action) return 'initialized';
77
+ return "".concat(message.action, " ").concat(message.amount || '').trim();
78
+ }
79
+ },
80
+ methods: {
81
+ increment: function increment(arg) {
82
+ var amount = typeof arg !== 'number' ? 1 : arg;
83
+ this.counter += amount;
84
+ this.message.action = 'incremented by';
85
+ this.message.amount = amount;
86
+ },
87
+ decrement: function decrement(arg) {
88
+ var amount = typeof arg !== 'number' ? 1 : arg;
89
+ this.counter -= amount;
90
+ this.message.action = 'decremented by';
91
+ this.message.amount = amount;
92
+ },
93
+ reset: function reset() {
94
+ this.counter = this.initCounter;
95
+ this.message.action = 'reset';
96
+ this.message.amount = null;
97
+ }
98
+ }
99
+ });var _hoisted_1$3 = {
100
+ class: "quantic-vue-sample"
101
+ };
102
+
103
+ var _hoisted_2$3 = /*#__PURE__*/vue.createTextVNode(".");
104
+
105
+ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
106
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [vue.createElementVNode("p", null, [vue.createTextVNode("The counter was " + vue.toDisplayString(_ctx.changedBy) + " to ", 1), vue.createElementVNode("b", null, vue.toDisplayString(_ctx.counter), 1), _hoisted_2$3]), vue.createElementVNode("button", {
107
+ onClick: _cache[0] || (_cache[0] = function () {
108
+ return _ctx.increment && _ctx.increment.apply(_ctx, arguments);
109
+ })
110
+ }, " Click +1 "), vue.createElementVNode("button", {
111
+ onClick: _cache[1] || (_cache[1] = function () {
112
+ return _ctx.decrement && _ctx.decrement.apply(_ctx, arguments);
113
+ })
114
+ }, " Click -1 "), vue.createElementVNode("button", {
115
+ onClick: _cache[2] || (_cache[2] = function ($event) {
116
+ return _ctx.increment(5);
117
+ })
118
+ }, " Click +5 "), vue.createElementVNode("button", {
119
+ onClick: _cache[3] || (_cache[3] = function ($event) {
120
+ return _ctx.decrement(5);
121
+ })
122
+ }, " Click -5 "), vue.createElementVNode("button", {
123
+ onClick: _cache[4] || (_cache[4] = function () {
124
+ return _ctx.reset && _ctx.reset.apply(_ctx, arguments);
125
+ })
126
+ }, " Reset ")]);
127
+ }function styleInject(css, ref) {
128
+ if ( ref === void 0 ) ref = {};
129
+ var insertAt = ref.insertAt;
130
+
131
+ if (!css || typeof document === 'undefined') { return; }
132
+
133
+ var head = document.head || document.getElementsByTagName('head')[0];
134
+ var style = document.createElement('style');
135
+ style.type = 'text/css';
136
+
137
+ if (insertAt === 'top') {
138
+ if (head.firstChild) {
139
+ head.insertBefore(style, head.firstChild);
140
+ } else {
141
+ head.appendChild(style);
142
+ }
143
+ } else {
144
+ head.appendChild(style);
145
+ }
146
+
147
+ if (style.styleSheet) {
148
+ style.styleSheet.cssText = css;
149
+ } else {
150
+ style.appendChild(document.createTextNode(css));
151
+ }
152
+ }var css_248z$3 = "\n.quantic-vue-sample[data-v-e1d15920] {\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.quantic-vue-sample p[data-v-e1d15920] {\n margin: 0 0 1em;\n}\n";
153
+ styleInject(css_248z$3);script$3.render = render$3;
154
+ script$3.__scopeId = "data-v-e1d15920";var script$2 = {
155
+ props: {
156
+ label: {
157
+ type: String,
158
+ default: ''
159
+ }
160
+ }
161
+ };var _hoisted_1$2 = {
162
+ key: 0
163
+ };
164
+ var _hoisted_2$2 = {
165
+ class: "btn-cta"
166
+ };
167
+
168
+ var _hoisted_3 = /*#__PURE__*/vue.createTextVNode(" | button 7 ");
169
+
170
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
171
+ return vue.openBlock(), vue.createElementBlock("div", null, [$props.label ? (vue.openBlock(), vue.createElementBlock("label", _hoisted_1$2, vue.toDisplayString($props.label), 1)) : vue.createCommentVNode("", true), vue.createElementVNode("button", _hoisted_2$2, [_hoisted_3, vue.renderSlot(_ctx.$slots, "default")])]);
172
+ }var css_248z$2 = "\n.btn-cta {\r\n background-color: #d0d0d5;\r\n border-width: 3px;\r\n border-color: #1b1b32;\r\n border-radius: 0;\r\n border-style: solid;\r\n color: #1b1b32;\r\n display: block;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n -ms-touch-action: manipulation;\r\n touch-action: manipulation;\r\n cursor: pointer;\r\n white-space: nowrap;\r\n padding: 6px 12px;\r\n font-size: 18px;\r\n line-height: 1.42857143;\n}\n.btn-cta:active:hover,\r\n.btn-cta:focus,\r\n.btn-cta:hover {\r\n background-color: #1b1b32;\r\n border-width: 3px;\r\n border-color: #000;\r\n background-image: none;\r\n color: #f5f6f7;\n}\r\n";
173
+ styleInject(css_248z$2);script$2.render = render$2;var script$1 = {
174
+ props: {
175
+ label: {
176
+ type: String,
177
+ default: ''
178
+ }
179
+ }
180
+ };var _hoisted_1$1 = {
181
+ key: 0
182
+ };
183
+
184
+ var _hoisted_2$1 = /*#__PURE__*/vue.createElementVNode("input", null, null, -1);
185
+
186
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
187
+ return vue.openBlock(), vue.createElementBlock("div", null, [$props.label ? (vue.openBlock(), vue.createElementBlock("label", _hoisted_1$1, vue.toDisplayString($props.label), 1)) : vue.createCommentVNode("", true), _hoisted_2$1]);
188
+ }var css_248z$1 = "\n.btn-cta {\r\n background-color: #d0d0d5;\r\n border-width: 3px;\r\n border-color: #1b1b32;\r\n border-radius: 0;\r\n border-style: solid;\r\n color: #1b1b32;\r\n display: block;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n -ms-touch-action: manipulation;\r\n touch-action: manipulation;\r\n cursor: pointer;\r\n white-space: nowrap;\r\n padding: 6px 12px;\r\n font-size: 18px;\r\n line-height: 1.42857143;\n}\n.btn-cta:active:hover,\r\n.btn-cta:focus,\r\n.btn-cta:hover {\r\n background-color: #1b1b32;\r\n border-width: 3px;\r\n border-color: #000;\r\n background-image: none;\r\n color: #f5f6f7;\n}\r\n";
189
+ styleInject(css_248z$1);script$1.render = render$1;var script = {
190
+ props: {
191
+ label: {
192
+ type: String,
193
+ default: ''
194
+ }
195
+ }
196
+ };var _hoisted_1 = {
197
+ key: 0
198
+ };
199
+
200
+ var _hoisted_2 = /*#__PURE__*/vue.createElementVNode("textarea", null, null, -1);
201
+
202
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
203
+ return vue.openBlock(), vue.createElementBlock("div", null, [$props.label ? (vue.openBlock(), vue.createElementBlock("label", _hoisted_1, vue.toDisplayString($props.label), 1)) : vue.createCommentVNode("", true), _hoisted_2]);
204
+ }var css_248z = "\n.btn-cta {\r\n background-color: #d0d0d5;\r\n border-width: 3px;\r\n border-color: #1b1b32;\r\n border-radius: 0;\r\n border-style: solid;\r\n color: #1b1b32;\r\n display: block;\r\n margin-bottom: 0;\r\n font-weight: normal;\r\n text-align: center;\r\n -ms-touch-action: manipulation;\r\n touch-action: manipulation;\r\n cursor: pointer;\r\n white-space: nowrap;\r\n padding: 6px 12px;\r\n font-size: 18px;\r\n line-height: 1.42857143;\n}\n.btn-cta:active:hover,\r\n.btn-cta:focus,\r\n.btn-cta:hover {\r\n background-color: #1b1b32;\r\n border-width: 3px;\r\n border-color: #000;\r\n background-image: none;\r\n color: #f5f6f7;\n}\r\n";
205
+ styleInject(css_248z);script.render = render;/* eslint-disable import/prefer-default-export */var components$1=/*#__PURE__*/Object.freeze({__proto__:null,QuanticVueSample:script$3,QvButton:script$2,QvInputText:script$1,QvTextarea:script});console.log('ESTOY EN PACKAGE'); // install function executed by Vue.use()
206
+
207
+ var install = function installQuanticVue(app, options) {
208
+ console.log('arranco paquete');
209
+ console.log('options', options);
210
+ Object.entries(components$1).forEach(function (_ref) {
211
+ var _ref2 = _slicedToArray(_ref, 2),
212
+ componentName = _ref2[0],
213
+ component = _ref2[1];
214
+
215
+ app.component(componentName, component);
216
+ });
217
+ }; // Create module definition for Vue.use()
218
+ var components=/*#__PURE__*/Object.freeze({__proto__:null,'default':install,QuanticVueSample:script$3,QvButton:script$2,QvInputText:script$1,QvTextarea:script});// only expose one global var, with component exports exposed as properties of
219
+ // that global var (eg. plugin.component)
220
+
221
+ Object.entries(components).forEach(function (_ref) {
222
+ var _ref2 = _slicedToArray(_ref, 2),
223
+ componentName = _ref2[0],
224
+ component = _ref2[1];
225
+
226
+ if (componentName !== 'default') {
227
+ var key = componentName;
228
+ var val = component;
229
+ install[key] = val;
230
+ }
231
+ });module.exports=install;
@@ -0,0 +1,4 @@
1
+ import { Plugin } from 'vue';
2
+ declare const install: Exclude<Plugin['install'], undefined>;
3
+ export default install;
4
+ export * from "./lib-components/index";
@@ -0,0 +1,4 @@
1
+ export { default as QuanticVueSample } from './quantic-vue-sample.vue';
2
+ export { default as QvButton } from './qv-button.vue';
3
+ export { default as QvInputText } from './qv-input-text.vue';
4
+ export { default as QvTextarea } from './qv-textarea.vue';
@@ -0,0 +1,16 @@
1
+ interface SampleData {
2
+ counter: number;
3
+ initCounter: number;
4
+ message: {
5
+ action: string | null;
6
+ amount: number | null;
7
+ };
8
+ }
9
+ declare const _default: import("vue").DefineComponent<{}, {}, SampleData, {
10
+ changedBy(): string;
11
+ }, {
12
+ increment(arg: Event | number): void;
13
+ decrement(arg: Event | number): void;
14
+ reset(): void;
15
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}>, {}>;
16
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "cleek",
3
+ "version": "1.1.0",
4
+ "description": "",
5
+ "main": "dist/cleek.ssr.js",
6
+ "browser": "dist/cleek.esm.js",
7
+ "module": "dist/cleek.esm.js",
8
+ "unpkg": "dist/cleek.min.js",
9
+ "types": "dist/types/src/entry.esm.d.ts",
10
+ "files": [
11
+ "dist/*",
12
+ "src/**/*.vue"
13
+ ],
14
+ "sideEffects": false,
15
+ "scripts": {
16
+ "serve": "vue-cli-service serve dev/serve.ts",
17
+ "prebuild": "rimraf ./dist",
18
+ "build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js",
19
+ "build:ssr": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format cjs",
20
+ "build:es": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es",
21
+ "build:unpkg": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format iife",
22
+ "postbuild": "rimraf ./dist/types/dev ./dist/types/src/entry.d.ts"
23
+ },
24
+ "dependencies": {
25
+ "@fortawesome/fontawesome-svg-core": "^1.2.36",
26
+ "@fortawesome/free-brands-svg-icons": "^5.15.4",
27
+ "@fortawesome/free-regular-svg-icons": "^5.15.4",
28
+ "@fortawesome/free-solid-svg-icons": "^5.15.4",
29
+ "@fortawesome/vue-fontawesome": "^3.0.0-4",
30
+ "vue-select": "^4.0.0-beta.1"
31
+ },
32
+ "devDependencies": {
33
+ "@babel/core": "^7.14.6",
34
+ "@babel/preset-env": "^7.14.7",
35
+ "@babel/preset-typescript": "^7.14.5",
36
+ "@rollup/plugin-alias": "^3.1.2",
37
+ "@rollup/plugin-babel": "^5.3.0",
38
+ "@rollup/plugin-commonjs": "^14.0.0",
39
+ "@rollup/plugin-node-resolve": "^9.0.0",
40
+ "@rollup/plugin-replace": "^2.4.2",
41
+ "@vue/cli-plugin-babel": "^4.5.13",
42
+ "@vue/cli-plugin-typescript": "^4.5.13",
43
+ "@vue/cli-service": "^4.5.13",
44
+ "@vue/compiler-sfc": "^3.0.11",
45
+ "@zerollup/ts-transform-paths": "^1.7.18",
46
+ "cross-env": "^7.0.3",
47
+ "minimist": "^1.2.5",
48
+ "postcss": "^8.2.10",
49
+ "pug": "^3.0.2",
50
+ "pug-plain-loader": "^1.1.0",
51
+ "rimraf": "^3.0.2",
52
+ "rollup": "^2.52.8",
53
+ "rollup-plugin-postcss": "^4.0.0",
54
+ "rollup-plugin-terser": "^7.0.2",
55
+ "rollup-plugin-typescript2": "^0.30.0",
56
+ "rollup-plugin-vue": "^6.0.0",
57
+ "stylus": "^0.56.0",
58
+ "stylus-loader": "^3.0.2",
59
+ "ttypescript": "^1.5.12",
60
+ "typescript": "^4.0.3",
61
+ "vue": "^3.0.5"
62
+ },
63
+ "peerDependencies": {
64
+ "vue": "^3.0.5"
65
+ },
66
+ "engines": {
67
+ "node": ">=12"
68
+ }
69
+ }
@@ -0,0 +1,103 @@
1
+ <template lang="pug">
2
+ .ck-button
3
+ ck-label(v-if="label" label-align="labelAlign") {{ label }}
4
+ button(
5
+ :class="computedClass"
6
+ )
7
+ //- icon left
8
+ ck-icon.ck-button--icon-left(
9
+ v-if="icon"
10
+ :icon="icon"
11
+ :icon-package="iconPackage"
12
+ )
13
+ //- slot
14
+ slot
15
+ //- icon right
16
+ ck-icon.ck-button--icon-right(
17
+ v-if="iconRight"
18
+ :icon="iconRight"
19
+ :icon-package="iconPackage"
20
+ )
21
+ </template>
22
+
23
+ <script>
24
+ import functions from './functions.ts';
25
+
26
+ export default {
27
+ props: {
28
+ type: { type: String, default: '' }, // outlined || filled
29
+ color: { type: String, default: '' },
30
+ // icon
31
+ icon: { type: [String, Array], default: '' },
32
+ 'icon-package': { type: String, default: '' },
33
+ 'icon-right': { type: String, default: '' },
34
+ // label
35
+ label: { type: String, default: '' },
36
+ 'label-align': { type: String, default: '' },
37
+ // group
38
+ group: { type: String, default: '' },
39
+ groupBreak: { type: String, default: 's' },
40
+ groupVertical: { type: String, default: '' },
41
+ },
42
+ computed: {
43
+ computedClass() {
44
+ const classList = [];
45
+ // group
46
+ classList.push(functions.getGroupClass(this));
47
+ // color
48
+ if (this.color) {
49
+ if (this.type === 'filled') {
50
+ classList.push(`ck-component__bg-color--${this.color}`);
51
+ } else {
52
+ classList.push(`ck-component__border-color--${this.color}`);
53
+ }
54
+ }
55
+ // // size
56
+ // if (this.size) classList.push(`rs-component-size__${this.size}`);
57
+ return classList;
58
+ },
59
+ }, // computed
60
+ }; // export default
61
+ </script>
62
+
63
+ <style lang="stylus" scoped>
64
+ json('./styles/StylusVars.json')
65
+ .ck-button
66
+ display inline-flex
67
+ > button
68
+ width 100%
69
+ font-family inherit
70
+ cursor pointer
71
+ padding globalPadding (2*globalPadding)
72
+ font-size globalFontSize
73
+ border-radius globalBorderRadius
74
+ background-color white
75
+ border 1px solid primary
76
+ color primary
77
+ display inline-block
78
+ min-height globalMinHeight
79
+ > .ck-button--icon-left
80
+ padding-right .5rem
81
+ > .ck-button--icon-right
82
+ padding-left .5rem
83
+ // margin-bottom: 0;
84
+ // font-weight: normal;
85
+ // text-align: center;
86
+ // -ms-touch-action: manipulation;
87
+ // touch-action: manipulation;
88
+ // white-space: nowrap;
89
+ // padding: 6px 12px;
90
+ // font-size: 18px;
91
+ // line-height: 1.42857143;
92
+
93
+ // .btn-cta:active:hover,
94
+ // .btn-cta:focus,
95
+ // .btn-cta:hover {
96
+ // background-color: #1b1b32;
97
+ // border-width: 3px;
98
+ // border-color: #000;
99
+ // background-image: none;
100
+ // color: #f5f6f7;
101
+ // }
102
+ @require './styles/globalStyle'
103
+ </style>
@@ -0,0 +1,62 @@
1
+ <template lang="pug">
2
+ .ck-icon
3
+ //- font-awesome-icon-global(icon="user")
4
+ font-awesome-icon(
5
+ v-if="computedIconPackage === 'font-awesome'"
6
+ :icon="icon"
7
+ :size="size"
8
+ :rotation="rotation"
9
+ :flip="flip"
10
+ :pull="pull"
11
+ :spin="spin"
12
+ :pulse="pulse"
13
+ :inverse="inverse"
14
+ :fixed-width="fixedWidth"
15
+ :swap-opacity="swapOpacity"
16
+ )
17
+ </template>
18
+
19
+ <script>
20
+ import { library } from '@fortawesome/fontawesome-svg-core';
21
+ import { fas } from '@fortawesome/free-solid-svg-icons';
22
+ import { far } from '@fortawesome/free-regular-svg-icons';
23
+ import { fab } from '@fortawesome/free-brands-svg-icons';
24
+ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
25
+
26
+ export default {
27
+ components: {
28
+ FontAwesomeIcon,
29
+ },
30
+ created() {
31
+ library.add(fas);
32
+ library.add(far);
33
+ library.add(fab);
34
+ },
35
+ props: {
36
+ icon: { type: [String, Array], default: '' },
37
+ 'icon-package': { type: String, default: '' },
38
+ size: { type: String, default: null }, // xs || lg || 6x
39
+ rotation: { type: String, default: null }, // 90 || 180 || 270
40
+ flip: { type: String, default: null }, // horizontal || vertical || both
41
+ pull: { type: String, default: null }, // left || right
42
+ spin: { type: Boolean, default: false }, // true actives animation
43
+ pulse: { type: Boolean, default: false }, // true actives animation
44
+ inverse: { type: Boolean, default: false },
45
+ 'fixed-width': { type: Boolean, default: false },
46
+ 'swap-opacity': { type: Boolean, default: false },
47
+ },
48
+ computed: {
49
+ computedIconPackage() {
50
+ const defaultPackage = 'font-awesome';
51
+ if (this.iconPackage === '') return defaultPackage;
52
+ if (this.iconPackage === 'feather') return this.iconPackage;
53
+ return defaultPackage;
54
+ },
55
+ }, // computed
56
+ }; // export default
57
+ </script>
58
+
59
+ <style lang="stylus" scoped>
60
+ .ck-icon
61
+ display inline-flex
62
+ </style>
@@ -0,0 +1,59 @@
1
+ <template lang="pug">
2
+ .ck-input-text
3
+ //- label
4
+ ck-label(v-if="label" :align="labelAlign") {{ label }}
5
+ //- input
6
+ input(
7
+ v-model="value"
8
+ type="text"
9
+ :placeholder="placeholder"
10
+ :class="computedClass"
11
+ )
12
+ </template>
13
+
14
+ <script>
15
+ import functions from './functions.ts';
16
+
17
+ export default {
18
+ props: {
19
+ modelValue: { type: String, required: true },
20
+ label: { type: String, default: '' },
21
+ placeholder: { type: String, default: '' },
22
+ 'label-align': { type: String, default: '' },
23
+ // group
24
+ group: { type: String, default: '' },
25
+ groupBreak: { type: String, default: 's' },
26
+ groupVertical: { type: String, default: '' },
27
+ },
28
+ computed: {
29
+ value: {
30
+ get() { return this.modelValue; },
31
+ set(val) { this.$emit('update:modelValue', val); },
32
+ },
33
+ computedClass() {
34
+ const classList = [];
35
+ // group
36
+ classList.push(functions.getGroupClass(this));
37
+ return classList;
38
+ },
39
+ }, // computed
40
+ }; // export default
41
+ </script>
42
+
43
+ <style lang="stylus" scoped>
44
+ json('./styles/StylusVars.json')
45
+
46
+ .ck-input-text
47
+ display inline-block
48
+ > input
49
+ padding globalPadding
50
+ font-size globalFontSize
51
+ border-radius globalBorderRadius
52
+ border 1px solid globalBorderColor
53
+ min-height 40px
54
+ box-sizing border-box
55
+ &:focus-visible
56
+ outline-color primary
57
+
58
+ @require './styles/globalStyle'
59
+ </style>
@@ -0,0 +1,41 @@
1
+ <template lang="pug">
2
+ label.ck-label(
3
+ :class="computedClass"
4
+ )
5
+ slot
6
+ </template>
7
+
8
+ <script>
9
+ export default {
10
+ props: {
11
+ align: { type: String, default: '' },
12
+ },
13
+ computed: {
14
+ computedClass() {
15
+ const list = [];
16
+ // align
17
+ let align = 'left';
18
+ if (this.align === 'center' || this.align === 'right') align = this.align;
19
+ list.push(`ck-align--${align}`);
20
+ return list;
21
+ },
22
+ }, // computed
23
+ }; // export default
24
+ </script>
25
+
26
+ <style lang="stylus" scoped>
27
+ @require './styles/templateStyle'
28
+
29
+ .ck-label
30
+ width 100%
31
+ padding-x .5rem
32
+ display flex
33
+ margin-bottom .1rem
34
+ font-size .85rem
35
+ &.ck-align--left
36
+ justify-content flex-start
37
+ &.ck-align--right
38
+ justify-content flex-end
39
+ &.ck-align--center
40
+ justify-content center
41
+ </style>
@@ -0,0 +1,131 @@
1
+ <template lang="pug">
2
+ .ck-select(
3
+ :style="computedStyle"
4
+ )
5
+ ck-label(v-if="label" :label-align="labelAlign") {{ label }}
6
+ v-select.ck-select__v-select(
7
+ ref="vSelect"
8
+ v-model="value"
9
+ :label="prop"
10
+ :options="options"
11
+ :disabled="!!disabled"
12
+ :reduce="realReduceFunction"
13
+ :clearable="!notClearable && !valueIsDefault"
14
+ :searchable="realSearchable"
15
+ )
16
+ span(slot="no-options") {{ noDataText }}
17
+ </template>
18
+
19
+ <script>
20
+ import vSelect from 'vue-select';
21
+ import functions from './functions.ts';
22
+
23
+ export default {
24
+ components: {
25
+ vSelect,
26
+ },
27
+ props: {
28
+ modelValue: { required: true },
29
+ prop: { type: String, default: 'name' }, // prop of the object showed in HTML
30
+ autofocus: { type: Boolean, default: false }, // CHECK
31
+ noDataText: { type: String, default: 'No se encontró nada' },
32
+ notReduce: { type: Boolean, default: false },
33
+ options: { type: Array, default: () => [] },
34
+ reduceFunction: { type: Function, default: Option => Option.id },
35
+ notClearable: { type: Boolean, default: false },
36
+ clearValue: { default: 'auto' },
37
+ searchable: { type: [Boolean, String], default: 'auto' },
38
+ 'min-width': { type: String, default: '180px' }, // min-width in px
39
+ noBorder: { type: Boolean, default: false },
40
+ bgTransparent: { type: Boolean, default: false },
41
+ disabled: { type: [Boolean, Number], default: false },
42
+ // group
43
+ group: { type: String, default: '' },
44
+ groupBreak: { type: String, default: '' },
45
+ groupVertical: { type: String, default: '' },
46
+ // label
47
+ label: { type: String, default: '' },
48
+ 'label-align': { type: String, default: '' },
49
+ },
50
+ computed: {
51
+ value: {
52
+ get() { return this.modelValue; },
53
+ set(val) {
54
+ if (val === null) val = this.realClearValue;
55
+ this.$emit('update:modelValue', val);
56
+ },
57
+ },
58
+ computedClass() {
59
+ const classList = [];
60
+ // group
61
+ classList.push(functions.getGroupClass(this));
62
+ return classList;
63
+ },
64
+ computedStyle() {
65
+ const list = [];
66
+ if (this.minWidth) list.push({ 'min-width': this.minWidth });
67
+ return list;
68
+ },
69
+ realSearchable() {
70
+ if (this.searchable === 'auto') {
71
+ if (this.options.length < 5) return false;
72
+ return true;
73
+ }
74
+ return this.searchable;
75
+ },
76
+ realClearValue() {
77
+ switch (typeof this.modelValue) {
78
+ case 'number': return 0;
79
+ case 'string': return '';
80
+ case 'object': // array is also object
81
+ if (this.modelValue.constructor === Array) return [];
82
+ return {};
83
+ default: return null;
84
+ }
85
+ },
86
+ valueIsDefault() {
87
+ switch (typeof this.modelValue) {
88
+ case 'number': return this.modelValue === 0;
89
+ case 'string': return this.modelValue === '';
90
+ case 'object': // array is also object
91
+ if (this.modelValue.constructor === Array) {
92
+ return this.modelValue.length() === 0;
93
+ }
94
+ return Object.keys(this.modelValue).length === 0;
95
+ default: return this.modelValue === null;
96
+ }
97
+ },
98
+ }, // computed
99
+ methods: {
100
+ // reduceFunction
101
+ // setFocus [ CALLED BY OUTSIDE ]
102
+
103
+ realReduceFunction(Option) {
104
+ if (this.notReduce) return Option;
105
+ return this.reduceFunction(Option);
106
+ },
107
+ setFocus() {
108
+ const el = this.$refs.vSelect.$el.children[0].children[0].children[1];
109
+ setTimeout(() => {
110
+ el.focus();
111
+ }, 100);
112
+ },
113
+ }, // methods
114
+ }; // export default
115
+ </script>
116
+
117
+ <style lang="stylus" scoped>
118
+ @require '../../node_modules/vue-select/dist/vue-select.css';
119
+ json('./styles/StylusVars.json')
120
+
121
+ .ck-select
122
+ display inline-flex
123
+ flex-wrap wrap
124
+ > .ck-select__v-select
125
+ width 100%
126
+ /deep/ .vs__dropdown-toggle
127
+ border-radius globalBorderRadius
128
+ border 1px solid globalBorderColor
129
+ height 40px
130
+ background-color white
131
+ </style>
@@ -0,0 +1,40 @@
1
+ <template lang="pug">
2
+ .ck-textarea
3
+ ck-label(v-if="label" :label-align="labelAlign") {{ label }}
4
+ textarea(v-model="value")
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ props: {
10
+ modelValue: { type: String, required: true },
11
+ // label
12
+ label: { type: String, default: '' },
13
+ 'label-align': { type: String, default: '' },
14
+ },
15
+ computed: {
16
+ value: {
17
+ get() { return this.modelValue; },
18
+ set(val) { this.$emit('update:modelValue', val); },
19
+ },
20
+ }, // computed
21
+ }; // export default
22
+ </script>
23
+
24
+ <style lang="stylus" scoped>
25
+ json('./styles/StylusVars.json')
26
+
27
+ .ck-textarea
28
+ > textarea
29
+ min-width 100%
30
+ max-width 100%
31
+ min-height 6rem
32
+ box-sizing border-box
33
+ font-family inherit
34
+ padding globalPadding
35
+ font-size globalFontSize * (85/100)
36
+ border-radius globalBorderRadius
37
+ border 1px solid globalBorderColor
38
+ &:focus-visible
39
+ outline-color primary
40
+ </style>
@@ -0,0 +1,88 @@
1
+ <script lang="ts">
2
+ import { defineComponent } from 'vue';
3
+
4
+ interface SampleData {
5
+ counter: number;
6
+ initCounter: number;
7
+ message: {
8
+ action: string | null;
9
+ amount: number | null;
10
+ };
11
+ }
12
+
13
+ export default /*#__PURE__*/defineComponent({
14
+ name: 'CleekSample', // vue component name
15
+ data(): SampleData {
16
+ return {
17
+ counter: 5,
18
+ initCounter: 5,
19
+ message: {
20
+ action: null,
21
+ amount: null,
22
+ },
23
+ };
24
+ },
25
+ computed: {
26
+ changedBy() {
27
+ const { message } = this as SampleData;
28
+ if (!message.action) return 'initialized';
29
+ return `${message.action} ${message.amount || ''}`.trim();
30
+ },
31
+ },
32
+ methods: {
33
+ increment(arg: Event | number): void {
34
+ const amount = (typeof arg !== 'number') ? 1 : arg;
35
+ this.counter += amount;
36
+ this.message.action = 'incremented by';
37
+ this.message.amount = amount;
38
+ },
39
+ decrement(arg: Event | number): void {
40
+ const amount = (typeof arg !== 'number') ? 1 : arg;
41
+ this.counter -= amount;
42
+ this.message.action = 'decremented by';
43
+ this.message.amount = amount;
44
+ },
45
+ reset(): void {
46
+ this.counter = this.initCounter;
47
+ this.message.action = 'reset';
48
+ this.message.amount = null;
49
+ },
50
+ },
51
+ });
52
+ </script>
53
+
54
+ <template>
55
+ <div class="cleek-sample">
56
+ <p>The counter was {{ changedBy }} to <b>{{ counter }}</b>.</p>
57
+ <button @click="increment">
58
+ Click +1
59
+ </button>
60
+ <button @click="decrement">
61
+ Click -1
62
+ </button>
63
+ <button @click="increment(5)">
64
+ Click +5
65
+ </button>
66
+ <button @click="decrement(5)">
67
+ Click -5
68
+ </button>
69
+ <button @click="reset">
70
+ Reset
71
+ </button>
72
+ </div>
73
+ </template>
74
+
75
+ <style scoped>
76
+ .cleek-sample {
77
+ display: block;
78
+ width: 400px;
79
+ margin: 25px auto;
80
+ border: 1px solid #ccc;
81
+ background: #eaeaea;
82
+ text-align: center;
83
+ padding: 25px;
84
+ }
85
+ .cleek-sample p {
86
+ margin: 0 0 1em;
87
+ }
88
+ </style>