cleek 2.0.2 → 2.0.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, ref, onMounted, getCurrentInstance, unref, normalizeStyle, withCtx, createTextVNode, toDisplayString, withDirectives, isRef, vModelDynamic, createVNode, Fragment, renderList, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
20
+ import { defineComponent, computed, watch, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, renderSlot, mergeProps, withKeys, withModifiers, createElementVNode, pushScopeId, popScopeId, unref, normalizeStyle, ref, getCurrentInstance, onMounted, withCtx, createTextVNode, toDisplayString, withDirectives, isRef, vModelDynamic, createVNode, Fragment, renderList, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
21
21
  var validators = {
22
22
  size: (type) => {
23
23
  return ["", "xs", "s", "m", "l", "xl"].includes(type);
@@ -74,13 +74,18 @@ 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;
81
+ },
82
+ getCleekOptions(getCurrentInstance2) {
83
+ return getCurrentInstance2().appContext.app.config.globalProperties.$cleekOptions;
79
84
  }
80
85
  };
81
86
  var globalVariables = {
82
87
  defaultFailImg: "df",
83
- imagesFolderPath: "asd",
88
+ imagesFolderPath: "",
84
89
  defaultImgBorderColor: "#EEEEEE"
85
90
  };
86
91
  /*!
@@ -11202,7 +11207,7 @@ defineComponent({
11202
11207
  };
11203
11208
  }
11204
11209
  });
11205
- function render$d(_ctx, _cache, $props, $setup, $data, $options) {
11210
+ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
11206
11211
  const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
11207
11212
  return openBlock(), createElementBlock("div", {
11208
11213
  class: normalizeClass(["ck-icon", $options.computedClass]),
@@ -11231,7 +11236,7 @@ var _export_sfc = (sfc, props) => {
11231
11236
  }
11232
11237
  return target;
11233
11238
  };
11234
- const _sfc_main$j = {
11239
+ const _sfc_main$l = {
11235
11240
  name: "CkIcon",
11236
11241
  components: {
11237
11242
  FontAwesomeIcon
@@ -11278,9 +11283,9 @@ const _sfc_main$j = {
11278
11283
  }
11279
11284
  }
11280
11285
  };
11281
- var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$d], ["__scopeId", "data-v-77d9963a"]]);
11282
- const _hoisted_1$g = ["title", "aria-label", "disabled"];
11283
- function render$c(_ctx, _cache, $props, $setup, $data, $options) {
11286
+ var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", render$b], ["__scopeId", "data-v-77d9963a"]]);
11287
+ const _hoisted_1$i = ["title", "aria-label", "disabled"];
11288
+ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
11284
11289
  const _component_ck_icon = resolveComponent("ck-icon");
11285
11290
  return openBlock(), createElementBlock("button", {
11286
11291
  type: "button",
@@ -11303,13 +11308,13 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
11303
11308
  icon: $props.iconRight,
11304
11309
  "icon-pack": $props.iconPack
11305
11310
  }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true)
11306
- ], 10, _hoisted_1$g);
11311
+ ], 10, _hoisted_1$i);
11307
11312
  }
11308
11313
  var ckButton_vue_vue_type_style_index_0_scoped_true_lang = "";
11309
11314
  const defaultType = "outlined";
11310
11315
  const defaultColor = "primary";
11311
11316
  const defaultAlign = "left";
11312
- const _sfc_main$i = {
11317
+ const _sfc_main$k = {
11313
11318
  name: "CkButton",
11314
11319
  components: {
11315
11320
  ckIcon
@@ -11363,15 +11368,15 @@ const _sfc_main$i = {
11363
11368
  }
11364
11369
  }
11365
11370
  };
11366
- var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$c], ["__scopeId", "data-v-a687842a"]]);
11371
+ var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", render$a], ["__scopeId", "data-v-a687842a"]]);
11367
11372
  const _withScopeId$2 = (n) => (pushScopeId("data-v-69dfa524"), n = n(), popScopeId(), n);
11368
- const _hoisted_1$f = ["disabled", "checked"];
11369
- const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
11373
+ const _hoisted_1$h = ["disabled", "checked"];
11374
+ const _hoisted_2$8 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
11370
11375
  const _hoisted_3$5 = {
11371
11376
  key: 0,
11372
11377
  class: "c-Checkbox__label"
11373
11378
  };
11374
- function render$b(_ctx, _cache, $props, $setup, $data, $options) {
11379
+ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
11375
11380
  return openBlock(), createElementBlock("label", mergeProps({ class: "ck-checkbox" }, $options.checkboxAttributes, {
11376
11381
  onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
11377
11382
  }, ["prevent"]), ["space"])),
@@ -11390,15 +11395,15 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
11390
11395
  $options.value = $event.target.checked;
11391
11396
  $options.onChange($event);
11392
11397
  })
11393
- }, null, 40, _hoisted_1$f),
11394
- _hoisted_2$7,
11398
+ }, null, 40, _hoisted_1$h),
11399
+ _hoisted_2$8,
11395
11400
  _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$5, [
11396
11401
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
11397
11402
  ])) : createCommentVNode("", true)
11398
11403
  ], 16);
11399
11404
  }
11400
11405
  var ckCheckbox_vue_vue_type_style_index_0_scoped_true_lang = "";
11401
- const _sfc_main$h = {
11406
+ const _sfc_main$j = {
11402
11407
  name: "CkCheckbox",
11403
11408
  props: {
11404
11409
  modelValue: { type: Boolean, default: false },
@@ -11431,14 +11436,58 @@ const _sfc_main$h = {
11431
11436
  }
11432
11437
  }
11433
11438
  };
11434
- var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$b], ["__scopeId", "data-v-69dfa524"]]);
11439
+ var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$9], ["__scopeId", "data-v-69dfa524"]]);
11440
+ var ckChip_vue_vue_type_style_index_0_scoped_true_lang = "";
11441
+ const _hoisted_1$g = ["color"];
11442
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
11443
+ props: {
11444
+ size: { type: String, default: "s" },
11445
+ color: { type: String, default: "primary" },
11446
+ textColor: { type: String, default: void 0 },
11447
+ icon: { type: String, default: void 0 },
11448
+ iconPack: { type: String, default: void 0 }
11449
+ },
11450
+ emits: ["click"],
11451
+ setup(__props, { emit: emits }) {
11452
+ const props = __props;
11453
+ const computedClass = computed(() => {
11454
+ return [
11455
+ `size-${props.size}`,
11456
+ `ck-component__bg-color--${props.color}`
11457
+ ];
11458
+ });
11459
+ const computedStyle = computed(() => {
11460
+ const list = [];
11461
+ if (props.color)
11462
+ ;
11463
+ return list;
11464
+ });
11465
+ return (_ctx, _cache) => {
11466
+ return openBlock(), createElementBlock("div", {
11467
+ class: normalizeClass(["ck-chip", unref(computedClass)]),
11468
+ color: __props.color,
11469
+ style: normalizeStyle(unref(computedStyle)),
11470
+ onClick: _cache[0] || (_cache[0] = ($event) => emits("click", $event))
11471
+ }, [
11472
+ __props.icon ? (openBlock(), createBlock(ckIcon, {
11473
+ key: 0,
11474
+ icon: __props.icon,
11475
+ "icon-pack": __props.iconPack
11476
+ }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true),
11477
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
11478
+ ], 14, _hoisted_1$g);
11479
+ };
11480
+ }
11481
+ });
11482
+ var ckChip = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-73ff343b"]]);
11435
11483
  var ckImg_vue_vue_type_style_index_0_scoped_true_lang = "";
11436
- const _hoisted_1$e = ["src"];
11437
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
11484
+ const _hoisted_1$f = ["src", "alt"];
11485
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11438
11486
  props: {
11439
11487
  src: { type: String, default: "" },
11440
11488
  isFullPath: { type: Boolean, default: false },
11441
11489
  failImgSrc: { type: String, default: "" },
11490
+ alt: { type: String, default: "" },
11442
11491
  size: { type: String, default: "", validator: validators.size },
11443
11492
  sizeAbsolute: { type: String, default: "" },
11444
11493
  width: { type: String, default: "" },
@@ -11452,7 +11501,6 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11452
11501
  setup(__props) {
11453
11502
  const props = __props;
11454
11503
  const altNeeded = ref(false);
11455
- let context;
11456
11504
  let isMounted = ref(false);
11457
11505
  const imageUrl = computed(() => {
11458
11506
  if (!isMounted.value)
@@ -11463,11 +11511,12 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11463
11511
  });
11464
11512
  const computedClass = computed(() => {
11465
11513
  const classList2 = [];
11466
- if (!props.size && !props.sizeAbsolute && !props.width && !props.height) {
11467
- props.size = "m";
11514
+ let size = props.size;
11515
+ if (!size && !props.sizeAbsolute && !props.width && !props.height) {
11516
+ size = "m";
11468
11517
  }
11469
- if (props.size)
11470
- classList2.push(`ck-img__size--${props.size}`);
11518
+ if (size)
11519
+ classList2.push(`ck-img__size--${size}`);
11471
11520
  if (props.hasBorder) {
11472
11521
  classList2.push("ck-img__has-border");
11473
11522
  if (functions$1.isColorTemplateVariable(realBorderColor.value)) {
@@ -11514,13 +11563,15 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11514
11563
  }
11515
11564
  function getImg(src) {
11516
11565
  let path = "";
11517
- console.log("context.$cleekOptions", context.$cleekOptions);
11518
- if (context.$cleekOptions)
11519
- path = context.$cleekOptions.imgPath;
11566
+ const $cleekOptions = functions$1.getCleekOptions(getCurrentInstance);
11567
+ if ($cleekOptions) {
11568
+ if ($cleekOptions.imgPath)
11569
+ path = $cleekOptions.imgPath;
11570
+ }
11520
11571
  return `${path}${src}`;
11521
11572
  }
11522
11573
  onMounted(() => {
11523
- context = getCurrentInstance().ctx;
11574
+ getCurrentInstance().ctx;
11524
11575
  isMounted.value = true;
11525
11576
  });
11526
11577
  return (_ctx, _cache) => {
@@ -11532,24 +11583,25 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11532
11583
  createElementVNode("img", {
11533
11584
  src: unref(imageUrl),
11534
11585
  style: normalizeStyle(unref(computedImgStyle)),
11586
+ alt: __props.alt,
11535
11587
  onError: _cache[0] || (_cache[0] = ($event) => altNeeded.value = true)
11536
- }, null, 44, _hoisted_1$e)
11588
+ }, null, 44, _hoisted_1$f)
11537
11589
  ], 6);
11538
11590
  };
11539
11591
  }
11540
11592
  });
11541
- var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-78f4ca32"]]);
11542
- const _hoisted_1$d = ["for"];
11543
- function render$a(_ctx, _cache, $props, $setup, $data, $options) {
11593
+ var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-53d78f2e"]]);
11594
+ const _hoisted_1$e = ["for"];
11595
+ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
11544
11596
  return openBlock(), createElementBlock("label", {
11545
11597
  class: normalizeClass(["ck-label", $options.computedClass]),
11546
11598
  for: $props.for
11547
11599
  }, [
11548
11600
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
11549
- ], 10, _hoisted_1$d);
11601
+ ], 10, _hoisted_1$e);
11550
11602
  }
11551
11603
  var ckLabel_vue_vue_type_style_index_0_scoped_true_lang = "";
11552
- const _sfc_main$f = {
11604
+ const _sfc_main$g = {
11553
11605
  name: "CkLabel",
11554
11606
  props: {
11555
11607
  for: { type: String, default: "" },
@@ -11566,11 +11618,11 @@ const _sfc_main$f = {
11566
11618
  }
11567
11619
  }
11568
11620
  };
11569
- var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", render$a], ["__scopeId", "data-v-4b8b9ab4"]]);
11621
+ var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", render$8], ["__scopeId", "data-v-4b8b9ab4"]]);
11570
11622
  var ckInput_vue_vue_type_style_index_0_scoped_true_lang = "";
11571
- const _hoisted_1$c = { class: "ck-input" };
11572
- const _hoisted_2$6 = ["type", "placeholder", "id", "disabled"];
11573
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
11623
+ const _hoisted_1$d = { class: "ck-input" };
11624
+ const _hoisted_2$7 = ["type", "placeholder", "id", "disabled"];
11625
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11574
11626
  props: {
11575
11627
  modelValue: {},
11576
11628
  type: { type: String, validator: validators.inputType, default: "text" },
@@ -11631,7 +11683,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11631
11683
  return list;
11632
11684
  });
11633
11685
  return (_ctx, _cache) => {
11634
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
11686
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
11635
11687
  __props.label ? (openBlock(), createBlock(ckLabel, {
11636
11688
  key: 0,
11637
11689
  align: __props.labelAlign,
@@ -11660,7 +11712,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11660
11712
  onChange: _cache[1] || (_cache[1] = ($event) => onChange($event)),
11661
11713
  onInput: _cache[2] || (_cache[2] = ($event) => onInput($event)),
11662
11714
  onClick: _cache[3] || (_cache[3] = ($event) => onClick($event))
11663
- }, null, 46, _hoisted_2$6), [
11715
+ }, null, 46, _hoisted_2$7), [
11664
11716
  [vModelDynamic, unref(value)]
11665
11717
  ]),
11666
11718
  __props.iconRight ? (openBlock(), createBlock(ckIcon, {
@@ -11674,13 +11726,13 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11674
11726
  };
11675
11727
  }
11676
11728
  });
11677
- var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-61fababc"]]);
11729
+ var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-61fababc"]]);
11678
11730
  var ckPopup_vue_vue_type_style_index_0_lang = "";
11679
- const _hoisted_1$b = {
11731
+ const _hoisted_1$c = {
11680
11732
  key: 0,
11681
11733
  class: "ck-popup"
11682
11734
  };
11683
- const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("div", { class: "blackout" }, null, -1);
11735
+ const _hoisted_2$6 = /* @__PURE__ */ createElementVNode("div", { class: "blackout" }, null, -1);
11684
11736
  const _hoisted_3$4 = { class: "ck-popup__slot-header" };
11685
11737
  const _hoisted_4$2 = {
11686
11738
  key: 0,
@@ -11733,11 +11785,11 @@ const __default__$1 = {
11733
11785
  }
11734
11786
  }
11735
11787
  };
11736
- const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
11788
+ const _sfc_main$e = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__$1), {
11737
11789
  setup(__props) {
11738
11790
  return (_ctx, _cache) => {
11739
- return _ctx.value ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
11740
- _hoisted_2$5,
11791
+ return _ctx.value ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
11792
+ _hoisted_2$6,
11741
11793
  createElementVNode("div", {
11742
11794
  class: "popup-container",
11743
11795
  onClick: _cache[4] || (_cache[4] = ($event) => _ctx.onBgClick())
@@ -11790,14 +11842,14 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
11790
11842
  }
11791
11843
  }));
11792
11844
  const _withScopeId$1 = (n) => (pushScopeId("data-v-73a891e8"), n = n(), popScopeId(), n);
11793
- const _hoisted_1$a = ["onKeyup"];
11794
- const _hoisted_2$4 = ["name", "value", "disabled"];
11845
+ const _hoisted_1$b = ["onKeyup"];
11846
+ const _hoisted_2$5 = ["name", "value", "disabled"];
11795
11847
  const _hoisted_3$3 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", { class: "c-Radio__element" }, null, -1));
11796
11848
  const _hoisted_4$1 = {
11797
11849
  key: 0,
11798
11850
  class: "c-Radio__label"
11799
11851
  };
11800
- function render$9(_ctx, _cache, $props, $setup, $data, $options) {
11852
+ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
11801
11853
  return openBlock(true), createElementBlock(Fragment, null, renderList($props.options, (item, index) => {
11802
11854
  return openBlock(), createElementBlock("label", mergeProps({
11803
11855
  key: `radio-${index}`,
@@ -11818,16 +11870,16 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
11818
11870
  name: $props.name,
11819
11871
  value: item.value,
11820
11872
  disabled: $props.disabled
11821
- }, null, 8, _hoisted_2$4), [
11873
+ }, null, 8, _hoisted_2$5), [
11822
11874
  [vModelRadio, $options.value]
11823
11875
  ]),
11824
11876
  _hoisted_3$3,
11825
11877
  item.label ? (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString(item.label), 1)) : createCommentVNode("", true)
11826
- ], 16, _hoisted_1$a);
11878
+ ], 16, _hoisted_1$b);
11827
11879
  }), 128);
11828
11880
  }
11829
11881
  var ckRadio_vue_vue_type_style_index_0_scoped_true_lang = "";
11830
- const _sfc_main$c = {
11882
+ const _sfc_main$d = {
11831
11883
  name: "CkRadio",
11832
11884
  props: {
11833
11885
  modelValue: { type: String, default: void 0 },
@@ -11859,7 +11911,100 @@ const _sfc_main$c = {
11859
11911
  }
11860
11912
  }
11861
11913
  };
11862
- var ckRadio = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", render$9], ["__scopeId", "data-v-73a891e8"]]);
11914
+ var ckRadio = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", render$7], ["__scopeId", "data-v-73a891e8"]]);
11915
+ var qmApi = {};
11916
+ var qmArray = {
11917
+ arrayToText(arr, key = null) {
11918
+ let msg = "";
11919
+ for (let index = 0; index < arr.length; index++) {
11920
+ if (index) {
11921
+ if (index === arr.length - 1) {
11922
+ msg += " y ";
11923
+ } else {
11924
+ msg += ", ";
11925
+ }
11926
+ }
11927
+ let word;
11928
+ if (key) {
11929
+ word = arr[index][key];
11930
+ } else {
11931
+ word = arr[index];
11932
+ }
11933
+ msg += `"${word}"`;
11934
+ }
11935
+ return msg;
11936
+ },
11937
+ getRandomElementOfArray(arr) {
11938
+ return arr[Math.floor(Math.random() * arr.length)];
11939
+ },
11940
+ hexToRGBA(hex, alpha) {
11941
+ const r = parseInt(hex.slice(1, 3), 16);
11942
+ const g = parseInt(hex.slice(3, 5), 16);
11943
+ const b = parseInt(hex.slice(5, 7), 16);
11944
+ if (alpha)
11945
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
11946
+ return `rgb(${r}, ${g}, ${b})`;
11947
+ },
11948
+ removeOfArray(list, findFunction) {
11949
+ if (!list || !findFunction)
11950
+ return;
11951
+ const index = list.findIndex(findFunction);
11952
+ if (index === -1)
11953
+ return;
11954
+ list.splice(index, 1);
11955
+ },
11956
+ removeOfArrayById(list, id) {
11957
+ const index = list.findIndex((i) => i.id === id);
11958
+ if (index === -1)
11959
+ return;
11960
+ list.splice(index, 1);
11961
+ },
11962
+ replaceInList(arr, NewItem, prop = "id") {
11963
+ if (!NewItem)
11964
+ return;
11965
+ const index = arr.findIndex((i) => i[prop] === NewItem[prop]);
11966
+ if (index !== -1)
11967
+ arr.splice(index, 1, NewItem);
11968
+ },
11969
+ sort(arr, keys) {
11970
+ if (typeof keys === "string")
11971
+ keys = [keys];
11972
+ if (keys.length === 2) {
11973
+ if (keys[1] === "DESC" || keys[1] === "ASC") {
11974
+ keys = [keys];
11975
+ }
11976
+ }
11977
+ const finalKeys = [];
11978
+ keys.forEach((key) => {
11979
+ if (typeof key === "string")
11980
+ key = [key];
11981
+ if (typeof key[1] === "undefined")
11982
+ key[1] = "ASC";
11983
+ finalKeys.push(key);
11984
+ });
11985
+ return arr.sort((a, b) => {
11986
+ let value = 0;
11987
+ finalKeys.forEach(([key, order2]) => {
11988
+ if (!value) {
11989
+ const mult = order2 === "DESC" ? -1 : 1;
11990
+ if (a[key] < b[key])
11991
+ value = -1 * mult;
11992
+ if (a[key] > b[key])
11993
+ value = 1 * mult;
11994
+ }
11995
+ });
11996
+ return value;
11997
+ });
11998
+ }
11999
+ };
12000
+ var qmAudio = {
12001
+ reproduceAudio(path) {
12002
+ if (path) {
12003
+ const audio = new Audio(path);
12004
+ audio.play();
12005
+ }
12006
+ }
12007
+ };
11863
12008
  const qmStr = {
11864
12009
  capitalize(str) {
11865
12010
  return str.charAt(0).toUpperCase() + str.slice(1);
@@ -11877,6 +12022,15 @@ const qmStr = {
11877
12022
  str = str.toLowerCase();
11878
12023
  return str;
11879
12024
  },
12025
+ getRandomStr(length = 10) {
12026
+ let result = "";
12027
+ const characters = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz123456789";
12028
+ const charactersLength = characters.length;
12029
+ for (let i = 0; i < length; i++) {
12030
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
12031
+ }
12032
+ return result;
12033
+ },
11880
12034
  padZeros(num, size = 2) {
11881
12035
  return `000000000${num}`.substr(-size);
11882
12036
  },
@@ -11896,9 +12050,146 @@ const qmStr = {
11896
12050
  return joinArray;
11897
12051
  }
11898
12052
  };
12053
+ var qmNum = {
12054
+ getRandomInt(min2, max2) {
12055
+ min2 = Math.ceil(min2);
12056
+ max2 = Math.floor(max2);
12057
+ return Math.floor(Math.random() * (max2 - min2 + 1)) + min2;
12058
+ },
12059
+ setPrice(num, { precision = 2 } = {}) {
12060
+ if (!num)
12061
+ return 0;
12062
+ return +parseFloat(num).toFixed(precision);
12063
+ },
12064
+ presentNum(num, forceDecimal = false) {
12065
+ num = +num;
12066
+ let finalInt = "0";
12067
+ let decimal = "00";
12068
+ const isNegative = num < 0;
12069
+ const isValidNum = !(!num || !+num);
12070
+ if (isValidNum) {
12071
+ num = parseFloat(Math.abs(num)).toFixed(2);
12072
+ decimal = num.substring(num.length - 2, num.length);
12073
+ const int = num.substring(0, num.length - 3);
12074
+ const reversedInt = qmStr.reverseString(int);
12075
+ let reversedRealInt = "";
12076
+ for (let i = 0; i < reversedInt.length; i++) {
12077
+ reversedRealInt += reversedInt.charAt(i);
12078
+ if (i + 1 >= reversedInt.length)
12079
+ continue;
12080
+ if ((i + 1) % 3)
12081
+ continue;
12082
+ reversedRealInt += ".";
12083
+ }
12084
+ finalInt = qmStr.reverseString(reversedRealInt);
12085
+ }
12086
+ let finalValue = finalInt;
12087
+ if (isNegative)
12088
+ finalValue = `-${finalValue}`;
12089
+ if (forceDecimal || +decimal) {
12090
+ finalValue = `${finalValue},${decimal}`;
12091
+ }
12092
+ return finalValue;
12093
+ },
12094
+ removeNoNumber(str, isFloat = false) {
12095
+ let newStr = "";
12096
+ str = str.toString();
12097
+ for (let i = 0; i < str.length; i++) {
12098
+ if (str[i] == parseInt(str[i], 10)) {
12099
+ newStr += str[i];
12100
+ } else if (isFloat && str[i] == "," || isFloat && str[i] == ".") {
12101
+ newStr += ".";
12102
+ isFloat = false;
12103
+ }
12104
+ }
12105
+ return newStr;
12106
+ },
12107
+ showPrice(num, Extra = { hideIcon: false, currency: "$" }) {
12108
+ if (Extra.hideIcon !== true)
12109
+ Extra.hideIcon = false;
12110
+ let presentedNum = this.presentNum(num, true);
12111
+ const isNegative = presentedNum[0] === "-";
12112
+ if (isNegative)
12113
+ presentedNum = presentedNum.substring(1, presentedNum.length);
12114
+ if (!Extra.hideIcon)
12115
+ presentedNum = `${Extra.currency}${presentedNum}`;
12116
+ if (isNegative)
12117
+ presentedNum = `- ${presentedNum}`;
12118
+ return presentedNum;
12119
+ },
12120
+ simplifyNum(num) {
12121
+ if (!(num % 1))
12122
+ return Math.floor(num);
12123
+ return this.presentNum(num);
12124
+ }
12125
+ };
12126
+ function getKeyValue(obj, key) {
12127
+ return obj[key];
12128
+ }
12129
+ function setKeyValue(obj, key, value) {
12130
+ obj[key] = value;
12131
+ }
12132
+ var qmObj = {
12133
+ addEmptyOptionToList(optionsList, { prop = "name", title = "Todos", noneId = 0 } = {}) {
12134
+ const noneOption = {
12135
+ id: noneId,
12136
+ [prop]: title
12137
+ };
12138
+ const newList = [...optionsList];
12139
+ newList.unshift(noneOption);
12140
+ return newList;
12141
+ },
12142
+ copyAvaibleFields(ObjEditable, ObjToCopy) {
12143
+ for (const key in ObjEditable) {
12144
+ if (typeof getKeyValue(ObjToCopy, key) !== "undefined") {
12145
+ setKeyValue(ObjEditable, key, getKeyValue(ObjToCopy, key));
12146
+ }
12147
+ }
12148
+ },
12149
+ isArray(obj) {
12150
+ return obj.constructor === Array;
12151
+ },
12152
+ objsAreTheSame(obj1, obj2) {
12153
+ for (const key in obj1) {
12154
+ if (getKeyValue(obj1, key) != getKeyValue(obj2, key))
12155
+ return false;
12156
+ }
12157
+ for (const key in obj2) {
12158
+ if (getKeyValue(obj1, key) != getKeyValue(obj2, key))
12159
+ return false;
12160
+ }
12161
+ return true;
12162
+ },
12163
+ qoIsObjEmpty(obj = {}) {
12164
+ return obj && Object.keys(obj).length === 0 && Object.getPrototypeOf(obj) === Object.prototype;
12165
+ }
12166
+ };
12167
+ var main$1 = {
12168
+ qmApi,
12169
+ qmArray,
12170
+ qmAudio,
12171
+ qmNum,
12172
+ qmObj,
12173
+ qmStr
12174
+ };
12175
+ var App;
12176
+ (function(App2) {
12177
+ class SomeClass {
12178
+ getName() {
12179
+ return "name";
12180
+ }
12181
+ }
12182
+ App2.SomeClass = SomeClass;
12183
+ class OtherClass {
12184
+ getName() {
12185
+ return "name";
12186
+ }
12187
+ }
12188
+ App2.OtherClass = OtherClass;
12189
+ })(App || (App = {}));
11899
12190
  var ckSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
11900
- const _hoisted_1$9 = ["value"];
11901
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
12191
+ const _hoisted_1$a = ["value"];
12192
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
11902
12193
  props: {
11903
12194
  modelValue: { default: null, type: [Boolean, Number, Object, Array, String] },
11904
12195
  prop: { type: String, default: "name" },
@@ -11923,6 +12214,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11923
12214
  emits: ["update:modelValue", "click", "change"],
11924
12215
  setup(__props, { emit: emits }) {
11925
12216
  const props = __props;
12217
+ const { qmStr: qmStr2 } = main$1;
11926
12218
  const search = ref("");
11927
12219
  ref(null);
11928
12220
  const value = computed({
@@ -11938,7 +12230,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
11938
12230
  const filteredOptions = computed(() => {
11939
12231
  const list = props.options.filter((option) => {
11940
12232
  const name = getOptionName(option);
11941
- return qmStr.checkContainsStr(name, search.value);
12233
+ return qmStr2.checkContainsStr(name, search.value);
11942
12234
  });
11943
12235
  return list;
11944
12236
  });
@@ -12036,7 +12328,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
12036
12328
  return openBlock(), createElementBlock("option", {
12037
12329
  value: getOptionKey(option),
12038
12330
  key: option
12039
- }, toDisplayString(getOptionName(option)), 9, _hoisted_1$9);
12331
+ }, toDisplayString(getOptionName(option)), 9, _hoisted_1$a);
12040
12332
  }), 128))
12041
12333
  ], 34), [
12042
12334
  [vModelSelect, unref(value)]
@@ -12045,15 +12337,15 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
12045
12337
  };
12046
12338
  }
12047
12339
  });
12048
- var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-02fab5ba"]]);
12340
+ var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-31af160a"]]);
12049
12341
  const _withScopeId = (n) => (pushScopeId("data-v-022b9f3c"), n = n(), popScopeId(), n);
12050
- const _hoisted_1$8 = ["disabled"];
12051
- const _hoisted_2$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
12342
+ const _hoisted_1$9 = ["disabled"];
12343
+ const _hoisted_2$4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
12052
12344
  const _hoisted_3$2 = {
12053
12345
  key: 0,
12054
12346
  class: "ck-switch__content"
12055
12347
  };
12056
- function render$8(_ctx, _cache, $props, $setup, $data, $options) {
12348
+ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
12057
12349
  return openBlock(), createElementBlock("label", mergeProps({ class: "ck-switch" }, $options.computedAttributes, {
12058
12350
  class: $options.computedClass,
12059
12351
  onKeydown: _cache[2] || (_cache[2] = withKeys(withModifiers(() => {
@@ -12070,17 +12362,17 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
12070
12362
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.value = $event),
12071
12363
  disabled: $props.disabled,
12072
12364
  onClick: _cache[1] || (_cache[1] = ($event) => $options.onTrigger())
12073
- }, null, 8, _hoisted_1$8), [
12365
+ }, null, 8, _hoisted_1$9), [
12074
12366
  [vModelCheckbox, $options.value]
12075
12367
  ]),
12076
- _hoisted_2$3,
12368
+ _hoisted_2$4,
12077
12369
  _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$2, [
12078
12370
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
12079
12371
  ])) : createCommentVNode("", true)
12080
12372
  ], 16);
12081
12373
  }
12082
12374
  var ckSwitch_vue_vue_type_style_index_0_scoped_true_lang = "";
12083
- const _sfc_main$a = {
12375
+ const _sfc_main$b = {
12084
12376
  name: "Switch",
12085
12377
  props: {
12086
12378
  modelValue: { type: Boolean, default: false },
@@ -12119,12 +12411,12 @@ const _sfc_main$a = {
12119
12411
  }
12120
12412
  }
12121
12413
  };
12122
- var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$8], ["__scopeId", "data-v-022b9f3c"]]);
12123
- const _hoisted_1$7 = { class: "ck-switch-options__container-exterior" };
12124
- const _hoisted_2$2 = ["onClick"];
12125
- function render$7(_ctx, _cache, $props, $setup, $data, $options) {
12414
+ var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", render$6], ["__scopeId", "data-v-022b9f3c"]]);
12415
+ const _hoisted_1$8 = { class: "ck-switch-options__container-exterior" };
12416
+ const _hoisted_2$3 = ["onClick"];
12417
+ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
12126
12418
  const _component_ck_label = resolveComponent("ck-label");
12127
- return openBlock(), createElementBlock("div", _hoisted_1$7, [
12419
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
12128
12420
  $props.label ? (openBlock(), createBlock(_component_ck_label, {
12129
12421
  key: 0,
12130
12422
  align: $props.labelAlign
@@ -12143,13 +12435,13 @@ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
12143
12435
  key: `ck-switch-options${index}`,
12144
12436
  style: normalizeStyle($options.computedItemStyle),
12145
12437
  onClick: ($event) => $options.selectedOption = $options.getOptionValue(Option)
12146
- }, toDisplayString(Option[$props.prop]), 15, _hoisted_2$2);
12438
+ }, toDisplayString(Option[$props.prop]), 15, _hoisted_2$3);
12147
12439
  }), 128))
12148
12440
  ], 2)
12149
12441
  ]);
12150
12442
  }
12151
12443
  var ckSwitchOptions_vue_vue_type_style_index_0_scoped_true_lang = "";
12152
- const _sfc_main$9 = {
12444
+ const _sfc_main$a = {
12153
12445
  components: {
12154
12446
  ckLabel
12155
12447
  },
@@ -12197,19 +12489,19 @@ const _sfc_main$9 = {
12197
12489
  }
12198
12490
  }
12199
12491
  };
12200
- var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$7], ["__scopeId", "data-v-f0c51430"]]);
12201
- const _hoisted_1$6 = { class: "ck-tr" };
12202
- function render$6(_ctx, _cache) {
12203
- return openBlock(), createElementBlock("tr", _hoisted_1$6, [
12492
+ var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$5], ["__scopeId", "data-v-f0c51430"]]);
12493
+ const _hoisted_1$7 = { class: "ck-tr" };
12494
+ function render$4(_ctx, _cache) {
12495
+ return openBlock(), createElementBlock("tr", _hoisted_1$7, [
12204
12496
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
12205
12497
  ]);
12206
12498
  }
12207
12499
  var ckTr_vue_vue_type_style_index_0_scoped_true_lang = "";
12208
- const _sfc_main$8 = {};
12209
- var ckTr = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", render$6], ["__scopeId", "data-v-1dd12190"]]);
12210
- const _hoisted_1$5 = { class: "ck-th" };
12211
- function render$5(_ctx, _cache, $props, $setup, $data, $options) {
12212
- return openBlock(), createElementBlock("th", _hoisted_1$5, [
12500
+ const _sfc_main$9 = {};
12501
+ var ckTr = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$4], ["__scopeId", "data-v-1dd12190"]]);
12502
+ const _hoisted_1$6 = { class: "ck-th" };
12503
+ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
12504
+ return openBlock(), createElementBlock("th", _hoisted_1$6, [
12213
12505
  createElementVNode("span", {
12214
12506
  class: normalizeClass($options.computedSpanClass),
12215
12507
  style: normalizeStyle($options.computedStyle)
@@ -12219,7 +12511,7 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
12219
12511
  ]);
12220
12512
  }
12221
12513
  var ckTh_vue_vue_type_style_index_0_scoped_true_lang = "";
12222
- const _sfc_main$7 = {
12514
+ const _sfc_main$8 = {
12223
12515
  props: {
12224
12516
  align: { type: String, default: "center", validator: validators.align },
12225
12517
  minWidth: { type: String, default: void 0 }
@@ -12240,46 +12532,38 @@ const _sfc_main$7 = {
12240
12532
  }
12241
12533
  }
12242
12534
  };
12243
- var ckTh = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", render$5], ["__scopeId", "data-v-e9943550"]]);
12244
- function render$4(_ctx, _cache, $props, $setup, $data, $options) {
12245
- const _component_ck_th = resolveComponent("ck-th");
12246
- return $options.isVisible ? (openBlock(), createBlock(_component_ck_th, {
12247
- key: 0,
12248
- align: $props.col.align,
12249
- "min-width": $props.col.minWidth
12250
- }, {
12251
- default: withCtx(() => [
12252
- createTextVNode(toDisplayString($props.col.title), 1)
12253
- ]),
12254
- _: 1
12255
- }, 8, ["align", "min-width"])) : createCommentVNode("", true);
12256
- }
12257
- const _sfc_main$6 = {
12258
- components: {
12259
- ckTh
12260
- },
12535
+ var ckTh = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", render$3], ["__scopeId", "data-v-e9943550"]]);
12536
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
12261
12537
  props: {
12262
12538
  col: { type: Object, required: true }
12263
12539
  },
12264
- computed: {
12265
- isVisible() {
12266
- return functions$1.isTableColumnsVisible(this.col);
12267
- }
12540
+ setup(__props) {
12541
+ return (_ctx, _cache) => {
12542
+ return openBlock(), createBlock(ckTh, {
12543
+ align: __props.col.align,
12544
+ "min-width": __props.col.minWidth
12545
+ }, {
12546
+ default: withCtx(() => [
12547
+ createTextVNode(toDisplayString(__props.col.title), 1)
12548
+ ]),
12549
+ _: 1
12550
+ }, 8, ["align", "min-width"]);
12551
+ };
12268
12552
  }
12269
- };
12270
- var ckTableTitle = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", render$4]]);
12553
+ });
12271
12554
  var ckTable__headerItems_vue_vue_type_style_index_0_scoped_true_lang = "";
12272
- const _hoisted_1$4 = { class: "ck-table__header-items" };
12273
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
12555
+ const _hoisted_1$5 = { class: "ck-table__header-items" };
12556
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
12274
12557
  props: {
12275
12558
  search: { type: String, default: void 0 },
12559
+ hasColumnsManager: { type: Boolean, default: false },
12276
12560
  hideRefreshBtn: { type: Boolean, required: true },
12277
12561
  hideItemsPerPage: { type: Boolean, required: true },
12278
12562
  currentPage: { type: Number, required: true },
12279
12563
  itemsPerPage: { type: Number, required: true },
12280
12564
  listLength: { type: Number, required: true }
12281
12565
  },
12282
- emits: ["update:search", "refreshList"],
12566
+ emits: ["update:search", "refreshList", "openColumnsManager"],
12283
12567
  setup(__props, { emit: emits }) {
12284
12568
  const props = __props;
12285
12569
  const searchLocal = computed({
@@ -12302,6 +12586,19 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
12302
12586
  return props.listLength;
12303
12587
  return value;
12304
12588
  });
12589
+ const itemsPerPageIsVisible = computed(() => {
12590
+ return !props.hideItemsPerPage && props.listLength;
12591
+ });
12592
+ const searchGroupValue = computed(() => {
12593
+ if (itemsPerPageIsVisible.value && props.hasColumnsManager) {
12594
+ return "center";
12595
+ }
12596
+ if (itemsPerPageIsVisible.value)
12597
+ return "right";
12598
+ if (props.hasColumnsManager)
12599
+ return "left";
12600
+ return "";
12601
+ });
12305
12602
  function checkRefresh() {
12306
12603
  const search = searchLocal.value;
12307
12604
  setTimeout(() => {
@@ -12311,14 +12608,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
12311
12608
  }, 1e3);
12312
12609
  }
12313
12610
  return (_ctx, _cache) => {
12314
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
12611
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
12315
12612
  !__props.hideRefreshBtn ? (openBlock(), createBlock(ckButton, {
12316
12613
  key: 0,
12317
12614
  type: "flat",
12318
12615
  icon: "redo-alt",
12616
+ title: "Recargar lista",
12319
12617
  onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("refreshList", false))
12320
12618
  })) : createCommentVNode("", true),
12321
- !__props.hideItemsPerPage && __props.listLength ? (openBlock(), createElementBlock("div", {
12619
+ unref(itemsPerPageIsVisible) ? (openBlock(), createElementBlock("div", {
12322
12620
  key: 1,
12323
12621
  class: normalizeClass(["items-per-page", { "ck-component__group--left": !unref(hideSearch) }])
12324
12622
  }, toDisplayString(unref(itemsPerPageStart)) + " - " + toDisplayString(unref(itemsPerPageEnd)) + " de " + toDisplayString(__props.listLength), 3)) : createCommentVNode("", true),
@@ -12328,17 +12626,25 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
12328
12626
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(searchLocal) ? searchLocal.value = $event : null),
12329
12627
  icon: "search",
12330
12628
  placeholder: "Buscar...",
12331
- group: __props.hideItemsPerPage ? "" : "right",
12629
+ group: unref(searchGroupValue),
12332
12630
  onInput: _cache[2] || (_cache[2] = ($event) => checkRefresh())
12333
- }, null, 8, ["modelValue", "group"])) : createCommentVNode("", true)
12631
+ }, null, 8, ["modelValue", "group"])) : createCommentVNode("", true),
12632
+ __props.hasColumnsManager ? (openBlock(), createBlock(ckButton, {
12633
+ key: 3,
12634
+ icon: "columns",
12635
+ type: "filled",
12636
+ title: "Administrador de columnas",
12637
+ group: unref(itemsPerPageIsVisible) || !unref(hideSearch) ? "right" : "",
12638
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("openColumnsManager"))
12639
+ }, null, 8, ["group"])) : createCommentVNode("", true)
12334
12640
  ]);
12335
12641
  };
12336
12642
  }
12337
12643
  });
12338
- var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-5c48aabc"]]);
12644
+ var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-38244f67"]]);
12339
12645
  var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
12340
- const _hoisted_1$3 = { class: "ck-table__pagination" };
12341
- const _hoisted_2$1 = ["onClick"];
12646
+ const _hoisted_1$4 = { class: "ck-table__pagination" };
12647
+ const _hoisted_2$2 = ["onClick"];
12342
12648
  const _hoisted_3$1 = ["onClick"];
12343
12649
  const itemsShowed = 5;
12344
12650
  const __default__ = {
@@ -12414,14 +12720,14 @@ const __default__ = {
12414
12720
  }
12415
12721
  }
12416
12722
  };
12417
- const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
12723
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
12418
12724
  setup(__props) {
12419
12725
  return (_ctx, _cache) => {
12420
12726
  return __props.currentPage && _ctx.totalPages > 1 ? (openBlock(), createElementBlock("div", {
12421
12727
  key: 0,
12422
12728
  class: normalizeClass(["ck-table__pagination-container", `pagination-align--${__props.align}`])
12423
12729
  }, [
12424
- createElementVNode("div", _hoisted_1$3, [
12730
+ createElementVNode("div", _hoisted_1$4, [
12425
12731
  _ctx.hasArrowLeft ? (openBlock(), createElementBlock("div", {
12426
12732
  key: 0,
12427
12733
  class: "ck-table__pagination--arrow-left",
@@ -12433,7 +12739,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
12433
12739
  return openBlock(), createElementBlock("div", {
12434
12740
  class: "ck-table__pagination-item pagination-item__left",
12435
12741
  onClick: ($event) => _ctx.updateCurrentPage(num)
12436
- }, toDisplayString(num), 9, _hoisted_2$1);
12742
+ }, toDisplayString(num), 9, _hoisted_2$2);
12437
12743
  }), 256)),
12438
12744
  createVNode(ckInput, {
12439
12745
  class: "ck-table__pagination-input",
@@ -12463,7 +12769,79 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
12463
12769
  };
12464
12770
  }
12465
12771
  }));
12466
- var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-7ad6042e"]]);
12772
+ var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-7ad6042e"]]);
12773
+ var ckTable__columnsManager_vue_vue_type_style_index_0_scoped_true_lang = "";
12774
+ const _hoisted_1$3 = { class: "columns-manger-container" };
12775
+ const _hoisted_2$1 = { class: "columns-manger__item" };
12776
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
12777
+ props: {
12778
+ modelValue: { type: Boolean, required: true },
12779
+ columns: { type: Object, required: true },
12780
+ columnsArray: { type: Array, required: true }
12781
+ },
12782
+ emits: ["update:modelValue"],
12783
+ setup(__props, { emit: emits }) {
12784
+ const props = __props;
12785
+ let columnsCheckable = ref([]);
12786
+ const isActive = computed({
12787
+ get() {
12788
+ return props.modelValue;
12789
+ },
12790
+ set(val) {
12791
+ emits("update:modelValue", val);
12792
+ }
12793
+ });
12794
+ watch(() => isActive.value, (val) => {
12795
+ if (!val)
12796
+ return;
12797
+ setColumnsCheckable();
12798
+ });
12799
+ function setColumnsCheckable() {
12800
+ console.log("hoola");
12801
+ const list = [];
12802
+ props.columnsArray.forEach((col) => {
12803
+ if (functions$1)
12804
+ list.push({
12805
+ name: col.name,
12806
+ title: col.title,
12807
+ value: functions$1.isColumnDisplayed(col)
12808
+ });
12809
+ });
12810
+ columnsCheckable.value = list;
12811
+ }
12812
+ function setColumnDisplayValue(colName, value) {
12813
+ props.columns[colName].isDisplayed = value;
12814
+ }
12815
+ return (_ctx, _cache) => {
12816
+ return openBlock(), createBlock(_sfc_main$e, {
12817
+ modelValue: unref(isActive),
12818
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(isActive) ? isActive.value = $event : null),
12819
+ title: "Administrador de columnas"
12820
+ }, {
12821
+ default: withCtx(() => [
12822
+ createElementVNode("div", _hoisted_1$3, [
12823
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(columnsCheckable), (col) => {
12824
+ return openBlock(), createElementBlock("div", _hoisted_2$1, [
12825
+ createVNode(ckCheckbox, {
12826
+ modelValue: col.value,
12827
+ "onUpdate:modelValue": ($event) => col.value = $event,
12828
+ onChange: ($event) => setColumnDisplayValue(col.name, col.value)
12829
+ }, {
12830
+ default: withCtx(() => [
12831
+ createTextVNode(toDisplayString(col.title), 1)
12832
+ ]),
12833
+ _: 2
12834
+ }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])
12835
+ ]);
12836
+ }), 256))
12837
+ ])
12838
+ ]),
12839
+ _: 1
12840
+ }, 8, ["modelValue"]);
12841
+ };
12842
+ }
12843
+ });
12844
+ var TableColumnsManager = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-6ae82d89"]]);
12467
12845
  var ckTable_vue_vue_type_style_index_0_scoped_true_lang = "";
12468
12846
  const _hoisted_1$2 = { class: "ck-table" };
12469
12847
  const _hoisted_2 = {
@@ -12479,7 +12857,8 @@ const _hoisted_5 = { key: 0 };
12479
12857
  const _hoisted_6 = { key: 1 };
12480
12858
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
12481
12859
  props: {
12482
- columns: { type: Array, required: true, default: () => [] },
12860
+ columns: { type: [Array, Object], required: true, default: () => [] },
12861
+ hasColumnsManager: { type: Boolean, default: false },
12483
12862
  currentPage: { type: Number, default: 0 },
12484
12863
  itemsPerPage: { type: Number, default: 40 },
12485
12864
  listLength: { type: Number, default: 0 },
@@ -12492,6 +12871,25 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
12492
12871
  emits: ["refreshList", "update:search", "update:currentPage"],
12493
12872
  setup(__props, { emit: emits }) {
12494
12873
  const props = __props;
12874
+ const { qmObj: qmObj2 } = main$1;
12875
+ const IsPopupActive = ref({
12876
+ columnsManager: false
12877
+ });
12878
+ const columnsAreObj = computed(() => !qmObj2.isArray(props.columns));
12879
+ const columnsArray = computed(() => {
12880
+ if (!columnsAreObj.value)
12881
+ return props.columns;
12882
+ const arr = Object.values(props.columns);
12883
+ const keys = Object.keys(props.columns);
12884
+ arr.forEach((col, index) => {
12885
+ const key = keys[index];
12886
+ col.name = key;
12887
+ });
12888
+ return arr;
12889
+ });
12890
+ const filteredColumnsList = computed(() => {
12891
+ return columnsArray.value.filter(functions$1.isColumnDisplayed);
12892
+ });
12495
12893
  const searchLocal = computed({
12496
12894
  get() {
12497
12895
  return props.search;
@@ -12511,114 +12909,150 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
12511
12909
  function refreshList(pageChange = false) {
12512
12910
  emits("refreshList", pageChange);
12513
12911
  }
12912
+ function openColumnsManager() {
12913
+ if (columnsAreObj.value) {
12914
+ IsPopupActive.value.columnsManager = true;
12915
+ } else {
12916
+ console.log("ERROR ck-table", "The columns list should be an object");
12917
+ }
12918
+ }
12514
12919
  return (_ctx, _cache) => {
12515
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
12516
- _ctx.$slots.header || !__props.hideHeaderActions ? (openBlock(), createElementBlock("div", _hoisted_2, [
12517
- !__props.hideHeaderActions ? (openBlock(), createBlock(TableHeaderItems, {
12518
- key: 0,
12519
- search: unref(searchLocal),
12520
- "onUpdate:search": _cache[0] || (_cache[0] = ($event) => isRef(searchLocal) ? searchLocal.value = $event : null),
12521
- currentPage: __props.currentPage,
12522
- itemsPerPage: __props.itemsPerPage,
12523
- listLength: __props.listLength,
12524
- hideRefreshBtn: __props.hideRefreshBtn,
12525
- hideItemsPerPage: __props.hideItemsPerPage,
12526
- onRefreshList: _cache[1] || (_cache[1] = ($event) => refreshList($event))
12527
- }, null, 8, ["search", "currentPage", "itemsPerPage", "listLength", "hideRefreshBtn", "hideItemsPerPage"])) : createCommentVNode("", true),
12528
- _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_3, [
12529
- renderSlot(_ctx.$slots, "header", {}, void 0, true)
12530
- ])) : createCommentVNode("", true)
12531
- ])) : createCommentVNode("", true),
12532
- createElementVNode("table", _hoisted_4, [
12533
- __props.columns.length ? (openBlock(), createElementBlock("thead", _hoisted_5, [
12534
- createVNode(ckTr, null, {
12535
- default: withCtx(() => [
12536
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (col) => {
12537
- return openBlock(), createBlock(ckTableTitle, {
12538
- key: col.title,
12539
- col
12540
- }, null, 8, ["col"]);
12541
- }), 128))
12542
- ]),
12543
- _: 1
12544
- })
12920
+ return openBlock(), createElementBlock(Fragment, null, [
12921
+ __props.hasColumnsManager && unref(columnsAreObj) ? (openBlock(), createBlock(TableColumnsManager, {
12922
+ key: 0,
12923
+ modelValue: IsPopupActive.value.columnsManager,
12924
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => IsPopupActive.value.columnsManager = $event),
12925
+ columnsArray: unref(columnsArray),
12926
+ columns: __props.columns
12927
+ }, null, 8, ["modelValue", "columnsArray", "columns"])) : createCommentVNode("", true),
12928
+ createElementVNode("div", _hoisted_1$2, [
12929
+ _ctx.$slots.header || !__props.hideHeaderActions ? (openBlock(), createElementBlock("div", _hoisted_2, [
12930
+ !__props.hideHeaderActions ? (openBlock(), createBlock(TableHeaderItems, {
12931
+ key: 0,
12932
+ search: unref(searchLocal),
12933
+ "onUpdate:search": _cache[1] || (_cache[1] = ($event) => isRef(searchLocal) ? searchLocal.value = $event : null),
12934
+ currentPage: __props.currentPage,
12935
+ hasColumnsManager: __props.hasColumnsManager,
12936
+ itemsPerPage: __props.itemsPerPage,
12937
+ listLength: __props.listLength,
12938
+ hideRefreshBtn: __props.hideRefreshBtn,
12939
+ hideItemsPerPage: __props.hideItemsPerPage,
12940
+ onRefreshList: _cache[2] || (_cache[2] = ($event) => refreshList($event)),
12941
+ onOpenColumnsManager: _cache[3] || (_cache[3] = ($event) => openColumnsManager())
12942
+ }, null, 8, ["search", "currentPage", "hasColumnsManager", "itemsPerPage", "listLength", "hideRefreshBtn", "hideItemsPerPage"])) : createCommentVNode("", true),
12943
+ _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_3, [
12944
+ renderSlot(_ctx.$slots, "header", {}, void 0, true)
12945
+ ])) : createCommentVNode("", true)
12545
12946
  ])) : createCommentVNode("", true),
12546
- createElementVNode("tbody", null, [
12547
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
12947
+ createElementVNode("table", _hoisted_4, [
12948
+ unref(filteredColumnsList).length ? (openBlock(), createElementBlock("thead", _hoisted_5, [
12949
+ createVNode(ckTr, null, {
12950
+ default: withCtx(() => [
12951
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredColumnsList), (col) => {
12952
+ return openBlock(), createBlock(_sfc_main$7, {
12953
+ key: col.title,
12954
+ col
12955
+ }, null, 8, ["col"]);
12956
+ }), 128))
12957
+ ]),
12958
+ _: 1
12959
+ })
12960
+ ])) : createCommentVNode("", true),
12961
+ createElementVNode("tbody", null, [
12962
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
12963
+ ]),
12964
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("tfoot", _hoisted_6, [
12965
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
12966
+ ])) : createCommentVNode("", true)
12548
12967
  ]),
12549
- _ctx.$slots.footer ? (openBlock(), createElementBlock("tfoot", _hoisted_6, [
12550
- renderSlot(_ctx.$slots, "footer", {}, void 0, true)
12551
- ])) : createCommentVNode("", true)
12552
- ]),
12553
- createVNode(TablePagination, {
12554
- currentPage: unref(currentPageLocal),
12555
- "onUpdate:currentPage": _cache[2] || (_cache[2] = ($event) => isRef(currentPageLocal) ? currentPageLocal.value = $event : null),
12556
- itemsPerPage: __props.itemsPerPage,
12557
- listLength: __props.listLength,
12558
- align: __props.paginationAlign,
12559
- onRefreshList: _cache[3] || (_cache[3] = ($event) => refreshList(true))
12560
- }, null, 8, ["currentPage", "itemsPerPage", "listLength", "align"])
12561
- ]);
12968
+ createVNode(TablePagination, {
12969
+ currentPage: unref(currentPageLocal),
12970
+ "onUpdate:currentPage": _cache[4] || (_cache[4] = ($event) => isRef(currentPageLocal) ? currentPageLocal.value = $event : null),
12971
+ itemsPerPage: __props.itemsPerPage,
12972
+ listLength: __props.listLength,
12973
+ align: __props.paginationAlign,
12974
+ onRefreshList: _cache[5] || (_cache[5] = ($event) => refreshList(true))
12975
+ }, null, 8, ["currentPage", "itemsPerPage", "listLength", "align"])
12976
+ ])
12977
+ ], 64);
12562
12978
  };
12563
12979
  }
12564
12980
  });
12565
- var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-cac87456"]]);
12566
- function render$3(_ctx, _cache, $props, $setup, $data, $options) {
12567
- return openBlock(), createElementBlock("td", {
12568
- class: normalizeClass(["ck-td", $options.computedTdClass])
12569
- }, [
12570
- createElementVNode("span", {
12571
- class: normalizeClass($options.computedSpanClass),
12572
- style: normalizeStyle($options.computedStyle)
12573
- }, [
12574
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
12575
- ], 6)
12576
- ], 2);
12577
- }
12981
+ var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-4abe8990"]]);
12578
12982
  var ckTd_vue_vue_type_style_index_0_scoped_true_lang = "";
12579
- const _sfc_main$2 = {
12983
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
12580
12984
  props: {
12985
+ col: { type: Object, default: void 0 },
12581
12986
  wrap: { type: Boolean, default: false },
12582
12987
  block: { type: Boolean, default: false },
12583
12988
  autoWidth: { type: Boolean, default: false },
12584
- align: { type: String, default: "center", validator: validators.align },
12989
+ align: { type: String, default: void 0, validator: validators.align },
12585
12990
  fixedWidth: { type: String, default: "" },
12586
12991
  minWidth: { type: String, default: "" },
12587
12992
  maxWidth: { type: String, default: "" },
12588
12993
  maxHeight: { type: String, default: "" }
12589
12994
  },
12590
- computed: {
12591
- computedTdClass() {
12592
- return {
12593
- "auto-width": this.autoWidth
12594
- };
12595
- },
12596
- computedSpanClass() {
12995
+ setup(__props) {
12996
+ const props = __props;
12997
+ const computedTdClass = computed(() => {
12597
12998
  return {
12598
- block: this.block,
12599
- "wrap-text": this.wrap,
12600
- "align-center": this.align !== "left" && this.align !== "right",
12601
- "align-left": this.align === "left",
12602
- "align-right": this.align === "right"
12999
+ "auto-width": props.autoWidth
12603
13000
  };
12604
- },
12605
- computedStyle() {
13001
+ });
13002
+ const computedSpanClass = computed(() => {
13003
+ const list = [];
13004
+ let align;
13005
+ if (props.col)
13006
+ align = props.col.align;
13007
+ if (props.align)
13008
+ align = props.align;
13009
+ if (align) {
13010
+ if (align === "center")
13011
+ list.push("align-center");
13012
+ if (align === "right")
13013
+ list.push("align-right");
13014
+ }
13015
+ if (props.block)
13016
+ list.push("block");
13017
+ if (props.block)
13018
+ list.push("wrap-text");
13019
+ return list;
13020
+ });
13021
+ const computedStyle = computed(() => {
12606
13022
  const list = {};
12607
- if (this.minWidth)
12608
- list["min-width"] = this.minWidth;
12609
- if (this.fixedWidth)
12610
- list["min-width"] = this.fixedWidth;
12611
- if (this.maxWidth)
12612
- list["max-width"] = this.maxWidth;
12613
- if (this.fixedWidth)
12614
- list["max-width"] = this.fixedWidth;
12615
- if (this.maxHeight)
12616
- list["max-height"] = this.maxHeight;
13023
+ if (props.minWidth)
13024
+ list["min-width"] = props.minWidth;
13025
+ if (props.fixedWidth)
13026
+ list["min-width"] = props.fixedWidth;
13027
+ if (props.maxWidth)
13028
+ list["max-width"] = props.maxWidth;
13029
+ if (props.fixedWidth)
13030
+ list["max-width"] = props.fixedWidth;
13031
+ if (props.maxHeight)
13032
+ list["max-height"] = props.maxHeight;
12617
13033
  return list;
12618
- }
13034
+ });
13035
+ const isColumnDisplayed = computed(() => {
13036
+ if (!props.col)
13037
+ return true;
13038
+ return functions$1.isColumnDisplayed(props.col);
13039
+ });
13040
+ return (_ctx, _cache) => {
13041
+ return unref(isColumnDisplayed) ? (openBlock(), createElementBlock("td", {
13042
+ key: 0,
13043
+ class: normalizeClass(["ck-td", unref(computedTdClass)])
13044
+ }, [
13045
+ createElementVNode("span", {
13046
+ class: normalizeClass(unref(computedSpanClass)),
13047
+ style: normalizeStyle(unref(computedStyle))
13048
+ }, [
13049
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
13050
+ ], 6)
13051
+ ], 2)) : createCommentVNode("", true);
13052
+ };
12619
13053
  }
12620
- };
12621
- var ckTd = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", render$3], ["__scopeId", "data-v-70c634f2"]]);
13054
+ });
13055
+ var ckTd = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-c34b91ca"]]);
12622
13056
  const _hoisted_1$1 = { class: "ck-textarea" };
12623
13057
  function render$2(_ctx, _cache, $props, $setup, $data, $options) {
12624
13058
  const _component_ck_label = resolveComponent("ck-label");
@@ -15260,11 +15694,12 @@ var components = /* @__PURE__ */ Object.freeze({
15260
15694
  [Symbol.toStringTag]: "Module",
15261
15695
  ckButton,
15262
15696
  ckCheckbox,
15697
+ ckChip,
15263
15698
  ckIcon,
15264
15699
  ckImg,
15265
15700
  ckInput,
15266
15701
  ckLabel,
15267
- ckPopup: _sfc_main$d,
15702
+ ckPopup: _sfc_main$e,
15268
15703
  ckRadio,
15269
15704
  ckSelect,
15270
15705
  ckSwitch,
@@ -15311,4 +15746,4 @@ const install = function installCleek(app, options) {
15311
15746
  app.component(componentName, component);
15312
15747
  });
15313
15748
  };
15314
- 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 };
15749
+ export { events as EVENTS, mitt as EventBus, ckButton, ckCheckbox, ckChip, ckIcon, ckImg, ckInput, ckLabel, _sfc_main$e as ckPopup, ckRadio, ckSelect, ckSwitch, ckSwitchOptions, ckTable, ckTd, ckTextarea, ckTh, ckTooltip, ckTr, install as default, lockScroll, unlockScroll };