cleek 2.0.3 → 2.0.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
@@ -74,8 +74,10 @@ var functions$1 = {
74
74
  return true;
75
75
  return false;
76
76
  },
77
- isTableColumnsVisible(col) {
78
- return !col.isHidden;
77
+ isColumnDisplayed(column) {
78
+ if (column.isDisplayed === false)
79
+ return false;
80
+ return true;
79
81
  },
80
82
  getCleekOptions(getCurrentInstance2) {
81
83
  return getCurrentInstance2().appContext.app.config.globalProperties.$cleekOptions;
@@ -83,7 +85,7 @@ var functions$1 = {
83
85
  };
84
86
  var globalVariables = {
85
87
  defaultFailImg: "df",
86
- imagesFolderPath: "asd",
88
+ imagesFolderPath: "",
87
89
  defaultImgBorderColor: "#EEEEEE"
88
90
  };
89
91
  /*!
@@ -11205,7 +11207,7 @@ defineComponent({
11205
11207
  };
11206
11208
  }
11207
11209
  });
11208
- function render$d(_ctx, _cache, $props, $setup, $data, $options) {
11210
+ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
11209
11211
  const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
11210
11212
  return openBlock(), createElementBlock("div", {
11211
11213
  class: normalizeClass(["ck-icon", $options.computedClass]),
@@ -11234,7 +11236,7 @@ var _export_sfc = (sfc, props) => {
11234
11236
  }
11235
11237
  return target;
11236
11238
  };
11237
- const _sfc_main$j = {
11239
+ const _sfc_main$k = {
11238
11240
  name: "CkIcon",
11239
11241
  components: {
11240
11242
  FontAwesomeIcon
@@ -11281,9 +11283,9 @@ const _sfc_main$j = {
11281
11283
  }
11282
11284
  }
11283
11285
  };
11284
- var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$d], ["__scopeId", "data-v-77d9963a"]]);
11285
- const _hoisted_1$g = ["title", "aria-label", "disabled"];
11286
- function render$c(_ctx, _cache, $props, $setup, $data, $options) {
11286
+ var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", render$b], ["__scopeId", "data-v-77d9963a"]]);
11287
+ const _hoisted_1$h = ["title", "aria-label", "disabled"];
11288
+ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
11287
11289
  const _component_ck_icon = resolveComponent("ck-icon");
11288
11290
  return openBlock(), createElementBlock("button", {
11289
11291
  type: "button",
@@ -11306,13 +11308,13 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
11306
11308
  icon: $props.iconRight,
11307
11309
  "icon-pack": $props.iconPack
11308
11310
  }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true)
11309
- ], 10, _hoisted_1$g);
11311
+ ], 10, _hoisted_1$h);
11310
11312
  }
11311
11313
  var ckButton_vue_vue_type_style_index_0_scoped_true_lang = "";
11312
11314
  const defaultType = "outlined";
11313
11315
  const defaultColor = "primary";
11314
11316
  const defaultAlign = "left";
11315
- const _sfc_main$i = {
11317
+ const _sfc_main$j = {
11316
11318
  name: "CkButton",
11317
11319
  components: {
11318
11320
  ckIcon
@@ -11366,15 +11368,15 @@ const _sfc_main$i = {
11366
11368
  }
11367
11369
  }
11368
11370
  };
11369
- var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$c], ["__scopeId", "data-v-a687842a"]]);
11371
+ var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$a], ["__scopeId", "data-v-a687842a"]]);
11370
11372
  const _withScopeId$2 = (n) => (pushScopeId("data-v-69dfa524"), n = n(), popScopeId(), n);
11371
- const _hoisted_1$f = ["disabled", "checked"];
11372
- const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
11373
+ const _hoisted_1$g = ["disabled", "checked"];
11374
+ const _hoisted_2$8 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
11373
11375
  const _hoisted_3$5 = {
11374
11376
  key: 0,
11375
11377
  class: "c-Checkbox__label"
11376
11378
  };
11377
- function render$b(_ctx, _cache, $props, $setup, $data, $options) {
11379
+ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
11378
11380
  return openBlock(), createElementBlock("label", mergeProps({ class: "ck-checkbox" }, $options.checkboxAttributes, {
11379
11381
  onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
11380
11382
  }, ["prevent"]), ["space"])),
@@ -11393,15 +11395,15 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
11393
11395
  $options.value = $event.target.checked;
11394
11396
  $options.onChange($event);
11395
11397
  })
11396
- }, null, 40, _hoisted_1$f),
11397
- _hoisted_2$7,
11398
+ }, null, 40, _hoisted_1$g),
11399
+ _hoisted_2$8,
11398
11400
  _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$5, [
11399
11401
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
11400
11402
  ])) : createCommentVNode("", true)
11401
11403
  ], 16);
11402
11404
  }
11403
11405
  var ckCheckbox_vue_vue_type_style_index_0_scoped_true_lang = "";
11404
- const _sfc_main$h = {
11406
+ const _sfc_main$i = {
11405
11407
  name: "CkCheckbox",
11406
11408
  props: {
11407
11409
  modelValue: { type: Boolean, default: false },
@@ -11434,14 +11436,15 @@ const _sfc_main$h = {
11434
11436
  }
11435
11437
  }
11436
11438
  };
11437
- var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$b], ["__scopeId", "data-v-69dfa524"]]);
11439
+ var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$9], ["__scopeId", "data-v-69dfa524"]]);
11438
11440
  var ckImg_vue_vue_type_style_index_0_scoped_true_lang = "";
11439
- const _hoisted_1$e = ["src"];
11440
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
11441
+ const _hoisted_1$f = ["src", "alt"];
11442
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11441
11443
  props: {
11442
11444
  src: { type: String, default: "" },
11443
11445
  isFullPath: { type: Boolean, default: false },
11444
11446
  failImgSrc: { type: String, default: "" },
11447
+ alt: { type: String, default: "" },
11445
11448
  size: { type: String, default: "", validator: validators.size },
11446
11449
  sizeAbsolute: { type: String, default: "" },
11447
11450
  width: { type: String, default: "" },
@@ -11518,8 +11521,10 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11518
11521
  function getImg(src) {
11519
11522
  let path = "";
11520
11523
  const $cleekOptions = functions$1.getCleekOptions(getCurrentInstance);
11521
- if ($cleekOptions)
11522
- path = $cleekOptions.imgPath;
11524
+ if ($cleekOptions) {
11525
+ if ($cleekOptions.imgPath)
11526
+ path = $cleekOptions.imgPath;
11527
+ }
11523
11528
  return `${path}${src}`;
11524
11529
  }
11525
11530
  onMounted(() => {
@@ -11535,24 +11540,25 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11535
11540
  createElementVNode("img", {
11536
11541
  src: unref(imageUrl),
11537
11542
  style: normalizeStyle(unref(computedImgStyle)),
11543
+ alt: __props.alt,
11538
11544
  onError: _cache[0] || (_cache[0] = ($event) => altNeeded.value = true)
11539
- }, null, 44, _hoisted_1$e)
11545
+ }, null, 44, _hoisted_1$f)
11540
11546
  ], 6);
11541
11547
  };
11542
11548
  }
11543
11549
  });
11544
- var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-b201891c"]]);
11545
- const _hoisted_1$d = ["for"];
11546
- function render$a(_ctx, _cache, $props, $setup, $data, $options) {
11550
+ var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-53d78f2e"]]);
11551
+ const _hoisted_1$e = ["for"];
11552
+ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
11547
11553
  return openBlock(), createElementBlock("label", {
11548
11554
  class: normalizeClass(["ck-label", $options.computedClass]),
11549
11555
  for: $props.for
11550
11556
  }, [
11551
11557
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
11552
- ], 10, _hoisted_1$d);
11558
+ ], 10, _hoisted_1$e);
11553
11559
  }
11554
11560
  var ckLabel_vue_vue_type_style_index_0_scoped_true_lang = "";
11555
- const _sfc_main$f = {
11561
+ const _sfc_main$g = {
11556
11562
  name: "CkLabel",
11557
11563
  props: {
11558
11564
  for: { type: String, default: "" },
@@ -11569,11 +11575,11 @@ const _sfc_main$f = {
11569
11575
  }
11570
11576
  }
11571
11577
  };
11572
- var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", render$a], ["__scopeId", "data-v-4b8b9ab4"]]);
11578
+ var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", render$8], ["__scopeId", "data-v-4b8b9ab4"]]);
11573
11579
  var ckInput_vue_vue_type_style_index_0_scoped_true_lang = "";
11574
- const _hoisted_1$c = { class: "ck-input" };
11575
- const _hoisted_2$6 = ["type", "placeholder", "id", "disabled"];
11576
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
11580
+ const _hoisted_1$d = { class: "ck-input" };
11581
+ const _hoisted_2$7 = ["type", "placeholder", "id", "disabled"];
11582
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11577
11583
  props: {
11578
11584
  modelValue: {},
11579
11585
  type: { type: String, validator: validators.inputType, default: "text" },
@@ -11634,7 +11640,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11634
11640
  return list;
11635
11641
  });
11636
11642
  return (_ctx, _cache) => {
11637
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
11643
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
11638
11644
  __props.label ? (openBlock(), createBlock(ckLabel, {
11639
11645
  key: 0,
11640
11646
  align: __props.labelAlign,
@@ -11663,7 +11669,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11663
11669
  onChange: _cache[1] || (_cache[1] = ($event) => onChange($event)),
11664
11670
  onInput: _cache[2] || (_cache[2] = ($event) => onInput($event)),
11665
11671
  onClick: _cache[3] || (_cache[3] = ($event) => onClick($event))
11666
- }, null, 46, _hoisted_2$6), [
11672
+ }, null, 46, _hoisted_2$7), [
11667
11673
  [vModelDynamic, unref(value)]
11668
11674
  ]),
11669
11675
  __props.iconRight ? (openBlock(), createBlock(ckIcon, {
@@ -11677,13 +11683,13 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11677
11683
  };
11678
11684
  }
11679
11685
  });
11680
- var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-61fababc"]]);
11686
+ var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-61fababc"]]);
11681
11687
  var ckPopup_vue_vue_type_style_index_0_lang = "";
11682
- const _hoisted_1$b = {
11688
+ const _hoisted_1$c = {
11683
11689
  key: 0,
11684
11690
  class: "ck-popup"
11685
11691
  };
11686
- const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("div", { class: "blackout" }, null, -1);
11692
+ const _hoisted_2$6 = /* @__PURE__ */ createElementVNode("div", { class: "blackout" }, null, -1);
11687
11693
  const _hoisted_3$4 = { class: "ck-popup__slot-header" };
11688
11694
  const _hoisted_4$2 = {
11689
11695
  key: 0,
@@ -11736,11 +11742,11 @@ const __default__$1 = {
11736
11742
  }
11737
11743
  }
11738
11744
  };
11739
- const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
11745
+ const _sfc_main$e = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
11740
11746
  setup(__props) {
11741
11747
  return (_ctx, _cache) => {
11742
- return _ctx.value ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
11743
- _hoisted_2$5,
11748
+ return _ctx.value ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
11749
+ _hoisted_2$6,
11744
11750
  createElementVNode("div", {
11745
11751
  class: "popup-container",
11746
11752
  onClick: _cache[4] || (_cache[4] = ($event) => _ctx.onBgClick())
@@ -11793,14 +11799,14 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
11793
11799
  }
11794
11800
  }));
11795
11801
  const _withScopeId$1 = (n) => (pushScopeId("data-v-73a891e8"), n = n(), popScopeId(), n);
11796
- const _hoisted_1$a = ["onKeyup"];
11797
- const _hoisted_2$4 = ["name", "value", "disabled"];
11802
+ const _hoisted_1$b = ["onKeyup"];
11803
+ const _hoisted_2$5 = ["name", "value", "disabled"];
11798
11804
  const _hoisted_3$3 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", { class: "c-Radio__element" }, null, -1));
11799
11805
  const _hoisted_4$1 = {
11800
11806
  key: 0,
11801
11807
  class: "c-Radio__label"
11802
11808
  };
11803
- function render$9(_ctx, _cache, $props, $setup, $data, $options) {
11809
+ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
11804
11810
  return openBlock(true), createElementBlock(Fragment, null, renderList($props.options, (item, index) => {
11805
11811
  return openBlock(), createElementBlock("label", mergeProps({
11806
11812
  key: `radio-${index}`,
@@ -11821,16 +11827,16 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
11821
11827
  name: $props.name,
11822
11828
  value: item.value,
11823
11829
  disabled: $props.disabled
11824
- }, null, 8, _hoisted_2$4), [
11830
+ }, null, 8, _hoisted_2$5), [
11825
11831
  [vModelRadio, $options.value]
11826
11832
  ]),
11827
11833
  _hoisted_3$3,
11828
11834
  item.label ? (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString(item.label), 1)) : createCommentVNode("", true)
11829
- ], 16, _hoisted_1$a);
11835
+ ], 16, _hoisted_1$b);
11830
11836
  }), 128);
11831
11837
  }
11832
11838
  var ckRadio_vue_vue_type_style_index_0_scoped_true_lang = "";
11833
- const _sfc_main$c = {
11839
+ const _sfc_main$d = {
11834
11840
  name: "CkRadio",
11835
11841
  props: {
11836
11842
  modelValue: { type: String, default: void 0 },
@@ -11862,7 +11868,100 @@ const _sfc_main$c = {
11862
11868
  }
11863
11869
  }
11864
11870
  };
11865
- var ckRadio = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", render$9], ["__scopeId", "data-v-73a891e8"]]);
11871
+ var ckRadio = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", render$7], ["__scopeId", "data-v-73a891e8"]]);
11872
+ var qmApi = {};
11873
+ var qmArray = {
11874
+ arrayToText(arr, key = null) {
11875
+ let msg = "";
11876
+ for (let index = 0; index < arr.length; index++) {
11877
+ if (index) {
11878
+ if (index === arr.length - 1) {
11879
+ msg += " y ";
11880
+ } else {
11881
+ msg += ", ";
11882
+ }
11883
+ }
11884
+ let word;
11885
+ if (key) {
11886
+ word = arr[index][key];
11887
+ } else {
11888
+ word = arr[index];
11889
+ }
11890
+ msg += `"${word}"`;
11891
+ }
11892
+ return msg;
11893
+ },
11894
+ getRandomElementOfArray(arr) {
11895
+ return arr[Math.floor(Math.random() * arr.length)];
11896
+ },
11897
+ hexToRGBA(hex, alpha) {
11898
+ const r = parseInt(hex.slice(1, 3), 16);
11899
+ const g = parseInt(hex.slice(3, 5), 16);
11900
+ const b = parseInt(hex.slice(5, 7), 16);
11901
+ if (alpha)
11902
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
11903
+ return `rgb(${r}, ${g}, ${b})`;
11904
+ },
11905
+ removeOfArray(list, findFunction) {
11906
+ if (!list || !findFunction)
11907
+ return;
11908
+ const index = list.findIndex(findFunction);
11909
+ if (index === -1)
11910
+ return;
11911
+ list.splice(index, 1);
11912
+ },
11913
+ removeOfArrayById(list, id) {
11914
+ const index = list.findIndex((i) => i.id === id);
11915
+ if (index === -1)
11916
+ return;
11917
+ list.splice(index, 1);
11918
+ },
11919
+ replaceInList(arr, NewItem, prop = "id") {
11920
+ if (!NewItem)
11921
+ return;
11922
+ const index = arr.findIndex((i) => i[prop] === NewItem[prop]);
11923
+ if (index !== -1)
11924
+ arr.splice(index, 1, NewItem);
11925
+ },
11926
+ sort(arr, keys) {
11927
+ if (typeof keys === "string")
11928
+ keys = [keys];
11929
+ if (keys.length === 2) {
11930
+ if (keys[1] === "DESC" || keys[1] === "ASC") {
11931
+ keys = [keys];
11932
+ }
11933
+ }
11934
+ const finalKeys = [];
11935
+ keys.forEach((key) => {
11936
+ if (typeof key === "string")
11937
+ key = [key];
11938
+ if (typeof key[1] === "undefined")
11939
+ key[1] = "ASC";
11940
+ finalKeys.push(key);
11941
+ });
11942
+ return arr.sort((a, b) => {
11943
+ let value = 0;
11944
+ finalKeys.forEach(([key, order2]) => {
11945
+ if (!value) {
11946
+ const mult = order2 === "DESC" ? -1 : 1;
11947
+ if (a[key] < b[key])
11948
+ value = -1 * mult;
11949
+ if (a[key] > b[key])
11950
+ value = 1 * mult;
11951
+ }
11952
+ });
11953
+ return value;
11954
+ });
11955
+ }
11956
+ };
11957
+ var qmAudio = {
11958
+ reproduceAudio(path) {
11959
+ if (path) {
11960
+ const audio = new Audio(path);
11961
+ audio.play();
11962
+ }
11963
+ }
11964
+ };
11866
11965
  const qmStr = {
11867
11966
  capitalize(str) {
11868
11967
  return str.charAt(0).toUpperCase() + str.slice(1);
@@ -11880,6 +11979,15 @@ const qmStr = {
11880
11979
  str = str.toLowerCase();
11881
11980
  return str;
11882
11981
  },
11982
+ getRandomStr(length = 10) {
11983
+ let result = "";
11984
+ const characters = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz123456789";
11985
+ const charactersLength = characters.length;
11986
+ for (let i = 0; i < length; i++) {
11987
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
11988
+ }
11989
+ return result;
11990
+ },
11883
11991
  padZeros(num, size = 2) {
11884
11992
  return `000000000${num}`.substr(-size);
11885
11993
  },
@@ -11899,9 +12007,146 @@ const qmStr = {
11899
12007
  return joinArray;
11900
12008
  }
11901
12009
  };
12010
+ var qmNum = {
12011
+ getRandomInt(min2, max2) {
12012
+ min2 = Math.ceil(min2);
12013
+ max2 = Math.floor(max2);
12014
+ return Math.floor(Math.random() * (max2 - min2 + 1)) + min2;
12015
+ },
12016
+ setPrice(num, { precision = 2 } = {}) {
12017
+ if (!num)
12018
+ return 0;
12019
+ return +parseFloat(num).toFixed(precision);
12020
+ },
12021
+ presentNum(num, forceDecimal = false) {
12022
+ num = +num;
12023
+ let finalInt = "0";
12024
+ let decimal = "00";
12025
+ const isNegative = num < 0;
12026
+ const isValidNum = !(!num || !+num);
12027
+ if (isValidNum) {
12028
+ num = parseFloat(Math.abs(num)).toFixed(2);
12029
+ decimal = num.substring(num.length - 2, num.length);
12030
+ const int = num.substring(0, num.length - 3);
12031
+ const reversedInt = qmStr.reverseString(int);
12032
+ let reversedRealInt = "";
12033
+ for (let i = 0; i < reversedInt.length; i++) {
12034
+ reversedRealInt += reversedInt.charAt(i);
12035
+ if (i + 1 >= reversedInt.length)
12036
+ continue;
12037
+ if ((i + 1) % 3)
12038
+ continue;
12039
+ reversedRealInt += ".";
12040
+ }
12041
+ finalInt = qmStr.reverseString(reversedRealInt);
12042
+ }
12043
+ let finalValue = finalInt;
12044
+ if (isNegative)
12045
+ finalValue = `-${finalValue}`;
12046
+ if (forceDecimal || +decimal) {
12047
+ finalValue = `${finalValue},${decimal}`;
12048
+ }
12049
+ return finalValue;
12050
+ },
12051
+ removeNoNumber(str, isFloat = false) {
12052
+ let newStr = "";
12053
+ str = str.toString();
12054
+ for (let i = 0; i < str.length; i++) {
12055
+ if (str[i] == parseInt(str[i], 10)) {
12056
+ newStr += str[i];
12057
+ } else if (isFloat && str[i] == "," || isFloat && str[i] == ".") {
12058
+ newStr += ".";
12059
+ isFloat = false;
12060
+ }
12061
+ }
12062
+ return newStr;
12063
+ },
12064
+ showPrice(num, Extra = { hideIcon: false, currency: "$" }) {
12065
+ if (Extra.hideIcon !== true)
12066
+ Extra.hideIcon = false;
12067
+ let presentedNum = this.presentNum(num, true);
12068
+ const isNegative = presentedNum[0] === "-";
12069
+ if (isNegative)
12070
+ presentedNum = presentedNum.substring(1, presentedNum.length);
12071
+ if (!Extra.hideIcon)
12072
+ presentedNum = `${Extra.currency}${presentedNum}`;
12073
+ if (isNegative)
12074
+ presentedNum = `- ${presentedNum}`;
12075
+ return presentedNum;
12076
+ },
12077
+ simplifyNum(num) {
12078
+ if (!(num % 1))
12079
+ return Math.floor(num);
12080
+ return this.presentNum(num);
12081
+ }
12082
+ };
12083
+ function getKeyValue(obj, key) {
12084
+ return obj[key];
12085
+ }
12086
+ function setKeyValue(obj, key, value) {
12087
+ obj[key] = value;
12088
+ }
12089
+ var qmObj = {
12090
+ addEmptyOptionToList(optionsList, { prop = "name", title = "Todos", noneId = 0 } = {}) {
12091
+ const noneOption = {
12092
+ id: noneId,
12093
+ [prop]: title
12094
+ };
12095
+ const newList = [...optionsList];
12096
+ newList.unshift(noneOption);
12097
+ return newList;
12098
+ },
12099
+ copyAvaibleFields(ObjEditable, ObjToCopy) {
12100
+ for (const key in ObjEditable) {
12101
+ if (typeof getKeyValue(ObjToCopy, key) !== "undefined") {
12102
+ setKeyValue(ObjEditable, key, getKeyValue(ObjToCopy, key));
12103
+ }
12104
+ }
12105
+ },
12106
+ isArray(obj) {
12107
+ return obj.constructor === Array;
12108
+ },
12109
+ objsAreTheSame(obj1, obj2) {
12110
+ for (const key in obj1) {
12111
+ if (getKeyValue(obj1, key) != getKeyValue(obj2, key))
12112
+ return false;
12113
+ }
12114
+ for (const key in obj2) {
12115
+ if (getKeyValue(obj1, key) != getKeyValue(obj2, key))
12116
+ return false;
12117
+ }
12118
+ return true;
12119
+ },
12120
+ qoIsObjEmpty(obj = {}) {
12121
+ return obj && Object.keys(obj).length === 0 && Object.getPrototypeOf(obj) === Object.prototype;
12122
+ }
12123
+ };
12124
+ var main$1 = {
12125
+ qmApi,
12126
+ qmArray,
12127
+ qmAudio,
12128
+ qmNum,
12129
+ qmObj,
12130
+ qmStr
12131
+ };
12132
+ var App;
12133
+ (function(App2) {
12134
+ class SomeClass {
12135
+ getName() {
12136
+ return "name";
12137
+ }
12138
+ }
12139
+ App2.SomeClass = SomeClass;
12140
+ class OtherClass {
12141
+ getName() {
12142
+ return "name";
12143
+ }
12144
+ }
12145
+ App2.OtherClass = OtherClass;
12146
+ })(App || (App = {}));
11902
12147
  var ckSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
11903
- const _hoisted_1$9 = ["value"];
11904
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
12148
+ const _hoisted_1$a = ["value"];
12149
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
11905
12150
  props: {
11906
12151
  modelValue: { default: null, type: [Boolean, Number, Object, Array, String] },
11907
12152
  prop: { type: String, default: "name" },
@@ -11926,6 +12171,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11926
12171
  emits: ["update:modelValue", "click", "change"],
11927
12172
  setup(__props, { emit: emits }) {
11928
12173
  const props = __props;
12174
+ const { qmStr: qmStr2 } = main$1;
11929
12175
  const search = ref("");
11930
12176
  ref(null);
11931
12177
  const value = computed({
@@ -11941,7 +12187,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11941
12187
  const filteredOptions = computed(() => {
11942
12188
  const list = props.options.filter((option) => {
11943
12189
  const name = getOptionName(option);
11944
- return qmStr.checkContainsStr(name, search.value);
12190
+ return qmStr2.checkContainsStr(name, search.value);
11945
12191
  });
11946
12192
  return list;
11947
12193
  });
@@ -12039,7 +12285,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
12039
12285
  return openBlock(), createElementBlock("option", {
12040
12286
  value: getOptionKey(option),
12041
12287
  key: option
12042
- }, toDisplayString(getOptionName(option)), 9, _hoisted_1$9);
12288
+ }, toDisplayString(getOptionName(option)), 9, _hoisted_1$a);
12043
12289
  }), 128))
12044
12290
  ], 34), [
12045
12291
  [vModelSelect, unref(value)]
@@ -12048,15 +12294,15 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
12048
12294
  };
12049
12295
  }
12050
12296
  });
12051
- var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-02fab5ba"]]);
12297
+ var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-31af160a"]]);
12052
12298
  const _withScopeId = (n) => (pushScopeId("data-v-022b9f3c"), n = n(), popScopeId(), n);
12053
- const _hoisted_1$8 = ["disabled"];
12054
- const _hoisted_2$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
12299
+ const _hoisted_1$9 = ["disabled"];
12300
+ const _hoisted_2$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
12055
12301
  const _hoisted_3$2 = {
12056
12302
  key: 0,
12057
12303
  class: "ck-switch__content"
12058
12304
  };
12059
- function render$8(_ctx, _cache, $props, $setup, $data, $options) {
12305
+ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
12060
12306
  return openBlock(), createElementBlock("label", mergeProps({ class: "ck-switch" }, $options.computedAttributes, {
12061
12307
  class: $options.computedClass,
12062
12308
  onKeydown: _cache[2] || (_cache[2] = withKeys(withModifiers(() => {
@@ -12073,17 +12319,17 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
12073
12319
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.value = $event),
12074
12320
  disabled: $props.disabled,
12075
12321
  onClick: _cache[1] || (_cache[1] = ($event) => $options.onTrigger())
12076
- }, null, 8, _hoisted_1$8), [
12322
+ }, null, 8, _hoisted_1$9), [
12077
12323
  [vModelCheckbox, $options.value]
12078
12324
  ]),
12079
- _hoisted_2$3,
12325
+ _hoisted_2$4,
12080
12326
  _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$2, [
12081
12327
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
12082
12328
  ])) : createCommentVNode("", true)
12083
12329
  ], 16);
12084
12330
  }
12085
12331
  var ckSwitch_vue_vue_type_style_index_0_scoped_true_lang = "";
12086
- const _sfc_main$a = {
12332
+ const _sfc_main$b = {
12087
12333
  name: "Switch",
12088
12334
  props: {
12089
12335
  modelValue: { type: Boolean, default: false },
@@ -12122,12 +12368,12 @@ const _sfc_main$a = {
12122
12368
  }
12123
12369
  }
12124
12370
  };
12125
- var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$8], ["__scopeId", "data-v-022b9f3c"]]);
12126
- const _hoisted_1$7 = { class: "ck-switch-options__container-exterior" };
12127
- const _hoisted_2$2 = ["onClick"];
12128
- function render$7(_ctx, _cache, $props, $setup, $data, $options) {
12371
+ var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", render$6], ["__scopeId", "data-v-022b9f3c"]]);
12372
+ const _hoisted_1$8 = { class: "ck-switch-options__container-exterior" };
12373
+ const _hoisted_2$3 = ["onClick"];
12374
+ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
12129
12375
  const _component_ck_label = resolveComponent("ck-label");
12130
- return openBlock(), createElementBlock("div", _hoisted_1$7, [
12376
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
12131
12377
  $props.label ? (openBlock(), createBlock(_component_ck_label, {
12132
12378
  key: 0,
12133
12379
  align: $props.labelAlign
@@ -12146,13 +12392,13 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
12146
12392
  key: `ck-switch-options${index}`,
12147
12393
  style: normalizeStyle($options.computedItemStyle),
12148
12394
  onClick: ($event) => $options.selectedOption = $options.getOptionValue(Option)
12149
- }, toDisplayString(Option[$props.prop]), 15, _hoisted_2$2);
12395
+ }, toDisplayString(Option[$props.prop]), 15, _hoisted_2$3);
12150
12396
  }), 128))
12151
12397
  ], 2)
12152
12398
  ]);
12153
12399
  }
12154
12400
  var ckSwitchOptions_vue_vue_type_style_index_0_scoped_true_lang = "";
12155
- const _sfc_main$9 = {
12401
+ const _sfc_main$a = {
12156
12402
  components: {
12157
12403
  ckLabel
12158
12404
  },
@@ -12200,19 +12446,19 @@ const _sfc_main$9 = {
12200
12446
  }
12201
12447
  }
12202
12448
  };
12203
- var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$7], ["__scopeId", "data-v-f0c51430"]]);
12204
- const _hoisted_1$6 = { class: "ck-tr" };
12205
- function render$6(_ctx, _cache) {
12206
- return openBlock(), createElementBlock("tr", _hoisted_1$6, [
12449
+ var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$5], ["__scopeId", "data-v-f0c51430"]]);
12450
+ const _hoisted_1$7 = { class: "ck-tr" };
12451
+ function render$4(_ctx, _cache) {
12452
+ return openBlock(), createElementBlock("tr", _hoisted_1$7, [
12207
12453
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
12208
12454
  ]);
12209
12455
  }
12210
12456
  var ckTr_vue_vue_type_style_index_0_scoped_true_lang = "";
12211
- const _sfc_main$8 = {};
12212
- var ckTr = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", render$6], ["__scopeId", "data-v-1dd12190"]]);
12213
- const _hoisted_1$5 = { class: "ck-th" };
12214
- function render$5(_ctx, _cache, $props, $setup, $data, $options) {
12215
- return openBlock(), createElementBlock("th", _hoisted_1$5, [
12457
+ const _sfc_main$9 = {};
12458
+ var ckTr = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$4], ["__scopeId", "data-v-1dd12190"]]);
12459
+ const _hoisted_1$6 = { class: "ck-th" };
12460
+ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
12461
+ return openBlock(), createElementBlock("th", _hoisted_1$6, [
12216
12462
  createElementVNode("span", {
12217
12463
  class: normalizeClass($options.computedSpanClass),
12218
12464
  style: normalizeStyle($options.computedStyle)
@@ -12222,7 +12468,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
12222
12468
  ]);
12223
12469
  }
12224
12470
  var ckTh_vue_vue_type_style_index_0_scoped_true_lang = "";
12225
- const _sfc_main$7 = {
12471
+ const _sfc_main$8 = {
12226
12472
  props: {
12227
12473
  align: { type: String, default: "center", validator: validators.align },
12228
12474
  minWidth: { type: String, default: void 0 }
@@ -12243,46 +12489,38 @@ const _sfc_main$7 = {
12243
12489
  }
12244
12490
  }
12245
12491
  };
12246
- var ckTh = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", render$5], ["__scopeId", "data-v-e9943550"]]);
12247
- function render$4(_ctx, _cache, $props, $setup, $data, $options) {
12248
- const _component_ck_th = resolveComponent("ck-th");
12249
- return $options.isVisible ? (openBlock(), createBlock(_component_ck_th, {
12250
- key: 0,
12251
- align: $props.col.align,
12252
- "min-width": $props.col.minWidth
12253
- }, {
12254
- default: withCtx(() => [
12255
- createTextVNode(toDisplayString($props.col.title), 1)
12256
- ]),
12257
- _: 1
12258
- }, 8, ["align", "min-width"])) : createCommentVNode("", true);
12259
- }
12260
- const _sfc_main$6 = {
12261
- components: {
12262
- ckTh
12263
- },
12492
+ var ckTh = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", render$3], ["__scopeId", "data-v-e9943550"]]);
12493
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
12264
12494
  props: {
12265
12495
  col: { type: Object, required: true }
12266
12496
  },
12267
- computed: {
12268
- isVisible() {
12269
- return functions$1.isTableColumnsVisible(this.col);
12270
- }
12497
+ setup(__props) {
12498
+ return (_ctx, _cache) => {
12499
+ return openBlock(), createBlock(ckTh, {
12500
+ align: __props.col.align,
12501
+ "min-width": __props.col.minWidth
12502
+ }, {
12503
+ default: withCtx(() => [
12504
+ createTextVNode(toDisplayString(__props.col.title), 1)
12505
+ ]),
12506
+ _: 1
12507
+ }, 8, ["align", "min-width"]);
12508
+ };
12271
12509
  }
12272
- };
12273
- var ckTableTitle = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", render$4]]);
12510
+ });
12274
12511
  var ckTable__headerItems_vue_vue_type_style_index_0_scoped_true_lang = "";
12275
- const _hoisted_1$4 = { class: "ck-table__header-items" };
12276
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
12512
+ const _hoisted_1$5 = { class: "ck-table__header-items" };
12513
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
12277
12514
  props: {
12278
12515
  search: { type: String, default: void 0 },
12516
+ hasColumnManager: { type: Boolean, default: false },
12279
12517
  hideRefreshBtn: { type: Boolean, required: true },
12280
12518
  hideItemsPerPage: { type: Boolean, required: true },
12281
12519
  currentPage: { type: Number, required: true },
12282
12520
  itemsPerPage: { type: Number, required: true },
12283
12521
  listLength: { type: Number, required: true }
12284
12522
  },
12285
- emits: ["update:search", "refreshList"],
12523
+ emits: ["update:search", "refreshList", "openColumnsManager"],
12286
12524
  setup(__props, { emit: emits }) {
12287
12525
  const props = __props;
12288
12526
  const searchLocal = computed({
@@ -12305,6 +12543,19 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
12305
12543
  return props.listLength;
12306
12544
  return value;
12307
12545
  });
12546
+ const itemsPerPageIsVisible = computed(() => {
12547
+ return !props.hideItemsPerPage && props.listLength;
12548
+ });
12549
+ const searchGroupValue = computed(() => {
12550
+ if (itemsPerPageIsVisible.value && props.hasColumnManager) {
12551
+ return "center";
12552
+ }
12553
+ if (itemsPerPageIsVisible.value)
12554
+ return "right";
12555
+ if (props.hasColumnManager)
12556
+ return "left";
12557
+ return "";
12558
+ });
12308
12559
  function checkRefresh() {
12309
12560
  const search = searchLocal.value;
12310
12561
  setTimeout(() => {
@@ -12314,14 +12565,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
12314
12565
  }, 1e3);
12315
12566
  }
12316
12567
  return (_ctx, _cache) => {
12317
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
12568
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
12318
12569
  !__props.hideRefreshBtn ? (openBlock(), createBlock(ckButton, {
12319
12570
  key: 0,
12320
12571
  type: "flat",
12321
12572
  icon: "redo-alt",
12573
+ title: "Recargar lista",
12322
12574
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("refreshList", false))
12323
12575
  })) : createCommentVNode("", true),
12324
- !__props.hideItemsPerPage && __props.listLength ? (openBlock(), createElementBlock("div", {
12576
+ unref(itemsPerPageIsVisible) ? (openBlock(), createElementBlock("div", {
12325
12577
  key: 1,
12326
12578
  class: normalizeClass(["items-per-page", { "ck-component__group--left": !unref(hideSearch) }])
12327
12579
  }, toDisplayString(unref(itemsPerPageStart)) + " - " + toDisplayString(unref(itemsPerPageEnd)) + " de " + toDisplayString(__props.listLength), 3)) : createCommentVNode("", true),
@@ -12331,17 +12583,25 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
12331
12583
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(searchLocal) ? searchLocal.value = $event : null),
12332
12584
  icon: "search",
12333
12585
  placeholder: "Buscar...",
12334
- group: __props.hideItemsPerPage ? "" : "right",
12586
+ group: unref(searchGroupValue),
12335
12587
  onInput: _cache[2] || (_cache[2] = ($event) => checkRefresh())
12336
- }, null, 8, ["modelValue", "group"])) : createCommentVNode("", true)
12588
+ }, null, 8, ["modelValue", "group"])) : createCommentVNode("", true),
12589
+ __props.hasColumnManager ? (openBlock(), createBlock(ckButton, {
12590
+ key: 3,
12591
+ icon: "columns",
12592
+ type: "filled",
12593
+ title: "Administrador de columnas",
12594
+ group: unref(itemsPerPageIsVisible) || !unref(hideSearch) ? "left" : "",
12595
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("openColumnsManager"))
12596
+ }, null, 8, ["group"])) : createCommentVNode("", true)
12337
12597
  ]);
12338
12598
  };
12339
12599
  }
12340
12600
  });
12341
- var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-5c48aabc"]]);
12601
+ var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-a15c3d80"]]);
12342
12602
  var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
12343
- const _hoisted_1$3 = { class: "ck-table__pagination" };
12344
- const _hoisted_2$1 = ["onClick"];
12603
+ const _hoisted_1$4 = { class: "ck-table__pagination" };
12604
+ const _hoisted_2$2 = ["onClick"];
12345
12605
  const _hoisted_3$1 = ["onClick"];
12346
12606
  const itemsShowed = 5;
12347
12607
  const __default__ = {
@@ -12417,14 +12677,14 @@ const __default__ = {
12417
12677
  }
12418
12678
  }
12419
12679
  };
12420
- const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
12680
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
12421
12681
  setup(__props) {
12422
12682
  return (_ctx, _cache) => {
12423
12683
  return __props.currentPage && _ctx.totalPages > 1 ? (openBlock(), createElementBlock("div", {
12424
12684
  key: 0,
12425
12685
  class: normalizeClass(["ck-table__pagination-container", `pagination-align--${__props.align}`])
12426
12686
  }, [
12427
- createElementVNode("div", _hoisted_1$3, [
12687
+ createElementVNode("div", _hoisted_1$4, [
12428
12688
  _ctx.hasArrowLeft ? (openBlock(), createElementBlock("div", {
12429
12689
  key: 0,
12430
12690
  class: "ck-table__pagination--arrow-left",
@@ -12436,7 +12696,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
12436
12696
  return openBlock(), createElementBlock("div", {
12437
12697
  class: "ck-table__pagination-item pagination-item__left",
12438
12698
  onClick: ($event) => _ctx.updateCurrentPage(num)
12439
- }, toDisplayString(num), 9, _hoisted_2$1);
12699
+ }, toDisplayString(num), 9, _hoisted_2$2);
12440
12700
  }), 256)),
12441
12701
  createVNode(ckInput, {
12442
12702
  class: "ck-table__pagination-input",
@@ -12466,7 +12726,79 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
12466
12726
  };
12467
12727
  }
12468
12728
  }));
12469
- var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-7ad6042e"]]);
12729
+ var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-7ad6042e"]]);
12730
+ var ckTable__columnsManager_vue_vue_type_style_index_0_scoped_true_lang = "";
12731
+ const _hoisted_1$3 = { class: "columns-manger-container" };
12732
+ const _hoisted_2$1 = { class: "columns-manger__item" };
12733
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
12734
+ props: {
12735
+ modelValue: { type: Boolean, required: true },
12736
+ columns: { type: Object, required: true },
12737
+ columnsArray: { type: Array, required: true }
12738
+ },
12739
+ emits: ["update:modelValue"],
12740
+ setup(__props, { emit: emits }) {
12741
+ const props = __props;
12742
+ let columnsCheckable = ref([]);
12743
+ const isActive = computed({
12744
+ get() {
12745
+ return props.modelValue;
12746
+ },
12747
+ set(val) {
12748
+ emits("update:modelValue", val);
12749
+ }
12750
+ });
12751
+ watch(() => isActive.value, (val) => {
12752
+ if (!val)
12753
+ return;
12754
+ setColumnsCheckable();
12755
+ });
12756
+ function setColumnsCheckable() {
12757
+ console.log("hoola");
12758
+ const list = [];
12759
+ props.columnsArray.forEach((col) => {
12760
+ if (functions$1)
12761
+ list.push({
12762
+ name: col.name,
12763
+ title: col.title,
12764
+ value: functions$1.isColumnDisplayed(col)
12765
+ });
12766
+ });
12767
+ columnsCheckable.value = list;
12768
+ }
12769
+ function setColumnDisplayValue(colName, value) {
12770
+ props.columns[colName].isDisplayed = value;
12771
+ }
12772
+ return (_ctx, _cache) => {
12773
+ return openBlock(), createBlock(_sfc_main$e, {
12774
+ modelValue: unref(isActive),
12775
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(isActive) ? isActive.value = $event : null),
12776
+ title: "Administrador de columnas"
12777
+ }, {
12778
+ default: withCtx(() => [
12779
+ createElementVNode("div", _hoisted_1$3, [
12780
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(columnsCheckable), (col) => {
12781
+ return openBlock(), createElementBlock("div", _hoisted_2$1, [
12782
+ createVNode(ckCheckbox, {
12783
+ modelValue: col.value,
12784
+ "onUpdate:modelValue": ($event) => col.value = $event,
12785
+ onChange: ($event) => setColumnDisplayValue(col.name, col.value)
12786
+ }, {
12787
+ default: withCtx(() => [
12788
+ createTextVNode(toDisplayString(col.title), 1)
12789
+ ]),
12790
+ _: 2
12791
+ }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])
12792
+ ]);
12793
+ }), 256))
12794
+ ])
12795
+ ]),
12796
+ _: 1
12797
+ }, 8, ["modelValue"]);
12798
+ };
12799
+ }
12800
+ });
12801
+ var TableColumnsManager = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-6ae82d89"]]);
12470
12802
  var ckTable_vue_vue_type_style_index_0_scoped_true_lang = "";
12471
12803
  const _hoisted_1$2 = { class: "ck-table" };
12472
12804
  const _hoisted_2 = {
@@ -12482,7 +12814,8 @@ const _hoisted_5 = { key: 0 };
12482
12814
  const _hoisted_6 = { key: 1 };
12483
12815
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
12484
12816
  props: {
12485
- columns: { type: Array, required: true, default: () => [] },
12817
+ columns: { type: [Array, Object], required: true, default: () => [] },
12818
+ hasColumnManager: { type: Boolean, default: false },
12486
12819
  currentPage: { type: Number, default: 0 },
12487
12820
  itemsPerPage: { type: Number, default: 40 },
12488
12821
  listLength: { type: Number, default: 0 },
@@ -12495,6 +12828,25 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
12495
12828
  emits: ["refreshList", "update:search", "update:currentPage"],
12496
12829
  setup(__props, { emit: emits }) {
12497
12830
  const props = __props;
12831
+ const { qmObj: qmObj2 } = main$1;
12832
+ const IsPopupActive = ref({
12833
+ columnsManager: false
12834
+ });
12835
+ const columnsAreObj = computed(() => !qmObj2.isArray(props.columns));
12836
+ const columnsArray = computed(() => {
12837
+ if (!columnsAreObj.value)
12838
+ return props.columns;
12839
+ const arr = Object.values(props.columns);
12840
+ const keys = Object.keys(props.columns);
12841
+ arr.forEach((col, index) => {
12842
+ const key = keys[index];
12843
+ col.name = key;
12844
+ });
12845
+ return arr;
12846
+ });
12847
+ const filteredColumnsList = computed(() => {
12848
+ return columnsArray.value.filter(functions$1.isColumnDisplayed);
12849
+ });
12498
12850
  const searchLocal = computed({
12499
12851
  get() {
12500
12852
  return props.search;
@@ -12514,114 +12866,150 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
12514
12866
  function refreshList(pageChange = false) {
12515
12867
  emits("refreshList", pageChange);
12516
12868
  }
12869
+ function openColumnsManager() {
12870
+ if (columnsAreObj.value) {
12871
+ IsPopupActive.value.columnsManager = true;
12872
+ } else {
12873
+ console.log("ERROR ck-table", "The columns list should be an object");
12874
+ }
12875
+ }
12517
12876
  return (_ctx, _cache) => {
12518
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
12519
- _ctx.$slots.header || !__props.hideHeaderActions ? (openBlock(), createElementBlock("div", _hoisted_2, [
12520
- !__props.hideHeaderActions ? (openBlock(), createBlock(TableHeaderItems, {
12521
- key: 0,
12522
- search: unref(searchLocal),
12523
- "onUpdate:search": _cache[0] || (_cache[0] = ($event) => isRef(searchLocal) ? searchLocal.value = $event : null),
12524
- currentPage: __props.currentPage,
12525
- itemsPerPage: __props.itemsPerPage,
12526
- listLength: __props.listLength,
12527
- hideRefreshBtn: __props.hideRefreshBtn,
12528
- hideItemsPerPage: __props.hideItemsPerPage,
12529
- onRefreshList: _cache[1] || (_cache[1] = ($event) => refreshList($event))
12530
- }, null, 8, ["search", "currentPage", "itemsPerPage", "listLength", "hideRefreshBtn", "hideItemsPerPage"])) : createCommentVNode("", true),
12531
- _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_3, [
12532
- renderSlot(_ctx.$slots, "header", {}, void 0, true)
12533
- ])) : createCommentVNode("", true)
12534
- ])) : createCommentVNode("", true),
12535
- createElementVNode("table", _hoisted_4, [
12536
- __props.columns.length ? (openBlock(), createElementBlock("thead", _hoisted_5, [
12537
- createVNode(ckTr, null, {
12538
- default: withCtx(() => [
12539
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
12540
- return openBlock(), createBlock(ckTableTitle, {
12541
- key: col.title,
12542
- col
12543
- }, null, 8, ["col"]);
12544
- }), 128))
12545
- ]),
12546
- _: 1
12547
- })
12877
+ return openBlock(), createElementBlock(Fragment, null, [
12878
+ __props.hasColumnManager && unref(columnsAreObj) ? (openBlock(), createBlock(TableColumnsManager, {
12879
+ key: 0,
12880
+ modelValue: IsPopupActive.value.columnsManager,
12881
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => IsPopupActive.value.columnsManager = $event),
12882
+ columnsArray: unref(columnsArray),
12883
+ columns: __props.columns
12884
+ }, null, 8, ["modelValue", "columnsArray", "columns"])) : createCommentVNode("", true),
12885
+ createElementVNode("div", _hoisted_1$2, [
12886
+ _ctx.$slots.header || !__props.hideHeaderActions ? (openBlock(), createElementBlock("div", _hoisted_2, [
12887
+ !__props.hideHeaderActions ? (openBlock(), createBlock(TableHeaderItems, {
12888
+ key: 0,
12889
+ search: unref(searchLocal),
12890
+ "onUpdate:search": _cache[1] || (_cache[1] = ($event) => isRef(searchLocal) ? searchLocal.value = $event : null),
12891
+ currentPage: __props.currentPage,
12892
+ hasColumnManager: __props.hasColumnManager,
12893
+ itemsPerPage: __props.itemsPerPage,
12894
+ listLength: __props.listLength,
12895
+ hideRefreshBtn: __props.hideRefreshBtn,
12896
+ hideItemsPerPage: __props.hideItemsPerPage,
12897
+ onRefreshList: _cache[2] || (_cache[2] = ($event) => refreshList($event)),
12898
+ onOpenColumnsManager: _cache[3] || (_cache[3] = ($event) => openColumnsManager())
12899
+ }, null, 8, ["search", "currentPage", "hasColumnManager", "itemsPerPage", "listLength", "hideRefreshBtn", "hideItemsPerPage"])) : createCommentVNode("", true),
12900
+ _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_3, [
12901
+ renderSlot(_ctx.$slots, "header", {}, void 0, true)
12902
+ ])) : createCommentVNode("", true)
12548
12903
  ])) : createCommentVNode("", true),
12549
- createElementVNode("tbody", null, [
12550
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
12904
+ createElementVNode("table", _hoisted_4, [
12905
+ unref(filteredColumnsList).length ? (openBlock(), createElementBlock("thead", _hoisted_5, [
12906
+ createVNode(ckTr, null, {
12907
+ default: withCtx(() => [
12908
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredColumnsList), (col) => {
12909
+ return openBlock(), createBlock(_sfc_main$7, {
12910
+ key: col.title,
12911
+ col
12912
+ }, null, 8, ["col"]);
12913
+ }), 128))
12914
+ ]),
12915
+ _: 1
12916
+ })
12917
+ ])) : createCommentVNode("", true),
12918
+ createElementVNode("tbody", null, [
12919
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
12920
+ ]),
12921
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("tfoot", _hoisted_6, [
12922
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
12923
+ ])) : createCommentVNode("", true)
12551
12924
  ]),
12552
- _ctx.$slots.footer ? (openBlock(), createElementBlock("tfoot", _hoisted_6, [
12553
- renderSlot(_ctx.$slots, "footer", {}, void 0, true)
12554
- ])) : createCommentVNode("", true)
12555
- ]),
12556
- createVNode(TablePagination, {
12557
- currentPage: unref(currentPageLocal),
12558
- "onUpdate:currentPage": _cache[2] || (_cache[2] = ($event) => isRef(currentPageLocal) ? currentPageLocal.value = $event : null),
12559
- itemsPerPage: __props.itemsPerPage,
12560
- listLength: __props.listLength,
12561
- align: __props.paginationAlign,
12562
- onRefreshList: _cache[3] || (_cache[3] = ($event) => refreshList(true))
12563
- }, null, 8, ["currentPage", "itemsPerPage", "listLength", "align"])
12564
- ]);
12925
+ createVNode(TablePagination, {
12926
+ currentPage: unref(currentPageLocal),
12927
+ "onUpdate:currentPage": _cache[4] || (_cache[4] = ($event) => isRef(currentPageLocal) ? currentPageLocal.value = $event : null),
12928
+ itemsPerPage: __props.itemsPerPage,
12929
+ listLength: __props.listLength,
12930
+ align: __props.paginationAlign,
12931
+ onRefreshList: _cache[5] || (_cache[5] = ($event) => refreshList(true))
12932
+ }, null, 8, ["currentPage", "itemsPerPage", "listLength", "align"])
12933
+ ])
12934
+ ], 64);
12565
12935
  };
12566
12936
  }
12567
12937
  });
12568
- var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-cac87456"]]);
12569
- function render$3(_ctx, _cache, $props, $setup, $data, $options) {
12570
- return openBlock(), createElementBlock("td", {
12571
- class: normalizeClass(["ck-td", $options.computedTdClass])
12572
- }, [
12573
- createElementVNode("span", {
12574
- class: normalizeClass($options.computedSpanClass),
12575
- style: normalizeStyle($options.computedStyle)
12576
- }, [
12577
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
12578
- ], 6)
12579
- ], 2);
12580
- }
12938
+ var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-3084c768"]]);
12581
12939
  var ckTd_vue_vue_type_style_index_0_scoped_true_lang = "";
12582
- const _sfc_main$2 = {
12940
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
12583
12941
  props: {
12942
+ col: { type: Object, default: void 0 },
12584
12943
  wrap: { type: Boolean, default: false },
12585
12944
  block: { type: Boolean, default: false },
12586
12945
  autoWidth: { type: Boolean, default: false },
12587
- align: { type: String, default: "center", validator: validators.align },
12946
+ align: { type: String, default: void 0, validator: validators.align },
12588
12947
  fixedWidth: { type: String, default: "" },
12589
12948
  minWidth: { type: String, default: "" },
12590
12949
  maxWidth: { type: String, default: "" },
12591
12950
  maxHeight: { type: String, default: "" }
12592
12951
  },
12593
- computed: {
12594
- computedTdClass() {
12952
+ setup(__props) {
12953
+ const props = __props;
12954
+ const computedTdClass = computed(() => {
12595
12955
  return {
12596
- "auto-width": this.autoWidth
12956
+ "auto-width": props.autoWidth
12597
12957
  };
12598
- },
12599
- computedSpanClass() {
12600
- return {
12601
- block: this.block,
12602
- "wrap-text": this.wrap,
12603
- "align-center": this.align !== "left" && this.align !== "right",
12604
- "align-left": this.align === "left",
12605
- "align-right": this.align === "right"
12606
- };
12607
- },
12608
- computedStyle() {
12958
+ });
12959
+ const computedSpanClass = computed(() => {
12960
+ const list = [];
12961
+ let align;
12962
+ if (props.col)
12963
+ align = props.col.align;
12964
+ if (props.align)
12965
+ align = props.align;
12966
+ if (align) {
12967
+ if (align === "center")
12968
+ list.push("align-center");
12969
+ if (align === "right")
12970
+ list.push("align-right");
12971
+ }
12972
+ if (props.block)
12973
+ list.push("block");
12974
+ if (props.block)
12975
+ list.push("wrap-text");
12976
+ return list;
12977
+ });
12978
+ const computedStyle = computed(() => {
12609
12979
  const list = {};
12610
- if (this.minWidth)
12611
- list["min-width"] = this.minWidth;
12612
- if (this.fixedWidth)
12613
- list["min-width"] = this.fixedWidth;
12614
- if (this.maxWidth)
12615
- list["max-width"] = this.maxWidth;
12616
- if (this.fixedWidth)
12617
- list["max-width"] = this.fixedWidth;
12618
- if (this.maxHeight)
12619
- list["max-height"] = this.maxHeight;
12980
+ if (props.minWidth)
12981
+ list["min-width"] = props.minWidth;
12982
+ if (props.fixedWidth)
12983
+ list["min-width"] = props.fixedWidth;
12984
+ if (props.maxWidth)
12985
+ list["max-width"] = props.maxWidth;
12986
+ if (props.fixedWidth)
12987
+ list["max-width"] = props.fixedWidth;
12988
+ if (props.maxHeight)
12989
+ list["max-height"] = props.maxHeight;
12620
12990
  return list;
12621
- }
12991
+ });
12992
+ const isColumnDisplayed = computed(() => {
12993
+ if (!props.col)
12994
+ return true;
12995
+ return functions$1.isColumnDisplayed(props.col);
12996
+ });
12997
+ return (_ctx, _cache) => {
12998
+ return unref(isColumnDisplayed) ? (openBlock(), createElementBlock("td", {
12999
+ key: 0,
13000
+ class: normalizeClass(["ck-td", unref(computedTdClass)])
13001
+ }, [
13002
+ createElementVNode("span", {
13003
+ class: normalizeClass(unref(computedSpanClass)),
13004
+ style: normalizeStyle(unref(computedStyle))
13005
+ }, [
13006
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
13007
+ ], 6)
13008
+ ], 2)) : createCommentVNode("", true);
13009
+ };
12622
13010
  }
12623
- };
12624
- var ckTd = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", render$3], ["__scopeId", "data-v-70c634f2"]]);
13011
+ });
13012
+ var ckTd = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-c34b91ca"]]);
12625
13013
  const _hoisted_1$1 = { class: "ck-textarea" };
12626
13014
  function render$2(_ctx, _cache, $props, $setup, $data, $options) {
12627
13015
  const _component_ck_label = resolveComponent("ck-label");
@@ -15267,7 +15655,7 @@ var components = /* @__PURE__ */ Object.freeze({
15267
15655
  ckImg,
15268
15656
  ckInput,
15269
15657
  ckLabel,
15270
- ckPopup: _sfc_main$d,
15658
+ ckPopup: _sfc_main$e,
15271
15659
  ckRadio,
15272
15660
  ckSelect,
15273
15661
  ckSwitch,
@@ -15314,4 +15702,4 @@ const install = function installCleek(app, options) {
15314
15702
  app.component(componentName, component);
15315
15703
  });
15316
15704
  };
15317
- 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 };
15705
+ export { events as EVENTS, mitt as EventBus, ckButton, ckCheckbox, ckIcon, ckImg, ckInput, ckLabel, _sfc_main$e as ckPopup, ckRadio, ckSelect, ckSwitch, ckSwitchOptions, ckTable, ckTd, ckTextarea, ckTh, ckTooltip, ckTr, install as default, lockScroll, unlockScroll };