cleek 1.8.5 → 1.8.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.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, vModelDynamic, createVNode, Fragment, renderList, vModelRadio, ref, vModelText, vModelCheckbox } from "vue";
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);
@@ -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$8 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
11364
- const _hoisted_3$6 = {
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$8,
11389
- _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$6, [
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$7 = ["type", "placeholder", "id", "disabled"];
11560
+ const _hoisted_2$6 = ["type", "placeholder", "id", "disabled"];
11561
11561
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
11562
11562
  props: {
11563
11563
  modelValue: {},
@@ -11644,7 +11644,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11644
11644
  disabled: __props.disabled,
11645
11645
  onChange: _cache[1] || (_cache[1] = ($event) => onChange($event)),
11646
11646
  onClick: _cache[2] || (_cache[2] = ($event) => onClick($event))
11647
- }, null, 46, _hoisted_2$7), [
11647
+ }, null, 46, _hoisted_2$6), [
11648
11648
  [vModelDynamic, unref(value)]
11649
11649
  ]),
11650
11650
  __props.iconRight ? (openBlock(), createBlock(ckIcon, {
@@ -11664,9 +11664,9 @@ const _hoisted_1$b = {
11664
11664
  key: 0,
11665
11665
  class: "ck-popup"
11666
11666
  };
11667
- const _hoisted_2$6 = /* @__PURE__ */ createElementVNode("div", { class: "blackout" }, null, -1);
11668
- const _hoisted_3$5 = { class: "ck-popup__slot-header" };
11669
- const _hoisted_4$3 = {
11667
+ const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("div", { class: "blackout" }, null, -1);
11668
+ const _hoisted_3$4 = { class: "ck-popup__slot-header" };
11669
+ const _hoisted_4$2 = {
11670
11670
  key: 0,
11671
11671
  class: "ck-popup__title"
11672
11672
  };
@@ -11721,7 +11721,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
11721
11721
  setup(__props) {
11722
11722
  return (_ctx, _cache) => {
11723
11723
  return _ctx.value ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
11724
- _hoisted_2$6,
11724
+ _hoisted_2$5,
11725
11725
  createElementVNode("div", {
11726
11726
  class: "popup-container",
11727
11727
  onClick: _cache[4] || (_cache[4] = ($event) => _ctx.onBgClick())
@@ -11731,8 +11731,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
11731
11731
  onClick: _cache[3] || (_cache[3] = withModifiers(() => {
11732
11732
  }, ["stop"]))
11733
11733
  }, [
11734
- createElementVNode("div", _hoisted_3$5, [
11735
- __props.title ? (openBlock(), createElementBlock("h3", _hoisted_4$3, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
11734
+ createElementVNode("div", _hoisted_3$4, [
11735
+ __props.title ? (openBlock(), createElementBlock("h3", _hoisted_4$2, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
11736
11736
  renderSlot(_ctx.$slots, "header", { class: "ml-3" }),
11737
11737
  !__props.notCloseBtn ? (openBlock(), createBlock(ckIcon, {
11738
11738
  key: 1,
@@ -11775,9 +11775,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
11775
11775
  }));
11776
11776
  const _withScopeId$1 = (n) => (pushScopeId("data-v-73a891e8"), n = n(), popScopeId(), n);
11777
11777
  const _hoisted_1$a = ["onKeyup"];
11778
- const _hoisted_2$5 = ["name", "value", "disabled"];
11779
- const _hoisted_3$4 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", { class: "c-Radio__element" }, null, -1));
11780
- const _hoisted_4$2 = {
11778
+ const _hoisted_2$4 = ["name", "value", "disabled"];
11779
+ const _hoisted_3$3 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", { class: "c-Radio__element" }, null, -1));
11780
+ const _hoisted_4$1 = {
11781
11781
  key: 0,
11782
11782
  class: "c-Radio__label"
11783
11783
  };
@@ -11802,11 +11802,11 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
11802
11802
  name: $props.name,
11803
11803
  value: item.value,
11804
11804
  disabled: $props.disabled
11805
- }, null, 8, _hoisted_2$5), [
11805
+ }, null, 8, _hoisted_2$4), [
11806
11806
  [vModelRadio, $options.value]
11807
11807
  ]),
11808
- _hoisted_3$4,
11809
- item.label ? (openBlock(), createElementBlock("span", _hoisted_4$2, toDisplayString(item.label), 1)) : createCommentVNode("", true)
11808
+ _hoisted_3$3,
11809
+ item.label ? (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString(item.label), 1)) : createCommentVNode("", true)
11810
11810
  ], 16, _hoisted_1$a);
11811
11811
  }), 128);
11812
11812
  }
@@ -11881,14 +11881,7 @@ const qmStr = {
11881
11881
  }
11882
11882
  };
11883
11883
  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"];
11884
+ const _hoisted_1$9 = ["value"];
11892
11885
  const _sfc_main$b = /* @__PURE__ */ defineComponent({
11893
11886
  props: {
11894
11887
  modelValue: { default: null, type: [Boolean, Number, Object, Array] },
@@ -11915,7 +11908,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11915
11908
  setup(__props, { emit: emits }) {
11916
11909
  const props = __props;
11917
11910
  const search = ref("");
11918
- const lastSelectedValue = ref(null);
11911
+ ref(null);
11919
11912
  const value = computed({
11920
11913
  get() {
11921
11914
  return props.modelValue;
@@ -11926,7 +11919,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11926
11919
  emits("update:modelValue", val);
11927
11920
  }
11928
11921
  });
11929
- computed(() => {
11922
+ const filteredOptions = computed(() => {
11930
11923
  const list = props.options.filter((option) => {
11931
11924
  const name = getOptionName(option);
11932
11925
  return qmStr.checkContainsStr(name, search.value);
@@ -11935,10 +11928,10 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11935
11928
  });
11936
11929
  const computedClass = computed(() => {
11937
11930
  const classList2 = [];
11938
- classList2.push(functions$1.getGroupClass(this));
11931
+ classList2.push(functions$1.getGroupClass(props));
11939
11932
  return classList2;
11940
11933
  });
11941
- computed(() => {
11934
+ const computedStyle = computed(() => {
11942
11935
  const list = [];
11943
11936
  if (props.minWidth)
11944
11937
  list.push({ "min-width": props.minWidth });
@@ -11983,28 +11976,6 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11983
11976
  return props.modelValue === null;
11984
11977
  }
11985
11978
  });
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
11979
  const getOptionKey = (option) => {
12009
11980
  return realReduceFunction(option);
12010
11981
  };
@@ -12019,45 +11990,28 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
12019
11990
  return props.reduceFunction(option);
12020
11991
  };
12021
11992
  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) => {
11993
+ return openBlock(), createElementBlock("div", {
11994
+ class: "ck-select",
11995
+ style: normalizeStyle(unref(computedStyle))
11996
+ }, [
11997
+ withDirectives(createElementVNode("select", {
11998
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(value) ? value.value = $event : null),
11999
+ class: normalizeClass(unref(computedClass))
12000
+ }, [
12001
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredOptions), (option) => {
12049
12002
  return openBlock(), createElementBlock("option", {
12050
- onClick: ($event) => _ctx.onClickOption(option),
12051
- key: getOptionKey(option),
12052
- value: getOptionName(option)
12053
- }, null, 8, _hoisted_4$1);
12003
+ value: getOptionKey(option),
12004
+ key: option
12005
+ }, toDisplayString(getOptionName(option)), 9, _hoisted_1$9);
12054
12006
  }), 128))
12007
+ ], 2), [
12008
+ [vModelSelect, unref(value)]
12055
12009
  ])
12056
- ]);
12010
+ ], 4);
12057
12011
  };
12058
12012
  }
12059
12013
  });
12060
- var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-748b30c8"]]);
12014
+ var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-02ca0bce"]]);
12061
12015
  const _withScopeId = (n) => (pushScopeId("data-v-5251135b"), n = n(), popScopeId(), n);
12062
12016
  const _hoisted_1$8 = ["disabled"];
12063
12017
  const _hoisted_2$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));