cleek 2.1.20 → 2.1.21

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, ref, openBlock, createElementBlock, createElementVNode, renderSlot, normalizeClass, createCommentVNode, computed as computed$2, normalizeStyle, unref as unref$1, watch, h, createBlock, Teleport, createVNode, createTextVNode, toDisplayString, withCtx, onMounted, getCurrentInstance, withDirectives, isRef as isRef$1, vModelDynamic, Fragment, renderList, mergeProps, withKeys, withModifiers, pushScopeId, popScopeId, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
20
+ import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, renderSlot, normalizeClass, createCommentVNode, computed as computed$2, normalizeStyle, unref as unref$1, watch, h, createBlock, Teleport, createVNode, createTextVNode, toDisplayString, withCtx, onMounted, getCurrentInstance, withDirectives, isRef as isRef$1, vModelDynamic, Fragment, renderList, mergeProps, withKeys, withModifiers, pushScopeId, popScopeId, nextTick as nextTick$1, onBeforeUnmount, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
21
21
  var ckDropdown_vue_vue_type_style_index_0_scoped_true_lang = "";
22
22
  var _export_sfc = (sfc, props) => {
23
23
  const target = sfc.__vccOpts || sfc;
@@ -13275,7 +13275,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
13275
13275
  hideHeaderActions: { type: Boolean, default: false },
13276
13276
  showRefreshBtn: { type: Boolean, default: false },
13277
13277
  hideItemsPerPage: { type: Boolean, default: false },
13278
- notFullWidth: { type: Boolean, default: false }
13278
+ notFullWidth: { type: Boolean, default: false },
13279
+ mobileMaxWidth: { type: [Number, String], default: 800 }
13279
13280
  },
13280
13281
  emits: ["refreshList", "update:search", "update:currentPage"],
13281
13282
  setup(__props, { emit: emits }) {
@@ -13315,6 +13316,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
13315
13316
  emits("update:currentPage", val);
13316
13317
  }
13317
13318
  });
13319
+ const isMobileVisible = computed$2(() => {
13320
+ return realWindowWidth.value <= +props.mobileMaxWidth;
13321
+ });
13318
13322
  function refreshList(pageChange = false) {
13319
13323
  emits("refreshList", pageChange);
13320
13324
  }
@@ -13325,6 +13329,19 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
13325
13329
  console.log("ERROR ck-table", "The columns list should be an object");
13326
13330
  }
13327
13331
  }
13332
+ const realWindowWidth = ref(0);
13333
+ function handleWindowResize(event) {
13334
+ realWindowWidth.value = event.currentTarget.innerWidth;
13335
+ }
13336
+ onMounted(() => {
13337
+ nextTick$1(() => {
13338
+ window.addEventListener("resize", handleWindowResize);
13339
+ });
13340
+ realWindowWidth.value = window.innerWidth;
13341
+ });
13342
+ onBeforeUnmount(() => {
13343
+ window.removeEventListener("resize", handleWindowResize);
13344
+ });
13328
13345
  return (_ctx, _cache) => {
13329
13346
  return openBlock(), createElementBlock(Fragment, null, [
13330
13347
  __props.hasColumnsManager && unref$1(columnsAreObj) ? (openBlock(), createBlock(TableColumnsManager, {
@@ -13357,7 +13374,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
13357
13374
  createElementVNode("table", {
13358
13375
  class: normalizeClass(["ck-table__table", { "not-full-width": __props.notFullWidth }])
13359
13376
  }, [
13360
- unref$1(filteredColumnsList).length ? (openBlock(), createElementBlock("thead", _hoisted_5, [
13377
+ unref$1(filteredColumnsList).length && !(_ctx.$slots.mobile && unref$1(isMobileVisible)) ? (openBlock(), createElementBlock("thead", _hoisted_5, [
13361
13378
  createVNode(ckTr, null, {
13362
13379
  default: withCtx(() => [
13363
13380
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(filteredColumnsList), (col) => {
@@ -13371,7 +13388,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
13371
13388
  })
13372
13389
  ])) : createCommentVNode("", true),
13373
13390
  createElementVNode("tbody", null, [
13374
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
13391
+ renderSlot(_ctx.$slots, "default", {}, void 0, true),
13392
+ !unref$1(isMobileVisible) ? renderSlot(_ctx.$slots, "desktop", { key: 0 }, void 0, true) : createCommentVNode("", true),
13393
+ unref$1(isMobileVisible) ? renderSlot(_ctx.$slots, "mobile", { key: 1 }, void 0, true) : createCommentVNode("", true)
13375
13394
  ]),
13376
13395
  _ctx.$slots.footer ? (openBlock(), createElementBlock("tfoot", _hoisted_6, [
13377
13396
  renderSlot(_ctx.$slots, "footer", {}, void 0, true)
@@ -13392,7 +13411,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
13392
13411
  };
13393
13412
  }
13394
13413
  });
13395
- var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-160656a0"]]);
13414
+ var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-6ea45185"]]);
13396
13415
  var ckTd_vue_vue_type_style_index_0_scoped_true_lang = "";
13397
13416
  const _sfc_main$8 = /* @__PURE__ */ defineComponent({
13398
13417
  props: {