cleek 1.8.4 → 1.8.9
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-styles/tiny-tailwind/.custom.styl +4 -0
- package/dist/cleek.es.js +113 -157
- package/dist/cleek.umd.js +6 -6
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/cleek.es.js
CHANGED
|
@@ -17,13 +17,13 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, computed, watch, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, renderSlot, mergeProps, withKeys, withModifiers, createElementVNode, pushScopeId, popScopeId, normalizeStyle, withCtx, createTextVNode, toDisplayString, withDirectives, isRef, unref, vModelDynamic, createVNode, Fragment, renderList, vModelRadio, ref,
|
|
20
|
+
import { defineComponent, computed, watch, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, renderSlot, mergeProps, withKeys, withModifiers, createElementVNode, pushScopeId, popScopeId, normalizeStyle, withCtx, createTextVNode, toDisplayString, withDirectives, isRef, unref, vModelDynamic, createVNode, Fragment, renderList, vModelRadio, ref, vModelSelect, vModelCheckbox, vModelText } from "vue";
|
|
21
21
|
var validators = {
|
|
22
22
|
size: (type) => {
|
|
23
23
|
return ["", "xs", "s", "m", "l", "xl"].includes(type);
|
|
24
24
|
},
|
|
25
25
|
group: (type) => {
|
|
26
|
-
return ["left", "right", "center"].includes(type);
|
|
26
|
+
return ["", "left", "right", "center"].includes(type);
|
|
27
27
|
},
|
|
28
28
|
groupVertical: (type) => {
|
|
29
29
|
return ["top", "bottom", "center"].includes(type);
|
|
@@ -11360,8 +11360,8 @@ const _sfc_main$i = {
|
|
|
11360
11360
|
var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$d], ["__scopeId", "data-v-dfa2f586"]]);
|
|
11361
11361
|
const _withScopeId$2 = (n) => (pushScopeId("data-v-64a6608c"), n = n(), popScopeId(), n);
|
|
11362
11362
|
const _hoisted_1$f = ["disabled", "checked"];
|
|
11363
|
-
const _hoisted_2$
|
|
11364
|
-
const _hoisted_3$
|
|
11363
|
+
const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
|
|
11364
|
+
const _hoisted_3$5 = {
|
|
11365
11365
|
key: 0,
|
|
11366
11366
|
class: "c-Checkbox__label"
|
|
11367
11367
|
};
|
|
@@ -11385,8 +11385,8 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11385
11385
|
$options.onChange($event);
|
|
11386
11386
|
})
|
|
11387
11387
|
}, null, 40, _hoisted_1$f),
|
|
11388
|
-
_hoisted_2$
|
|
11389
|
-
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$
|
|
11388
|
+
_hoisted_2$7,
|
|
11389
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$5, [
|
|
11390
11390
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
11391
11391
|
])) : createCommentVNode("", true)
|
|
11392
11392
|
], 16);
|
|
@@ -11557,7 +11557,7 @@ const _sfc_main$f = {
|
|
|
11557
11557
|
var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", render$a], ["__scopeId", "data-v-4b8b9ab4"]]);
|
|
11558
11558
|
var ckInput_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
11559
11559
|
const _hoisted_1$c = { class: "ck-input" };
|
|
11560
|
-
const _hoisted_2$
|
|
11560
|
+
const _hoisted_2$6 = ["type", "placeholder", "id", "disabled"];
|
|
11561
11561
|
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
11562
11562
|
props: {
|
|
11563
11563
|
modelValue: {},
|
|
@@ -11593,6 +11593,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11593
11593
|
event.target.select();
|
|
11594
11594
|
emits("click", event);
|
|
11595
11595
|
};
|
|
11596
|
+
const onInput = (event) => {
|
|
11597
|
+
emits("input", event);
|
|
11598
|
+
};
|
|
11596
11599
|
const onChange = (event) => {
|
|
11597
11600
|
emits("change", event);
|
|
11598
11601
|
};
|
|
@@ -11643,8 +11646,9 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11643
11646
|
id: __props.label ? "ck-input" : "",
|
|
11644
11647
|
disabled: __props.disabled,
|
|
11645
11648
|
onChange: _cache[1] || (_cache[1] = ($event) => onChange($event)),
|
|
11646
|
-
|
|
11647
|
-
|
|
11649
|
+
onInput: _cache[2] || (_cache[2] = ($event) => onInput($event)),
|
|
11650
|
+
onClick: _cache[3] || (_cache[3] = ($event) => onClick($event))
|
|
11651
|
+
}, null, 46, _hoisted_2$6), [
|
|
11648
11652
|
[vModelDynamic, unref(value)]
|
|
11649
11653
|
]),
|
|
11650
11654
|
__props.iconRight ? (openBlock(), createBlock(ckIcon, {
|
|
@@ -11658,15 +11662,15 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11658
11662
|
};
|
|
11659
11663
|
}
|
|
11660
11664
|
});
|
|
11661
|
-
var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-
|
|
11665
|
+
var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-6ae48508"]]);
|
|
11662
11666
|
var ckPopup_vue_vue_type_style_index_0_lang = "";
|
|
11663
11667
|
const _hoisted_1$b = {
|
|
11664
11668
|
key: 0,
|
|
11665
11669
|
class: "ck-popup"
|
|
11666
11670
|
};
|
|
11667
|
-
const _hoisted_2$
|
|
11668
|
-
const _hoisted_3$
|
|
11669
|
-
const _hoisted_4$
|
|
11671
|
+
const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("div", { class: "blackout" }, null, -1);
|
|
11672
|
+
const _hoisted_3$4 = { class: "ck-popup__slot-header" };
|
|
11673
|
+
const _hoisted_4$2 = {
|
|
11670
11674
|
key: 0,
|
|
11671
11675
|
class: "ck-popup__title"
|
|
11672
11676
|
};
|
|
@@ -11681,7 +11685,7 @@ const _hoisted_7 = {
|
|
|
11681
11685
|
};
|
|
11682
11686
|
const _hoisted_8 = /* @__PURE__ */ createTextVNode("Cancelar");
|
|
11683
11687
|
const _hoisted_9 = /* @__PURE__ */ createTextVNode("Aceptar");
|
|
11684
|
-
const __default__$
|
|
11688
|
+
const __default__$1 = {
|
|
11685
11689
|
props: {
|
|
11686
11690
|
modelValue: { type: Boolean },
|
|
11687
11691
|
title: { type: String, default: void 0 },
|
|
@@ -11717,11 +11721,11 @@ const __default__$3 = {
|
|
|
11717
11721
|
}
|
|
11718
11722
|
}
|
|
11719
11723
|
};
|
|
11720
|
-
const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$
|
|
11724
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
|
|
11721
11725
|
setup(__props) {
|
|
11722
11726
|
return (_ctx, _cache) => {
|
|
11723
11727
|
return _ctx.value ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
11724
|
-
_hoisted_2$
|
|
11728
|
+
_hoisted_2$5,
|
|
11725
11729
|
createElementVNode("div", {
|
|
11726
11730
|
class: "popup-container",
|
|
11727
11731
|
onClick: _cache[4] || (_cache[4] = ($event) => _ctx.onBgClick())
|
|
@@ -11731,8 +11735,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
11731
11735
|
onClick: _cache[3] || (_cache[3] = withModifiers(() => {
|
|
11732
11736
|
}, ["stop"]))
|
|
11733
11737
|
}, [
|
|
11734
|
-
createElementVNode("div", _hoisted_3$
|
|
11735
|
-
__props.title ? (openBlock(), createElementBlock("h3", _hoisted_4$
|
|
11738
|
+
createElementVNode("div", _hoisted_3$4, [
|
|
11739
|
+
__props.title ? (openBlock(), createElementBlock("h3", _hoisted_4$2, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
|
|
11736
11740
|
renderSlot(_ctx.$slots, "header", { class: "ml-3" }),
|
|
11737
11741
|
!__props.notCloseBtn ? (openBlock(), createBlock(ckIcon, {
|
|
11738
11742
|
key: 1,
|
|
@@ -11775,9 +11779,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
11775
11779
|
}));
|
|
11776
11780
|
const _withScopeId$1 = (n) => (pushScopeId("data-v-73a891e8"), n = n(), popScopeId(), n);
|
|
11777
11781
|
const _hoisted_1$a = ["onKeyup"];
|
|
11778
|
-
const _hoisted_2$
|
|
11779
|
-
const _hoisted_3$
|
|
11780
|
-
const _hoisted_4$
|
|
11782
|
+
const _hoisted_2$4 = ["name", "value", "disabled"];
|
|
11783
|
+
const _hoisted_3$3 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", { class: "c-Radio__element" }, null, -1));
|
|
11784
|
+
const _hoisted_4$1 = {
|
|
11781
11785
|
key: 0,
|
|
11782
11786
|
class: "c-Radio__label"
|
|
11783
11787
|
};
|
|
@@ -11802,11 +11806,11 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
11802
11806
|
name: $props.name,
|
|
11803
11807
|
value: item.value,
|
|
11804
11808
|
disabled: $props.disabled
|
|
11805
|
-
}, null, 8, _hoisted_2$
|
|
11809
|
+
}, null, 8, _hoisted_2$4), [
|
|
11806
11810
|
[vModelRadio, $options.value]
|
|
11807
11811
|
]),
|
|
11808
|
-
_hoisted_3$
|
|
11809
|
-
item.label ? (openBlock(), createElementBlock("span", _hoisted_4$
|
|
11812
|
+
_hoisted_3$3,
|
|
11813
|
+
item.label ? (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString(item.label), 1)) : createCommentVNode("", true)
|
|
11810
11814
|
], 16, _hoisted_1$a);
|
|
11811
11815
|
}), 128);
|
|
11812
11816
|
}
|
|
@@ -11881,17 +11885,10 @@ const qmStr = {
|
|
|
11881
11885
|
}
|
|
11882
11886
|
};
|
|
11883
11887
|
var ckSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
11884
|
-
const _hoisted_1$9 =
|
|
11885
|
-
class: "ck-select",
|
|
11886
|
-
action: "/action_page.php",
|
|
11887
|
-
method: "get"
|
|
11888
|
-
};
|
|
11889
|
-
const _hoisted_2$4 = ["id", "placeholder"];
|
|
11890
|
-
const _hoisted_3$3 = { id: "ck-select__list" };
|
|
11891
|
-
const _hoisted_4$1 = ["onClick", "value"];
|
|
11888
|
+
const _hoisted_1$9 = ["value"];
|
|
11892
11889
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
11893
11890
|
props: {
|
|
11894
|
-
modelValue: { default: null, type: [Boolean, Number, Object, Array] },
|
|
11891
|
+
modelValue: { default: null, type: [Boolean, Number, Object, Array, String] },
|
|
11895
11892
|
prop: { type: String, default: "name" },
|
|
11896
11893
|
autofocus: { type: Boolean, default: false },
|
|
11897
11894
|
noDataText: { type: String, default: "No se encontr\xF3 nada" },
|
|
@@ -11915,7 +11912,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
11915
11912
|
setup(__props, { emit: emits }) {
|
|
11916
11913
|
const props = __props;
|
|
11917
11914
|
const search = ref("");
|
|
11918
|
-
|
|
11915
|
+
ref(null);
|
|
11919
11916
|
const value = computed({
|
|
11920
11917
|
get() {
|
|
11921
11918
|
return props.modelValue;
|
|
@@ -11926,7 +11923,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
11926
11923
|
emits("update:modelValue", val);
|
|
11927
11924
|
}
|
|
11928
11925
|
});
|
|
11929
|
-
computed(() => {
|
|
11926
|
+
const filteredOptions = computed(() => {
|
|
11930
11927
|
const list = props.options.filter((option) => {
|
|
11931
11928
|
const name = getOptionName(option);
|
|
11932
11929
|
return qmStr.checkContainsStr(name, search.value);
|
|
@@ -11935,10 +11932,10 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
11935
11932
|
});
|
|
11936
11933
|
const computedClass = computed(() => {
|
|
11937
11934
|
const classList2 = [];
|
|
11938
|
-
classList2.push(functions$1.getGroupClass(
|
|
11935
|
+
classList2.push(functions$1.getGroupClass(props));
|
|
11939
11936
|
return classList2;
|
|
11940
11937
|
});
|
|
11941
|
-
computed(() => {
|
|
11938
|
+
const computedStyle = computed(() => {
|
|
11942
11939
|
const list = [];
|
|
11943
11940
|
if (props.minWidth)
|
|
11944
11941
|
list.push({ "min-width": props.minWidth });
|
|
@@ -11983,28 +11980,6 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
11983
11980
|
return props.modelValue === null;
|
|
11984
11981
|
}
|
|
11985
11982
|
});
|
|
11986
|
-
const onBlur = (event) => {
|
|
11987
|
-
const isValid = checkOptionsIsValid(event.target.value);
|
|
11988
|
-
if (!isValid)
|
|
11989
|
-
event.target.value = lastSelectedValue.value;
|
|
11990
|
-
lastSelectedValue.value = null;
|
|
11991
|
-
};
|
|
11992
|
-
const onFocus = (event) => {
|
|
11993
|
-
console.log("event", event);
|
|
11994
|
-
lastSelectedValue.value = search.value;
|
|
11995
|
-
search.value = "";
|
|
11996
|
-
};
|
|
11997
|
-
const onChangeOption = (event) => {
|
|
11998
|
-
console.log("option", search.value);
|
|
11999
|
-
const selected = props.options.find((i) => getOptionName(i) === search.value);
|
|
12000
|
-
value.value = getOptionKey(selected);
|
|
12001
|
-
event.target.blur();
|
|
12002
|
-
};
|
|
12003
|
-
const checkOptionsIsValid = (optionName) => {
|
|
12004
|
-
if (!optionName)
|
|
12005
|
-
return;
|
|
12006
|
-
return props.options.some((i) => getOptionName(i) === optionName);
|
|
12007
|
-
};
|
|
12008
11983
|
const getOptionKey = (option) => {
|
|
12009
11984
|
return realReduceFunction(option);
|
|
12010
11985
|
};
|
|
@@ -12019,46 +11994,39 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
12019
11994
|
return props.reduceFunction(option);
|
|
12020
11995
|
};
|
|
12021
11996
|
return (_ctx, _cache) => {
|
|
12022
|
-
return openBlock(), createElementBlock("
|
|
11997
|
+
return openBlock(), createElementBlock("div", {
|
|
11998
|
+
class: "ck-select",
|
|
11999
|
+
style: normalizeStyle(unref(computedStyle))
|
|
12000
|
+
}, [
|
|
12023
12001
|
__props.label ? (openBlock(), createBlock(ckLabel, {
|
|
12024
12002
|
key: 0,
|
|
12025
12003
|
align: __props.labelAlign,
|
|
12026
|
-
for: "ck-
|
|
12004
|
+
for: "ck-input"
|
|
12027
12005
|
}, {
|
|
12028
12006
|
default: withCtx(() => [
|
|
12029
12007
|
createTextVNode(toDisplayString(__props.label), 1)
|
|
12030
12008
|
]),
|
|
12031
12009
|
_: 1
|
|
12032
12010
|
}, 8, ["align"])) : createCommentVNode("", true),
|
|
12033
|
-
withDirectives(createElementVNode("
|
|
12034
|
-
|
|
12035
|
-
|
|
12036
|
-
|
|
12037
|
-
|
|
12038
|
-
id: __props.label ? "ck-select" : "",
|
|
12039
|
-
placeholder: lastSelectedValue.value,
|
|
12040
|
-
class: normalizeClass(unref(computedClass)),
|
|
12041
|
-
onFocus: _cache[1] || (_cache[1] = ($event) => onFocus($event)),
|
|
12042
|
-
onBlur: _cache[2] || (_cache[2] = ($event) => onBlur($event)),
|
|
12043
|
-
onChange: _cache[3] || (_cache[3] = ($event) => onChangeOption($event))
|
|
12044
|
-
}, null, 42, _hoisted_2$4), [
|
|
12045
|
-
[vModelText, search.value]
|
|
12046
|
-
]),
|
|
12047
|
-
createElementVNode("datalist", _hoisted_3$3, [
|
|
12048
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
|
|
12011
|
+
withDirectives(createElementVNode("select", {
|
|
12012
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(value) ? value.value = $event : null),
|
|
12013
|
+
class: normalizeClass(unref(computedClass))
|
|
12014
|
+
}, [
|
|
12015
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredOptions), (option) => {
|
|
12049
12016
|
return openBlock(), createElementBlock("option", {
|
|
12050
|
-
|
|
12051
|
-
key:
|
|
12052
|
-
|
|
12053
|
-
}, null, 8, _hoisted_4$1);
|
|
12017
|
+
value: getOptionKey(option),
|
|
12018
|
+
key: option
|
|
12019
|
+
}, toDisplayString(getOptionName(option)), 9, _hoisted_1$9);
|
|
12054
12020
|
}), 128))
|
|
12021
|
+
], 2), [
|
|
12022
|
+
[vModelSelect, unref(value)]
|
|
12055
12023
|
])
|
|
12056
|
-
]);
|
|
12024
|
+
], 4);
|
|
12057
12025
|
};
|
|
12058
12026
|
}
|
|
12059
12027
|
});
|
|
12060
|
-
var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-
|
|
12061
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
12028
|
+
var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-a7e7777c"]]);
|
|
12029
|
+
const _withScopeId = (n) => (pushScopeId("data-v-4963b7ae"), n = n(), popScopeId(), n);
|
|
12062
12030
|
const _hoisted_1$8 = ["disabled"];
|
|
12063
12031
|
const _hoisted_2$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
|
|
12064
12032
|
const _hoisted_3$2 = {
|
|
@@ -12131,7 +12099,7 @@ const _sfc_main$a = {
|
|
|
12131
12099
|
}
|
|
12132
12100
|
}
|
|
12133
12101
|
};
|
|
12134
|
-
var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$8], ["__scopeId", "data-v-
|
|
12102
|
+
var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$8], ["__scopeId", "data-v-4963b7ae"]]);
|
|
12135
12103
|
const _hoisted_1$7 = { class: "ck-switch-options__container-exterior" };
|
|
12136
12104
|
const _hoisted_2$2 = ["onClick"];
|
|
12137
12105
|
function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -12282,8 +12250,7 @@ const _sfc_main$6 = {
|
|
|
12282
12250
|
var ckTableTitle = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", render$4]]);
|
|
12283
12251
|
var ckTable__headerItems_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
12284
12252
|
const _hoisted_1$4 = { class: "ck-table__header-items" };
|
|
12285
|
-
const
|
|
12286
|
-
name: "CkTableHeaderItems",
|
|
12253
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
12287
12254
|
props: {
|
|
12288
12255
|
search: { type: String, default: void 0 },
|
|
12289
12256
|
hideRefreshBtn: { type: Boolean, required: true },
|
|
@@ -12292,34 +12259,37 @@ const __default__$2 = {
|
|
|
12292
12259
|
itemsPerPage: { type: Number, required: true },
|
|
12293
12260
|
listLength: { type: Number, required: true }
|
|
12294
12261
|
},
|
|
12295
|
-
emits: ["
|
|
12296
|
-
|
|
12297
|
-
|
|
12262
|
+
emits: ["update:search", "refreshList"],
|
|
12263
|
+
setup(__props, { emit: emits }) {
|
|
12264
|
+
const props = __props;
|
|
12265
|
+
const searchLocal = computed({
|
|
12298
12266
|
get() {
|
|
12299
|
-
return
|
|
12267
|
+
return props.search;
|
|
12300
12268
|
},
|
|
12301
12269
|
set(val) {
|
|
12302
|
-
|
|
12270
|
+
emits("update:search", val);
|
|
12303
12271
|
}
|
|
12304
|
-
}
|
|
12305
|
-
hideSearch() {
|
|
12306
|
-
return typeof
|
|
12307
|
-
}
|
|
12308
|
-
itemsPerPageStart() {
|
|
12309
|
-
return (
|
|
12310
|
-
}
|
|
12311
|
-
itemsPerPageEnd() {
|
|
12312
|
-
|
|
12313
|
-
|
|
12314
|
-
|
|
12315
|
-
if (value > this.listLength)
|
|
12316
|
-
return this.listLength;
|
|
12272
|
+
});
|
|
12273
|
+
const hideSearch = computed(() => {
|
|
12274
|
+
return typeof searchLocal.value === "undefined";
|
|
12275
|
+
});
|
|
12276
|
+
const itemsPerPageStart = computed(() => {
|
|
12277
|
+
return (props.currentPage - 1) * props.itemsPerPage + 1;
|
|
12278
|
+
});
|
|
12279
|
+
const itemsPerPageEnd = computed(() => {
|
|
12280
|
+
const value = props.currentPage * props.itemsPerPage;
|
|
12281
|
+
if (value > props.listLength)
|
|
12282
|
+
return props.listLength;
|
|
12317
12283
|
return value;
|
|
12284
|
+
});
|
|
12285
|
+
function checkRefresh() {
|
|
12286
|
+
const search = searchLocal.value;
|
|
12287
|
+
setTimeout(() => {
|
|
12288
|
+
if (search !== searchLocal.value)
|
|
12289
|
+
return;
|
|
12290
|
+
emits("refreshList", false);
|
|
12291
|
+
}, 1e3);
|
|
12318
12292
|
}
|
|
12319
|
-
}
|
|
12320
|
-
};
|
|
12321
|
-
const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$2), {
|
|
12322
|
-
setup(__props) {
|
|
12323
12293
|
return (_ctx, _cache) => {
|
|
12324
12294
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
12325
12295
|
!__props.hideRefreshBtn ? (openBlock(), createBlock(ckButton, {
|
|
@@ -12330,28 +12300,28 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
12330
12300
|
})) : createCommentVNode("", true),
|
|
12331
12301
|
!__props.hideItemsPerPage && __props.listLength ? (openBlock(), createElementBlock("div", {
|
|
12332
12302
|
key: 1,
|
|
12333
|
-
class: normalizeClass(["items-per-page", { "ck-component__group--left": !
|
|
12334
|
-
}, toDisplayString(
|
|
12335
|
-
!
|
|
12303
|
+
class: normalizeClass(["items-per-page", { "ck-component__group--left": !unref(hideSearch) }])
|
|
12304
|
+
}, toDisplayString(unref(itemsPerPageStart)) + " - " + toDisplayString(unref(itemsPerPageEnd)) + " de " + toDisplayString(__props.listLength), 3)) : createCommentVNode("", true),
|
|
12305
|
+
!unref(hideSearch) ? (openBlock(), createBlock(ckInput, {
|
|
12336
12306
|
key: 2,
|
|
12337
|
-
modelValue:
|
|
12307
|
+
modelValue: unref(searchLocal),
|
|
12338
12308
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(searchLocal) ? searchLocal.value = $event : null),
|
|
12339
12309
|
icon: "search",
|
|
12340
12310
|
placeholder: "Buscar...",
|
|
12341
12311
|
group: __props.hideItemsPerPage ? "" : "right",
|
|
12342
|
-
|
|
12312
|
+
onInput: _cache[2] || (_cache[2] = ($event) => checkRefresh())
|
|
12343
12313
|
}, null, 8, ["modelValue", "group"])) : createCommentVNode("", true)
|
|
12344
12314
|
]);
|
|
12345
12315
|
};
|
|
12346
12316
|
}
|
|
12347
|
-
})
|
|
12348
|
-
var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
12317
|
+
});
|
|
12318
|
+
var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-5fa6396e"]]);
|
|
12349
12319
|
var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
12350
12320
|
const _hoisted_1$3 = { class: "ck-table__pagination" };
|
|
12351
12321
|
const _hoisted_2$1 = ["onClick"];
|
|
12352
12322
|
const _hoisted_3$1 = ["onClick"];
|
|
12353
12323
|
const itemsShowed = 5;
|
|
12354
|
-
const __default__
|
|
12324
|
+
const __default__ = {
|
|
12355
12325
|
name: "CkTablePagination",
|
|
12356
12326
|
props: {
|
|
12357
12327
|
currentPage: { type: Number, required: true },
|
|
@@ -12424,10 +12394,9 @@ const __default__$1 = {
|
|
|
12424
12394
|
}
|
|
12425
12395
|
}
|
|
12426
12396
|
};
|
|
12427
|
-
const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__
|
|
12397
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
|
|
12428
12398
|
setup(__props) {
|
|
12429
12399
|
return (_ctx, _cache) => {
|
|
12430
|
-
const _component_ck_input = resolveComponent("ck-input");
|
|
12431
12400
|
return __props.currentPage && _ctx.totalPages > 1 ? (openBlock(), createElementBlock("div", {
|
|
12432
12401
|
key: 0,
|
|
12433
12402
|
class: normalizeClass(["ck-table__pagination-container", `pagination-align--${__props.align}`])
|
|
@@ -12446,7 +12415,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
12446
12415
|
onClick: ($event) => _ctx.updateCurrentPage(num)
|
|
12447
12416
|
}, toDisplayString(num), 9, _hoisted_2$1);
|
|
12448
12417
|
}), 256)),
|
|
12449
|
-
createVNode(
|
|
12418
|
+
createVNode(ckInput, {
|
|
12450
12419
|
class: "ck-table__pagination-input",
|
|
12451
12420
|
autoSelect: "",
|
|
12452
12421
|
type: "number",
|
|
@@ -12474,7 +12443,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
12474
12443
|
};
|
|
12475
12444
|
}
|
|
12476
12445
|
}));
|
|
12477
|
-
var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
12446
|
+
var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-3fc0d6c6"]]);
|
|
12478
12447
|
var ckTable_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
12479
12448
|
const _hoisted_1$2 = { class: "ck-table" };
|
|
12480
12449
|
const _hoisted_2 = {
|
|
@@ -12488,66 +12457,53 @@ const _hoisted_3 = {
|
|
|
12488
12457
|
const _hoisted_4 = { class: "ck-table__table" };
|
|
12489
12458
|
const _hoisted_5 = { key: 0 };
|
|
12490
12459
|
const _hoisted_6 = { key: 1 };
|
|
12491
|
-
const
|
|
12492
|
-
const defaultItemsPerPage = 40;
|
|
12493
|
-
const __default__ = {
|
|
12494
|
-
name: "CkTable",
|
|
12460
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
12495
12461
|
props: {
|
|
12496
12462
|
columns: { type: Array, required: true, default: () => [] },
|
|
12497
12463
|
currentPage: { type: Number, default: 0 },
|
|
12498
|
-
itemsPerPage: { type: Number, default:
|
|
12464
|
+
itemsPerPage: { type: Number, default: 40 },
|
|
12499
12465
|
listLength: { type: Number, default: 0 },
|
|
12500
|
-
paginationAlign: { type: String, default:
|
|
12466
|
+
paginationAlign: { type: String, default: "center", validator: validators.align },
|
|
12501
12467
|
search: { type: String, default: void 0 },
|
|
12502
12468
|
hideHeaderActions: { type: Boolean, default: false },
|
|
12503
12469
|
hideRefreshBtn: { type: Boolean, default: false },
|
|
12504
12470
|
hideItemsPerPage: { type: Boolean, default: false }
|
|
12505
12471
|
},
|
|
12506
12472
|
emits: ["refreshList", "update:search", "update:currentPage"],
|
|
12507
|
-
|
|
12508
|
-
|
|
12473
|
+
setup(__props, { emit: emits }) {
|
|
12474
|
+
const props = __props;
|
|
12475
|
+
const searchLocal = computed({
|
|
12509
12476
|
get() {
|
|
12510
|
-
return
|
|
12477
|
+
return props.search;
|
|
12511
12478
|
},
|
|
12512
12479
|
set(val) {
|
|
12513
|
-
|
|
12480
|
+
emits("update:search", val);
|
|
12514
12481
|
}
|
|
12515
|
-
}
|
|
12516
|
-
currentPageLocal
|
|
12482
|
+
});
|
|
12483
|
+
const currentPageLocal = computed({
|
|
12517
12484
|
get() {
|
|
12518
|
-
return
|
|
12485
|
+
return props.currentPage;
|
|
12519
12486
|
},
|
|
12520
12487
|
set(val) {
|
|
12521
|
-
|
|
12522
|
-
this.$emit("update:currentPage", val);
|
|
12488
|
+
emits("update:currentPage", val);
|
|
12523
12489
|
}
|
|
12490
|
+
});
|
|
12491
|
+
function refreshList(pageChange = false) {
|
|
12492
|
+
emits("refreshList", pageChange);
|
|
12524
12493
|
}
|
|
12525
|
-
},
|
|
12526
|
-
methods: {
|
|
12527
|
-
refreshList(pageChange = false) {
|
|
12528
|
-
this.$emit("refreshList", pageChange);
|
|
12529
|
-
},
|
|
12530
|
-
testCurrentPage(cosito) {
|
|
12531
|
-
console.log("cosito", cosito);
|
|
12532
|
-
this.$emit("update:currentPage", cosito);
|
|
12533
|
-
}
|
|
12534
|
-
}
|
|
12535
|
-
};
|
|
12536
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
|
|
12537
|
-
setup(__props) {
|
|
12538
12494
|
return (_ctx, _cache) => {
|
|
12539
12495
|
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
12540
12496
|
_ctx.$slots.header || !__props.hideHeaderActions ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
12541
12497
|
!__props.hideHeaderActions ? (openBlock(), createBlock(TableHeaderItems, {
|
|
12542
12498
|
key: 0,
|
|
12543
|
-
search:
|
|
12499
|
+
search: unref(searchLocal),
|
|
12544
12500
|
"onUpdate:search": _cache[0] || (_cache[0] = ($event) => isRef(searchLocal) ? searchLocal.value = $event : null),
|
|
12545
12501
|
currentPage: __props.currentPage,
|
|
12546
12502
|
itemsPerPage: __props.itemsPerPage,
|
|
12547
12503
|
listLength: __props.listLength,
|
|
12548
12504
|
hideRefreshBtn: __props.hideRefreshBtn,
|
|
12549
12505
|
hideItemsPerPage: __props.hideItemsPerPage,
|
|
12550
|
-
onRefreshList: _cache[1] || (_cache[1] = ($event) =>
|
|
12506
|
+
onRefreshList: _cache[1] || (_cache[1] = ($event) => refreshList($event))
|
|
12551
12507
|
}, null, 8, ["search", "currentPage", "itemsPerPage", "listLength", "hideRefreshBtn", "hideItemsPerPage"])) : createCommentVNode("", true),
|
|
12552
12508
|
_ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
12553
12509
|
renderSlot(_ctx.$slots, "header", {}, void 0, true)
|
|
@@ -12575,18 +12531,18 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
12575
12531
|
])) : createCommentVNode("", true)
|
|
12576
12532
|
]),
|
|
12577
12533
|
createVNode(TablePagination, {
|
|
12578
|
-
currentPage:
|
|
12579
|
-
"onUpdate:currentPage": _cache[2] || (_cache[2] = ($event) =>
|
|
12534
|
+
currentPage: unref(currentPageLocal),
|
|
12535
|
+
"onUpdate:currentPage": _cache[2] || (_cache[2] = ($event) => isRef(currentPageLocal) ? currentPageLocal.value = $event : null),
|
|
12580
12536
|
itemsPerPage: __props.itemsPerPage,
|
|
12581
12537
|
listLength: __props.listLength,
|
|
12582
12538
|
align: __props.paginationAlign,
|
|
12583
|
-
onRefreshList: _cache[3] || (_cache[3] = ($event) =>
|
|
12539
|
+
onRefreshList: _cache[3] || (_cache[3] = ($event) => refreshList(true))
|
|
12584
12540
|
}, null, 8, ["currentPage", "itemsPerPage", "listLength", "align"])
|
|
12585
12541
|
]);
|
|
12586
12542
|
};
|
|
12587
12543
|
}
|
|
12588
|
-
})
|
|
12589
|
-
var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
12544
|
+
});
|
|
12545
|
+
var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-cac87456"]]);
|
|
12590
12546
|
function render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
12591
12547
|
return openBlock(), createElementBlock("td", {
|
|
12592
12548
|
class: normalizeClass(["ck-td", $options.computedTdClass])
|
|
@@ -12642,7 +12598,7 @@ const _sfc_main$2 = {
|
|
|
12642
12598
|
}
|
|
12643
12599
|
}
|
|
12644
12600
|
};
|
|
12645
|
-
var ckTd = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", render$3], ["__scopeId", "data-v-
|
|
12601
|
+
var ckTd = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", render$3], ["__scopeId", "data-v-70c634f2"]]);
|
|
12646
12602
|
const _hoisted_1$1 = { class: "ck-textarea" };
|
|
12647
12603
|
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
12648
12604
|
const _component_ck_label = resolveComponent("ck-label");
|