cleek 1.1.2 → 1.1.6

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/dist/cleek.ssr.js DELETED
@@ -1,304 +0,0 @@
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$1 = /*#__PURE__*/vue.defineComponent({
59
- name: 'CleekSample',
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$1 = {
100
- class: "cleek-sample"
101
- };
102
-
103
- var _hoisted_2 = /*#__PURE__*/vue.createTextVNode(".");
104
-
105
- function render$1(_ctx, _cache, $props, $setup, $data, $options) {
106
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [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]), 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 = "\n.cleek-sample[data-v-0917b8aa] {\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.cleek-sample p[data-v-0917b8aa] {\n margin: 0 0 1em;\n}\n";
153
- styleInject(css_248z);script$1.render = render$1;
154
- script$1.__scopeId = "data-v-0917b8aa";var functions = {
155
- getGroupClass: function getGroupClass() {
156
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
157
- _ref$group = _ref.group,
158
- group = _ref$group === void 0 ? '' : _ref$group,
159
- _ref$groupVertical = _ref.groupVertical,
160
- groupVertical = _ref$groupVertical === void 0 ? '' : _ref$groupVertical,
161
- _ref$groupBreak = _ref.groupBreak,
162
- groupBreak = _ref$groupBreak === void 0 ? '' : _ref$groupBreak;
163
-
164
- var _screenSize = '';
165
- if (groupBreak && groupBreak === _screenSize) return [];
166
- var classList = []; // group
167
-
168
- if (group) classList.push("ck-component__group--".concat(group)); // groupVertical
169
-
170
- if (groupVertical) classList.push("ck-component__group-vertical--".concat(groupVertical));
171
- return classList;
172
- }
173
- };require('./styles/ck-button.styl');
174
- var script = {
175
- props: {
176
- type: {
177
- type: String,
178
- default: ''
179
- },
180
- // outlined || filled
181
- color: {
182
- type: String,
183
- default: ''
184
- },
185
- // icon
186
- icon: {
187
- type: [String, Array],
188
- default: ''
189
- },
190
- 'icon-package': {
191
- type: String,
192
- default: ''
193
- },
194
- 'icon-right': {
195
- type: String,
196
- default: ''
197
- },
198
- // label
199
- label: {
200
- type: String,
201
- default: ''
202
- },
203
- 'label-align': {
204
- type: String,
205
- default: ''
206
- },
207
- // group
208
- group: {
209
- type: String,
210
- default: ''
211
- },
212
- groupBreak: {
213
- type: String,
214
- default: 's'
215
- },
216
- groupVertical: {
217
- type: String,
218
- default: ''
219
- }
220
- },
221
- computed: {
222
- computedClass: function computedClass() {
223
- var classList = []; // group
224
-
225
- classList.push(functions.getGroupClass(this)); // color
226
-
227
- if (this.color) {
228
- if (this.type === 'filled') {
229
- classList.push("ck-component__bg-color--".concat(this.color));
230
- } else {
231
- classList.push("ck-component__border-color--".concat(this.color));
232
- }
233
- } // // size
234
- // if (this.size) classList.push(`rs-component-size__${this.size}`);
235
-
236
-
237
- return classList;
238
- }
239
- } // computed
240
-
241
- }; // export default
242
- var _hoisted_1 = {
243
- class: "ck-button"
244
- };
245
- function render(_ctx, _cache, $props, $setup, $data, $options) {
246
- var _component_ck_label = vue.resolveComponent("ck-label");
247
-
248
- var _component_ck_icon = vue.resolveComponent("ck-icon");
249
-
250
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [$props.label ? (vue.openBlock(), vue.createBlock(_component_ck_label, {
251
- key: 0,
252
- "label-align": "labelAlign"
253
- }, {
254
- default: vue.withCtx(function () {
255
- return [vue.createTextVNode(vue.toDisplayString($props.label), 1)];
256
- }),
257
- _: 1
258
- })) : vue.createCommentVNode("", true), vue.createElementVNode("button", {
259
- class: vue.normalizeClass($options.computedClass),
260
- onClick: _cache[0] || (_cache[0] = function ($event) {
261
- return _ctx.$emit('click', $event);
262
- })
263
- }, [$props.icon ? (vue.openBlock(), vue.createBlock(_component_ck_icon, {
264
- key: 0,
265
- class: "ck-button--icon-left",
266
- icon: $props.icon,
267
- "icon-package": _ctx.iconPackage
268
- }, null, 8, ["icon", "icon-package"])) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default"), _ctx.iconRight ? (vue.openBlock(), vue.createBlock(_component_ck_icon, {
269
- key: 1,
270
- class: "ck-button--icon-right",
271
- icon: _ctx.iconRight,
272
- "icon-package": _ctx.iconPackage
273
- }, null, 8, ["icon", "icon-package"])) : vue.createCommentVNode("", true)], 2)]);
274
- }script.render = render;/* eslint-disable import/prefer-default-export */
275
- // export { default as CkInputText } from './ck-input-text.vue';
276
- // export { default as CkLabel } from './ck-label.vue';
277
- // export { default as CkTextarea } from './ck-textarea.vue';
278
- // export { default as CkSelect } from './ck-select.vue';
279
- var components$1=/*#__PURE__*/Object.freeze({__proto__:null,CleekSample:script$1,CkButton:script});var install = function installCleek(app, options) {
280
- console.log('arranco paquete');
281
- console.log('options', options); // vue components
282
-
283
- Object.entries(components$1).forEach(function (_ref) {
284
- var _ref2 = _slicedToArray(_ref, 2),
285
- componentName = _ref2[0],
286
- component = _ref2[1];
287
-
288
- app.component(componentName, component);
289
- });
290
- }; // Create module definition for Vue.use()
291
- var components=/*#__PURE__*/Object.freeze({__proto__:null,'default':install,CleekSample:script$1,CkButton:script});// only expose one global var, with component exports exposed as properties of
292
- // that global var (eg. plugin.component)
293
-
294
- Object.entries(components).forEach(function (_ref) {
295
- var _ref2 = _slicedToArray(_ref, 2),
296
- componentName = _ref2[0],
297
- component = _ref2[1];
298
-
299
- if (componentName !== 'default') {
300
- var key = componentName;
301
- var val = component;
302
- install[key] = val;
303
- }
304
- });module.exports=install;
@@ -1,4 +0,0 @@
1
- import { Plugin } from 'vue';
2
- declare const install: Exclude<Plugin['install'], undefined>;
3
- export default install;
4
- export * from "./lib-components/index";
@@ -1,16 +0,0 @@
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;
@@ -1,8 +0,0 @@
1
- declare const _default: {
2
- getGroupClass({ group, groupVertical, groupBreak }?: {
3
- group?: string | undefined;
4
- groupVertical?: string | undefined;
5
- groupBreak?: string | undefined;
6
- }): string[];
7
- };
8
- export default _default;
@@ -1,2 +0,0 @@
1
- export { default as CleekSample } from './cleek-sample.vue';
2
- export { default as CkButton } from './ck-button.vue';
@@ -1,63 +0,0 @@
1
- <template lang="pug">
2
- .ck-button
3
- ck-label(v-if="label" label-align="labelAlign") {{ label }}
4
- button(
5
- :class="computedClass"
6
- @click="$emit('click', $event)"
7
- )
8
- //- icon left
9
- ck-icon.ck-button--icon-left(
10
- v-if="icon"
11
- :icon="icon"
12
- :icon-package="iconPackage"
13
- )
14
- //- slot
15
- slot
16
- //- icon right
17
- ck-icon.ck-button--icon-right(
18
- v-if="iconRight"
19
- :icon="iconRight"
20
- :icon-package="iconPackage"
21
- )
22
- </template>
23
-
24
- <script>
25
- require('./styles/ck-button.styl');
26
- import functions from './functions.ts';
27
-
28
- export default {
29
- props: {
30
- type: { type: String, default: '' }, // outlined || filled
31
- color: { type: String, default: '' },
32
- // icon
33
- icon: { type: [String, Array], default: '' },
34
- 'icon-package': { type: String, default: '' },
35
- 'icon-right': { type: String, default: '' },
36
- // label
37
- label: { type: String, default: '' },
38
- 'label-align': { type: String, default: '' },
39
- // group
40
- group: { type: String, default: '' },
41
- groupBreak: { type: String, default: 's' },
42
- groupVertical: { type: String, default: '' },
43
- },
44
- computed: {
45
- computedClass() {
46
- const classList = [];
47
- // group
48
- classList.push(functions.getGroupClass(this));
49
- // color
50
- if (this.color) {
51
- if (this.type === 'filled') {
52
- classList.push(`ck-component__bg-color--${this.color}`);
53
- } else {
54
- classList.push(`ck-component__border-color--${this.color}`);
55
- }
56
- }
57
- // // size
58
- // if (this.size) classList.push(`rs-component-size__${this.size}`);
59
- return classList;
60
- },
61
- }, // computed
62
- }; // export default
63
- </script>
@@ -1,61 +0,0 @@
1
- <template lang="pug">
2
- .ck-icon
3
- font-awesome-icon(
4
- v-if="computedIconPackage === 'font-awesome'"
5
- :icon="icon"
6
- :size="size"
7
- :rotation="rotation"
8
- :flip="flip"
9
- :pull="pull"
10
- :spin="spin"
11
- :pulse="pulse"
12
- :inverse="inverse"
13
- :fixed-width="fixedWidth"
14
- :swap-opacity="swapOpacity"
15
- )
16
- </template>
17
-
18
- <script>
19
- import { library } from '@fortawesome/fontawesome-svg-core';
20
- import { fas } from '@fortawesome/free-solid-svg-icons';
21
- import { far } from '@fortawesome/free-regular-svg-icons';
22
- import { fab } from '@fortawesome/free-brands-svg-icons';
23
- import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
24
-
25
- export default {
26
- components: {
27
- FontAwesomeIcon,
28
- },
29
- created() {
30
- library.add(fas);
31
- library.add(far);
32
- library.add(fab);
33
- },
34
- props: {
35
- icon: { type: [String, Array], default: '' },
36
- 'icon-package': { type: String, default: '' },
37
- size: { type: String, default: null }, // xs || lg || 6x
38
- rotation: { type: String, default: null }, // 90 || 180 || 270
39
- flip: { type: String, default: null }, // horizontal || vertical || both
40
- pull: { type: String, default: null }, // left || right
41
- spin: { type: Boolean, default: false }, // true actives animation
42
- pulse: { type: Boolean, default: false }, // true actives animation
43
- inverse: { type: Boolean, default: false },
44
- 'fixed-width': { type: Boolean, default: false },
45
- 'swap-opacity': { type: Boolean, default: false },
46
- },
47
- computed: {
48
- computedIconPackage() {
49
- const defaultPackage = 'font-awesome';
50
- if (this.iconPackage === '') return defaultPackage;
51
- if (this.iconPackage === 'feather') return this.iconPackage;
52
- return defaultPackage;
53
- },
54
- }, // computed
55
- }; // export default
56
- </script>
57
-
58
- <style lang="stylus" scoped>
59
- .ck-icon
60
- display inline-flex
61
- </style>
@@ -1,59 +0,0 @@
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>
@@ -1,41 +0,0 @@
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>
@@ -1,131 +0,0 @@
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>