cleek 1.8.3 → 1.8.4
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.es.js +158 -147
- 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,7 +17,7 @@ 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,
|
|
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, vModelText, vModelCheckbox } from "vue";
|
|
21
21
|
var validators = {
|
|
22
22
|
size: (type) => {
|
|
23
23
|
return ["", "xs", "s", "m", "l", "xl"].includes(type);
|
|
@@ -34,6 +34,9 @@ var validators = {
|
|
|
34
34
|
buttonType: (type) => {
|
|
35
35
|
return ["filled", "outlined", "flat"].includes(type);
|
|
36
36
|
},
|
|
37
|
+
inputType: (type) => {
|
|
38
|
+
return ["text", "number", "date", "time", "password"].includes(type);
|
|
39
|
+
},
|
|
37
40
|
radioOptions: (options) => {
|
|
38
41
|
let isValid = true;
|
|
39
42
|
options.forEach((option) => {
|
|
@@ -11199,7 +11202,7 @@ defineComponent({
|
|
|
11199
11202
|
};
|
|
11200
11203
|
}
|
|
11201
11204
|
});
|
|
11202
|
-
function render$
|
|
11205
|
+
function render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11203
11206
|
const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
|
|
11204
11207
|
return openBlock(), createElementBlock("div", {
|
|
11205
11208
|
class: normalizeClass(["ck-icon", $options.computedClass]),
|
|
@@ -11275,9 +11278,9 @@ const _sfc_main$j = {
|
|
|
11275
11278
|
}
|
|
11276
11279
|
}
|
|
11277
11280
|
};
|
|
11278
|
-
var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$
|
|
11281
|
+
var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$e], ["__scopeId", "data-v-77d9963a"]]);
|
|
11279
11282
|
const _hoisted_1$g = ["title", "aria-label", "disabled"];
|
|
11280
|
-
function render$
|
|
11283
|
+
function render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11281
11284
|
const _component_ck_icon = resolveComponent("ck-icon");
|
|
11282
11285
|
return openBlock(), createElementBlock("button", {
|
|
11283
11286
|
type: "button",
|
|
@@ -11354,7 +11357,7 @@ const _sfc_main$i = {
|
|
|
11354
11357
|
}
|
|
11355
11358
|
}
|
|
11356
11359
|
};
|
|
11357
|
-
var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$
|
|
11360
|
+
var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$d], ["__scopeId", "data-v-dfa2f586"]]);
|
|
11358
11361
|
const _withScopeId$2 = (n) => (pushScopeId("data-v-64a6608c"), n = n(), popScopeId(), n);
|
|
11359
11362
|
const _hoisted_1$f = ["disabled", "checked"];
|
|
11360
11363
|
const _hoisted_2$8 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
|
|
@@ -11362,7 +11365,7 @@ const _hoisted_3$6 = {
|
|
|
11362
11365
|
key: 0,
|
|
11363
11366
|
class: "c-Checkbox__label"
|
|
11364
11367
|
};
|
|
11365
|
-
function render$
|
|
11368
|
+
function render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11366
11369
|
return openBlock(), createElementBlock("label", mergeProps({ class: "ck-checkbox" }, $options.checkboxAttributes, {
|
|
11367
11370
|
onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
|
|
11368
11371
|
}, ["prevent"]), ["space"])),
|
|
@@ -11422,9 +11425,9 @@ const _sfc_main$h = {
|
|
|
11422
11425
|
}
|
|
11423
11426
|
}
|
|
11424
11427
|
};
|
|
11425
|
-
var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$
|
|
11428
|
+
var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$c], ["__scopeId", "data-v-64a6608c"]]);
|
|
11426
11429
|
const _hoisted_1$e = ["src"];
|
|
11427
|
-
function render$
|
|
11430
|
+
function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11428
11431
|
return openBlock(), createElementBlock("div", {
|
|
11429
11432
|
class: normalizeClass(["ck-img", $options.computedClass]),
|
|
11430
11433
|
style: normalizeStyle($options.computedStyle),
|
|
@@ -11523,9 +11526,9 @@ const _sfc_main$g = {
|
|
|
11523
11526
|
}
|
|
11524
11527
|
}
|
|
11525
11528
|
};
|
|
11526
|
-
var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", render$
|
|
11529
|
+
var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", render$b], ["__scopeId", "data-v-38b603bf"]]);
|
|
11527
11530
|
const _hoisted_1$d = ["for"];
|
|
11528
|
-
function render$
|
|
11531
|
+
function render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11529
11532
|
return openBlock(), createElementBlock("label", {
|
|
11530
11533
|
class: normalizeClass(["ck-label", $options.computedClass]),
|
|
11531
11534
|
for: $props.for
|
|
@@ -11551,28 +11554,30 @@ const _sfc_main$f = {
|
|
|
11551
11554
|
}
|
|
11552
11555
|
}
|
|
11553
11556
|
};
|
|
11554
|
-
var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", render$
|
|
11555
|
-
var
|
|
11556
|
-
const _hoisted_1$c = { class: "ck-input
|
|
11557
|
-
const _hoisted_2$7 = ["placeholder", "id"];
|
|
11557
|
+
var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", render$a], ["__scopeId", "data-v-4b8b9ab4"]]);
|
|
11558
|
+
var ckInput_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
11559
|
+
const _hoisted_1$c = { class: "ck-input" };
|
|
11560
|
+
const _hoisted_2$7 = ["type", "placeholder", "id", "disabled"];
|
|
11558
11561
|
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
11559
11562
|
props: {
|
|
11560
|
-
modelValue: {
|
|
11561
|
-
|
|
11562
|
-
|
|
11563
|
+
modelValue: {},
|
|
11564
|
+
type: { type: String, validator: validators.inputType, default: "text" },
|
|
11565
|
+
disabled: { type: Boolean, default: false },
|
|
11566
|
+
placeholder: { type: String, default: void 0 },
|
|
11567
|
+
label: { type: String, default: void 0 },
|
|
11563
11568
|
labelAlign: { type: String, validator: validators.align, default: void 0 },
|
|
11564
11569
|
icon: { type: [String, Array], default: void 0 },
|
|
11565
11570
|
iconPack: { type: String, default: void 0 },
|
|
11566
11571
|
iconRight: { type: String, default: void 0 },
|
|
11567
|
-
group: { type: String, default:
|
|
11572
|
+
group: { type: String, default: void 0 },
|
|
11568
11573
|
groupBreak: { type: String, default: "s" },
|
|
11569
|
-
groupVertical: { type: String, default:
|
|
11574
|
+
groupVertical: { type: String, default: void 0 },
|
|
11570
11575
|
hideBorder: { type: Boolean, default: false },
|
|
11571
11576
|
width: { type: String, default: void 0 },
|
|
11572
11577
|
align: { type: String, validator: validators.align, default: void 0 },
|
|
11573
11578
|
autoSelect: { type: Boolean, default: false }
|
|
11574
11579
|
},
|
|
11575
|
-
emits: ["update:modelValue", "click", "change"],
|
|
11580
|
+
emits: ["update:modelValue", "click", "input", "change"],
|
|
11576
11581
|
setup(__props, { emit: emits }) {
|
|
11577
11582
|
const props = __props;
|
|
11578
11583
|
const value = computed({
|
|
@@ -11583,14 +11588,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11583
11588
|
emits("update:modelValue", val);
|
|
11584
11589
|
}
|
|
11585
11590
|
});
|
|
11586
|
-
const onChange = (event) => {
|
|
11587
|
-
emits("change", event);
|
|
11588
|
-
};
|
|
11589
11591
|
const onClick = (event) => {
|
|
11590
11592
|
if (props.autoSelect)
|
|
11591
11593
|
event.target.select();
|
|
11592
11594
|
emits("click", event);
|
|
11593
11595
|
};
|
|
11596
|
+
const onChange = (event) => {
|
|
11597
|
+
emits("change", event);
|
|
11598
|
+
};
|
|
11594
11599
|
const computedStyleInput = computed(() => {
|
|
11595
11600
|
const list = [];
|
|
11596
11601
|
if (props.width)
|
|
@@ -11615,7 +11620,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11615
11620
|
__props.label ? (openBlock(), createBlock(ckLabel, {
|
|
11616
11621
|
key: 0,
|
|
11617
11622
|
align: __props.labelAlign,
|
|
11618
|
-
for: "ck-input
|
|
11623
|
+
for: "ck-input"
|
|
11619
11624
|
}, {
|
|
11620
11625
|
default: withCtx(() => [
|
|
11621
11626
|
createTextVNode(toDisplayString(__props.label), 1)
|
|
@@ -11631,15 +11636,16 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11631
11636
|
}, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true),
|
|
11632
11637
|
withDirectives(createElementVNode("input", {
|
|
11633
11638
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(value) ? value.value = $event : null),
|
|
11634
|
-
type:
|
|
11639
|
+
type: __props.type,
|
|
11635
11640
|
placeholder: __props.placeholder,
|
|
11636
11641
|
class: normalizeClass(unref(computedClassInput)),
|
|
11637
11642
|
style: normalizeStyle(unref(computedStyleInput)),
|
|
11638
|
-
id: __props.label ? "ck-input
|
|
11643
|
+
id: __props.label ? "ck-input" : "",
|
|
11644
|
+
disabled: __props.disabled,
|
|
11639
11645
|
onChange: _cache[1] || (_cache[1] = ($event) => onChange($event)),
|
|
11640
11646
|
onClick: _cache[2] || (_cache[2] = ($event) => onClick($event))
|
|
11641
11647
|
}, null, 46, _hoisted_2$7), [
|
|
11642
|
-
[
|
|
11648
|
+
[vModelDynamic, unref(value)]
|
|
11643
11649
|
]),
|
|
11644
11650
|
__props.iconRight ? (openBlock(), createBlock(ckIcon, {
|
|
11645
11651
|
key: 2,
|
|
@@ -11652,7 +11658,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11652
11658
|
};
|
|
11653
11659
|
}
|
|
11654
11660
|
});
|
|
11655
|
-
var
|
|
11661
|
+
var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-36850b72"]]);
|
|
11656
11662
|
var ckPopup_vue_vue_type_style_index_0_lang = "";
|
|
11657
11663
|
const _hoisted_1$b = {
|
|
11658
11664
|
key: 0,
|
|
@@ -11775,7 +11781,7 @@ const _hoisted_4$2 = {
|
|
|
11775
11781
|
key: 0,
|
|
11776
11782
|
class: "c-Radio__label"
|
|
11777
11783
|
};
|
|
11778
|
-
function render$
|
|
11784
|
+
function render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11779
11785
|
return openBlock(true), createElementBlock(Fragment, null, renderList($props.options, (item, index) => {
|
|
11780
11786
|
return openBlock(), createElementBlock("label", mergeProps({
|
|
11781
11787
|
key: `radio-${index}`,
|
|
@@ -11837,7 +11843,7 @@ const _sfc_main$c = {
|
|
|
11837
11843
|
}
|
|
11838
11844
|
}
|
|
11839
11845
|
};
|
|
11840
|
-
var ckRadio = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", render$
|
|
11846
|
+
var ckRadio = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", render$9], ["__scopeId", "data-v-73a891e8"]]);
|
|
11841
11847
|
const qmStr = {
|
|
11842
11848
|
capitalize(str) {
|
|
11843
11849
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
@@ -11874,51 +11880,16 @@ const qmStr = {
|
|
|
11874
11880
|
return joinArray;
|
|
11875
11881
|
}
|
|
11876
11882
|
};
|
|
11883
|
+
var ckSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
11877
11884
|
const _hoisted_1$9 = {
|
|
11878
11885
|
class: "ck-select",
|
|
11879
11886
|
action: "/action_page.php",
|
|
11880
11887
|
method: "get"
|
|
11881
11888
|
};
|
|
11882
|
-
const _hoisted_2$4 = ["placeholder"];
|
|
11889
|
+
const _hoisted_2$4 = ["id", "placeholder"];
|
|
11883
11890
|
const _hoisted_3$3 = { id: "ck-select__list" };
|
|
11884
|
-
const _hoisted_4$1 = ["value"];
|
|
11885
|
-
|
|
11886
|
-
const _component_ck_label = resolveComponent("ck-label");
|
|
11887
|
-
return openBlock(), createElementBlock("form", _hoisted_1$9, [
|
|
11888
|
-
$props.label ? (openBlock(), createBlock(_component_ck_label, {
|
|
11889
|
-
key: 0,
|
|
11890
|
-
align: $props.labelAlign,
|
|
11891
|
-
for: "ck-select"
|
|
11892
|
-
}, {
|
|
11893
|
-
default: withCtx(() => [
|
|
11894
|
-
createTextVNode(toDisplayString($props.label), 1)
|
|
11895
|
-
]),
|
|
11896
|
-
_: 1
|
|
11897
|
-
}, 8, ["align"])) : createCommentVNode("", true),
|
|
11898
|
-
createElementVNode("input", {
|
|
11899
|
-
list: "ck-select__list",
|
|
11900
|
-
name: "ck-select",
|
|
11901
|
-
id: "ck-select",
|
|
11902
|
-
placeholder: $data.lastSelectedValue,
|
|
11903
|
-
class: normalizeClass($options.computedClass),
|
|
11904
|
-
onFocus: _cache[0] || (_cache[0] = ($event) => $options.onFocus($event)),
|
|
11905
|
-
onBlur: _cache[1] || (_cache[1] = ($event) => $options.onBlur($event))
|
|
11906
|
-
}, null, 42, _hoisted_2$4),
|
|
11907
|
-
createElementVNode("datalist", _hoisted_3$3, [
|
|
11908
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList($props.options, (option) => {
|
|
11909
|
-
return openBlock(), createElementBlock("option", {
|
|
11910
|
-
value: option.name
|
|
11911
|
-
}, null, 8, _hoisted_4$1);
|
|
11912
|
-
}), 256))
|
|
11913
|
-
])
|
|
11914
|
-
]);
|
|
11915
|
-
}
|
|
11916
|
-
var ckSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
11917
|
-
const _sfc_main$b = {
|
|
11918
|
-
name: "CkSelect",
|
|
11919
|
-
components: {
|
|
11920
|
-
ckLabel
|
|
11921
|
-
},
|
|
11891
|
+
const _hoisted_4$1 = ["onClick", "value"];
|
|
11892
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
11922
11893
|
props: {
|
|
11923
11894
|
modelValue: { default: null, type: [Boolean, Number, Object, Array] },
|
|
11924
11895
|
prop: { type: String, default: "name" },
|
|
@@ -11940,115 +11911,153 @@ const _sfc_main$b = {
|
|
|
11940
11911
|
label: { type: String, default: "" },
|
|
11941
11912
|
labelAlign: { type: String, default: "" }
|
|
11942
11913
|
},
|
|
11943
|
-
emits: ["update:modelValue"],
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
},
|
|
11950
|
-
computed: {
|
|
11951
|
-
value: {
|
|
11914
|
+
emits: ["update:modelValue", "click", "change"],
|
|
11915
|
+
setup(__props, { emit: emits }) {
|
|
11916
|
+
const props = __props;
|
|
11917
|
+
const search = ref("");
|
|
11918
|
+
const lastSelectedValue = ref(null);
|
|
11919
|
+
const value = computed({
|
|
11952
11920
|
get() {
|
|
11953
|
-
return
|
|
11921
|
+
return props.modelValue;
|
|
11954
11922
|
},
|
|
11955
11923
|
set(val) {
|
|
11956
11924
|
if (val === null)
|
|
11957
|
-
val =
|
|
11958
|
-
|
|
11925
|
+
val = realClearValue;
|
|
11926
|
+
emits("update:modelValue", val);
|
|
11959
11927
|
}
|
|
11960
|
-
}
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
const name =
|
|
11964
|
-
return qmStr.checkContainsStr(name,
|
|
11928
|
+
});
|
|
11929
|
+
computed(() => {
|
|
11930
|
+
const list = props.options.filter((option) => {
|
|
11931
|
+
const name = getOptionName(option);
|
|
11932
|
+
return qmStr.checkContainsStr(name, search.value);
|
|
11965
11933
|
});
|
|
11966
|
-
|
|
11967
|
-
|
|
11934
|
+
return list;
|
|
11935
|
+
});
|
|
11936
|
+
const computedClass = computed(() => {
|
|
11968
11937
|
const classList2 = [];
|
|
11969
11938
|
classList2.push(functions$1.getGroupClass(this));
|
|
11970
11939
|
return classList2;
|
|
11971
|
-
}
|
|
11972
|
-
|
|
11940
|
+
});
|
|
11941
|
+
computed(() => {
|
|
11973
11942
|
const list = [];
|
|
11974
|
-
if (
|
|
11975
|
-
list.push({ "min-width":
|
|
11943
|
+
if (props.minWidth)
|
|
11944
|
+
list.push({ "min-width": props.minWidth });
|
|
11976
11945
|
return list;
|
|
11977
|
-
}
|
|
11978
|
-
|
|
11979
|
-
if (
|
|
11980
|
-
if (
|
|
11946
|
+
});
|
|
11947
|
+
computed(() => {
|
|
11948
|
+
if (props.searchable === "auto") {
|
|
11949
|
+
if (props.options.length < 5)
|
|
11981
11950
|
return false;
|
|
11982
11951
|
return true;
|
|
11983
11952
|
}
|
|
11984
|
-
return
|
|
11985
|
-
}
|
|
11986
|
-
realClearValue() {
|
|
11987
|
-
switch (typeof
|
|
11953
|
+
return props.searchable;
|
|
11954
|
+
});
|
|
11955
|
+
const realClearValue = computed(() => {
|
|
11956
|
+
switch (typeof props.modelValue) {
|
|
11988
11957
|
case "number":
|
|
11989
11958
|
return 0;
|
|
11990
11959
|
case "string":
|
|
11991
11960
|
return "";
|
|
11992
11961
|
case "object":
|
|
11993
|
-
if (
|
|
11962
|
+
if (props.modelValue.constructor === Array)
|
|
11994
11963
|
return [];
|
|
11995
11964
|
return {};
|
|
11996
11965
|
default:
|
|
11997
11966
|
return null;
|
|
11998
11967
|
}
|
|
11999
|
-
}
|
|
12000
|
-
|
|
12001
|
-
switch (typeof
|
|
11968
|
+
});
|
|
11969
|
+
computed(() => {
|
|
11970
|
+
switch (typeof props.modelValue) {
|
|
12002
11971
|
case "number":
|
|
12003
|
-
return
|
|
11972
|
+
return props.modelValue === 0;
|
|
12004
11973
|
case "string":
|
|
12005
|
-
return
|
|
11974
|
+
return props.modelValue === "";
|
|
12006
11975
|
case "object":
|
|
12007
|
-
if (!
|
|
11976
|
+
if (!props.modelValue)
|
|
12008
11977
|
return null;
|
|
12009
|
-
if (
|
|
12010
|
-
return
|
|
11978
|
+
if (props.modelValue.constructor === Array) {
|
|
11979
|
+
return props.modelValue.length() === 0;
|
|
12011
11980
|
}
|
|
12012
|
-
return Object.keys(
|
|
11981
|
+
return Object.keys(props.modelValue).length === 0;
|
|
12013
11982
|
default:
|
|
12014
|
-
return
|
|
11983
|
+
return props.modelValue === null;
|
|
12015
11984
|
}
|
|
12016
|
-
}
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
onBlur(event) {
|
|
12020
|
-
const isValid = this.checkOptionsIsValid(event.target.value);
|
|
11985
|
+
});
|
|
11986
|
+
const onBlur = (event) => {
|
|
11987
|
+
const isValid = checkOptionsIsValid(event.target.value);
|
|
12021
11988
|
if (!isValid)
|
|
12022
|
-
event.target.value =
|
|
12023
|
-
|
|
12024
|
-
}
|
|
12025
|
-
onFocus(event) {
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
|
|
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) => {
|
|
12030
12004
|
if (!optionName)
|
|
12031
12005
|
return;
|
|
12032
|
-
return
|
|
12033
|
-
}
|
|
12034
|
-
getOptionKey(option) {
|
|
12035
|
-
return
|
|
12036
|
-
}
|
|
12037
|
-
getOptionName(option) {
|
|
12038
|
-
if (!
|
|
12006
|
+
return props.options.some((i) => getOptionName(i) === optionName);
|
|
12007
|
+
};
|
|
12008
|
+
const getOptionKey = (option) => {
|
|
12009
|
+
return realReduceFunction(option);
|
|
12010
|
+
};
|
|
12011
|
+
const getOptionName = (option) => {
|
|
12012
|
+
if (!props.prop)
|
|
12039
12013
|
return option;
|
|
12040
|
-
return option[
|
|
12041
|
-
}
|
|
12042
|
-
realReduceFunction(option) {
|
|
12043
|
-
if (
|
|
12014
|
+
return option[props.prop];
|
|
12015
|
+
};
|
|
12016
|
+
const realReduceFunction = (option) => {
|
|
12017
|
+
if (props.notReduce)
|
|
12044
12018
|
return option;
|
|
12045
|
-
return
|
|
12046
|
-
}
|
|
12047
|
-
|
|
12048
|
-
|
|
12019
|
+
return props.reduceFunction(option);
|
|
12020
|
+
};
|
|
12021
|
+
return (_ctx, _cache) => {
|
|
12022
|
+
return openBlock(), createElementBlock("form", _hoisted_1$9, [
|
|
12023
|
+
__props.label ? (openBlock(), createBlock(ckLabel, {
|
|
12024
|
+
key: 0,
|
|
12025
|
+
align: __props.labelAlign,
|
|
12026
|
+
for: "ck-select"
|
|
12027
|
+
}, {
|
|
12028
|
+
default: withCtx(() => [
|
|
12029
|
+
createTextVNode(toDisplayString(__props.label), 1)
|
|
12030
|
+
]),
|
|
12031
|
+
_: 1
|
|
12032
|
+
}, 8, ["align"])) : createCommentVNode("", true),
|
|
12033
|
+
withDirectives(createElementVNode("input", {
|
|
12034
|
+
autocomplete: "off",
|
|
12035
|
+
list: "ck-select__list",
|
|
12036
|
+
name: "ck-select",
|
|
12037
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => search.value = $event),
|
|
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) => {
|
|
12049
|
+
return openBlock(), createElementBlock("option", {
|
|
12050
|
+
onClick: ($event) => _ctx.onClickOption(option),
|
|
12051
|
+
key: getOptionKey(option),
|
|
12052
|
+
value: getOptionName(option)
|
|
12053
|
+
}, null, 8, _hoisted_4$1);
|
|
12054
|
+
}), 128))
|
|
12055
|
+
])
|
|
12056
|
+
]);
|
|
12057
|
+
};
|
|
12049
12058
|
}
|
|
12050
|
-
};
|
|
12051
|
-
var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["
|
|
12059
|
+
});
|
|
12060
|
+
var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-748b30c8"]]);
|
|
12052
12061
|
const _withScopeId = (n) => (pushScopeId("data-v-5251135b"), n = n(), popScopeId(), n);
|
|
12053
12062
|
const _hoisted_1$8 = ["disabled"];
|
|
12054
12063
|
const _hoisted_2$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
|
|
@@ -12323,7 +12332,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
12323
12332
|
key: 1,
|
|
12324
12333
|
class: normalizeClass(["items-per-page", { "ck-component__group--left": !_ctx.hideSearch }])
|
|
12325
12334
|
}, toDisplayString(_ctx.itemsPerPageStart) + " - " + toDisplayString(_ctx.itemsPerPageEnd) + " de " + toDisplayString(__props.listLength), 3)) : createCommentVNode("", true),
|
|
12326
|
-
!_ctx.hideSearch ? (openBlock(), createBlock(
|
|
12335
|
+
!_ctx.hideSearch ? (openBlock(), createBlock(ckInput, {
|
|
12327
12336
|
key: 2,
|
|
12328
12337
|
modelValue: _ctx.searchLocal,
|
|
12329
12338
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(searchLocal) ? searchLocal.value = $event : null),
|
|
@@ -12336,7 +12345,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
12336
12345
|
};
|
|
12337
12346
|
}
|
|
12338
12347
|
}));
|
|
12339
|
-
var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
12348
|
+
var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-4ce2fcee"]]);
|
|
12340
12349
|
var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
12341
12350
|
const _hoisted_1$3 = { class: "ck-table__pagination" };
|
|
12342
12351
|
const _hoisted_2$1 = ["onClick"];
|
|
@@ -12418,6 +12427,7 @@ const __default__$1 = {
|
|
|
12418
12427
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
|
|
12419
12428
|
setup(__props) {
|
|
12420
12429
|
return (_ctx, _cache) => {
|
|
12430
|
+
const _component_ck_input = resolveComponent("ck-input");
|
|
12421
12431
|
return __props.currentPage && _ctx.totalPages > 1 ? (openBlock(), createElementBlock("div", {
|
|
12422
12432
|
key: 0,
|
|
12423
12433
|
class: normalizeClass(["ck-table__pagination-container", `pagination-align--${__props.align}`])
|
|
@@ -12436,9 +12446,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
12436
12446
|
onClick: ($event) => _ctx.updateCurrentPage(num)
|
|
12437
12447
|
}, toDisplayString(num), 9, _hoisted_2$1);
|
|
12438
12448
|
}), 256)),
|
|
12439
|
-
createVNode(
|
|
12449
|
+
createVNode(_component_ck_input, {
|
|
12440
12450
|
class: "ck-table__pagination-input",
|
|
12441
12451
|
autoSelect: "",
|
|
12452
|
+
type: "number",
|
|
12442
12453
|
width: "50px",
|
|
12443
12454
|
align: "center",
|
|
12444
12455
|
modelValue: _ctx.currentPageLocal2,
|
|
@@ -12463,7 +12474,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
12463
12474
|
};
|
|
12464
12475
|
}
|
|
12465
12476
|
}));
|
|
12466
|
-
var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
12477
|
+
var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-49a1575a"]]);
|
|
12467
12478
|
var ckTable_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
12468
12479
|
const _hoisted_1$2 = { class: "ck-table" };
|
|
12469
12480
|
const _hoisted_2 = {
|
|
@@ -15275,7 +15286,7 @@ var components = /* @__PURE__ */ Object.freeze({
|
|
|
15275
15286
|
ckCheckbox,
|
|
15276
15287
|
ckIcon,
|
|
15277
15288
|
ckImg,
|
|
15278
|
-
|
|
15289
|
+
ckInput,
|
|
15279
15290
|
ckLabel,
|
|
15280
15291
|
ckPopup: _sfc_main$d,
|
|
15281
15292
|
ckRadio,
|
|
@@ -15299,4 +15310,4 @@ const install = function installCleek(app, options) {
|
|
|
15299
15310
|
app.component(componentName, component);
|
|
15300
15311
|
});
|
|
15301
15312
|
};
|
|
15302
|
-
export { events as EVENTS, mitt as EventBus, ckButton, ckCheckbox, ckIcon, ckImg,
|
|
15313
|
+
export { events as EVENTS, mitt as EventBus, ckButton, ckCheckbox, ckIcon, ckImg, ckInput, ckLabel, _sfc_main$d as ckPopup, ckRadio, ckSelect, ckSwitch, ckSwitchOptions, ckTable, ckTd, ckTextarea, ckTh, ckTooltip, ckTr, install as default, lockScroll, unlockScroll };
|