cleek 2.3.48 → 2.3.51

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
@@ -16859,7 +16859,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
16859
16859
  };
16860
16860
  }
16861
16861
  });
16862
- var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-400ea765"]]);
16862
+ var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-4a9527c9"]]);
16863
16863
  var ckInput_vue_vue_type_style_index_0_scoped_true_lang = "";
16864
16864
  const _hoisted_1$e = ["autocomplete", "type", "placeholder", "disabled"];
16865
16865
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
@@ -18008,7 +18008,7 @@ const computed = (getterOrOptions, debugOptions) => {
18008
18008
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
18009
18009
  };
18010
18010
  var ckCheckbox_vue_vue_type_style_index_0_scoped_true_lang = "";
18011
- const _withScopeId$2 = (n) => (pushScopeId("data-v-132565da"), n = n(), popScopeId(), n);
18011
+ const _withScopeId$2 = (n) => (pushScopeId("data-v-79b1a82b"), n = n(), popScopeId(), n);
18012
18012
  const _hoisted_1$b = ["disabled", "checked"];
18013
18013
  const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
18014
18014
  const _hoisted_3$4 = {
@@ -18072,7 +18072,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
18072
18072
  };
18073
18073
  }
18074
18074
  });
18075
- var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-132565da"]]);
18075
+ var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-79b1a82b"]]);
18076
18076
  var ckPopup_vue_vue_type_style_index_0_lang = "";
18077
18077
  const _hoisted_1$a = {
18078
18078
  key: 0,
@@ -18104,6 +18104,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
18104
18104
  notCloseBtn: { type: Boolean, default: false },
18105
18105
  notCloseByBg: { type: Boolean, default: false },
18106
18106
  preventCloseOnCancel: { type: Boolean, default: false },
18107
+ width: { type: String, default: void 0 },
18107
18108
  maxWidth: { type: String, default: void 0 }
18108
18109
  },
18109
18110
  emits: ["update:modelValue", "cancel", "accept"],
@@ -18121,6 +18122,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
18121
18122
  const list = [];
18122
18123
  if (props.maxWidth)
18123
18124
  list.push({ maxWidth: props.maxWidth });
18125
+ if (props.width)
18126
+ list.push({ width: props.width });
18124
18127
  return list;
18125
18128
  });
18126
18129
  function onCancel() {
@@ -18999,7 +19002,7 @@ const _hoisted_1$4 = ["disabled"];
18999
19002
  const _hoisted_2$2 = ["value"];
19000
19003
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
19001
19004
  props: {
19002
- modelValue: { default: null, type: [Boolean, Number, Object, Array, String] },
19005
+ modelValue: { default: null },
19003
19006
  prop: { type: String, default: void 0 },
19004
19007
  reduceValueProp: { type: String, default: "id" },
19005
19008
  reduceNameProp: { type: String, default: "name" },
@@ -19050,9 +19053,18 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
19050
19053
  });
19051
19054
  return list;
19052
19055
  });
19056
+ const isClearBtnVisible = computed$2(() => {
19057
+ if (props.notClearable)
19058
+ return false;
19059
+ if (valueIsDefault.value)
19060
+ return false;
19061
+ return true;
19062
+ });
19053
19063
  const computedClassSelect = computed$2(() => {
19054
19064
  const list = [];
19055
19065
  list.push(functions.getGroupClass(props, windowWidth.value));
19066
+ if (isClearBtnVisible.value)
19067
+ list.push("clear-able");
19056
19068
  return list;
19057
19069
  });
19058
19070
  const computedStyle = computed$2(() => {
@@ -19079,12 +19091,16 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
19079
19091
  return props.searchable;
19080
19092
  });
19081
19093
  const realClearValue = computed$2(() => {
19094
+ if (props.clearValue !== "auto")
19095
+ return props.clearValue;
19082
19096
  switch (typeof props.modelValue) {
19083
19097
  case "number":
19084
19098
  return 0;
19085
19099
  case "string":
19086
19100
  return "";
19087
19101
  case "object":
19102
+ if (!props.modelValue)
19103
+ return null;
19088
19104
  if (props.modelValue.constructor === Array)
19089
19105
  return [];
19090
19106
  return {};
@@ -19092,7 +19108,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
19092
19108
  return null;
19093
19109
  }
19094
19110
  });
19095
- computed$2(() => {
19111
+ const valueIsDefault = computed$2(() => {
19112
+ if (props.clearValue !== "auto")
19113
+ return value.value === props.clearValue;
19096
19114
  switch (typeof props.modelValue) {
19097
19115
  case "number":
19098
19116
  return props.modelValue === 0;
@@ -19136,8 +19154,15 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
19136
19154
  class: "ck-select",
19137
19155
  style: normalizeStyle(unref$1(computedStyle))
19138
19156
  }, [
19139
- __props.label ? (openBlock(), createBlock(ckLabel, {
19157
+ unref$1(isClearBtnVisible) ? (openBlock(), createElementBlock("div", {
19140
19158
  key: 0,
19159
+ class: "ck-select__clear-btn",
19160
+ onClick: _cache[0] || (_cache[0] = ($event) => value.value = unref$1(realClearValue))
19161
+ }, [
19162
+ createVNode(ckIcon, { icon: "times" })
19163
+ ])) : createCommentVNode("", true),
19164
+ __props.label ? (openBlock(), createBlock(ckLabel, {
19165
+ key: 1,
19141
19166
  align: __props.labelAlign,
19142
19167
  for: "ck-input"
19143
19168
  }, {
@@ -19147,11 +19172,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
19147
19172
  _: 1
19148
19173
  }, 8, ["align"])) : createCommentVNode("", true),
19149
19174
  withDirectives(createElementVNode("select", {
19150
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(value) ? value.value = $event : null),
19175
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef$1(value) ? value.value = $event : null),
19151
19176
  class: normalizeClass(unref$1(computedClassSelect)),
19152
19177
  disabled: __props.disabled,
19153
- onClick: _cache[1] || (_cache[1] = ($event) => onClick($event)),
19154
- onChange: _cache[2] || (_cache[2] = ($event) => onChange2($event))
19178
+ onClick: _cache[2] || (_cache[2] = ($event) => onClick($event)),
19179
+ onChange: _cache[3] || (_cache[3] = ($event) => onChange2($event))
19155
19180
  }, [
19156
19181
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(filteredOptions), (option) => {
19157
19182
  return openBlock(), createElementBlock("option", {
@@ -19166,7 +19191,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
19166
19191
  };
19167
19192
  }
19168
19193
  });
19169
- var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-7c5ab996"]]);
19194
+ var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-bf9787dc"]]);
19170
19195
  var ckSwitch_vue_vue_type_style_index_0_scoped_true_lang = "";
19171
19196
  const _withScopeId = (n) => (pushScopeId("data-v-7e2f20c4"), n = n(), popScopeId(), n);
19172
19197
  const _hoisted_1$3 = ["disabled"];