cleek 2.4.1 → 2.4.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 CHANGED
@@ -29,7 +29,7 @@ var __objRest = (source2, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
- import { pushScopeId, popScopeId, defineComponent, nextTick as nextTick$1, openBlock, createBlock, withScopeId, resolveComponent, createElementBlock, normalizeClass, normalizeStyle, withKeys, createElementVNode, Fragment, renderSlot, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h, toDisplayString, computed as computed$2, unref as unref$1, createTextVNode, watch, onMounted, onBeforeUnmount, getCurrentInstance, withDirectives, isRef as isRef$1, vModelDynamic, renderList, withModifiers, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
32
+ import { pushScopeId, popScopeId, defineComponent, nextTick as nextTick$1, openBlock, createBlock, withScopeId, resolveComponent, createElementBlock, normalizeClass, normalizeStyle, withKeys, createElementVNode, Fragment, renderSlot, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h, toDisplayString, computed as computed$2, unref as unref$1, createTextVNode, watch, onMounted, onBeforeUnmount, getCurrentInstance, withDirectives, isRef as isRef$1, vModelDynamic, renderList, withModifiers, vModelRadio, vModelSelect, vModelCheckbox, vModelText, Teleport } from "vue";
33
33
  function getBasePlacement(placement) {
34
34
  return placement.split("-")[0];
35
35
  }
@@ -23449,10 +23449,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
23449
23449
  });
23450
23450
  var CkConfirmComponent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-bc51fc7a"]]);
23451
23451
  var CkNotify_vue_vue_type_style_index_0_scoped_true_lang = "";
23452
- const _hoisted_1 = {
23453
- key: 0,
23454
- class: "ck-notify__container"
23455
- };
23452
+ const _hoisted_1 = { class: "ck-notify__container" };
23456
23453
  const _hoisted_2 = { class: "ck-notify__title" };
23457
23454
  const _hoisted_3 = { class: "close-btn" };
23458
23455
  const _hoisted_4 = { class: "ck-notify__text" };
@@ -23462,31 +23459,49 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23462
23459
  const title = ref("");
23463
23460
  const text2 = ref("");
23464
23461
  const color = ref("");
23462
+ const duration = ref(0);
23463
+ const closeCallback = ref(() => {
23464
+ });
23465
23465
  expose({
23466
23466
  title,
23467
23467
  text: text2,
23468
- color
23468
+ color,
23469
+ duration,
23470
+ closeCallback
23471
+ });
23472
+ onMounted(() => {
23473
+ setTimeout(() => {
23474
+ closeCallback.value();
23475
+ }, duration.value);
23469
23476
  });
23470
23477
  return (_ctx, _cache) => {
23471
- return isActive.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
23472
- createElementVNode("div", {
23473
- class: "ck-notify",
23474
- style: normalizeStyle({ "background-color": color.value }),
23475
- onClick: _cache[0] || (_cache[0] = ($event) => isActive.value = false)
23476
- }, [
23477
- createElementVNode("div", _hoisted_2, [
23478
- createElementVNode("div", _hoisted_3, [
23479
- createVNode(CkIcon, { icon: "times" })
23478
+ return isActive.value ? (openBlock(), createBlock(Teleport, {
23479
+ key: 0,
23480
+ to: "body"
23481
+ }, [
23482
+ createElementVNode("div", _hoisted_1, [
23483
+ createElementVNode("div", {
23484
+ class: "ck-notify",
23485
+ style: normalizeStyle({ "background-color": color.value }),
23486
+ onClick: _cache[0] || (_cache[0] = ($event) => {
23487
+ isActive.value = false;
23488
+ closeCallback.value();
23489
+ })
23490
+ }, [
23491
+ createElementVNode("div", _hoisted_2, [
23492
+ createElementVNode("div", _hoisted_3, [
23493
+ createVNode(CkIcon, { icon: "times" })
23494
+ ]),
23495
+ createTextVNode(toDisplayString(title.value), 1)
23480
23496
  ]),
23481
- createTextVNode(toDisplayString(title.value), 1)
23482
- ]),
23483
- createElementVNode("div", _hoisted_4, toDisplayString(text2.value), 1)
23484
- ], 4)
23497
+ createElementVNode("div", _hoisted_4, toDisplayString(text2.value), 1)
23498
+ ], 4)
23499
+ ])
23485
23500
  ])) : createCommentVNode("", true);
23486
23501
  };
23487
23502
  }
23488
23503
  });
23489
- var CkNotifyComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0d3144b1"]]);
23504
+ var CkNotifyComponent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-667c806b"]]);
23490
23505
  const defaultDuration = 2e3;
23491
23506
  var ckNotify = {
23492
23507
  confirm({
@@ -23521,11 +23536,10 @@ var ckNotify = {
23521
23536
  instance.title = title;
23522
23537
  instance.text = text2;
23523
23538
  instance.color = color;
23524
- console.log("duration", duration);
23525
- setTimeout(() => {
23539
+ instance.duration = duration;
23540
+ instance.closeCallback = () => {
23526
23541
  instance.$el.remove();
23527
- console.log("cierro");
23528
- }, duration);
23542
+ };
23529
23543
  },
23530
23544
  notifySuccess(text2 = "", title = "\xC9xito") {
23531
23545
  this.notify({ text: text2, title, color: "#66CC00" });