cleek 2.1.10 → 2.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cleek.es.js CHANGED
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, renderSlot, normalizeClass, createCommentVNode, computed as computed$2, normalizeStyle, unref as unref$1, watch, h, createBlock, onMounted, getCurrentInstance, mergeProps, withKeys, withModifiers, pushScopeId, popScopeId, withCtx, createTextVNode, toDisplayString, withDirectives, isRef as isRef$1, vModelDynamic, createVNode, Fragment, renderList, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
20
+ import { defineComponent, ref, openBlock, createElementBlock, createElementVNode, renderSlot, normalizeClass, createCommentVNode, computed as computed$2, normalizeStyle, unref as unref$1, watch, h, createBlock, Teleport, createVNode, createTextVNode, toDisplayString, withCtx, onMounted, getCurrentInstance, withDirectives, isRef as isRef$1, vModelDynamic, Fragment, renderList, mergeProps, withKeys, withModifiers, pushScopeId, popScopeId, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
21
21
  var ckDropdown_vue_vue_type_style_index_0_scoped_true_lang = "";
22
22
  var _export_sfc = (sfc, props) => {
23
23
  const target = sfc.__vccOpts || sfc;
@@ -26,8 +26,8 @@ var _export_sfc = (sfc, props) => {
26
26
  }
27
27
  return target;
28
28
  };
29
- const _hoisted_1$j = { class: "ck-dropdown" };
30
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
29
+ const _hoisted_1$k = { class: "ck-dropdown" };
30
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
31
31
  props: {
32
32
  triggerType: { type: String, default: "click" },
33
33
  dark: { type: Boolean, default: false }
@@ -49,7 +49,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
49
49
  isOpen.value = true;
50
50
  }
51
51
  return (_ctx, _cache) => {
52
- return openBlock(), createElementBlock("div", _hoisted_1$j, [
52
+ return openBlock(), createElementBlock("div", _hoisted_1$k, [
53
53
  createElementVNode("div", {
54
54
  class: "ck-dropdown__trigger",
55
55
  onClick: _cache[0] || (_cache[0] = ($event) => openClose())
@@ -71,9 +71,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
71
71
  };
72
72
  }
73
73
  });
74
- var ckDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-64a91fb4"]]);
74
+ var ckDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-64a91fb4"]]);
75
75
  var ckNavbar_vue_vue_type_style_index_0_scoped_true_lang = "";
76
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
76
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
77
77
  props: {
78
78
  padding: { type: String, default: 0 },
79
79
  position: { type: String, default: "fixed" }
@@ -108,77 +108,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
108
108
  };
109
109
  }
110
110
  });
111
- var ckNavbar = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-5024db6a"]]);
112
- var validators = {
113
- size: (type) => {
114
- return ["", "xs", "s", "m", "l", "xl"].includes(type);
115
- },
116
- group: (type) => {
117
- return ["", "left", "right", "center"].includes(type);
118
- },
119
- groupVertical: (type) => {
120
- return ["top", "bottom", "center"].includes(type);
121
- },
122
- align: (type) => {
123
- return ["left", "center", "right"].includes(type);
124
- },
125
- buttonType: (type) => {
126
- return ["filled", "outlined", "flat"].includes(type);
127
- },
128
- inputType: (type) => {
129
- return ["text", "number", "date", "time", "password"].includes(type);
130
- },
131
- radioOptions: (options) => {
132
- let isValid = true;
133
- options.forEach((option) => {
134
- isValid = isValid && "label" in option && "value" in option;
135
- });
136
- return isValid;
137
- }
138
- };
139
- var functions$1 = {
140
- getGroupClass({ group = "", groupVertical = "", groupBreak = "" } = {}) {
141
- const _screenSize = "";
142
- if (groupBreak && groupBreak === _screenSize)
143
- return [];
144
- const classList2 = [];
145
- if (group)
146
- classList2.push(`ck-component__group--${group}`);
147
- if (groupVertical)
148
- classList2.push(`ck-component__group-vertical--${groupVertical}`);
149
- return classList2;
150
- },
151
- isColorTemplateVariable(color) {
152
- if (color === "primary")
153
- return true;
154
- if (color === "secondary")
155
- return true;
156
- if (color === "success")
157
- return true;
158
- if (color === "warning")
159
- return true;
160
- if (color === "danger")
161
- return true;
162
- if (color === "dark")
163
- return true;
164
- if (color === "light")
165
- return true;
166
- return false;
167
- },
168
- isColumnDisplayed(column) {
169
- if (column.isDisplayed === false)
170
- return false;
171
- if (column.unchangeable) {
172
- if (column.isDisplayed === true)
173
- return true;
174
- return false;
175
- }
176
- return true;
177
- },
178
- getCleekOptions(getCurrentInstance2) {
179
- return getCurrentInstance2().appContext.app.config.globalProperties.$cleekOptions;
180
- }
181
- };
111
+ var ckNavbar = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-5024db6a"]]);
182
112
  /*!
183
113
  * Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
184
114
  * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
@@ -384,11 +314,11 @@ if (!w[NAMESPACE_IDENTIFIER].hooks)
384
314
  if (!w[NAMESPACE_IDENTIFIER].shims)
385
315
  w[NAMESPACE_IDENTIFIER].shims = [];
386
316
  var namespace = w[NAMESPACE_IDENTIFIER];
387
- var functions = [];
317
+ var functions$1 = [];
388
318
  var listener = function listener2() {
389
319
  DOCUMENT.removeEventListener("DOMContentLoaded", listener2);
390
320
  loaded = 1;
391
- functions.map(function(fn2) {
321
+ functions$1.map(function(fn2) {
392
322
  return fn2();
393
323
  });
394
324
  };
@@ -11299,7 +11229,7 @@ defineComponent({
11299
11229
  }
11300
11230
  });
11301
11231
  var ckIcon_vue_vue_type_style_index_0_scoped_true_lang = "";
11302
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
11232
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
11303
11233
  props: {
11304
11234
  icon: { type: [String, Array], default: "" },
11305
11235
  color: { type: String, default: "" },
@@ -11359,10 +11289,212 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
11359
11289
  };
11360
11290
  }
11361
11291
  });
11362
- var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-25801d7b"]]);
11292
+ var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-25801d7b"]]);
11293
+ var ckNotify_vue_vue_type_style_index_0_scoped_true_lang = "";
11294
+ const _hoisted_1$j = { class: "ck-notify__container" };
11295
+ const _hoisted_2$9 = { class: "ck-notify__title" };
11296
+ const _hoisted_3$6 = { class: "close-btn" };
11297
+ const _hoisted_4$4 = { class: "ck-notify__text" };
11298
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
11299
+ setup(__props, { expose }) {
11300
+ expose({
11301
+ ckNotify: ckNotify2,
11302
+ ckNotifySuccess,
11303
+ ckNotifyError,
11304
+ ckNotifyWarning
11305
+ });
11306
+ const isActive = ref(false);
11307
+ const globalTitle = ref("");
11308
+ const globalText = ref("");
11309
+ const globalColor = ref("");
11310
+ const defaultDuration = ref(2e3);
11311
+ function closeNotification() {
11312
+ isActive.value = false;
11313
+ }
11314
+ function ckNotify2({ text: text3 = "", title = "", color = "#ccc", duration = defaultDuration.value }) {
11315
+ console.log("openNotify", title);
11316
+ globalTitle.value = title;
11317
+ globalText.value = text3;
11318
+ globalColor.value = color;
11319
+ isActive.value = true;
11320
+ setTimeout(() => {
11321
+ closeNotification();
11322
+ }, duration);
11323
+ }
11324
+ function ckNotifySuccess(text3 = "", title = "\xC9xito") {
11325
+ ckNotify2({
11326
+ text: text3,
11327
+ title,
11328
+ color: "#66CC00"
11329
+ });
11330
+ }
11331
+ function ckNotifyError(text3 = "", title = "Error") {
11332
+ ckNotify2({ text: text3, title, color: "#FF3333" });
11333
+ }
11334
+ function ckNotifyWarning(text3 = "", title = "Atenci\xF3n") {
11335
+ ckNotify2({ text: text3, title, color: "#FFDD33" });
11336
+ }
11337
+ return (_ctx, _cache) => {
11338
+ return isActive.value ? (openBlock(), createBlock(Teleport, {
11339
+ key: 0,
11340
+ to: "body"
11341
+ }, [
11342
+ createElementVNode("div", _hoisted_1$j, [
11343
+ createElementVNode("div", {
11344
+ class: "ck-notify",
11345
+ style: normalizeStyle({ "background-color": globalColor.value }),
11346
+ onClick: _cache[0] || (_cache[0] = ($event) => closeNotification())
11347
+ }, [
11348
+ createElementVNode("div", _hoisted_2$9, [
11349
+ createElementVNode("div", _hoisted_3$6, [
11350
+ createVNode(ckIcon, { icon: "times" })
11351
+ ]),
11352
+ createTextVNode(toDisplayString(globalTitle.value), 1)
11353
+ ]),
11354
+ createElementVNode("div", _hoisted_4$4, toDisplayString(globalText.value), 1)
11355
+ ], 4)
11356
+ ])
11357
+ ])) : createCommentVNode("", true);
11358
+ };
11359
+ }
11360
+ });
11361
+ var ckNotify = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-4eba623e"]]);
11362
+ const _hoisted_1$i = { class: "ck-tr" };
11363
+ function render$1(_ctx, _cache) {
11364
+ return openBlock(), createElementBlock("tr", _hoisted_1$i, [
11365
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
11366
+ ]);
11367
+ }
11368
+ var ckTr_vue_vue_type_style_index_0_scoped_true_lang = "";
11369
+ const _sfc_main$k = {};
11370
+ var ckTr = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", render$1], ["__scopeId", "data-v-519cf874"]]);
11371
+ var validators = {
11372
+ size: (type) => {
11373
+ return ["", "xs", "s", "m", "l", "xl"].includes(type);
11374
+ },
11375
+ group: (type) => {
11376
+ return ["", "left", "right", "center"].includes(type);
11377
+ },
11378
+ groupVertical: (type) => {
11379
+ return ["top", "bottom", "center"].includes(type);
11380
+ },
11381
+ align: (type) => {
11382
+ return ["left", "center", "right"].includes(type);
11383
+ },
11384
+ buttonType: (type) => {
11385
+ return ["filled", "outlined", "flat"].includes(type);
11386
+ },
11387
+ inputType: (type) => {
11388
+ return ["text", "number", "date", "time", "password"].includes(type);
11389
+ },
11390
+ radioOptions: (options) => {
11391
+ let isValid = true;
11392
+ options.forEach((option) => {
11393
+ isValid = isValid && "label" in option && "value" in option;
11394
+ });
11395
+ return isValid;
11396
+ }
11397
+ };
11398
+ var ckTh_vue_vue_type_style_index_0_scoped_true_lang = "";
11399
+ const _hoisted_1$h = { class: "ck-th" };
11400
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
11401
+ props: {
11402
+ align: { type: String, default: "left", validator: validators.align },
11403
+ minWidth: { type: String, default: void 0 }
11404
+ },
11405
+ setup(__props) {
11406
+ const props = __props;
11407
+ const computedSpanClass = computed$2(() => {
11408
+ return {
11409
+ "align-center": props.align !== "left" && props.align !== "right",
11410
+ "align-left": props.align === "left",
11411
+ "align-right": props.align === "right"
11412
+ };
11413
+ });
11414
+ const computedStyle = computed$2(() => {
11415
+ const list = [];
11416
+ if (props.minWidth)
11417
+ list.push({ "min-width": props.minWidth });
11418
+ return list;
11419
+ });
11420
+ return (_ctx, _cache) => {
11421
+ return openBlock(), createElementBlock("th", _hoisted_1$h, [
11422
+ createElementVNode("span", {
11423
+ class: normalizeClass(unref$1(computedSpanClass)),
11424
+ style: normalizeStyle(unref$1(computedStyle))
11425
+ }, [
11426
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
11427
+ ], 6)
11428
+ ]);
11429
+ };
11430
+ }
11431
+ });
11432
+ var ckTh = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-385c14e2"]]);
11433
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
11434
+ props: {
11435
+ col: { type: Object, required: true }
11436
+ },
11437
+ setup(__props) {
11438
+ return (_ctx, _cache) => {
11439
+ return openBlock(), createBlock(ckTh, {
11440
+ align: __props.col.align,
11441
+ "min-width": __props.col.minWidth
11442
+ }, {
11443
+ default: withCtx(() => [
11444
+ createTextVNode(toDisplayString(__props.col.title), 1)
11445
+ ]),
11446
+ _: 1
11447
+ }, 8, ["align", "min-width"]);
11448
+ };
11449
+ }
11450
+ });
11451
+ var functions = {
11452
+ getGroupClass({ group = "", groupVertical = "", groupBreak = "" } = {}) {
11453
+ const _screenSize = "";
11454
+ if (groupBreak && groupBreak === _screenSize)
11455
+ return [];
11456
+ const classList2 = [];
11457
+ if (group)
11458
+ classList2.push(`ck-component__group--${group}`);
11459
+ if (groupVertical)
11460
+ classList2.push(`ck-component__group-vertical--${groupVertical}`);
11461
+ return classList2;
11462
+ },
11463
+ isColorTemplateVariable(color) {
11464
+ if (color === "primary")
11465
+ return true;
11466
+ if (color === "secondary")
11467
+ return true;
11468
+ if (color === "success")
11469
+ return true;
11470
+ if (color === "warning")
11471
+ return true;
11472
+ if (color === "danger")
11473
+ return true;
11474
+ if (color === "dark")
11475
+ return true;
11476
+ if (color === "light")
11477
+ return true;
11478
+ return false;
11479
+ },
11480
+ isColumnDisplayed(column) {
11481
+ if (column.isDisplayed === false)
11482
+ return false;
11483
+ if (column.unchangeable) {
11484
+ if (column.isDisplayed === true)
11485
+ return true;
11486
+ return false;
11487
+ }
11488
+ return true;
11489
+ },
11490
+ getCleekOptions(getCurrentInstance2) {
11491
+ console.log("getCurrentInstance", getCurrentInstance2);
11492
+ return getCurrentInstance2().appContext.app.config.globalProperties.$cleekOptions;
11493
+ }
11494
+ };
11363
11495
  var ckButton_vue_vue_type_style_index_0_scoped_true_lang = "";
11364
- const _hoisted_1$i = ["title", "aria-label", "disabled"];
11365
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
11496
+ const _hoisted_1$g = ["title", "aria-label", "disabled"];
11497
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11366
11498
  props: {
11367
11499
  title: { type: String, default: void 0 },
11368
11500
  disabled: { type: Boolean, default: false },
@@ -11385,7 +11517,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
11385
11517
  const isMounted = ref(false);
11386
11518
  const computedClass = computed$2(() => {
11387
11519
  const classList2 = [];
11388
- classList2.push(functions$1.getGroupClass(props));
11520
+ classList2.push(functions.getGroupClass(props));
11389
11521
  if (props.color !== "primary") {
11390
11522
  if (props.type === "filled") {
11391
11523
  classList2.push(`ck-component__bg-color--${props.color}`);
@@ -11439,1073 +11571,1181 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
11439
11571
  icon: __props.iconRight,
11440
11572
  "icon-pack": __props.iconPack
11441
11573
  }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true)
11442
- ], 10, _hoisted_1$i);
11574
+ ], 10, _hoisted_1$g);
11443
11575
  };
11444
11576
  }
11445
11577
  });
11446
- var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-36b03be6"]]);
11447
- const NOOP$1 = () => {
11448
- };
11449
- const isArray$1 = Array.isArray;
11450
- const isFunction$1 = (val) => typeof val === "function";
11451
- const isSymbol = (val) => typeof val === "symbol";
11452
- const def = (obj, key, value) => {
11453
- Object.defineProperty(obj, key, {
11454
- configurable: true,
11455
- enumerable: false,
11456
- value
11457
- });
11458
- };
11459
- let activeEffectScope;
11460
- function recordEffectScope(effect3, scope) {
11461
- scope = scope || activeEffectScope;
11462
- if (scope && scope.active) {
11463
- scope.effects.push(effect3);
11464
- }
11465
- }
11466
- const createDep = (effects) => {
11467
- const dep = new Set(effects);
11468
- dep.w = 0;
11469
- dep.n = 0;
11470
- return dep;
11471
- };
11472
- const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
11473
- const newTracked = (dep) => (dep.n & trackOpBit) > 0;
11474
- const initDepMarkers = ({ deps }) => {
11475
- if (deps.length) {
11476
- for (let i = 0; i < deps.length; i++) {
11477
- deps[i].w |= trackOpBit;
11478
- }
11479
- }
11480
- };
11481
- const finalizeDepMarkers = (effect3) => {
11482
- const { deps } = effect3;
11483
- if (deps.length) {
11484
- let ptr = 0;
11485
- for (let i = 0; i < deps.length; i++) {
11486
- const dep = deps[i];
11487
- if (wasTracked(dep) && !newTracked(dep)) {
11488
- dep.delete(effect3);
11489
- } else {
11490
- deps[ptr++] = dep;
11491
- }
11492
- dep.w &= ~trackOpBit;
11493
- dep.n &= ~trackOpBit;
11494
- }
11495
- deps.length = ptr;
11496
- }
11497
- };
11498
- let effectTrackDepth = 0;
11499
- let trackOpBit = 1;
11500
- const maxMarkerBits = 30;
11501
- const effectStack = [];
11502
- let activeEffect;
11503
- class ReactiveEffect {
11504
- constructor(fn2, scheduler = null, scope) {
11505
- this.fn = fn2;
11506
- this.scheduler = scheduler;
11507
- this.active = true;
11508
- this.deps = [];
11509
- recordEffectScope(this, scope);
11510
- }
11511
- run() {
11512
- if (!this.active) {
11513
- return this.fn();
11514
- }
11515
- if (!effectStack.length || !effectStack.includes(this)) {
11516
- try {
11517
- effectStack.push(activeEffect = this);
11518
- enableTracking();
11519
- trackOpBit = 1 << ++effectTrackDepth;
11520
- if (effectTrackDepth <= maxMarkerBits) {
11521
- initDepMarkers(this);
11522
- } else {
11523
- cleanupEffect(this);
11524
- }
11525
- return this.fn();
11526
- } finally {
11527
- if (effectTrackDepth <= maxMarkerBits) {
11528
- finalizeDepMarkers(this);
11529
- }
11530
- trackOpBit = 1 << --effectTrackDepth;
11531
- resetTracking();
11532
- effectStack.pop();
11533
- const n = effectStack.length;
11534
- activeEffect = n > 0 ? effectStack[n - 1] : void 0;
11535
- }
11536
- }
11578
+ var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-36b03be6"]]);
11579
+ var ckLabel_vue_vue_type_style_index_0_scoped_true_lang = "";
11580
+ const _hoisted_1$f = ["for"];
11581
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11582
+ props: {
11583
+ for: { type: String, default: "" },
11584
+ align: { type: String, default: "" }
11585
+ },
11586
+ setup(__props) {
11587
+ const props = __props;
11588
+ const computedClass = computed$2(() => {
11589
+ const list = [];
11590
+ let align = "left";
11591
+ if (props.align === "center" || props.align === "right")
11592
+ align = props.align;
11593
+ list.push(`ck-align--${align}`);
11594
+ return list;
11595
+ });
11596
+ return (_ctx, _cache) => {
11597
+ return openBlock(), createElementBlock("label", {
11598
+ class: normalizeClass(["ck-label", unref$1(computedClass)]),
11599
+ for: __props.for
11600
+ }, [
11601
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
11602
+ ], 10, _hoisted_1$f);
11603
+ };
11537
11604
  }
11538
- stop() {
11539
- if (this.active) {
11540
- cleanupEffect(this);
11541
- if (this.onStop) {
11542
- this.onStop();
11605
+ });
11606
+ var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-ef74ea02"]]);
11607
+ var ckInput_vue_vue_type_style_index_0_scoped_true_lang = "";
11608
+ const _hoisted_1$e = { class: "ck-input" };
11609
+ const _hoisted_2$8 = ["type", "placeholder", "id", "disabled"];
11610
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11611
+ props: {
11612
+ modelValue: {},
11613
+ type: { type: String, validator: validators.inputType, default: "text" },
11614
+ disabled: { type: Boolean, default: false },
11615
+ placeholder: { type: String, default: void 0 },
11616
+ label: { type: String, default: void 0 },
11617
+ labelAlign: { type: String, validator: validators.align, default: void 0 },
11618
+ icon: { type: [String, Array], default: void 0 },
11619
+ iconPack: { type: String, default: void 0 },
11620
+ iconRight: { type: String, default: void 0 },
11621
+ group: { type: String, default: void 0 },
11622
+ groupBreak: { type: String, default: "s" },
11623
+ groupVertical: { type: String, default: void 0 },
11624
+ hideBorder: { type: Boolean, default: false },
11625
+ width: { type: String, default: void 0 },
11626
+ align: { type: String, validator: validators.align, default: void 0 },
11627
+ autoSelect: { type: Boolean, default: false }
11628
+ },
11629
+ emits: ["update:modelValue", "click", "input", "change"],
11630
+ setup(__props, { expose, emit: emits }) {
11631
+ const props = __props;
11632
+ expose({ setFocus, setSelect });
11633
+ const realInput = ref(null);
11634
+ const value = computed$2({
11635
+ get() {
11636
+ return props.modelValue;
11637
+ },
11638
+ set(val) {
11639
+ emits("update:modelValue", val);
11543
11640
  }
11544
- this.active = false;
11545
- }
11546
- }
11547
- }
11548
- function cleanupEffect(effect3) {
11549
- const { deps } = effect3;
11550
- if (deps.length) {
11551
- for (let i = 0; i < deps.length; i++) {
11552
- deps[i].delete(effect3);
11641
+ });
11642
+ const onClick = (event) => {
11643
+ if (props.autoSelect)
11644
+ event.target.select();
11645
+ emits("click", event);
11646
+ };
11647
+ const onInput = (event) => {
11648
+ emits("input", event);
11649
+ };
11650
+ const onChange = (event) => {
11651
+ emits("change", event);
11652
+ };
11653
+ const computedStyleInput = computed$2(() => {
11654
+ const list = [];
11655
+ if (props.width)
11656
+ list.push({ width: props.width });
11657
+ return list;
11658
+ });
11659
+ const computedClassInput = computed$2(() => {
11660
+ const list = [];
11661
+ list.push(functions.getGroupClass(props));
11662
+ if (props.icon)
11663
+ list.push("has-icon-left");
11664
+ if (props.iconRight)
11665
+ list.push("has-icon-right");
11666
+ if (props.align)
11667
+ list.push(`align--${props.align}`);
11668
+ if (props.hideBorder)
11669
+ list.push("no-border");
11670
+ return list;
11671
+ });
11672
+ function setFocus() {
11673
+ realInput.value.focus();
11553
11674
  }
11554
- deps.length = 0;
11555
- }
11556
- }
11557
- let shouldTrack = true;
11558
- const trackStack = [];
11559
- function enableTracking() {
11560
- trackStack.push(shouldTrack);
11561
- shouldTrack = true;
11562
- }
11563
- function resetTracking() {
11564
- const last = trackStack.pop();
11565
- shouldTrack = last === void 0 ? true : last;
11566
- }
11567
- function isTracking() {
11568
- return shouldTrack && activeEffect !== void 0;
11569
- }
11570
- function trackEffects(dep, debuggerEventExtraInfo) {
11571
- let shouldTrack2 = false;
11572
- if (effectTrackDepth <= maxMarkerBits) {
11573
- if (!newTracked(dep)) {
11574
- dep.n |= trackOpBit;
11575
- shouldTrack2 = !wasTracked(dep);
11675
+ function setSelect() {
11676
+ realInput.value.select();
11576
11677
  }
11577
- } else {
11578
- shouldTrack2 = !dep.has(activeEffect);
11579
- }
11580
- if (shouldTrack2) {
11581
- dep.add(activeEffect);
11582
- activeEffect.deps.push(dep);
11678
+ return (_ctx, _cache) => {
11679
+ return openBlock(), createElementBlock("div", _hoisted_1$e, [
11680
+ __props.label ? (openBlock(), createBlock(ckLabel, {
11681
+ key: 0,
11682
+ align: __props.labelAlign,
11683
+ for: "ck-input"
11684
+ }, {
11685
+ default: withCtx(() => [
11686
+ createTextVNode(toDisplayString(__props.label), 1)
11687
+ ]),
11688
+ _: 1
11689
+ }, 8, ["align"])) : createCommentVNode("", true),
11690
+ __props.icon ? (openBlock(), createBlock(ckIcon, {
11691
+ key: 1,
11692
+ class: "ck-input__icon-left",
11693
+ color: "lightgrey",
11694
+ icon: __props.icon,
11695
+ "icon-pack": __props.iconPack
11696
+ }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true),
11697
+ withDirectives(createElementVNode("input", {
11698
+ ref_key: "realInput",
11699
+ ref: realInput,
11700
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(value) ? value.value = $event : null),
11701
+ type: __props.type,
11702
+ placeholder: __props.placeholder,
11703
+ class: normalizeClass(unref$1(computedClassInput)),
11704
+ style: normalizeStyle(unref$1(computedStyleInput)),
11705
+ id: __props.label ? "ck-input" : "",
11706
+ disabled: __props.disabled,
11707
+ onChange: _cache[1] || (_cache[1] = ($event) => onChange($event)),
11708
+ onInput: _cache[2] || (_cache[2] = ($event) => onInput($event)),
11709
+ onClick: _cache[3] || (_cache[3] = ($event) => onClick($event))
11710
+ }, null, 46, _hoisted_2$8), [
11711
+ [vModelDynamic, unref$1(value)]
11712
+ ]),
11713
+ __props.iconRight ? (openBlock(), createBlock(ckIcon, {
11714
+ key: 2,
11715
+ class: "ck-input__icon-right",
11716
+ color: "lightgrey",
11717
+ icon: __props.iconRight,
11718
+ "icon-pack": __props.iconPack
11719
+ }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true)
11720
+ ]);
11721
+ };
11583
11722
  }
11584
- }
11585
- function triggerEffects(dep, debuggerEventExtraInfo) {
11586
- for (const effect3 of isArray$1(dep) ? dep : [...dep]) {
11587
- if (effect3 !== activeEffect || effect3.allowRecurse) {
11588
- if (effect3.scheduler) {
11589
- effect3.scheduler();
11590
- } else {
11591
- effect3.run();
11592
- }
11593
- }
11594
- }
11595
- }
11596
- new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));
11597
- function isReactive(value) {
11598
- if (isReadonly(value)) {
11599
- return isReactive(value["__v_raw"]);
11600
- }
11601
- return !!(value && value["__v_isReactive"]);
11602
- }
11603
- function isReadonly(value) {
11604
- return !!(value && value["__v_isReadonly"]);
11605
- }
11606
- function isShallow(value) {
11607
- return !!(value && value["__v_isShallow"]);
11608
- }
11609
- function toRaw(observed) {
11610
- const raw = observed && observed["__v_raw"];
11611
- return raw ? toRaw(raw) : observed;
11612
- }
11613
- function markRaw(value) {
11614
- def(value, "__v_skip", true);
11615
- return value;
11616
- }
11617
- function trackRefValue(ref2) {
11618
- if (isTracking()) {
11619
- ref2 = toRaw(ref2);
11620
- if (!ref2.dep) {
11621
- ref2.dep = createDep();
11622
- }
11623
- {
11624
- trackEffects(ref2.dep);
11625
- }
11626
- }
11627
- }
11628
- function triggerRefValue(ref2, newVal) {
11629
- ref2 = toRaw(ref2);
11630
- if (ref2.dep) {
11631
- {
11632
- triggerEffects(ref2.dep);
11633
- }
11634
- }
11635
- }
11636
- function isRef(r) {
11637
- return Boolean(r && r.__v_isRef === true);
11638
- }
11639
- function unref(ref2) {
11640
- return isRef(ref2) ? ref2.value : ref2;
11641
- }
11642
- const shallowUnwrapHandlers = {
11643
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
11644
- set: (target, key, value, receiver) => {
11645
- const oldValue = target[key];
11646
- if (isRef(oldValue) && !isRef(value)) {
11647
- oldValue.value = value;
11648
- return true;
11649
- } else {
11650
- return Reflect.set(target, key, value, receiver);
11651
- }
11652
- }
11653
- };
11654
- function proxyRefs(objectWithRefs) {
11655
- return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
11656
- }
11657
- class ComputedRefImpl {
11658
- constructor(getter, _setter, isReadonly2, isSSR) {
11659
- this._setter = _setter;
11660
- this.dep = void 0;
11661
- this.__v_isRef = true;
11662
- this._dirty = true;
11663
- this.effect = new ReactiveEffect(getter, () => {
11664
- if (!this._dirty) {
11665
- this._dirty = true;
11666
- triggerRefValue(this);
11723
+ });
11724
+ var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-19dca096"]]);
11725
+ var ckTable__headerItems_vue_vue_type_style_index_0_scoped_true_lang = "";
11726
+ const _hoisted_1$d = { class: "ck-table__header-items" };
11727
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11728
+ props: {
11729
+ search: { type: String, default: void 0 },
11730
+ hasColumnsManager: { type: Boolean, default: false },
11731
+ showRefreshBtn: { type: Boolean, required: true },
11732
+ hideItemsPerPage: { type: Boolean, required: true },
11733
+ currentPage: { type: Number, required: true },
11734
+ itemsPerPage: { type: Number, required: true },
11735
+ listLength: { type: Number, required: true }
11736
+ },
11737
+ emits: ["update:search", "refreshList", "openColumnsManager"],
11738
+ setup(__props, { emit: emits }) {
11739
+ const props = __props;
11740
+ const searchLocal = computed$2({
11741
+ get() {
11742
+ return props.search;
11743
+ },
11744
+ set(val) {
11745
+ emits("update:search", val);
11667
11746
  }
11668
11747
  });
11669
- this.effect.computed = this;
11670
- this.effect.active = this._cacheable = !isSSR;
11671
- this["__v_isReadonly"] = isReadonly2;
11672
- }
11673
- get value() {
11674
- const self2 = toRaw(this);
11675
- trackRefValue(self2);
11676
- if (self2._dirty || !self2._cacheable) {
11677
- self2._dirty = false;
11678
- self2._value = self2.effect.run();
11679
- }
11680
- return self2._value;
11681
- }
11682
- set value(newValue) {
11683
- this._setter(newValue);
11684
- }
11685
- }
11686
- function computed$1(getterOrOptions, debugOptions, isSSR = false) {
11687
- let getter;
11688
- let setter;
11689
- const onlyGetter = isFunction$1(getterOrOptions);
11690
- if (onlyGetter) {
11691
- getter = getterOrOptions;
11692
- setter = NOOP$1;
11693
- } else {
11694
- getter = getterOrOptions.get;
11695
- setter = getterOrOptions.set;
11696
- }
11697
- const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
11698
- return cRef;
11699
- }
11700
- Promise.resolve();
11701
- const EMPTY_OBJ = {};
11702
- const NOOP = () => {
11703
- };
11704
- const extend = Object.assign;
11705
- const remove = (arr, el) => {
11706
- const i = arr.indexOf(el);
11707
- if (i > -1) {
11708
- arr.splice(i, 1);
11709
- }
11710
- };
11711
- const isArray = Array.isArray;
11712
- const isMap = (val) => toTypeString(val) === "[object Map]";
11713
- const isSet = (val) => toTypeString(val) === "[object Set]";
11714
- const isFunction = (val) => typeof val === "function";
11715
- const isString = (val) => typeof val === "string";
11716
- const isObject = (val) => val !== null && typeof val === "object";
11717
- const isPromise = (val) => {
11718
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
11719
- };
11720
- const objectToString = Object.prototype.toString;
11721
- const toTypeString = (value) => objectToString.call(value);
11722
- const isPlainObject = (val) => toTypeString(val) === "[object Object]";
11723
- const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
11724
- function callWithErrorHandling(fn2, instance, type, args) {
11725
- let res;
11726
- try {
11727
- res = args ? fn2(...args) : fn2();
11728
- } catch (err) {
11729
- handleError(err, instance, type);
11730
- }
11731
- return res;
11732
- }
11733
- function callWithAsyncErrorHandling(fn2, instance, type, args) {
11734
- if (isFunction(fn2)) {
11735
- const res = callWithErrorHandling(fn2, instance, type, args);
11736
- if (res && isPromise(res)) {
11737
- res.catch((err) => {
11738
- handleError(err, instance, type);
11739
- });
11740
- }
11741
- return res;
11742
- }
11743
- const values = [];
11744
- for (let i = 0; i < fn2.length; i++) {
11745
- values.push(callWithAsyncErrorHandling(fn2[i], instance, type, args));
11746
- }
11747
- return values;
11748
- }
11749
- function handleError(err, instance, type, throwInDev = true) {
11750
- const contextVNode = instance ? instance.vnode : null;
11751
- if (instance) {
11752
- let cur = instance.parent;
11753
- const exposedInstance = instance.proxy;
11754
- const errorInfo = type;
11755
- while (cur) {
11756
- const errorCapturedHooks = cur.ec;
11757
- if (errorCapturedHooks) {
11758
- for (let i = 0; i < errorCapturedHooks.length; i++) {
11759
- if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
11760
- return;
11761
- }
11762
- }
11748
+ const hideSearch = computed$2(() => {
11749
+ return typeof searchLocal.value === "undefined";
11750
+ });
11751
+ const itemsPerPageStart = computed$2(() => {
11752
+ return (props.currentPage - 1) * props.itemsPerPage + 1;
11753
+ });
11754
+ const itemsPerPageEnd = computed$2(() => {
11755
+ const value = props.currentPage * props.itemsPerPage;
11756
+ if (value > props.listLength)
11757
+ return props.listLength;
11758
+ return value;
11759
+ });
11760
+ const itemsPerPageIsVisible = computed$2(() => {
11761
+ return !props.hideItemsPerPage && props.listLength && props.currentPage;
11762
+ });
11763
+ const refreshBtnIsVisible = computed$2(() => {
11764
+ return itemsPerPageIsVisible.value || props.showRefreshBtn;
11765
+ });
11766
+ const searchGroupValue = computed$2(() => {
11767
+ if (itemsPerPageIsVisible.value && props.hasColumnsManager) {
11768
+ return "center";
11763
11769
  }
11764
- cur = cur.parent;
11765
- }
11766
- const appErrorHandler = instance.appContext.config.errorHandler;
11767
- if (appErrorHandler) {
11768
- callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
11769
- return;
11770
- }
11771
- }
11772
- logError(err, type, contextVNode, throwInDev);
11773
- }
11774
- function logError(err, type, contextVNode, throwInDev = true) {
11775
- {
11776
- console.error(err);
11777
- }
11778
- }
11779
- let isFlushing = false;
11780
- let isFlushPending = false;
11781
- const queue = [];
11782
- let flushIndex = 0;
11783
- const pendingPreFlushCbs = [];
11784
- let activePreFlushCbs = null;
11785
- let preFlushIndex = 0;
11786
- const pendingPostFlushCbs = [];
11787
- let activePostFlushCbs = null;
11788
- let postFlushIndex = 0;
11789
- const resolvedPromise = Promise.resolve();
11790
- let currentFlushPromise = null;
11791
- let currentPreFlushParentJob = null;
11792
- function nextTick(fn2) {
11793
- const p = currentFlushPromise || resolvedPromise;
11794
- return fn2 ? p.then(this ? fn2.bind(this) : fn2) : p;
11795
- }
11796
- function findInsertionIndex(id) {
11797
- let start2 = flushIndex + 1;
11798
- let end2 = queue.length;
11799
- while (start2 < end2) {
11800
- const middle = start2 + end2 >>> 1;
11801
- const middleJobId = getId(queue[middle]);
11802
- middleJobId < id ? start2 = middle + 1 : end2 = middle;
11803
- }
11804
- return start2;
11805
- }
11806
- function queueJob(job) {
11807
- if ((!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) && job !== currentPreFlushParentJob) {
11808
- if (job.id == null) {
11809
- queue.push(job);
11810
- } else {
11811
- queue.splice(findInsertionIndex(job.id), 0, job);
11812
- }
11813
- queueFlush();
11814
- }
11815
- }
11816
- function queueFlush() {
11817
- if (!isFlushing && !isFlushPending) {
11818
- isFlushPending = true;
11819
- currentFlushPromise = resolvedPromise.then(flushJobs);
11820
- }
11821
- }
11822
- function queueCb(cb, activeQueue, pendingQueue, index) {
11823
- if (!isArray(cb)) {
11824
- if (!activeQueue || !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {
11825
- pendingQueue.push(cb);
11826
- }
11827
- } else {
11828
- pendingQueue.push(...cb);
11829
- }
11830
- queueFlush();
11831
- }
11832
- function queuePreFlushCb(cb) {
11833
- queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
11834
- }
11835
- function queuePostFlushCb(cb) {
11836
- queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
11837
- }
11838
- function flushPreFlushCbs(seen, parentJob = null) {
11839
- if (pendingPreFlushCbs.length) {
11840
- currentPreFlushParentJob = parentJob;
11841
- activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
11842
- pendingPreFlushCbs.length = 0;
11843
- for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
11844
- activePreFlushCbs[preFlushIndex]();
11845
- }
11846
- activePreFlushCbs = null;
11847
- preFlushIndex = 0;
11848
- currentPreFlushParentJob = null;
11849
- flushPreFlushCbs(seen, parentJob);
11850
- }
11851
- }
11852
- function flushPostFlushCbs(seen) {
11853
- if (pendingPostFlushCbs.length) {
11854
- const deduped = [...new Set(pendingPostFlushCbs)];
11855
- pendingPostFlushCbs.length = 0;
11856
- if (activePostFlushCbs) {
11857
- activePostFlushCbs.push(...deduped);
11858
- return;
11859
- }
11860
- activePostFlushCbs = deduped;
11861
- activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
11862
- for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
11863
- activePostFlushCbs[postFlushIndex]();
11770
+ if (itemsPerPageIsVisible.value)
11771
+ return "right";
11772
+ if (props.hasColumnsManager)
11773
+ return "left";
11774
+ return "";
11775
+ });
11776
+ function checkRefresh() {
11777
+ const search = searchLocal.value;
11778
+ setTimeout(() => {
11779
+ if (search !== searchLocal.value)
11780
+ return;
11781
+ emits("refreshList", false);
11782
+ }, 1e3);
11864
11783
  }
11865
- activePostFlushCbs = null;
11866
- postFlushIndex = 0;
11784
+ return (_ctx, _cache) => {
11785
+ return openBlock(), createElementBlock("div", _hoisted_1$d, [
11786
+ unref$1(refreshBtnIsVisible) ? (openBlock(), createBlock(ckButton, {
11787
+ key: 0,
11788
+ type: "flat",
11789
+ icon: "redo-alt",
11790
+ title: "Recargar lista",
11791
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("refreshList", false))
11792
+ })) : createCommentVNode("", true),
11793
+ unref$1(itemsPerPageIsVisible) ? (openBlock(), createElementBlock("div", {
11794
+ key: 1,
11795
+ class: normalizeClass(["items-per-page", { "ck-component__group--left": !unref$1(hideSearch) }])
11796
+ }, toDisplayString(unref$1(itemsPerPageStart)) + " - " + toDisplayString(unref$1(itemsPerPageEnd)) + " de " + toDisplayString(__props.listLength), 3)) : createCommentVNode("", true),
11797
+ !unref$1(hideSearch) ? (openBlock(), createBlock(ckInput, {
11798
+ key: 2,
11799
+ modelValue: unref$1(searchLocal),
11800
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef$1(searchLocal) ? searchLocal.value = $event : null),
11801
+ icon: "search",
11802
+ placeholder: "Buscar...",
11803
+ group: unref$1(searchGroupValue),
11804
+ onInput: _cache[2] || (_cache[2] = ($event) => checkRefresh())
11805
+ }, null, 8, ["modelValue", "group"])) : createCommentVNode("", true),
11806
+ __props.hasColumnsManager ? (openBlock(), createBlock(ckButton, {
11807
+ key: 3,
11808
+ icon: "columns",
11809
+ type: "filled",
11810
+ title: "Administrador de columnas",
11811
+ group: unref$1(itemsPerPageIsVisible) || !unref$1(hideSearch) ? "right" : "",
11812
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("openColumnsManager"))
11813
+ }, null, 8, ["group"])) : createCommentVNode("", true)
11814
+ ]);
11815
+ };
11867
11816
  }
11868
- }
11869
- const getId = (job) => job.id == null ? Infinity : job.id;
11870
- function flushJobs(seen) {
11871
- isFlushPending = false;
11872
- isFlushing = true;
11873
- flushPreFlushCbs(seen);
11874
- queue.sort((a, b) => getId(a) - getId(b));
11875
- const check = NOOP;
11876
- try {
11877
- for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
11878
- const job = queue[flushIndex];
11879
- if (job && job.active !== false) {
11880
- if (false)
11881
- ;
11882
- callWithErrorHandling(job, null, 14);
11817
+ });
11818
+ var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-5638f498"]]);
11819
+ var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
11820
+ const _hoisted_1$c = { class: "ck-table__pagination" };
11821
+ const _hoisted_2$7 = ["onClick"];
11822
+ const _hoisted_3$5 = ["onClick"];
11823
+ const itemsShowed = 5;
11824
+ const __default__ = {
11825
+ name: "CkTablePagination",
11826
+ props: {
11827
+ currentPage: { type: Number, required: true },
11828
+ align: { type: String, required: true },
11829
+ itemsPerPage: { type: Number, required: true },
11830
+ listLength: { type: Number, required: true }
11831
+ },
11832
+ emits: ["refreshList", "update:currentPage"],
11833
+ computed: {
11834
+ currentPageLocal2: {
11835
+ get() {
11836
+ return this.currentPage;
11837
+ },
11838
+ set(val) {
11839
+ return;
11840
+ }
11841
+ },
11842
+ hasArrowLeft() {
11843
+ if (!this.listLeft.length)
11844
+ return false;
11845
+ return this.listLeft[0] !== 1;
11846
+ },
11847
+ totalPages() {
11848
+ return Math.ceil(this.listLength / this.itemsPerPage);
11849
+ },
11850
+ hasArrowRight() {
11851
+ if (!this.listRight.length)
11852
+ return false;
11853
+ return this.listRight[this.listRight.length - 1] !== this.totalPages;
11854
+ },
11855
+ listLeft() {
11856
+ if (!this.listLength)
11857
+ return [];
11858
+ const list = [];
11859
+ const listLength = (itemsShowed - 1) / 2;
11860
+ for (const num of Array(listLength).keys()) {
11861
+ const listItem = this.currentPage - num - 1;
11862
+ if (listItem > 0)
11863
+ list.unshift(listItem);
11864
+ }
11865
+ return list;
11866
+ },
11867
+ listRight() {
11868
+ if (!this.listLength)
11869
+ return [];
11870
+ const list = [];
11871
+ const listLength = (itemsShowed - 1) / 2;
11872
+ for (const num of Array(listLength).keys()) {
11873
+ const listItem = this.currentPage + num + 1;
11874
+ if (listItem <= this.totalPages)
11875
+ list.push(listItem);
11883
11876
  }
11877
+ return list;
11884
11878
  }
11885
- } finally {
11886
- flushIndex = 0;
11887
- queue.length = 0;
11888
- flushPostFlushCbs();
11889
- isFlushing = false;
11890
- currentFlushPromise = null;
11891
- if (queue.length || pendingPreFlushCbs.length || pendingPostFlushCbs.length) {
11892
- flushJobs(seen);
11879
+ },
11880
+ methods: {
11881
+ updateCurrentPage(val) {
11882
+ this.$emit("update:currentPage", val);
11883
+ this.$emit("refreshList", val);
11884
+ },
11885
+ validateInputNumber(val) {
11886
+ val = +val;
11887
+ if (val > this.totalPages)
11888
+ val = this.totalPages;
11889
+ if (val < 1)
11890
+ val = 1;
11891
+ if (val === this.currentPage)
11892
+ return;
11893
+ this.updateCurrentPage(val);
11893
11894
  }
11894
11895
  }
11895
- }
11896
- function queueEffectWithSuspense(fn2, suspense) {
11897
- if (suspense && suspense.pendingBranch) {
11898
- if (isArray(fn2)) {
11899
- suspense.effects.push(...fn2);
11900
- } else {
11901
- suspense.effects.push(fn2);
11902
- }
11903
- } else {
11904
- queuePostFlushCb(fn2);
11896
+ };
11897
+ const _sfc_main$d = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
11898
+ setup(__props) {
11899
+ return (_ctx, _cache) => {
11900
+ return __props.currentPage && _ctx.totalPages > 1 ? (openBlock(), createElementBlock("div", {
11901
+ key: 0,
11902
+ class: normalizeClass(["ck-table__pagination-container", `pagination-align--${__props.align}`])
11903
+ }, [
11904
+ createElementVNode("div", _hoisted_1$c, [
11905
+ _ctx.hasArrowLeft ? (openBlock(), createElementBlock("div", {
11906
+ key: 0,
11907
+ class: "ck-table__pagination--arrow-left",
11908
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.updateCurrentPage(__props.currentPage - 1))
11909
+ }, [
11910
+ createVNode(ckIcon, { icon: "arrow-left" })
11911
+ ])) : createCommentVNode("", true),
11912
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listLeft, (num) => {
11913
+ return openBlock(), createElementBlock("div", {
11914
+ class: "ck-table__pagination-item pagination-item__left",
11915
+ onClick: ($event) => _ctx.updateCurrentPage(num)
11916
+ }, toDisplayString(num), 9, _hoisted_2$7);
11917
+ }), 256)),
11918
+ createVNode(ckInput, {
11919
+ class: "ck-table__pagination-input",
11920
+ autoSelect: "",
11921
+ type: "number",
11922
+ width: "50px",
11923
+ align: "center",
11924
+ modelValue: _ctx.currentPageLocal2,
11925
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef$1(currentPageLocal2) ? currentPageLocal2.value = $event : null),
11926
+ onChange: _cache[2] || (_cache[2] = ($event) => _ctx.validateInputNumber($event.target.value))
11927
+ }, null, 8, ["modelValue"]),
11928
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listRight, (num) => {
11929
+ return openBlock(), createElementBlock("div", {
11930
+ class: "ck-table__pagination-item pagination-item__right",
11931
+ onClick: ($event) => _ctx.updateCurrentPage(num)
11932
+ }, toDisplayString(num), 9, _hoisted_3$5);
11933
+ }), 256)),
11934
+ _ctx.hasArrowRight ? (openBlock(), createElementBlock("div", {
11935
+ key: 1,
11936
+ class: "ck-table__pagination--arrow-right",
11937
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.updateCurrentPage(__props.currentPage + 1))
11938
+ }, [
11939
+ createVNode(ckIcon, { icon: "arrow-right" })
11940
+ ])) : createCommentVNode("", true)
11941
+ ])
11942
+ ], 2)) : createCommentVNode("", true);
11943
+ };
11944
+ }
11945
+ }));
11946
+ var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-65c21486"]]);
11947
+ const NOOP$1 = () => {
11948
+ };
11949
+ const isArray$1 = Array.isArray;
11950
+ const isFunction$1 = (val) => typeof val === "function";
11951
+ const isSymbol = (val) => typeof val === "symbol";
11952
+ const def = (obj, key, value) => {
11953
+ Object.defineProperty(obj, key, {
11954
+ configurable: true,
11955
+ enumerable: false,
11956
+ value
11957
+ });
11958
+ };
11959
+ let activeEffectScope;
11960
+ function recordEffectScope(effect3, scope) {
11961
+ scope = scope || activeEffectScope;
11962
+ if (scope && scope.active) {
11963
+ scope.effects.push(effect3);
11905
11964
  }
11906
11965
  }
11907
- const INITIAL_WATCHER_VALUE = {};
11908
- function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger: onTrigger2 } = EMPTY_OBJ) {
11909
- const instance = currentInstance;
11910
- let getter;
11911
- let forceTrigger = false;
11912
- let isMultiSource = false;
11913
- if (isRef(source)) {
11914
- getter = () => source.value;
11915
- forceTrigger = isShallow(source);
11916
- } else if (isReactive(source)) {
11917
- getter = () => source;
11918
- deep = true;
11919
- } else if (isArray(source)) {
11920
- isMultiSource = true;
11921
- forceTrigger = source.some(isReactive);
11922
- getter = () => source.map((s) => {
11923
- if (isRef(s)) {
11924
- return s.value;
11925
- } else if (isReactive(s)) {
11926
- return traverse(s);
11927
- } else if (isFunction(s)) {
11928
- return callWithErrorHandling(s, instance, 2);
11929
- } else
11930
- ;
11931
- });
11932
- } else if (isFunction(source)) {
11933
- if (cb) {
11934
- getter = () => callWithErrorHandling(source, instance, 2);
11935
- } else {
11936
- getter = () => {
11937
- if (instance && instance.isUnmounted) {
11938
- return;
11939
- }
11940
- if (cleanup) {
11941
- cleanup();
11942
- }
11943
- return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]);
11944
- };
11966
+ const createDep = (effects) => {
11967
+ const dep = new Set(effects);
11968
+ dep.w = 0;
11969
+ dep.n = 0;
11970
+ return dep;
11971
+ };
11972
+ const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
11973
+ const newTracked = (dep) => (dep.n & trackOpBit) > 0;
11974
+ const initDepMarkers = ({ deps }) => {
11975
+ if (deps.length) {
11976
+ for (let i = 0; i < deps.length; i++) {
11977
+ deps[i].w |= trackOpBit;
11945
11978
  }
11946
- } else {
11947
- getter = NOOP;
11948
11979
  }
11949
- if (cb && deep) {
11950
- const baseGetter = getter;
11951
- getter = () => traverse(baseGetter());
11980
+ };
11981
+ const finalizeDepMarkers = (effect3) => {
11982
+ const { deps } = effect3;
11983
+ if (deps.length) {
11984
+ let ptr = 0;
11985
+ for (let i = 0; i < deps.length; i++) {
11986
+ const dep = deps[i];
11987
+ if (wasTracked(dep) && !newTracked(dep)) {
11988
+ dep.delete(effect3);
11989
+ } else {
11990
+ deps[ptr++] = dep;
11991
+ }
11992
+ dep.w &= ~trackOpBit;
11993
+ dep.n &= ~trackOpBit;
11994
+ }
11995
+ deps.length = ptr;
11952
11996
  }
11953
- let cleanup;
11954
- let onCleanup = (fn2) => {
11955
- cleanup = effect3.onStop = () => {
11956
- callWithErrorHandling(fn2, instance, 4);
11957
- };
11958
- };
11959
- let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
11960
- const job = () => {
11961
- if (!effect3.active) {
11962
- return;
11997
+ };
11998
+ let effectTrackDepth = 0;
11999
+ let trackOpBit = 1;
12000
+ const maxMarkerBits = 30;
12001
+ const effectStack = [];
12002
+ let activeEffect;
12003
+ class ReactiveEffect {
12004
+ constructor(fn2, scheduler = null, scope) {
12005
+ this.fn = fn2;
12006
+ this.scheduler = scheduler;
12007
+ this.active = true;
12008
+ this.deps = [];
12009
+ recordEffectScope(this, scope);
12010
+ }
12011
+ run() {
12012
+ if (!this.active) {
12013
+ return this.fn();
11963
12014
  }
11964
- if (cb) {
11965
- const newValue = effect3.run();
11966
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
11967
- if (cleanup) {
11968
- cleanup();
12015
+ if (!effectStack.length || !effectStack.includes(this)) {
12016
+ try {
12017
+ effectStack.push(activeEffect = this);
12018
+ enableTracking();
12019
+ trackOpBit = 1 << ++effectTrackDepth;
12020
+ if (effectTrackDepth <= maxMarkerBits) {
12021
+ initDepMarkers(this);
12022
+ } else {
12023
+ cleanupEffect(this);
11969
12024
  }
11970
- callWithAsyncErrorHandling(cb, instance, 3, [
11971
- newValue,
11972
- oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue,
11973
- onCleanup
11974
- ]);
11975
- oldValue = newValue;
12025
+ return this.fn();
12026
+ } finally {
12027
+ if (effectTrackDepth <= maxMarkerBits) {
12028
+ finalizeDepMarkers(this);
12029
+ }
12030
+ trackOpBit = 1 << --effectTrackDepth;
12031
+ resetTracking();
12032
+ effectStack.pop();
12033
+ const n = effectStack.length;
12034
+ activeEffect = n > 0 ? effectStack[n - 1] : void 0;
11976
12035
  }
11977
- } else {
11978
- effect3.run();
11979
12036
  }
11980
- };
11981
- job.allowRecurse = !!cb;
11982
- let scheduler;
11983
- if (flush === "sync") {
11984
- scheduler = job;
11985
- } else if (flush === "post") {
11986
- scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
11987
- } else {
11988
- scheduler = () => {
11989
- if (!instance || instance.isMounted) {
11990
- queuePreFlushCb(job);
11991
- } else {
11992
- job();
11993
- }
11994
- };
11995
12037
  }
11996
- const effect3 = new ReactiveEffect(getter, scheduler);
11997
- if (cb) {
11998
- if (immediate) {
11999
- job();
12000
- } else {
12001
- oldValue = effect3.run();
12038
+ stop() {
12039
+ if (this.active) {
12040
+ cleanupEffect(this);
12041
+ if (this.onStop) {
12042
+ this.onStop();
12043
+ }
12044
+ this.active = false;
12002
12045
  }
12003
- } else if (flush === "post") {
12004
- queuePostRenderEffect(effect3.run.bind(effect3), instance && instance.suspense);
12005
- } else {
12006
- effect3.run();
12007
12046
  }
12008
- return () => {
12009
- effect3.stop();
12010
- if (instance && instance.scope) {
12011
- remove(instance.scope.effects, effect3);
12047
+ }
12048
+ function cleanupEffect(effect3) {
12049
+ const { deps } = effect3;
12050
+ if (deps.length) {
12051
+ for (let i = 0; i < deps.length; i++) {
12052
+ deps[i].delete(effect3);
12012
12053
  }
12013
- };
12054
+ deps.length = 0;
12055
+ }
12014
12056
  }
12015
- function instanceWatch(source, value, options) {
12016
- const publicThis = this.proxy;
12017
- const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
12018
- let cb;
12019
- if (isFunction(value)) {
12020
- cb = value;
12057
+ let shouldTrack = true;
12058
+ const trackStack = [];
12059
+ function enableTracking() {
12060
+ trackStack.push(shouldTrack);
12061
+ shouldTrack = true;
12062
+ }
12063
+ function resetTracking() {
12064
+ const last = trackStack.pop();
12065
+ shouldTrack = last === void 0 ? true : last;
12066
+ }
12067
+ function isTracking() {
12068
+ return shouldTrack && activeEffect !== void 0;
12069
+ }
12070
+ function trackEffects(dep, debuggerEventExtraInfo) {
12071
+ let shouldTrack2 = false;
12072
+ if (effectTrackDepth <= maxMarkerBits) {
12073
+ if (!newTracked(dep)) {
12074
+ dep.n |= trackOpBit;
12075
+ shouldTrack2 = !wasTracked(dep);
12076
+ }
12021
12077
  } else {
12022
- cb = value.handler;
12023
- options = value;
12078
+ shouldTrack2 = !dep.has(activeEffect);
12024
12079
  }
12025
- const cur = currentInstance;
12026
- setCurrentInstance(this);
12027
- const res = doWatch(getter, cb.bind(publicThis), options);
12028
- if (cur) {
12029
- setCurrentInstance(cur);
12030
- } else {
12031
- unsetCurrentInstance();
12080
+ if (shouldTrack2) {
12081
+ dep.add(activeEffect);
12082
+ activeEffect.deps.push(dep);
12032
12083
  }
12033
- return res;
12034
12084
  }
12035
- function createPathGetter(ctx, path) {
12036
- const segments = path.split(".");
12037
- return () => {
12038
- let cur = ctx;
12039
- for (let i = 0; i < segments.length && cur; i++) {
12040
- cur = cur[segments[i]];
12085
+ function triggerEffects(dep, debuggerEventExtraInfo) {
12086
+ for (const effect3 of isArray$1(dep) ? dep : [...dep]) {
12087
+ if (effect3 !== activeEffect || effect3.allowRecurse) {
12088
+ if (effect3.scheduler) {
12089
+ effect3.scheduler();
12090
+ } else {
12091
+ effect3.run();
12092
+ }
12041
12093
  }
12042
- return cur;
12043
- };
12094
+ }
12044
12095
  }
12045
- function traverse(value, seen) {
12046
- if (!isObject(value) || value["__v_skip"]) {
12047
- return value;
12096
+ new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));
12097
+ function isReactive(value) {
12098
+ if (isReadonly(value)) {
12099
+ return isReactive(value["__v_raw"]);
12048
12100
  }
12049
- seen = seen || new Set();
12050
- if (seen.has(value)) {
12051
- return value;
12101
+ return !!(value && value["__v_isReactive"]);
12102
+ }
12103
+ function isReadonly(value) {
12104
+ return !!(value && value["__v_isReadonly"]);
12105
+ }
12106
+ function isShallow(value) {
12107
+ return !!(value && value["__v_isShallow"]);
12108
+ }
12109
+ function toRaw(observed) {
12110
+ const raw = observed && observed["__v_raw"];
12111
+ return raw ? toRaw(raw) : observed;
12112
+ }
12113
+ function markRaw(value) {
12114
+ def(value, "__v_skip", true);
12115
+ return value;
12116
+ }
12117
+ function trackRefValue(ref2) {
12118
+ if (isTracking()) {
12119
+ ref2 = toRaw(ref2);
12120
+ if (!ref2.dep) {
12121
+ ref2.dep = createDep();
12122
+ }
12123
+ {
12124
+ trackEffects(ref2.dep);
12125
+ }
12052
12126
  }
12053
- seen.add(value);
12054
- if (isRef(value)) {
12055
- traverse(value.value, seen);
12056
- } else if (isArray(value)) {
12057
- for (let i = 0; i < value.length; i++) {
12058
- traverse(value[i], seen);
12127
+ }
12128
+ function triggerRefValue(ref2, newVal) {
12129
+ ref2 = toRaw(ref2);
12130
+ if (ref2.dep) {
12131
+ {
12132
+ triggerEffects(ref2.dep);
12059
12133
  }
12060
- } else if (isSet(value) || isMap(value)) {
12061
- value.forEach((v) => {
12062
- traverse(v, seen);
12134
+ }
12135
+ }
12136
+ function isRef(r) {
12137
+ return Boolean(r && r.__v_isRef === true);
12138
+ }
12139
+ function unref(ref2) {
12140
+ return isRef(ref2) ? ref2.value : ref2;
12141
+ }
12142
+ const shallowUnwrapHandlers = {
12143
+ get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
12144
+ set: (target, key, value, receiver) => {
12145
+ const oldValue = target[key];
12146
+ if (isRef(oldValue) && !isRef(value)) {
12147
+ oldValue.value = value;
12148
+ return true;
12149
+ } else {
12150
+ return Reflect.set(target, key, value, receiver);
12151
+ }
12152
+ }
12153
+ };
12154
+ function proxyRefs(objectWithRefs) {
12155
+ return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
12156
+ }
12157
+ class ComputedRefImpl {
12158
+ constructor(getter, _setter, isReadonly2, isSSR) {
12159
+ this._setter = _setter;
12160
+ this.dep = void 0;
12161
+ this.__v_isRef = true;
12162
+ this._dirty = true;
12163
+ this.effect = new ReactiveEffect(getter, () => {
12164
+ if (!this._dirty) {
12165
+ this._dirty = true;
12166
+ triggerRefValue(this);
12167
+ }
12063
12168
  });
12064
- } else if (isPlainObject(value)) {
12065
- for (const key in value) {
12066
- traverse(value[key], seen);
12169
+ this.effect.computed = this;
12170
+ this.effect.active = this._cacheable = !isSSR;
12171
+ this["__v_isReadonly"] = isReadonly2;
12172
+ }
12173
+ get value() {
12174
+ const self2 = toRaw(this);
12175
+ trackRefValue(self2);
12176
+ if (self2._dirty || !self2._cacheable) {
12177
+ self2._dirty = false;
12178
+ self2._value = self2.effect.run();
12067
12179
  }
12180
+ return self2._value;
12181
+ }
12182
+ set value(newValue) {
12183
+ this._setter(newValue);
12068
12184
  }
12069
- return value;
12070
12185
  }
12071
- function resolveMergedOptions(instance) {
12072
- const base = instance.type;
12073
- const { mixins, extends: extendsOptions } = base;
12074
- const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
12075
- const cached = cache.get(base);
12076
- let resolved;
12077
- if (cached) {
12078
- resolved = cached;
12079
- } else if (!globalMixins.length && !mixins && !extendsOptions) {
12080
- {
12081
- resolved = base;
12082
- }
12186
+ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
12187
+ let getter;
12188
+ let setter;
12189
+ const onlyGetter = isFunction$1(getterOrOptions);
12190
+ if (onlyGetter) {
12191
+ getter = getterOrOptions;
12192
+ setter = NOOP$1;
12083
12193
  } else {
12084
- resolved = {};
12085
- if (globalMixins.length) {
12086
- globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
12087
- }
12088
- mergeOptions(resolved, base, optionMergeStrategies);
12194
+ getter = getterOrOptions.get;
12195
+ setter = getterOrOptions.set;
12089
12196
  }
12090
- cache.set(base, resolved);
12091
- return resolved;
12197
+ const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
12198
+ return cRef;
12092
12199
  }
12093
- function mergeOptions(to, from, strats, asMixin = false) {
12094
- const { mixins, extends: extendsOptions } = from;
12095
- if (extendsOptions) {
12096
- mergeOptions(to, extendsOptions, strats, true);
12200
+ Promise.resolve();
12201
+ const EMPTY_OBJ = {};
12202
+ const NOOP = () => {
12203
+ };
12204
+ const extend = Object.assign;
12205
+ const remove = (arr, el) => {
12206
+ const i = arr.indexOf(el);
12207
+ if (i > -1) {
12208
+ arr.splice(i, 1);
12097
12209
  }
12098
- if (mixins) {
12099
- mixins.forEach((m) => mergeOptions(to, m, strats, true));
12210
+ };
12211
+ const isArray = Array.isArray;
12212
+ const isMap = (val) => toTypeString(val) === "[object Map]";
12213
+ const isSet = (val) => toTypeString(val) === "[object Set]";
12214
+ const isFunction = (val) => typeof val === "function";
12215
+ const isString = (val) => typeof val === "string";
12216
+ const isObject = (val) => val !== null && typeof val === "object";
12217
+ const isPromise = (val) => {
12218
+ return isObject(val) && isFunction(val.then) && isFunction(val.catch);
12219
+ };
12220
+ const objectToString = Object.prototype.toString;
12221
+ const toTypeString = (value) => objectToString.call(value);
12222
+ const isPlainObject = (val) => toTypeString(val) === "[object Object]";
12223
+ const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
12224
+ function callWithErrorHandling(fn2, instance, type, args) {
12225
+ let res;
12226
+ try {
12227
+ res = args ? fn2(...args) : fn2();
12228
+ } catch (err) {
12229
+ handleError(err, instance, type);
12100
12230
  }
12101
- for (const key in from) {
12102
- if (asMixin && key === "expose")
12103
- ;
12104
- else {
12105
- const strat = internalOptionMergeStrats[key] || strats && strats[key];
12106
- to[key] = strat ? strat(to[key], from[key]) : from[key];
12231
+ return res;
12232
+ }
12233
+ function callWithAsyncErrorHandling(fn2, instance, type, args) {
12234
+ if (isFunction(fn2)) {
12235
+ const res = callWithErrorHandling(fn2, instance, type, args);
12236
+ if (res && isPromise(res)) {
12237
+ res.catch((err) => {
12238
+ handleError(err, instance, type);
12239
+ });
12107
12240
  }
12241
+ return res;
12108
12242
  }
12109
- return to;
12243
+ const values = [];
12244
+ for (let i = 0; i < fn2.length; i++) {
12245
+ values.push(callWithAsyncErrorHandling(fn2[i], instance, type, args));
12246
+ }
12247
+ return values;
12110
12248
  }
12111
- const internalOptionMergeStrats = {
12112
- data: mergeDataFn,
12113
- props: mergeObjectOptions,
12114
- emits: mergeObjectOptions,
12115
- methods: mergeObjectOptions,
12116
- computed: mergeObjectOptions,
12117
- beforeCreate: mergeAsArray,
12118
- created: mergeAsArray,
12119
- beforeMount: mergeAsArray,
12120
- mounted: mergeAsArray,
12121
- beforeUpdate: mergeAsArray,
12122
- updated: mergeAsArray,
12123
- beforeDestroy: mergeAsArray,
12124
- beforeUnmount: mergeAsArray,
12125
- destroyed: mergeAsArray,
12126
- unmounted: mergeAsArray,
12127
- activated: mergeAsArray,
12128
- deactivated: mergeAsArray,
12129
- errorCaptured: mergeAsArray,
12130
- serverPrefetch: mergeAsArray,
12131
- components: mergeObjectOptions,
12132
- directives: mergeObjectOptions,
12133
- watch: mergeWatchOptions,
12134
- provide: mergeDataFn,
12135
- inject: mergeInject
12136
- };
12137
- function mergeDataFn(to, from) {
12138
- if (!from) {
12139
- return to;
12249
+ function handleError(err, instance, type, throwInDev = true) {
12250
+ const contextVNode = instance ? instance.vnode : null;
12251
+ if (instance) {
12252
+ let cur = instance.parent;
12253
+ const exposedInstance = instance.proxy;
12254
+ const errorInfo = type;
12255
+ while (cur) {
12256
+ const errorCapturedHooks = cur.ec;
12257
+ if (errorCapturedHooks) {
12258
+ for (let i = 0; i < errorCapturedHooks.length; i++) {
12259
+ if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
12260
+ return;
12261
+ }
12262
+ }
12263
+ }
12264
+ cur = cur.parent;
12265
+ }
12266
+ const appErrorHandler = instance.appContext.config.errorHandler;
12267
+ if (appErrorHandler) {
12268
+ callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
12269
+ return;
12270
+ }
12140
12271
  }
12141
- if (!to) {
12142
- return from;
12272
+ logError(err, type, contextVNode, throwInDev);
12273
+ }
12274
+ function logError(err, type, contextVNode, throwInDev = true) {
12275
+ {
12276
+ console.error(err);
12143
12277
  }
12144
- return function mergedDataFn() {
12145
- return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
12146
- };
12147
12278
  }
12148
- function mergeInject(to, from) {
12149
- return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
12279
+ let isFlushing = false;
12280
+ let isFlushPending = false;
12281
+ const queue = [];
12282
+ let flushIndex = 0;
12283
+ const pendingPreFlushCbs = [];
12284
+ let activePreFlushCbs = null;
12285
+ let preFlushIndex = 0;
12286
+ const pendingPostFlushCbs = [];
12287
+ let activePostFlushCbs = null;
12288
+ let postFlushIndex = 0;
12289
+ const resolvedPromise = Promise.resolve();
12290
+ let currentFlushPromise = null;
12291
+ let currentPreFlushParentJob = null;
12292
+ function nextTick(fn2) {
12293
+ const p = currentFlushPromise || resolvedPromise;
12294
+ return fn2 ? p.then(this ? fn2.bind(this) : fn2) : p;
12150
12295
  }
12151
- function normalizeInject(raw) {
12152
- if (isArray(raw)) {
12153
- const res = {};
12154
- for (let i = 0; i < raw.length; i++) {
12155
- res[raw[i]] = raw[i];
12156
- }
12157
- return res;
12296
+ function findInsertionIndex(id) {
12297
+ let start2 = flushIndex + 1;
12298
+ let end2 = queue.length;
12299
+ while (start2 < end2) {
12300
+ const middle = start2 + end2 >>> 1;
12301
+ const middleJobId = getId(queue[middle]);
12302
+ middleJobId < id ? start2 = middle + 1 : end2 = middle;
12158
12303
  }
12159
- return raw;
12160
- }
12161
- function mergeAsArray(to, from) {
12162
- return to ? [...new Set([].concat(to, from))] : from;
12304
+ return start2;
12163
12305
  }
12164
- function mergeObjectOptions(to, from) {
12165
- return to ? extend(extend(Object.create(null), to), from) : from;
12306
+ function queueJob(job) {
12307
+ if ((!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) && job !== currentPreFlushParentJob) {
12308
+ if (job.id == null) {
12309
+ queue.push(job);
12310
+ } else {
12311
+ queue.splice(findInsertionIndex(job.id), 0, job);
12312
+ }
12313
+ queueFlush();
12314
+ }
12166
12315
  }
12167
- function mergeWatchOptions(to, from) {
12168
- if (!to)
12169
- return from;
12170
- if (!from)
12171
- return to;
12172
- const merged = extend(Object.create(null), to);
12173
- for (const key in from) {
12174
- merged[key] = mergeAsArray(to[key], from[key]);
12316
+ function queueFlush() {
12317
+ if (!isFlushing && !isFlushPending) {
12318
+ isFlushPending = true;
12319
+ currentFlushPromise = resolvedPromise.then(flushJobs);
12175
12320
  }
12176
- return merged;
12177
12321
  }
12178
- const queuePostRenderEffect = queueEffectWithSuspense;
12179
- const getPublicInstance = (i) => {
12180
- if (!i)
12181
- return null;
12182
- if (isStatefulComponent(i))
12183
- return getExposeProxy(i) || i.proxy;
12184
- return getPublicInstance(i.parent);
12185
- };
12186
- const publicPropertiesMap = extend(Object.create(null), {
12187
- $: (i) => i,
12188
- $el: (i) => i.vnode.el,
12189
- $data: (i) => i.data,
12190
- $props: (i) => i.props,
12191
- $attrs: (i) => i.attrs,
12192
- $slots: (i) => i.slots,
12193
- $refs: (i) => i.refs,
12194
- $parent: (i) => getPublicInstance(i.parent),
12195
- $root: (i) => getPublicInstance(i.root),
12196
- $emit: (i) => i.emit,
12197
- $options: (i) => resolveMergedOptions(i),
12198
- $forceUpdate: (i) => () => queueJob(i.update),
12199
- $nextTick: (i) => nextTick.bind(i.proxy),
12200
- $watch: (i) => instanceWatch.bind(i)
12201
- });
12202
- let currentInstance = null;
12203
- const setCurrentInstance = (instance) => {
12204
- currentInstance = instance;
12205
- instance.scope.on();
12206
- };
12207
- const unsetCurrentInstance = () => {
12208
- currentInstance && currentInstance.scope.off();
12209
- currentInstance = null;
12210
- };
12211
- function isStatefulComponent(instance) {
12212
- return instance.vnode.shapeFlag & 4;
12322
+ function queueCb(cb, activeQueue, pendingQueue, index) {
12323
+ if (!isArray(cb)) {
12324
+ if (!activeQueue || !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {
12325
+ pendingQueue.push(cb);
12326
+ }
12327
+ } else {
12328
+ pendingQueue.push(...cb);
12329
+ }
12330
+ queueFlush();
12213
12331
  }
12214
- let isInSSRComponentSetup = false;
12215
- function getExposeProxy(instance) {
12216
- if (instance.exposed) {
12217
- return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
12218
- get(target, key) {
12219
- if (key in target) {
12220
- return target[key];
12221
- } else if (key in publicPropertiesMap) {
12222
- return publicPropertiesMap[key](instance);
12223
- }
12224
- }
12225
- }));
12332
+ function queuePreFlushCb(cb) {
12333
+ queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
12334
+ }
12335
+ function queuePostFlushCb(cb) {
12336
+ queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
12337
+ }
12338
+ function flushPreFlushCbs(seen, parentJob = null) {
12339
+ if (pendingPreFlushCbs.length) {
12340
+ currentPreFlushParentJob = parentJob;
12341
+ activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
12342
+ pendingPreFlushCbs.length = 0;
12343
+ for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
12344
+ activePreFlushCbs[preFlushIndex]();
12345
+ }
12346
+ activePreFlushCbs = null;
12347
+ preFlushIndex = 0;
12348
+ currentPreFlushParentJob = null;
12349
+ flushPreFlushCbs(seen, parentJob);
12226
12350
  }
12227
12351
  }
12228
- const computed = (getterOrOptions, debugOptions) => {
12229
- return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
12230
- };
12231
- var ckCheckbox_vue_vue_type_style_index_0_scoped_true_lang = "";
12232
- const _withScopeId$2 = (n) => (pushScopeId("data-v-132565da"), n = n(), popScopeId(), n);
12233
- const _hoisted_1$h = ["disabled", "checked"];
12234
- const _hoisted_2$8 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
12235
- const _hoisted_3$5 = {
12236
- key: 0,
12237
- class: "c-Checkbox__label"
12238
- };
12239
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
12240
- props: {
12241
- modelValue: { type: Boolean, default: false },
12242
- label: { type: String, default: void 0 },
12243
- disabled: { type: Boolean, default: false }
12244
- },
12245
- emits: ["update:modelValue", "change"],
12246
- setup(__props, { emit: emits }) {
12247
- const props = __props;
12248
- const value = computed({
12249
- get() {
12250
- return props.modelValue;
12251
- },
12252
- set(val) {
12253
- emits("update:modelValue", val);
12352
+ function flushPostFlushCbs(seen) {
12353
+ if (pendingPostFlushCbs.length) {
12354
+ const deduped = [...new Set(pendingPostFlushCbs)];
12355
+ pendingPostFlushCbs.length = 0;
12356
+ if (activePostFlushCbs) {
12357
+ activePostFlushCbs.push(...deduped);
12358
+ return;
12359
+ }
12360
+ activePostFlushCbs = deduped;
12361
+ activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
12362
+ for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
12363
+ activePostFlushCbs[postFlushIndex]();
12364
+ }
12365
+ activePostFlushCbs = null;
12366
+ postFlushIndex = 0;
12367
+ }
12368
+ }
12369
+ const getId = (job) => job.id == null ? Infinity : job.id;
12370
+ function flushJobs(seen) {
12371
+ isFlushPending = false;
12372
+ isFlushing = true;
12373
+ flushPreFlushCbs(seen);
12374
+ queue.sort((a, b) => getId(a) - getId(b));
12375
+ const check = NOOP;
12376
+ try {
12377
+ for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
12378
+ const job = queue[flushIndex];
12379
+ if (job && job.active !== false) {
12380
+ if (false)
12381
+ ;
12382
+ callWithErrorHandling(job, null, 14);
12254
12383
  }
12255
- });
12256
- const checkboxAttributes = computed(() => {
12257
- return {
12258
- "aria-disabled": props.disabled,
12259
- tabindex: props.disabled ? void 0 : "0"
12260
- };
12261
- });
12262
- function onChange(event) {
12263
- emits("change", event);
12264
12384
  }
12265
- function onTrigger2() {
12266
- value.value = !value.value;
12385
+ } finally {
12386
+ flushIndex = 0;
12387
+ queue.length = 0;
12388
+ flushPostFlushCbs();
12389
+ isFlushing = false;
12390
+ currentFlushPromise = null;
12391
+ if (queue.length || pendingPreFlushCbs.length || pendingPostFlushCbs.length) {
12392
+ flushJobs(seen);
12267
12393
  }
12268
- return (_ctx, _cache) => {
12269
- return openBlock(), createElementBlock("label", mergeProps({ class: "ck-checkbox" }, unref$1(checkboxAttributes), {
12270
- onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
12271
- }, ["prevent"]), ["space"])),
12272
- onKeyup: [
12273
- _cache[2] || (_cache[2] = withKeys(($event) => onTrigger2(), ["enter"])),
12274
- _cache[3] || (_cache[3] = withKeys(($event) => onTrigger2(), ["space"]))
12275
- ]
12276
- }), [
12277
- createElementVNode("input", {
12278
- class: "ck-checkbox__input",
12279
- "aria-hidden": "true",
12280
- type: "checkbox",
12281
- disabled: __props.disabled,
12282
- checked: unref$1(value),
12283
- onChange: _cache[0] || (_cache[0] = ($event) => {
12284
- value.value = $event.target.checked;
12285
- onChange($event);
12286
- })
12287
- }, null, 40, _hoisted_1$h),
12288
- _hoisted_2$8,
12289
- _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$5, [
12290
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
12291
- ])) : createCommentVNode("", true)
12292
- ], 16);
12293
- };
12294
12394
  }
12295
- });
12296
- var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-132565da"]]);
12297
- var ckChip_vue_vue_type_style_index_0_scoped_true_lang = "";
12298
- const _hoisted_1$g = ["color"];
12299
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
12300
- props: {
12301
- size: { type: String, default: "s" },
12302
- color: { type: String, default: "primary" },
12303
- textColor: { type: String, default: void 0 },
12304
- icon: { type: String, default: void 0 },
12305
- iconPack: { type: String, default: void 0 }
12306
- },
12307
- emits: ["click"],
12308
- setup(__props, { emit: emits }) {
12309
- const props = __props;
12310
- const computedClass = computed$2(() => {
12311
- return [
12312
- `size-${props.size}`,
12313
- `ck-component__bg-color--${props.color}`
12314
- ];
12315
- });
12316
- const computedStyle = computed$2(() => {
12317
- const list = [];
12318
- if (props.color)
12319
- ;
12320
- return list;
12321
- });
12322
- return (_ctx, _cache) => {
12323
- return openBlock(), createElementBlock("div", {
12324
- class: normalizeClass(["ck-chip", unref$1(computedClass)]),
12325
- color: __props.color,
12326
- style: normalizeStyle(unref$1(computedStyle)),
12327
- onClick: _cache[0] || (_cache[0] = ($event) => emits("click", $event))
12328
- }, [
12329
- __props.icon ? (openBlock(), createBlock(ckIcon, {
12330
- key: 0,
12331
- icon: __props.icon,
12332
- "icon-pack": __props.iconPack
12333
- }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true),
12334
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
12335
- ], 14, _hoisted_1$g);
12336
- };
12395
+ }
12396
+ function queueEffectWithSuspense(fn2, suspense) {
12397
+ if (suspense && suspense.pendingBranch) {
12398
+ if (isArray(fn2)) {
12399
+ suspense.effects.push(...fn2);
12400
+ } else {
12401
+ suspense.effects.push(fn2);
12402
+ }
12403
+ } else {
12404
+ queuePostFlushCb(fn2);
12337
12405
  }
12338
- });
12339
- var ckChip = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-5333de26"]]);
12340
- var globalVariables = {
12341
- defaultFailImg: "df",
12342
- imagesFolderPath: "",
12343
- defaultImgBorderColor: "#EEEEEE"
12344
- };
12345
- var ckImg_vue_vue_type_style_index_0_scoped_true_lang = "";
12346
- const _hoisted_1$f = ["src", "alt"];
12347
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
12348
- props: {
12349
- src: { type: String, default: "" },
12350
- isFullPath: { type: Boolean, default: false },
12351
- failImgSrc: { type: String, default: "" },
12352
- alt: { type: String, default: "" },
12353
- size: { type: String, default: "", validator: validators.size },
12354
- sizeAbsolute: { type: String, default: "" },
12355
- width: { type: String, default: "" },
12356
- height: { type: String, default: "" },
12357
- zoom: { type: Boolean, default: false },
12358
- zoomTitle: { type: String, default: "" },
12359
- hasBorder: { type: Boolean, default: false },
12360
- radius: { type: String, default: "" },
12361
- borderColor: { type: String, default: "" },
12362
- rounded: { type: Boolean, default: false }
12363
- },
12364
- setup(__props) {
12365
- const props = __props;
12366
- const altNeeded = ref(false);
12367
- let isMounted = ref(false);
12368
- const imageUrl = computed$2(() => {
12369
- if (!isMounted.value)
12370
- return "";
12371
- if (props.isFullPath)
12372
- return props.src;
12373
- return getImg(props.src);
12406
+ }
12407
+ const INITIAL_WATCHER_VALUE = {};
12408
+ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger: onTrigger2 } = EMPTY_OBJ) {
12409
+ const instance = currentInstance;
12410
+ let getter;
12411
+ let forceTrigger = false;
12412
+ let isMultiSource = false;
12413
+ if (isRef(source)) {
12414
+ getter = () => source.value;
12415
+ forceTrigger = isShallow(source);
12416
+ } else if (isReactive(source)) {
12417
+ getter = () => source;
12418
+ deep = true;
12419
+ } else if (isArray(source)) {
12420
+ isMultiSource = true;
12421
+ forceTrigger = source.some(isReactive);
12422
+ getter = () => source.map((s) => {
12423
+ if (isRef(s)) {
12424
+ return s.value;
12425
+ } else if (isReactive(s)) {
12426
+ return traverse(s);
12427
+ } else if (isFunction(s)) {
12428
+ return callWithErrorHandling(s, instance, 2);
12429
+ } else
12430
+ ;
12374
12431
  });
12375
- const computedClass = computed$2(() => {
12376
- const classList2 = [];
12377
- if (props.size)
12378
- classList2.push(`ck-img__size--${props.size}`);
12379
- if (props.rounded)
12380
- classList2.push("is-rounded");
12381
- if (props.hasBorder) {
12382
- classList2.push("ck-img__has-border");
12383
- if (functions$1.isColorTemplateVariable(realBorderColor.value)) {
12384
- classList2.push(`ck-component__border-color--${realBorderColor.value}`);
12432
+ } else if (isFunction(source)) {
12433
+ if (cb) {
12434
+ getter = () => callWithErrorHandling(source, instance, 2);
12435
+ } else {
12436
+ getter = () => {
12437
+ if (instance && instance.isUnmounted) {
12438
+ return;
12439
+ }
12440
+ if (cleanup) {
12441
+ cleanup();
12385
12442
  }
12386
- }
12387
- if (props.zoom)
12388
- classList2.push("zoom-able");
12389
- return classList2;
12390
- });
12391
- const computedStyle = computed$2(() => {
12392
- const styleList = [];
12393
- if (props.sizeAbsolute) {
12394
- styleList.push({ width: props.sizeAbsolute });
12395
- styleList.push({ height: props.sizeAbsolute });
12396
- }
12397
- if (props.radius)
12398
- styleList.push({ "border-radius": props.radius });
12399
- if (props.hasBorder) {
12400
- if (!functions$1.isColorTemplateVariable(realBorderColor.value)) {
12401
- styleList.push({ "border-color": realBorderColor.value });
12443
+ return callWithAsyncErrorHandling(source, instance, 3, [onCleanup]);
12444
+ };
12445
+ }
12446
+ } else {
12447
+ getter = NOOP;
12448
+ }
12449
+ if (cb && deep) {
12450
+ const baseGetter = getter;
12451
+ getter = () => traverse(baseGetter());
12452
+ }
12453
+ let cleanup;
12454
+ let onCleanup = (fn2) => {
12455
+ cleanup = effect3.onStop = () => {
12456
+ callWithErrorHandling(fn2, instance, 4);
12457
+ };
12458
+ };
12459
+ let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
12460
+ const job = () => {
12461
+ if (!effect3.active) {
12462
+ return;
12463
+ }
12464
+ if (cb) {
12465
+ const newValue = effect3.run();
12466
+ if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
12467
+ if (cleanup) {
12468
+ cleanup();
12402
12469
  }
12470
+ callWithAsyncErrorHandling(cb, instance, 3, [
12471
+ newValue,
12472
+ oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue,
12473
+ onCleanup
12474
+ ]);
12475
+ oldValue = newValue;
12403
12476
  }
12404
- return styleList;
12405
- });
12406
- const computedImgStyle = computed$2(() => {
12407
- const styleList = [];
12408
- if (props.radius)
12409
- styleList.push({ "border-radius": props.radius });
12410
- if (props.width)
12411
- styleList.push({ width: props.width });
12412
- if (props.height)
12413
- styleList.push({ height: props.height });
12414
- return styleList;
12415
- });
12416
- const realBorderColor = computed$2(() => {
12417
- if (props.borderColor)
12418
- return props.borderColor;
12419
- return globalVariables.defaultImgBorderColor;
12420
- });
12421
- function clickImg() {
12422
- if (props.zoom)
12423
- ;
12477
+ } else {
12478
+ effect3.run();
12424
12479
  }
12425
- function getImg(src) {
12426
- let path = "";
12427
- const $cleekOptions = functions$1.getCleekOptions(getCurrentInstance);
12428
- if ($cleekOptions) {
12429
- if ($cleekOptions.imgPath)
12430
- path = $cleekOptions.imgPath;
12480
+ };
12481
+ job.allowRecurse = !!cb;
12482
+ let scheduler;
12483
+ if (flush === "sync") {
12484
+ scheduler = job;
12485
+ } else if (flush === "post") {
12486
+ scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
12487
+ } else {
12488
+ scheduler = () => {
12489
+ if (!instance || instance.isMounted) {
12490
+ queuePreFlushCb(job);
12491
+ } else {
12492
+ job();
12431
12493
  }
12432
- return `${path}${src}`;
12494
+ };
12495
+ }
12496
+ const effect3 = new ReactiveEffect(getter, scheduler);
12497
+ if (cb) {
12498
+ if (immediate) {
12499
+ job();
12500
+ } else {
12501
+ oldValue = effect3.run();
12433
12502
  }
12434
- onMounted(() => {
12435
- getCurrentInstance().ctx;
12436
- isMounted.value = true;
12503
+ } else if (flush === "post") {
12504
+ queuePostRenderEffect(effect3.run.bind(effect3), instance && instance.suspense);
12505
+ } else {
12506
+ effect3.run();
12507
+ }
12508
+ return () => {
12509
+ effect3.stop();
12510
+ if (instance && instance.scope) {
12511
+ remove(instance.scope.effects, effect3);
12512
+ }
12513
+ };
12514
+ }
12515
+ function instanceWatch(source, value, options) {
12516
+ const publicThis = this.proxy;
12517
+ const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
12518
+ let cb;
12519
+ if (isFunction(value)) {
12520
+ cb = value;
12521
+ } else {
12522
+ cb = value.handler;
12523
+ options = value;
12524
+ }
12525
+ const cur = currentInstance;
12526
+ setCurrentInstance(this);
12527
+ const res = doWatch(getter, cb.bind(publicThis), options);
12528
+ if (cur) {
12529
+ setCurrentInstance(cur);
12530
+ } else {
12531
+ unsetCurrentInstance();
12532
+ }
12533
+ return res;
12534
+ }
12535
+ function createPathGetter(ctx, path) {
12536
+ const segments = path.split(".");
12537
+ return () => {
12538
+ let cur = ctx;
12539
+ for (let i = 0; i < segments.length && cur; i++) {
12540
+ cur = cur[segments[i]];
12541
+ }
12542
+ return cur;
12543
+ };
12544
+ }
12545
+ function traverse(value, seen) {
12546
+ if (!isObject(value) || value["__v_skip"]) {
12547
+ return value;
12548
+ }
12549
+ seen = seen || new Set();
12550
+ if (seen.has(value)) {
12551
+ return value;
12552
+ }
12553
+ seen.add(value);
12554
+ if (isRef(value)) {
12555
+ traverse(value.value, seen);
12556
+ } else if (isArray(value)) {
12557
+ for (let i = 0; i < value.length; i++) {
12558
+ traverse(value[i], seen);
12559
+ }
12560
+ } else if (isSet(value) || isMap(value)) {
12561
+ value.forEach((v) => {
12562
+ traverse(v, seen);
12437
12563
  });
12438
- return (_ctx, _cache) => {
12439
- return openBlock(), createElementBlock("div", {
12440
- class: normalizeClass(["ck-img", unref$1(computedClass)]),
12441
- style: normalizeStyle(unref$1(computedStyle)),
12442
- onClick: _cache[1] || (_cache[1] = ($event) => clickImg())
12443
- }, [
12444
- createElementVNode("img", {
12445
- src: unref$1(imageUrl),
12446
- style: normalizeStyle(unref$1(computedImgStyle)),
12447
- alt: __props.alt,
12448
- onError: _cache[0] || (_cache[0] = ($event) => altNeeded.value = true)
12449
- }, null, 44, _hoisted_1$f)
12450
- ], 6);
12451
- };
12564
+ } else if (isPlainObject(value)) {
12565
+ for (const key in value) {
12566
+ traverse(value[key], seen);
12567
+ }
12568
+ }
12569
+ return value;
12570
+ }
12571
+ function resolveMergedOptions(instance) {
12572
+ const base = instance.type;
12573
+ const { mixins, extends: extendsOptions } = base;
12574
+ const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
12575
+ const cached = cache.get(base);
12576
+ let resolved;
12577
+ if (cached) {
12578
+ resolved = cached;
12579
+ } else if (!globalMixins.length && !mixins && !extendsOptions) {
12580
+ {
12581
+ resolved = base;
12582
+ }
12583
+ } else {
12584
+ resolved = {};
12585
+ if (globalMixins.length) {
12586
+ globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
12587
+ }
12588
+ mergeOptions(resolved, base, optionMergeStrategies);
12589
+ }
12590
+ cache.set(base, resolved);
12591
+ return resolved;
12592
+ }
12593
+ function mergeOptions(to, from, strats, asMixin = false) {
12594
+ const { mixins, extends: extendsOptions } = from;
12595
+ if (extendsOptions) {
12596
+ mergeOptions(to, extendsOptions, strats, true);
12597
+ }
12598
+ if (mixins) {
12599
+ mixins.forEach((m) => mergeOptions(to, m, strats, true));
12600
+ }
12601
+ for (const key in from) {
12602
+ if (asMixin && key === "expose")
12603
+ ;
12604
+ else {
12605
+ const strat = internalOptionMergeStrats[key] || strats && strats[key];
12606
+ to[key] = strat ? strat(to[key], from[key]) : from[key];
12607
+ }
12608
+ }
12609
+ return to;
12610
+ }
12611
+ const internalOptionMergeStrats = {
12612
+ data: mergeDataFn,
12613
+ props: mergeObjectOptions,
12614
+ emits: mergeObjectOptions,
12615
+ methods: mergeObjectOptions,
12616
+ computed: mergeObjectOptions,
12617
+ beforeCreate: mergeAsArray,
12618
+ created: mergeAsArray,
12619
+ beforeMount: mergeAsArray,
12620
+ mounted: mergeAsArray,
12621
+ beforeUpdate: mergeAsArray,
12622
+ updated: mergeAsArray,
12623
+ beforeDestroy: mergeAsArray,
12624
+ beforeUnmount: mergeAsArray,
12625
+ destroyed: mergeAsArray,
12626
+ unmounted: mergeAsArray,
12627
+ activated: mergeAsArray,
12628
+ deactivated: mergeAsArray,
12629
+ errorCaptured: mergeAsArray,
12630
+ serverPrefetch: mergeAsArray,
12631
+ components: mergeObjectOptions,
12632
+ directives: mergeObjectOptions,
12633
+ watch: mergeWatchOptions,
12634
+ provide: mergeDataFn,
12635
+ inject: mergeInject
12636
+ };
12637
+ function mergeDataFn(to, from) {
12638
+ if (!from) {
12639
+ return to;
12640
+ }
12641
+ if (!to) {
12642
+ return from;
12643
+ }
12644
+ return function mergedDataFn() {
12645
+ return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
12646
+ };
12647
+ }
12648
+ function mergeInject(to, from) {
12649
+ return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
12650
+ }
12651
+ function normalizeInject(raw) {
12652
+ if (isArray(raw)) {
12653
+ const res = {};
12654
+ for (let i = 0; i < raw.length; i++) {
12655
+ res[raw[i]] = raw[i];
12656
+ }
12657
+ return res;
12452
12658
  }
12453
- });
12454
- var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-e808078e"]]);
12455
- var ckLabel_vue_vue_type_style_index_0_scoped_true_lang = "";
12456
- const _hoisted_1$e = ["for"];
12457
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
12458
- props: {
12459
- for: { type: String, default: "" },
12460
- align: { type: String, default: "" }
12461
- },
12462
- setup(__props) {
12463
- const props = __props;
12464
- const computedClass = computed$2(() => {
12465
- const list = [];
12466
- let align = "left";
12467
- if (props.align === "center" || props.align === "right")
12468
- align = props.align;
12469
- list.push(`ck-align--${align}`);
12470
- return list;
12471
- });
12472
- return (_ctx, _cache) => {
12473
- return openBlock(), createElementBlock("label", {
12474
- class: normalizeClass(["ck-label", unref$1(computedClass)]),
12475
- for: __props.for
12476
- }, [
12477
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
12478
- ], 10, _hoisted_1$e);
12479
- };
12659
+ return raw;
12660
+ }
12661
+ function mergeAsArray(to, from) {
12662
+ return to ? [...new Set([].concat(to, from))] : from;
12663
+ }
12664
+ function mergeObjectOptions(to, from) {
12665
+ return to ? extend(extend(Object.create(null), to), from) : from;
12666
+ }
12667
+ function mergeWatchOptions(to, from) {
12668
+ if (!to)
12669
+ return from;
12670
+ if (!from)
12671
+ return to;
12672
+ const merged = extend(Object.create(null), to);
12673
+ for (const key in from) {
12674
+ merged[key] = mergeAsArray(to[key], from[key]);
12480
12675
  }
12676
+ return merged;
12677
+ }
12678
+ const queuePostRenderEffect = queueEffectWithSuspense;
12679
+ const getPublicInstance = (i) => {
12680
+ if (!i)
12681
+ return null;
12682
+ if (isStatefulComponent(i))
12683
+ return getExposeProxy(i) || i.proxy;
12684
+ return getPublicInstance(i.parent);
12685
+ };
12686
+ const publicPropertiesMap = extend(Object.create(null), {
12687
+ $: (i) => i,
12688
+ $el: (i) => i.vnode.el,
12689
+ $data: (i) => i.data,
12690
+ $props: (i) => i.props,
12691
+ $attrs: (i) => i.attrs,
12692
+ $slots: (i) => i.slots,
12693
+ $refs: (i) => i.refs,
12694
+ $parent: (i) => getPublicInstance(i.parent),
12695
+ $root: (i) => getPublicInstance(i.root),
12696
+ $emit: (i) => i.emit,
12697
+ $options: (i) => resolveMergedOptions(i),
12698
+ $forceUpdate: (i) => () => queueJob(i.update),
12699
+ $nextTick: (i) => nextTick.bind(i.proxy),
12700
+ $watch: (i) => instanceWatch.bind(i)
12481
12701
  });
12482
- var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-ef74ea02"]]);
12483
- var ckInput_vue_vue_type_style_index_0_scoped_true_lang = "";
12484
- const _hoisted_1$d = { class: "ck-input" };
12485
- const _hoisted_2$7 = ["type", "placeholder", "id", "disabled"];
12486
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
12702
+ let currentInstance = null;
12703
+ const setCurrentInstance = (instance) => {
12704
+ currentInstance = instance;
12705
+ instance.scope.on();
12706
+ };
12707
+ const unsetCurrentInstance = () => {
12708
+ currentInstance && currentInstance.scope.off();
12709
+ currentInstance = null;
12710
+ };
12711
+ function isStatefulComponent(instance) {
12712
+ return instance.vnode.shapeFlag & 4;
12713
+ }
12714
+ let isInSSRComponentSetup = false;
12715
+ function getExposeProxy(instance) {
12716
+ if (instance.exposed) {
12717
+ return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
12718
+ get(target, key) {
12719
+ if (key in target) {
12720
+ return target[key];
12721
+ } else if (key in publicPropertiesMap) {
12722
+ return publicPropertiesMap[key](instance);
12723
+ }
12724
+ }
12725
+ }));
12726
+ }
12727
+ }
12728
+ const computed = (getterOrOptions, debugOptions) => {
12729
+ return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
12730
+ };
12731
+ var ckCheckbox_vue_vue_type_style_index_0_scoped_true_lang = "";
12732
+ const _withScopeId$2 = (n) => (pushScopeId("data-v-132565da"), n = n(), popScopeId(), n);
12733
+ const _hoisted_1$b = ["disabled", "checked"];
12734
+ const _hoisted_2$6 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
12735
+ const _hoisted_3$4 = {
12736
+ key: 0,
12737
+ class: "c-Checkbox__label"
12738
+ };
12739
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
12487
12740
  props: {
12488
- modelValue: {},
12489
- type: { type: String, validator: validators.inputType, default: "text" },
12490
- disabled: { type: Boolean, default: false },
12491
- placeholder: { type: String, default: void 0 },
12741
+ modelValue: { type: Boolean, default: false },
12492
12742
  label: { type: String, default: void 0 },
12493
- labelAlign: { type: String, validator: validators.align, default: void 0 },
12494
- icon: { type: [String, Array], default: void 0 },
12495
- iconPack: { type: String, default: void 0 },
12496
- iconRight: { type: String, default: void 0 },
12497
- group: { type: String, default: void 0 },
12498
- groupBreak: { type: String, default: "s" },
12499
- groupVertical: { type: String, default: void 0 },
12500
- hideBorder: { type: Boolean, default: false },
12501
- width: { type: String, default: void 0 },
12502
- align: { type: String, validator: validators.align, default: void 0 },
12503
- autoSelect: { type: Boolean, default: false }
12743
+ disabled: { type: Boolean, default: false }
12504
12744
  },
12505
- emits: ["update:modelValue", "click", "input", "change"],
12745
+ emits: ["update:modelValue", "change"],
12506
12746
  setup(__props, { emit: emits }) {
12507
12747
  const props = __props;
12508
- const value = computed$2({
12748
+ const value = computed({
12509
12749
  get() {
12510
12750
  return props.modelValue;
12511
12751
  },
@@ -12513,88 +12753,54 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
12513
12753
  emits("update:modelValue", val);
12514
12754
  }
12515
12755
  });
12516
- const onClick = (event) => {
12517
- if (props.autoSelect)
12518
- event.target.select();
12519
- emits("click", event);
12520
- };
12521
- const onInput = (event) => {
12522
- emits("input", event);
12523
- };
12524
- const onChange = (event) => {
12525
- emits("change", event);
12526
- };
12527
- const computedStyleInput = computed$2(() => {
12528
- const list = [];
12529
- if (props.width)
12530
- list.push({ width: props.width });
12531
- return list;
12532
- });
12533
- const computedClassInput = computed$2(() => {
12534
- const list = [];
12535
- list.push(functions$1.getGroupClass(props));
12536
- if (props.icon)
12537
- list.push("has-icon-left");
12538
- if (props.iconRight)
12539
- list.push("has-icon-right");
12540
- if (props.align)
12541
- list.push(`align--${props.align}`);
12542
- if (props.hideBorder)
12543
- list.push("no-border");
12544
- return list;
12756
+ const checkboxAttributes = computed(() => {
12757
+ return {
12758
+ "aria-disabled": props.disabled,
12759
+ tabindex: props.disabled ? void 0 : "0"
12760
+ };
12545
12761
  });
12762
+ function onChange(event) {
12763
+ emits("change", event);
12764
+ }
12765
+ function onTrigger2() {
12766
+ value.value = !value.value;
12767
+ }
12546
12768
  return (_ctx, _cache) => {
12547
- return openBlock(), createElementBlock("div", _hoisted_1$d, [
12548
- __props.label ? (openBlock(), createBlock(ckLabel, {
12549
- key: 0,
12550
- align: __props.labelAlign,
12551
- for: "ck-input"
12552
- }, {
12553
- default: withCtx(() => [
12554
- createTextVNode(toDisplayString(__props.label), 1)
12555
- ]),
12556
- _: 1
12557
- }, 8, ["align"])) : createCommentVNode("", true),
12558
- __props.icon ? (openBlock(), createBlock(ckIcon, {
12559
- key: 1,
12560
- class: "ck-input__icon-left",
12561
- color: "lightgrey",
12562
- icon: __props.icon,
12563
- "icon-pack": __props.iconPack
12564
- }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true),
12565
- withDirectives(createElementVNode("input", {
12566
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(value) ? value.value = $event : null),
12567
- type: __props.type,
12568
- placeholder: __props.placeholder,
12569
- class: normalizeClass(unref$1(computedClassInput)),
12570
- style: normalizeStyle(unref$1(computedStyleInput)),
12571
- id: __props.label ? "ck-input" : "",
12769
+ return openBlock(), createElementBlock("label", mergeProps({ class: "ck-checkbox" }, unref$1(checkboxAttributes), {
12770
+ onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
12771
+ }, ["prevent"]), ["space"])),
12772
+ onKeyup: [
12773
+ _cache[2] || (_cache[2] = withKeys(($event) => onTrigger2(), ["enter"])),
12774
+ _cache[3] || (_cache[3] = withKeys(($event) => onTrigger2(), ["space"]))
12775
+ ]
12776
+ }), [
12777
+ createElementVNode("input", {
12778
+ class: "ck-checkbox__input",
12779
+ "aria-hidden": "true",
12780
+ type: "checkbox",
12572
12781
  disabled: __props.disabled,
12573
- onChange: _cache[1] || (_cache[1] = ($event) => onChange($event)),
12574
- onInput: _cache[2] || (_cache[2] = ($event) => onInput($event)),
12575
- onClick: _cache[3] || (_cache[3] = ($event) => onClick($event))
12576
- }, null, 46, _hoisted_2$7), [
12577
- [vModelDynamic, unref$1(value)]
12578
- ]),
12579
- __props.iconRight ? (openBlock(), createBlock(ckIcon, {
12580
- key: 2,
12581
- class: "ck-input__icon-right",
12582
- color: "lightgrey",
12583
- icon: __props.iconRight,
12584
- "icon-pack": __props.iconPack
12585
- }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true)
12586
- ]);
12782
+ checked: unref$1(value),
12783
+ onChange: _cache[0] || (_cache[0] = ($event) => {
12784
+ value.value = $event.target.checked;
12785
+ onChange($event);
12786
+ })
12787
+ }, null, 40, _hoisted_1$b),
12788
+ _hoisted_2$6,
12789
+ _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_3$4, [
12790
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
12791
+ ])) : createCommentVNode("", true)
12792
+ ], 16);
12587
12793
  };
12588
12794
  }
12589
12795
  });
12590
- var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-5db08b1e"]]);
12796
+ var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-132565da"]]);
12591
12797
  var ckPopup_vue_vue_type_style_index_0_lang = "";
12592
- const _hoisted_1$c = {
12798
+ const _hoisted_1$a = {
12593
12799
  key: 0,
12594
12800
  class: "ck-popup"
12595
12801
  };
12596
- const _hoisted_2$6 = /* @__PURE__ */ createElementVNode("div", { class: "blackout" }, null, -1);
12597
- const _hoisted_3$4 = { class: "ck-popup__slot-header" };
12802
+ const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("div", { class: "blackout" }, null, -1);
12803
+ const _hoisted_3$3 = { class: "ck-popup__slot-header" };
12598
12804
  const _hoisted_4$3 = {
12599
12805
  key: 0,
12600
12806
  class: "ck-popup__title"
@@ -12610,7 +12816,7 @@ const _hoisted_7 = {
12610
12816
  };
12611
12817
  const _hoisted_8 = /* @__PURE__ */ createTextVNode("Cancelar");
12612
12818
  const _hoisted_9 = /* @__PURE__ */ createTextVNode("Aceptar");
12613
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
12819
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
12614
12820
  props: {
12615
12821
  modelValue: { type: Boolean },
12616
12822
  title: { type: String, default: void 0 },
@@ -12631,24 +12837,21 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
12631
12837
  }
12632
12838
  });
12633
12839
  function onCancel() {
12634
- console.log("onCancel");
12635
12840
  emits("cancel");
12636
12841
  if (!props.preventCloseOnCancel)
12637
12842
  isActive.value = false;
12638
12843
  }
12639
12844
  function onAccept() {
12640
- console.log("onAccept");
12641
12845
  emits("accept");
12642
12846
  }
12643
12847
  function onBgClick() {
12644
- console.log("onBgClick");
12645
12848
  if (props.notCloseByBg)
12646
12849
  return;
12647
12850
  isActive.value = false;
12648
12851
  }
12649
12852
  return (_ctx, _cache) => {
12650
- return unref$1(isActive) ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
12651
- _hoisted_2$6,
12853
+ return unref$1(isActive) ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
12854
+ _hoisted_2$5,
12652
12855
  createElementVNode("div", {
12653
12856
  class: "popup-container",
12654
12857
  onClick: _cache[4] || (_cache[4] = ($event) => onBgClick())
@@ -12658,12 +12861,12 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
12658
12861
  onClick: _cache[3] || (_cache[3] = withModifiers(() => {
12659
12862
  }, ["stop"]))
12660
12863
  }, [
12661
- createElementVNode("div", _hoisted_3$4, [
12864
+ createElementVNode("div", _hoisted_3$3, [
12662
12865
  __props.title ? (openBlock(), createElementBlock("h3", _hoisted_4$3, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
12663
- renderSlot(_ctx.$slots, "header", { class: "ml-3" }),
12866
+ renderSlot(_ctx.$slots, "header"),
12664
12867
  !__props.notCloseBtn ? (openBlock(), createBlock(ckIcon, {
12665
12868
  key: 1,
12666
- class: "mr-3 close",
12869
+ class: "close",
12667
12870
  icon: "times",
12668
12871
  onClick: _cache[0] || (_cache[0] = ($event) => isActive.value = false)
12669
12872
  })) : createCommentVNode("", true)
@@ -12701,26 +12904,20 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
12701
12904
  };
12702
12905
  }
12703
12906
  });
12704
- var ckRadio_vue_vue_type_style_index_0_scoped_true_lang = "";
12705
- const _withScopeId$1 = (n) => (pushScopeId("data-v-a5198d80"), n = n(), popScopeId(), n);
12706
- const _hoisted_1$b = ["onKeyup"];
12707
- const _hoisted_2$5 = ["name", "value", "disabled"];
12708
- const _hoisted_3$3 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", { class: "c-Radio__element" }, null, -1));
12709
- const _hoisted_4$2 = {
12710
- key: 0,
12711
- class: "c-Radio__label"
12712
- };
12713
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
12907
+ var ckTable__columnsManager_vue_vue_type_style_index_0_scoped_true_lang = "";
12908
+ const _hoisted_1$9 = { class: "columns-manger-container" };
12909
+ const _hoisted_2$4 = { class: "columns-manger__item" };
12910
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
12714
12911
  props: {
12715
- modelValue: { type: String, default: void 0 },
12716
- name: { type: String, required: true },
12717
- options: { type: Array, required: true, validator: validators.radioOptions },
12718
- disabled: { type: Boolean, default: false }
12912
+ modelValue: { type: Boolean, required: true },
12913
+ columns: { type: Object, required: true },
12914
+ columnsArray: { type: Array, required: true }
12719
12915
  },
12720
- emits: ["update:modelValue", "change"],
12916
+ emits: ["update:modelValue"],
12721
12917
  setup(__props, { emit: emits }) {
12722
12918
  const props = __props;
12723
- const value = computed$2({
12919
+ let columnsCheckable = ref([]);
12920
+ const isActive = computed$2({
12724
12921
  get() {
12725
12922
  return props.modelValue;
12726
12923
  },
@@ -12728,48 +12925,58 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
12728
12925
  emits("update:modelValue", val);
12729
12926
  }
12730
12927
  });
12731
- const radioAttributes = computed$2(() => {
12732
- return {
12733
- "aria-disabled": props.disabled,
12734
- tabindex: props.disabled ? void 0 : "0"
12735
- };
12928
+ watch(() => isActive.value, (val) => {
12929
+ if (!val)
12930
+ return;
12931
+ setColumnsCheckable();
12736
12932
  });
12737
- function handleChange(value2) {
12738
- value2.value = value2;
12739
- emits("change", value2);
12933
+ function setColumnsCheckable() {
12934
+ console.log("hoola");
12935
+ const list = [];
12936
+ props.columnsArray.forEach((col) => {
12937
+ if (!col.unchangeable) {
12938
+ list.push({
12939
+ name: col.name,
12940
+ title: col.title,
12941
+ value: functions.isColumnDisplayed(col)
12942
+ });
12943
+ }
12944
+ });
12945
+ columnsCheckable.value = list;
12946
+ }
12947
+ function setColumnDisplayValue(colName, value) {
12948
+ props.columns[colName].isDisplayed = value;
12740
12949
  }
12741
12950
  return (_ctx, _cache) => {
12742
- return openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => {
12743
- return openBlock(), createElementBlock("label", mergeProps({
12744
- key: `radio-${index}`,
12745
- class: "c-Radio"
12746
- }, unref$1(radioAttributes), {
12747
- onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
12748
- }, ["prevent"]), ["space"])),
12749
- onKeyup: [
12750
- withKeys(($event) => handleChange(item.value), ["enter"]),
12751
- withKeys(($event) => handleChange(item.value), ["space"])
12752
- ]
12753
- }), [
12754
- withDirectives(createElementVNode("input", {
12755
- class: "c-Radio__input",
12756
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(value) ? value.value = $event : null),
12757
- "aria-hidden": "true",
12758
- type: "radio",
12759
- name: __props.name,
12760
- value: item.value,
12761
- disabled: __props.disabled
12762
- }, null, 8, _hoisted_2$5), [
12763
- [vModelRadio, unref$1(value)]
12764
- ]),
12765
- _hoisted_3$3,
12766
- item.label ? (openBlock(), createElementBlock("span", _hoisted_4$2, toDisplayString(item.label), 1)) : createCommentVNode("", true)
12767
- ], 16, _hoisted_1$b);
12768
- }), 128);
12951
+ return openBlock(), createBlock(_sfc_main$b, {
12952
+ modelValue: unref$1(isActive),
12953
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(isActive) ? isActive.value = $event : null),
12954
+ title: "Administrador de columnas"
12955
+ }, {
12956
+ default: withCtx(() => [
12957
+ createElementVNode("div", _hoisted_1$9, [
12958
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(columnsCheckable), (col) => {
12959
+ return openBlock(), createElementBlock("div", _hoisted_2$4, [
12960
+ createVNode(ckCheckbox, {
12961
+ modelValue: col.value,
12962
+ "onUpdate:modelValue": ($event) => col.value = $event,
12963
+ onChange: ($event) => setColumnDisplayValue(col.name, col.value)
12964
+ }, {
12965
+ default: withCtx(() => [
12966
+ createTextVNode(toDisplayString(col.title), 1)
12967
+ ]),
12968
+ _: 2
12969
+ }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])
12970
+ ]);
12971
+ }), 256))
12972
+ ])
12973
+ ]),
12974
+ _: 1
12975
+ }, 8, ["modelValue"]);
12769
12976
  };
12770
12977
  }
12771
12978
  });
12772
- var ckRadio = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-a5198d80"]]);
12979
+ var TableColumnsManager = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-5b0e173f"]]);
12773
12980
  var qmApi = {};
12774
12981
  var qmArray = {
12775
12982
  arrayToText(arr, key = null) {
@@ -12958,982 +13165,864 @@ var qmNum = {
12958
13165
  } else if (isFloat && str[i] == "," || isFloat && str[i] == ".") {
12959
13166
  newStr += ".";
12960
13167
  isFloat = false;
12961
- }
12962
- }
12963
- return newStr;
12964
- },
12965
- showPrice(num, Extra = { hideIcon: false, currency: "$" }) {
12966
- if (Extra.hideIcon !== true)
12967
- Extra.hideIcon = false;
12968
- let presentedNum = this.presentNum(num, true);
12969
- const isNegative = presentedNum[0] === "-";
12970
- if (isNegative)
12971
- presentedNum = presentedNum.substring(1, presentedNum.length);
12972
- if (!Extra.hideIcon)
12973
- presentedNum = `${Extra.currency}${presentedNum}`;
12974
- if (isNegative)
12975
- presentedNum = `- ${presentedNum}`;
12976
- return presentedNum;
12977
- },
12978
- simplifyNum(num) {
12979
- if (!(num % 1))
12980
- return Math.floor(num);
12981
- return this.presentNum(num);
12982
- }
12983
- };
12984
- function getKeyValue(obj, key) {
12985
- return obj[key];
12986
- }
12987
- function setKeyValue(obj, key, value) {
12988
- obj[key] = value;
12989
- }
12990
- var qmObj = {
12991
- addEmptyOptionToList(optionsList, { prop = "name", title = "Todos", noneId = 0 } = {}) {
12992
- const noneOption = {
12993
- id: noneId,
12994
- [prop]: title
12995
- };
12996
- const newList = [...optionsList];
12997
- newList.unshift(noneOption);
12998
- return newList;
12999
- },
13000
- copyAvaibleFields(ObjEditable, ObjToCopy) {
13001
- for (const key in ObjEditable) {
13002
- if (typeof getKeyValue(ObjToCopy, key) !== "undefined") {
13003
- setKeyValue(ObjEditable, key, getKeyValue(ObjToCopy, key));
13004
- }
13005
- }
13006
- },
13007
- isArray(obj) {
13008
- return obj.constructor === Array;
13009
- },
13010
- objsAreTheSame(obj1, obj2) {
13011
- for (const key in obj1) {
13012
- if (getKeyValue(obj1, key) != getKeyValue(obj2, key))
13013
- return false;
13014
- }
13015
- for (const key in obj2) {
13016
- if (getKeyValue(obj1, key) != getKeyValue(obj2, key))
13017
- return false;
13018
- }
13019
- return true;
13020
- },
13021
- qoIsObjEmpty(obj = {}) {
13022
- return obj && Object.keys(obj).length === 0 && Object.getPrototypeOf(obj) === Object.prototype;
13023
- }
13024
- };
13025
- var main$1 = {
13026
- qmApi,
13027
- qmArray,
13028
- qmAudio,
13029
- qmNum,
13030
- qmObj,
13031
- qmStr
13032
- };
13033
- var App;
13034
- (function(App2) {
13035
- class SomeClass {
13036
- getName() {
13037
- return "name";
13038
- }
13039
- }
13040
- App2.SomeClass = SomeClass;
13041
- class OtherClass {
13042
- getName() {
13043
- return "name";
13044
- }
13045
- }
13046
- App2.OtherClass = OtherClass;
13047
- })(App || (App = {}));
13048
- var ckSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
13049
- const _hoisted_1$a = ["value"];
13050
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
13051
- props: {
13052
- modelValue: { default: null, type: [Boolean, Number, Object, Array, String] },
13053
- prop: { type: String, default: "name" },
13054
- autofocus: { type: Boolean, default: false },
13055
- noDataText: { type: String, default: "No se encontr\xF3 nada" },
13056
- notReduce: { type: Boolean, default: false },
13057
- options: { type: Array, default: () => [] },
13058
- reduceFunction: { type: Function, default: (Option) => Option.id },
13059
- notClearable: { type: Boolean, default: false },
13060
- clearValue: { type: [Boolean, String], default: "auto" },
13061
- searchable: { type: [Boolean, String], default: "auto" },
13062
- minWidth: { type: String, default: "180px" },
13063
- noBorder: { type: Boolean, default: false },
13064
- bgTransparent: { type: Boolean, default: false },
13065
- disabled: { type: [Boolean, Number], default: false },
13066
- group: { type: String, default: "" },
13067
- groupBreak: { type: String, default: "" },
13068
- groupVertical: { type: String, default: "" },
13069
- label: { type: String, default: "" },
13070
- labelAlign: { type: String, default: "" }
13071
- },
13072
- emits: ["update:modelValue", "click", "change"],
13073
- setup(__props, { emit: emits }) {
13074
- const props = __props;
13075
- const { qmStr: qmStr2 } = main$1;
13076
- const search = ref("");
13077
- ref(null);
13078
- const value = computed$2({
13079
- get() {
13080
- return props.modelValue;
13081
- },
13082
- set(val) {
13083
- if (val === null)
13084
- val = realClearValue;
13085
- emits("update:modelValue", val);
13086
- }
13087
- });
13088
- const filteredOptions = computed$2(() => {
13089
- const list = props.options.filter((option) => {
13090
- const name = getOptionName(option);
13091
- return qmStr2.checkContainsStr(name, search.value);
13092
- });
13093
- return list;
13094
- });
13095
- const computedClass = computed$2(() => {
13096
- const classList2 = [];
13097
- classList2.push(functions$1.getGroupClass(props));
13098
- return classList2;
13099
- });
13100
- const computedStyle = computed$2(() => {
13101
- const list = [];
13102
- if (props.minWidth)
13103
- list.push({ "min-width": props.minWidth });
13104
- return list;
13105
- });
13106
- computed$2(() => {
13107
- if (props.searchable === "auto") {
13108
- if (props.options.length < 5)
13109
- return false;
13110
- return true;
13111
- }
13112
- return props.searchable;
13113
- });
13114
- const realClearValue = computed$2(() => {
13115
- switch (typeof props.modelValue) {
13116
- case "number":
13117
- return 0;
13118
- case "string":
13119
- return "";
13120
- case "object":
13121
- if (props.modelValue.constructor === Array)
13122
- return [];
13123
- return {};
13124
- default:
13125
- return null;
13126
- }
13127
- });
13128
- computed$2(() => {
13129
- switch (typeof props.modelValue) {
13130
- case "number":
13131
- return props.modelValue === 0;
13132
- case "string":
13133
- return props.modelValue === "";
13134
- case "object":
13135
- if (!props.modelValue)
13136
- return null;
13137
- if (props.modelValue.constructor === Array) {
13138
- return props.modelValue.length() === 0;
13139
- }
13140
- return Object.keys(props.modelValue).length === 0;
13141
- default:
13142
- return props.modelValue === null;
13143
- }
13144
- });
13145
- function onClick(event) {
13146
- emits("click", event);
13168
+ }
13147
13169
  }
13148
- const onChange = (event) => {
13149
- emits("change", event);
13150
- };
13151
- const getOptionKey = (option) => {
13152
- return realReduceFunction(option);
13153
- };
13154
- const getOptionName = (option) => {
13155
- if (!props.prop)
13156
- return option;
13157
- return option[props.prop];
13158
- };
13159
- const realReduceFunction = (option) => {
13160
- if (props.notReduce)
13161
- return option;
13162
- return props.reduceFunction(option);
13163
- };
13164
- return (_ctx, _cache) => {
13165
- return openBlock(), createElementBlock("div", {
13166
- class: "ck-select",
13167
- style: normalizeStyle(unref$1(computedStyle))
13168
- }, [
13169
- __props.label ? (openBlock(), createBlock(ckLabel, {
13170
- key: 0,
13171
- align: __props.labelAlign,
13172
- for: "ck-input"
13173
- }, {
13174
- default: withCtx(() => [
13175
- createTextVNode(toDisplayString(__props.label), 1)
13176
- ]),
13177
- _: 1
13178
- }, 8, ["align"])) : createCommentVNode("", true),
13179
- withDirectives(createElementVNode("select", {
13180
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(value) ? value.value = $event : null),
13181
- class: normalizeClass(unref$1(computedClass)),
13182
- onClick: _cache[1] || (_cache[1] = ($event) => onClick($event)),
13183
- onChange: _cache[2] || (_cache[2] = ($event) => onChange($event))
13184
- }, [
13185
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(filteredOptions), (option) => {
13186
- return openBlock(), createElementBlock("option", {
13187
- value: getOptionKey(option),
13188
- key: option
13189
- }, toDisplayString(getOptionName(option)), 9, _hoisted_1$a);
13190
- }), 128))
13191
- ], 34), [
13192
- [vModelSelect, unref$1(value)]
13193
- ])
13194
- ], 4);
13170
+ return newStr;
13171
+ },
13172
+ showPrice(num, Extra = { hideIcon: false, currency: "$" }) {
13173
+ if (Extra.hideIcon !== true)
13174
+ Extra.hideIcon = false;
13175
+ let presentedNum = this.presentNum(num, true);
13176
+ const isNegative = presentedNum[0] === "-";
13177
+ if (isNegative)
13178
+ presentedNum = presentedNum.substring(1, presentedNum.length);
13179
+ if (!Extra.hideIcon)
13180
+ presentedNum = `${Extra.currency}${presentedNum}`;
13181
+ if (isNegative)
13182
+ presentedNum = `- ${presentedNum}`;
13183
+ return presentedNum;
13184
+ },
13185
+ simplifyNum(num) {
13186
+ if (!(num % 1))
13187
+ return Math.floor(num);
13188
+ return this.presentNum(num);
13189
+ }
13190
+ };
13191
+ function getKeyValue(obj, key) {
13192
+ return obj[key];
13193
+ }
13194
+ function setKeyValue(obj, key, value) {
13195
+ obj[key] = value;
13196
+ }
13197
+ var qmObj = {
13198
+ addEmptyOptionToList(optionsList, { prop = "name", title = "Todos", noneId = 0 } = {}) {
13199
+ const noneOption = {
13200
+ id: noneId,
13201
+ [prop]: title
13195
13202
  };
13203
+ const newList = [...optionsList];
13204
+ newList.unshift(noneOption);
13205
+ return newList;
13206
+ },
13207
+ copyAvaibleFields(ObjEditable, ObjToCopy) {
13208
+ for (const key in ObjEditable) {
13209
+ if (typeof getKeyValue(ObjToCopy, key) !== "undefined") {
13210
+ setKeyValue(ObjEditable, key, getKeyValue(ObjToCopy, key));
13211
+ }
13212
+ }
13213
+ },
13214
+ isArray(obj) {
13215
+ return obj.constructor === Array;
13216
+ },
13217
+ objsAreTheSame(obj1, obj2) {
13218
+ for (const key in obj1) {
13219
+ if (getKeyValue(obj1, key) != getKeyValue(obj2, key))
13220
+ return false;
13221
+ }
13222
+ for (const key in obj2) {
13223
+ if (getKeyValue(obj1, key) != getKeyValue(obj2, key))
13224
+ return false;
13225
+ }
13226
+ return true;
13227
+ },
13228
+ qoIsObjEmpty(obj = {}) {
13229
+ return obj && Object.keys(obj).length === 0 && Object.getPrototypeOf(obj) === Object.prototype;
13196
13230
  }
13197
- });
13198
- var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-31af160a"]]);
13199
- var ckSwitch_vue_vue_type_style_index_0_scoped_true_lang = "";
13200
- const _withScopeId = (n) => (pushScopeId("data-v-35213eec"), n = n(), popScopeId(), n);
13201
- const _hoisted_1$9 = ["disabled"];
13202
- const _hoisted_2$4 = { class: "ck-switch__slider-container" };
13203
- const _hoisted_3$2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
13204
- const _hoisted_4$1 = {
13231
+ };
13232
+ var main$1 = {
13233
+ qmApi,
13234
+ qmArray,
13235
+ qmAudio,
13236
+ qmNum,
13237
+ qmObj,
13238
+ qmStr
13239
+ };
13240
+ var App;
13241
+ (function(App2) {
13242
+ class SomeClass {
13243
+ getName() {
13244
+ return "name";
13245
+ }
13246
+ }
13247
+ App2.SomeClass = SomeClass;
13248
+ class OtherClass {
13249
+ getName() {
13250
+ return "name";
13251
+ }
13252
+ }
13253
+ App2.OtherClass = OtherClass;
13254
+ })(App || (App = {}));
13255
+ var ckTable_vue_vue_type_style_index_0_scoped_true_lang = "";
13256
+ const _hoisted_1$8 = { class: "ck-table" };
13257
+ const _hoisted_2$3 = {
13205
13258
  key: 0,
13206
- class: "ck-switch__content"
13259
+ class: "ck-table__header"
13207
13260
  };
13208
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
13261
+ const _hoisted_3$2 = {
13262
+ key: 1,
13263
+ class: "ck-table__header--slot"
13264
+ };
13265
+ const _hoisted_4$2 = { class: "ck-table__table-container" };
13266
+ const _hoisted_5 = { key: 0 };
13267
+ const _hoisted_6 = { key: 1 };
13268
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
13209
13269
  props: {
13210
- modelValue: { type: [Boolean, Number], default: false },
13211
- disabled: { type: Boolean, default: false },
13212
- outlined: { type: Boolean, default: false },
13213
- squared: { type: Boolean, default: false },
13214
- icon: { type: String, default: void 0 },
13215
- iconPack: { type: String, default: void 0 }
13270
+ columns: { type: [Array, Object], required: true, default: () => [] },
13271
+ hasColumnsManager: { type: Boolean, default: false },
13272
+ currentPage: { type: Number, default: 0 },
13273
+ itemsPerPage: { type: Number, default: 40 },
13274
+ listLength: { type: Number, default: 0 },
13275
+ paginationAlign: { type: String, default: "center", validator: validators.align },
13276
+ search: { type: String, default: void 0 },
13277
+ hideHeaderActions: { type: Boolean, default: false },
13278
+ showRefreshBtn: { type: Boolean, default: false },
13279
+ hideItemsPerPage: { type: Boolean, default: false },
13280
+ notFullWidth: { type: Boolean, default: false }
13216
13281
  },
13217
- emits: ["update:modelValue"],
13282
+ emits: ["refreshList", "update:search", "update:currentPage"],
13218
13283
  setup(__props, { emit: emits }) {
13219
13284
  const props = __props;
13220
- const value = computed$2({
13285
+ const { qmObj: qmObj2 } = main$1;
13286
+ const IsPopupActive = ref({
13287
+ columnsManager: false
13288
+ });
13289
+ const columnsAreObj = computed$2(() => !qmObj2.isArray(props.columns));
13290
+ const columnsArray = computed$2(() => {
13291
+ if (!columnsAreObj.value)
13292
+ return props.columns;
13293
+ const arr = Object.values(props.columns);
13294
+ const keys = Object.keys(props.columns);
13295
+ arr.forEach((col, index) => {
13296
+ const key = keys[index];
13297
+ col.name = key;
13298
+ });
13299
+ return arr;
13300
+ });
13301
+ const filteredColumnsList = computed$2(() => {
13302
+ return columnsArray.value.filter(functions.isColumnDisplayed);
13303
+ });
13304
+ const searchLocal = computed$2({
13221
13305
  get() {
13222
- return props.modelValue;
13306
+ return props.search;
13223
13307
  },
13224
13308
  set(val) {
13225
- emits("update:modelValue", val);
13309
+ emits("update:search", val);
13226
13310
  }
13227
13311
  });
13228
- const computedClass = computed$2(() => {
13229
- const list = [];
13230
- if (props.squared)
13231
- list.push("is-squared");
13232
- if (props.outlined)
13233
- list.push("is-outlined");
13234
- return list;
13235
- });
13236
- const computedAttributes = computed$2(() => {
13237
- return {
13238
- "aria-disabled": props.disabled,
13239
- tabindex: props.disabled ? void 0 : "0"
13240
- };
13241
- });
13242
- function onTrigger2() {
13243
- value.value = !value.value;
13244
- }
13245
- return (_ctx, _cache) => {
13246
- return openBlock(), createElementBlock("label", mergeProps({ class: "ck-switch" }, unref$1(computedAttributes), {
13247
- class: unref$1(computedClass),
13248
- onKeydown: _cache[2] || (_cache[2] = withKeys(withModifiers(() => {
13249
- }, ["prevent"]), ["space"])),
13250
- onKeyup: [
13251
- _cache[3] || (_cache[3] = withKeys(($event) => onTrigger2(), ["enter"])),
13252
- _cache[4] || (_cache[4] = withKeys(($event) => onTrigger2(), ["space"]))
13253
- ]
13254
- }), [
13255
- withDirectives(createElementVNode("input", {
13256
- class: "ck-switch__input",
13257
- "aria-hidden": "true",
13258
- type: "checkbox",
13259
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(value) ? value.value = $event : null),
13260
- disabled: __props.disabled,
13261
- onClick: _cache[1] || (_cache[1] = ($event) => onTrigger2())
13262
- }, null, 8, _hoisted_1$9), [
13263
- [vModelCheckbox, unref$1(value)]
13264
- ]),
13265
- createElementVNode("div", _hoisted_2$4, [
13266
- _hoisted_3$2,
13267
- __props.icon && unref$1(value) ? (openBlock(), createBlock(ckIcon, {
13268
- key: 0,
13269
- class: "ck-switch__icon-left",
13270
- icon: __props.icon,
13271
- "icon-pack": __props.iconPack
13272
- }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true),
13273
- __props.icon && !unref$1(value) ? (openBlock(), createBlock(ckIcon, {
13274
- key: 1,
13275
- class: "ck-switch__icon-right",
13276
- icon: __props.icon,
13277
- "icon-pack": __props.iconPack
13278
- }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true)
13279
- ]),
13280
- _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_4$1, [
13281
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
13282
- ])) : createCommentVNode("", true)
13283
- ], 16);
13284
- };
13285
- }
13286
- });
13287
- var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-35213eec"]]);
13288
- var ckSwitchOptions_vue_vue_type_style_index_0_scoped_true_lang = "";
13289
- const _hoisted_1$8 = { class: "ck-switch-options__container-exterior" };
13290
- const _hoisted_2$3 = ["onClick"];
13291
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
13292
- props: {
13293
- modelValue: { type: [Boolean, Number, Object], default: 0 },
13294
- options: { type: Array, required: true },
13295
- prop: { type: String, default: "name" },
13296
- notReduce: { type: Boolean, default: false },
13297
- reduceFunction: { type: Function, default: (Option) => Option.id },
13298
- label: { type: String, default: "" },
13299
- labelAlign: { type: String, default: "" },
13300
- group: { type: String, default: "" },
13301
- groupBreak: { type: String, default: "s" },
13302
- groupVertical: { type: String, default: "" },
13303
- sameWidthOptions: { type: Boolean, default: false }
13304
- },
13305
- emits: ["update:modelValue", "change"],
13306
- setup(__props, { emit: emits }) {
13307
- const props = __props;
13308
- const selectedOption = computed$2({
13312
+ const currentPageLocal = computed$2({
13309
13313
  get() {
13310
- return props.modelValue;
13314
+ return props.currentPage;
13311
13315
  },
13312
13316
  set(val) {
13313
- emits("update:modelValue", val);
13314
- emits("change", val);
13317
+ emits("update:currentPage", val);
13315
13318
  }
13316
13319
  });
13317
- const computedClass = computed$2(() => {
13318
- const classList2 = [];
13319
- classList2.push(functions$1.getGroupClass(props));
13320
- return classList2;
13321
- });
13322
- const computedItemStyle = computed$2(() => {
13323
- const list = [];
13324
- if (props.sameWidthOptions)
13325
- list.push({ width: `${100 / props.options.length}%` });
13326
- return list;
13327
- });
13328
- function getOptionValue(Option) {
13329
- if (props.notReduce)
13330
- return Option;
13331
- return props.reduceFunction(Option);
13320
+ function refreshList(pageChange = false) {
13321
+ emits("refreshList", pageChange);
13322
+ }
13323
+ function openColumnsManager() {
13324
+ if (columnsAreObj.value) {
13325
+ IsPopupActive.value.columnsManager = true;
13326
+ } else {
13327
+ console.log("ERROR ck-table", "The columns list should be an object");
13328
+ }
13332
13329
  }
13333
13330
  return (_ctx, _cache) => {
13334
- return openBlock(), createElementBlock("div", _hoisted_1$8, [
13335
- __props.label ? (openBlock(), createBlock(ckLabel, {
13331
+ return openBlock(), createElementBlock(Fragment, null, [
13332
+ __props.hasColumnsManager && unref$1(columnsAreObj) ? (openBlock(), createBlock(TableColumnsManager, {
13336
13333
  key: 0,
13337
- align: __props.labelAlign
13338
- }, {
13339
- default: withCtx(() => [
13340
- createTextVNode(toDisplayString(__props.label), 1)
13334
+ modelValue: IsPopupActive.value.columnsManager,
13335
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => IsPopupActive.value.columnsManager = $event),
13336
+ columnsArray: unref$1(columnsArray),
13337
+ columns: __props.columns
13338
+ }, null, 8, ["modelValue", "columnsArray", "columns"])) : createCommentVNode("", true),
13339
+ createElementVNode("div", _hoisted_1$8, [
13340
+ _ctx.$slots.header || !__props.hideHeaderActions ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
13341
+ !__props.hideHeaderActions ? (openBlock(), createBlock(TableHeaderItems, {
13342
+ key: 0,
13343
+ search: unref$1(searchLocal),
13344
+ "onUpdate:search": _cache[1] || (_cache[1] = ($event) => isRef$1(searchLocal) ? searchLocal.value = $event : null),
13345
+ currentPage: __props.currentPage,
13346
+ hasColumnsManager: __props.hasColumnsManager,
13347
+ itemsPerPage: __props.itemsPerPage,
13348
+ listLength: __props.listLength,
13349
+ showRefreshBtn: __props.showRefreshBtn,
13350
+ hideItemsPerPage: __props.hideItemsPerPage,
13351
+ onRefreshList: _cache[2] || (_cache[2] = ($event) => refreshList($event)),
13352
+ onOpenColumnsManager: _cache[3] || (_cache[3] = ($event) => openColumnsManager())
13353
+ }, null, 8, ["search", "currentPage", "hasColumnsManager", "itemsPerPage", "listLength", "showRefreshBtn", "hideItemsPerPage"])) : createCommentVNode("", true),
13354
+ _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
13355
+ renderSlot(_ctx.$slots, "header", {}, void 0, true)
13356
+ ])) : createCommentVNode("", true)
13357
+ ])) : createCommentVNode("", true),
13358
+ createElementVNode("div", _hoisted_4$2, [
13359
+ createElementVNode("table", {
13360
+ class: normalizeClass(["ck-table__table", { "not-full-width": __props.notFullWidth }])
13361
+ }, [
13362
+ unref$1(filteredColumnsList).length ? (openBlock(), createElementBlock("thead", _hoisted_5, [
13363
+ createVNode(ckTr, null, {
13364
+ default: withCtx(() => [
13365
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(filteredColumnsList), (col) => {
13366
+ return openBlock(), createBlock(_sfc_main$i, {
13367
+ key: col.title,
13368
+ col
13369
+ }, null, 8, ["col"]);
13370
+ }), 128))
13371
+ ]),
13372
+ _: 1
13373
+ })
13374
+ ])) : createCommentVNode("", true),
13375
+ createElementVNode("tbody", null, [
13376
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
13377
+ ]),
13378
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("tfoot", _hoisted_6, [
13379
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
13380
+ ])) : createCommentVNode("", true)
13381
+ ], 2)
13341
13382
  ]),
13342
- _: 1
13343
- }, 8, ["align"])) : createCommentVNode("", true),
13344
- createElementVNode("div", {
13345
- class: normalizeClass(["ck-switch-options__container", unref$1(computedClass)])
13346
- }, [
13347
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (Option, index) => {
13348
- return openBlock(), createElementBlock("div", {
13349
- class: normalizeClass(["ck-switch-options__option", { selected: unref$1(selectedOption) == getOptionValue(Option) }]),
13350
- key: `ck-switch-options${index}`,
13351
- style: normalizeStyle(unref$1(computedItemStyle)),
13352
- onClick: ($event) => selectedOption.value = getOptionValue(Option)
13353
- }, toDisplayString(Option[__props.prop]), 15, _hoisted_2$3);
13354
- }), 128))
13355
- ], 2)
13356
- ]);
13383
+ createVNode(TablePagination, {
13384
+ class: "ck-table__pagination",
13385
+ currentPage: unref$1(currentPageLocal),
13386
+ "onUpdate:currentPage": _cache[4] || (_cache[4] = ($event) => isRef$1(currentPageLocal) ? currentPageLocal.value = $event : null),
13387
+ itemsPerPage: __props.itemsPerPage,
13388
+ listLength: __props.listLength,
13389
+ align: __props.paginationAlign,
13390
+ onRefreshList: _cache[5] || (_cache[5] = ($event) => refreshList(true))
13391
+ }, null, 8, ["currentPage", "itemsPerPage", "listLength", "align"])
13392
+ ])
13393
+ ], 64);
13357
13394
  };
13358
13395
  }
13359
13396
  });
13360
- var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-2c3e07c8"]]);
13361
- const _hoisted_1$7 = { class: "ck-tr" };
13362
- function render$1(_ctx, _cache) {
13363
- return openBlock(), createElementBlock("tr", _hoisted_1$7, [
13364
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
13365
- ]);
13366
- }
13367
- var ckTr_vue_vue_type_style_index_0_scoped_true_lang = "";
13368
- const _sfc_main$9 = {};
13369
- var ckTr = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$1], ["__scopeId", "data-v-1dd12190"]]);
13370
- var ckTh_vue_vue_type_style_index_0_scoped_true_lang = "";
13371
- const _hoisted_1$6 = { class: "ck-th" };
13397
+ var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-160656a0"]]);
13398
+ var ckTd_vue_vue_type_style_index_0_scoped_true_lang = "";
13372
13399
  const _sfc_main$8 = /* @__PURE__ */ defineComponent({
13373
13400
  props: {
13374
- align: { type: String, default: "center", validator: validators.align },
13375
- minWidth: { type: String, default: void 0 }
13401
+ col: { type: Object, default: void 0 },
13402
+ nowrap: { type: Boolean, default: false },
13403
+ block: { type: Boolean, default: false },
13404
+ autoWidth: { type: Boolean, default: false },
13405
+ overflowAuto: { type: Boolean, default: false },
13406
+ align: { type: String, default: void 0, validator: validators.align },
13407
+ fixedWidth: { type: String, default: "" },
13408
+ minWidth: { type: String, default: "" },
13409
+ maxWidth: { type: String, default: "" },
13410
+ maxHeight: { type: String, default: "" }
13376
13411
  },
13377
13412
  setup(__props) {
13378
13413
  const props = __props;
13379
- const computedSpanClass = computed$2(() => {
13414
+ const computedTdClass = computed$2(() => {
13380
13415
  return {
13381
- "align-center": props.align !== "left" && props.align !== "right",
13382
- "align-left": props.align === "left",
13383
- "align-right": props.align === "right"
13416
+ "auto-width": props.autoWidth,
13417
+ "overflow-auto": props.overflowAuto
13384
13418
  };
13385
13419
  });
13386
- const computedStyle = computed$2(() => {
13420
+ const computedSpanClass = computed$2(() => {
13387
13421
  const list = [];
13422
+ let align;
13423
+ if (props.col)
13424
+ align = props.col.align;
13425
+ if (props.align)
13426
+ align = props.align;
13427
+ if (align) {
13428
+ if (align === "center")
13429
+ list.push("align-center");
13430
+ if (align === "right")
13431
+ list.push("align-right");
13432
+ }
13433
+ if (props.block)
13434
+ list.push("block");
13435
+ if (props.block)
13436
+ list.push("no-wrap-text");
13437
+ return list;
13438
+ });
13439
+ const computedStyle = computed$2(() => {
13440
+ const list = {};
13388
13441
  if (props.minWidth)
13389
- list.push({ "min-width": props.minWidth });
13442
+ list["min-width"] = props.minWidth;
13443
+ if (props.fixedWidth)
13444
+ list["min-width"] = props.fixedWidth;
13445
+ if (props.maxWidth)
13446
+ list["max-width"] = props.maxWidth;
13447
+ if (props.fixedWidth)
13448
+ list["max-width"] = props.fixedWidth;
13449
+ if (props.maxHeight)
13450
+ list["max-height"] = props.maxHeight;
13390
13451
  return list;
13391
13452
  });
13453
+ const isColumnDisplayed = computed$2(() => {
13454
+ if (!props.col)
13455
+ return true;
13456
+ return functions.isColumnDisplayed(props.col);
13457
+ });
13392
13458
  return (_ctx, _cache) => {
13393
- return openBlock(), createElementBlock("th", _hoisted_1$6, [
13459
+ return unref$1(isColumnDisplayed) ? (openBlock(), createElementBlock("td", {
13460
+ key: 0,
13461
+ class: normalizeClass(["ck-td", unref$1(computedTdClass)])
13462
+ }, [
13394
13463
  createElementVNode("span", {
13395
13464
  class: normalizeClass(unref$1(computedSpanClass)),
13396
13465
  style: normalizeStyle(unref$1(computedStyle))
13397
13466
  }, [
13398
13467
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
13399
13468
  ], 6)
13400
- ]);
13469
+ ], 2)) : createCommentVNode("", true);
13401
13470
  };
13402
13471
  }
13403
13472
  });
13404
- var ckTh = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-c179a3c2"]]);
13473
+ var ckTd = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-4eae6064"]]);
13474
+ var ckChip_vue_vue_type_style_index_0_scoped_true_lang = "";
13475
+ const _hoisted_1$7 = ["color"];
13405
13476
  const _sfc_main$7 = /* @__PURE__ */ defineComponent({
13406
13477
  props: {
13407
- col: { type: Object, required: true }
13478
+ size: { type: String, default: "s" },
13479
+ color: { type: String, default: "primary" },
13480
+ textColor: { type: String, default: void 0 },
13481
+ icon: { type: String, default: void 0 },
13482
+ iconPack: { type: String, default: void 0 }
13408
13483
  },
13409
- setup(__props) {
13484
+ emits: ["click"],
13485
+ setup(__props, { emit: emits }) {
13486
+ const props = __props;
13487
+ const computedClass = computed$2(() => {
13488
+ return [
13489
+ `size-${props.size}`,
13490
+ `ck-component__bg-color--${props.color}`
13491
+ ];
13492
+ });
13493
+ const computedStyle = computed$2(() => {
13494
+ const list = [];
13495
+ if (props.color)
13496
+ ;
13497
+ return list;
13498
+ });
13410
13499
  return (_ctx, _cache) => {
13411
- return openBlock(), createBlock(ckTh, {
13412
- align: __props.col.align,
13413
- "min-width": __props.col.minWidth
13414
- }, {
13415
- default: withCtx(() => [
13416
- createTextVNode(toDisplayString(__props.col.title), 1)
13417
- ]),
13418
- _: 1
13419
- }, 8, ["align", "min-width"]);
13500
+ return openBlock(), createElementBlock("div", {
13501
+ class: normalizeClass(["ck-chip", unref$1(computedClass)]),
13502
+ color: __props.color,
13503
+ style: normalizeStyle(unref$1(computedStyle)),
13504
+ onClick: _cache[0] || (_cache[0] = ($event) => emits("click", $event))
13505
+ }, [
13506
+ __props.icon ? (openBlock(), createBlock(ckIcon, {
13507
+ key: 0,
13508
+ icon: __props.icon,
13509
+ "icon-pack": __props.iconPack
13510
+ }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true),
13511
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
13512
+ ], 14, _hoisted_1$7);
13420
13513
  };
13421
13514
  }
13422
13515
  });
13423
- var ckTable__headerItems_vue_vue_type_style_index_0_scoped_true_lang = "";
13424
- const _hoisted_1$5 = { class: "ck-table__header-items" };
13516
+ var ckChip = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-5333de26"]]);
13517
+ var globalVariables = {
13518
+ defaultFailImg: "df",
13519
+ imagesFolderPath: "",
13520
+ defaultImgBorderColor: "#EEEEEE"
13521
+ };
13522
+ var ckImg_vue_vue_type_style_index_0_scoped_true_lang = "";
13523
+ const _hoisted_1$6 = ["src", "alt"];
13425
13524
  const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13426
13525
  props: {
13427
- search: { type: String, default: void 0 },
13428
- hasColumnsManager: { type: Boolean, default: false },
13429
- showRefreshBtn: { type: Boolean, required: true },
13430
- hideItemsPerPage: { type: Boolean, required: true },
13431
- currentPage: { type: Number, required: true },
13432
- itemsPerPage: { type: Number, required: true },
13433
- listLength: { type: Number, required: true }
13526
+ src: { type: String, default: "" },
13527
+ isFullPath: { type: Boolean, default: false },
13528
+ failImgSrc: { type: String, default: "" },
13529
+ alt: { type: String, default: "" },
13530
+ size: { type: String, default: "", validator: validators.size },
13531
+ sizeAbsolute: { type: String, default: "" },
13532
+ width: { type: String, default: "" },
13533
+ height: { type: String, default: "" },
13534
+ zoom: { type: Boolean, default: false },
13535
+ zoomTitle: { type: String, default: "" },
13536
+ hasBorder: { type: Boolean, default: false },
13537
+ radius: { type: String, default: "" },
13538
+ borderColor: { type: String, default: "" },
13539
+ rounded: { type: Boolean, default: false }
13434
13540
  },
13435
- emits: ["update:search", "refreshList", "openColumnsManager"],
13436
- setup(__props, { emit: emits }) {
13541
+ setup(__props) {
13437
13542
  const props = __props;
13438
- const searchLocal = computed$2({
13439
- get() {
13440
- return props.search;
13441
- },
13442
- set(val) {
13443
- emits("update:search", val);
13444
- }
13445
- });
13446
- const hideSearch = computed$2(() => {
13447
- return typeof searchLocal.value === "undefined";
13543
+ const altNeeded = ref(false);
13544
+ let isMounted = ref(false);
13545
+ const imageUrl = computed$2(() => {
13546
+ if (!isMounted.value)
13547
+ return "";
13548
+ if (props.isFullPath)
13549
+ return props.src;
13550
+ return getImg(props.src);
13448
13551
  });
13449
- const itemsPerPageStart = computed$2(() => {
13450
- return (props.currentPage - 1) * props.itemsPerPage + 1;
13552
+ const computedClass = computed$2(() => {
13553
+ const classList2 = [];
13554
+ if (props.size)
13555
+ classList2.push(`ck-img__size--${props.size}`);
13556
+ if (props.rounded)
13557
+ classList2.push("is-rounded");
13558
+ if (props.hasBorder) {
13559
+ classList2.push("ck-img__has-border");
13560
+ if (functions.isColorTemplateVariable(realBorderColor.value)) {
13561
+ classList2.push(`ck-component__border-color--${realBorderColor.value}`);
13562
+ }
13563
+ }
13564
+ if (props.zoom)
13565
+ classList2.push("zoom-able");
13566
+ return classList2;
13451
13567
  });
13452
- const itemsPerPageEnd = computed$2(() => {
13453
- const value = props.currentPage * props.itemsPerPage;
13454
- if (value > props.listLength)
13455
- return props.listLength;
13456
- return value;
13568
+ const computedStyle = computed$2(() => {
13569
+ const styleList = [];
13570
+ if (props.sizeAbsolute) {
13571
+ styleList.push({ width: props.sizeAbsolute });
13572
+ styleList.push({ height: props.sizeAbsolute });
13573
+ }
13574
+ if (props.radius)
13575
+ styleList.push({ "border-radius": props.radius });
13576
+ if (props.hasBorder) {
13577
+ if (!functions.isColorTemplateVariable(realBorderColor.value)) {
13578
+ styleList.push({ "border-color": realBorderColor.value });
13579
+ }
13580
+ }
13581
+ return styleList;
13457
13582
  });
13458
- const itemsPerPageIsVisible = computed$2(() => {
13459
- return !props.hideItemsPerPage && props.listLength && props.currentPage;
13583
+ const computedImgStyle = computed$2(() => {
13584
+ const styleList = [];
13585
+ if (props.radius)
13586
+ styleList.push({ "border-radius": props.radius });
13587
+ if (props.width)
13588
+ styleList.push({ width: props.width });
13589
+ if (props.height)
13590
+ styleList.push({ height: props.height });
13591
+ return styleList;
13460
13592
  });
13461
- const refreshBtnIsVisible = computed$2(() => {
13462
- return itemsPerPageIsVisible.value || props.showRefreshBtn;
13593
+ const realBorderColor = computed$2(() => {
13594
+ if (props.borderColor)
13595
+ return props.borderColor;
13596
+ return globalVariables.defaultImgBorderColor;
13463
13597
  });
13464
- const searchGroupValue = computed$2(() => {
13465
- if (itemsPerPageIsVisible.value && props.hasColumnsManager) {
13466
- return "center";
13598
+ function clickImg() {
13599
+ if (props.zoom)
13600
+ ;
13601
+ }
13602
+ function getImg(src) {
13603
+ let path = "";
13604
+ const $cleekOptions = functions.getCleekOptions(getCurrentInstance);
13605
+ if ($cleekOptions) {
13606
+ if ($cleekOptions.imgPath)
13607
+ path = $cleekOptions.imgPath;
13467
13608
  }
13468
- if (itemsPerPageIsVisible.value)
13469
- return "right";
13470
- if (props.hasColumnsManager)
13471
- return "left";
13472
- return "";
13473
- });
13474
- function checkRefresh() {
13475
- const search = searchLocal.value;
13476
- setTimeout(() => {
13477
- if (search !== searchLocal.value)
13478
- return;
13479
- emits("refreshList", false);
13480
- }, 1e3);
13609
+ return `${path}${src}`;
13481
13610
  }
13611
+ onMounted(() => {
13612
+ getCurrentInstance().ctx;
13613
+ isMounted.value = true;
13614
+ });
13482
13615
  return (_ctx, _cache) => {
13483
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
13484
- unref$1(refreshBtnIsVisible) ? (openBlock(), createBlock(ckButton, {
13485
- key: 0,
13486
- type: "flat",
13487
- icon: "redo-alt",
13488
- title: "Recargar lista",
13489
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("refreshList", false))
13490
- })) : createCommentVNode("", true),
13491
- unref$1(itemsPerPageIsVisible) ? (openBlock(), createElementBlock("div", {
13492
- key: 1,
13493
- class: normalizeClass(["items-per-page", { "ck-component__group--left": !unref$1(hideSearch) }])
13494
- }, toDisplayString(unref$1(itemsPerPageStart)) + " - " + toDisplayString(unref$1(itemsPerPageEnd)) + " de " + toDisplayString(__props.listLength), 3)) : createCommentVNode("", true),
13495
- !unref$1(hideSearch) ? (openBlock(), createBlock(ckInput, {
13496
- key: 2,
13497
- modelValue: unref$1(searchLocal),
13498
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef$1(searchLocal) ? searchLocal.value = $event : null),
13499
- icon: "search",
13500
- placeholder: "Buscar...",
13501
- group: unref$1(searchGroupValue),
13502
- onInput: _cache[2] || (_cache[2] = ($event) => checkRefresh())
13503
- }, null, 8, ["modelValue", "group"])) : createCommentVNode("", true),
13504
- __props.hasColumnsManager ? (openBlock(), createBlock(ckButton, {
13505
- key: 3,
13506
- icon: "columns",
13507
- type: "filled",
13508
- title: "Administrador de columnas",
13509
- group: unref$1(itemsPerPageIsVisible) || !unref$1(hideSearch) ? "right" : "",
13510
- onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("openColumnsManager"))
13511
- }, null, 8, ["group"])) : createCommentVNode("", true)
13512
- ]);
13616
+ return openBlock(), createElementBlock("div", {
13617
+ class: normalizeClass(["ck-img", unref$1(computedClass)]),
13618
+ style: normalizeStyle(unref$1(computedStyle)),
13619
+ onClick: _cache[1] || (_cache[1] = ($event) => clickImg())
13620
+ }, [
13621
+ createElementVNode("img", {
13622
+ src: unref$1(imageUrl),
13623
+ style: normalizeStyle(unref$1(computedImgStyle)),
13624
+ alt: __props.alt,
13625
+ onError: _cache[0] || (_cache[0] = ($event) => altNeeded.value = true)
13626
+ }, null, 44, _hoisted_1$6)
13627
+ ], 6);
13513
13628
  };
13514
13629
  }
13515
13630
  });
13516
- var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-15c7bf13"]]);
13517
- var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
13518
- const _hoisted_1$4 = { class: "ck-table__pagination" };
13519
- const _hoisted_2$2 = ["onClick"];
13520
- const _hoisted_3$1 = ["onClick"];
13521
- const itemsShowed = 5;
13522
- const __default__ = {
13523
- name: "CkTablePagination",
13631
+ var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-e808078e"]]);
13632
+ var ckRadio_vue_vue_type_style_index_0_scoped_true_lang = "";
13633
+ const _withScopeId$1 = (n) => (pushScopeId("data-v-a5198d80"), n = n(), popScopeId(), n);
13634
+ const _hoisted_1$5 = ["onKeyup"];
13635
+ const _hoisted_2$2 = ["name", "value", "disabled"];
13636
+ const _hoisted_3$1 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("div", { class: "c-Radio__element" }, null, -1));
13637
+ const _hoisted_4$1 = {
13638
+ key: 0,
13639
+ class: "c-Radio__label"
13640
+ };
13641
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
13524
13642
  props: {
13525
- currentPage: { type: Number, required: true },
13526
- align: { type: String, required: true },
13527
- itemsPerPage: { type: Number, required: true },
13528
- listLength: { type: Number, required: true }
13643
+ modelValue: { type: String, default: void 0 },
13644
+ name: { type: String, required: true },
13645
+ options: { type: Array, required: true, validator: validators.radioOptions },
13646
+ disabled: { type: Boolean, default: false }
13529
13647
  },
13530
- emits: ["refreshList", "update:currentPage"],
13531
- computed: {
13532
- currentPageLocal2: {
13648
+ emits: ["update:modelValue", "change"],
13649
+ setup(__props, { emit: emits }) {
13650
+ const props = __props;
13651
+ const value = computed$2({
13533
13652
  get() {
13534
- return this.currentPage;
13653
+ return props.modelValue;
13535
13654
  },
13536
13655
  set(val) {
13537
- return;
13538
- }
13539
- },
13540
- hasArrowLeft() {
13541
- if (!this.listLeft.length)
13542
- return false;
13543
- return this.listLeft[0] !== 1;
13544
- },
13545
- totalPages() {
13546
- return Math.ceil(this.listLength / this.itemsPerPage);
13547
- },
13548
- hasArrowRight() {
13549
- if (!this.listRight.length)
13550
- return false;
13551
- return this.listRight[this.listRight.length - 1] !== this.totalPages;
13552
- },
13553
- listLeft() {
13554
- if (!this.listLength)
13555
- return [];
13556
- const list = [];
13557
- const listLength = (itemsShowed - 1) / 2;
13558
- for (const num of Array(listLength).keys()) {
13559
- const listItem = this.currentPage - num - 1;
13560
- if (listItem > 0)
13561
- list.unshift(listItem);
13562
- }
13563
- return list;
13564
- },
13565
- listRight() {
13566
- if (!this.listLength)
13567
- return [];
13568
- const list = [];
13569
- const listLength = (itemsShowed - 1) / 2;
13570
- for (const num of Array(listLength).keys()) {
13571
- const listItem = this.currentPage + num + 1;
13572
- if (listItem <= this.totalPages)
13573
- list.push(listItem);
13656
+ emits("update:modelValue", val);
13574
13657
  }
13575
- return list;
13576
- }
13577
- },
13578
- methods: {
13579
- updateCurrentPage(val) {
13580
- this.$emit("update:currentPage", val);
13581
- this.$emit("refreshList", val);
13582
- },
13583
- validateInputNumber(val) {
13584
- val = +val;
13585
- if (val > this.totalPages)
13586
- val = this.totalPages;
13587
- if (val < 1)
13588
- val = 1;
13589
- if (val === this.currentPage)
13590
- return;
13591
- this.updateCurrentPage(val);
13592
- }
13593
- }
13594
- };
13595
- const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({}, __default__), {
13596
- setup(__props) {
13597
- return (_ctx, _cache) => {
13598
- return __props.currentPage && _ctx.totalPages > 1 ? (openBlock(), createElementBlock("div", {
13599
- key: 0,
13600
- class: normalizeClass(["ck-table__pagination-container", `pagination-align--${__props.align}`])
13601
- }, [
13602
- createElementVNode("div", _hoisted_1$4, [
13603
- _ctx.hasArrowLeft ? (openBlock(), createElementBlock("div", {
13604
- key: 0,
13605
- class: "ck-table__pagination--arrow-left",
13606
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.updateCurrentPage(__props.currentPage - 1))
13607
- }, [
13608
- createVNode(ckIcon, { icon: "arrow-left" })
13609
- ])) : createCommentVNode("", true),
13610
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listLeft, (num) => {
13611
- return openBlock(), createElementBlock("div", {
13612
- class: "ck-table__pagination-item pagination-item__left",
13613
- onClick: ($event) => _ctx.updateCurrentPage(num)
13614
- }, toDisplayString(num), 9, _hoisted_2$2);
13615
- }), 256)),
13616
- createVNode(ckInput, {
13617
- class: "ck-table__pagination-input",
13618
- autoSelect: "",
13619
- type: "number",
13620
- width: "50px",
13621
- align: "center",
13622
- modelValue: _ctx.currentPageLocal2,
13623
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef$1(currentPageLocal2) ? currentPageLocal2.value = $event : null),
13624
- onChange: _cache[2] || (_cache[2] = ($event) => _ctx.validateInputNumber($event.target.value))
13625
- }, null, 8, ["modelValue"]),
13626
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listRight, (num) => {
13627
- return openBlock(), createElementBlock("div", {
13628
- class: "ck-table__pagination-item pagination-item__right",
13629
- onClick: ($event) => _ctx.updateCurrentPage(num)
13630
- }, toDisplayString(num), 9, _hoisted_3$1);
13631
- }), 256)),
13632
- _ctx.hasArrowRight ? (openBlock(), createElementBlock("div", {
13633
- key: 1,
13634
- class: "ck-table__pagination--arrow-right",
13635
- onClick: _cache[3] || (_cache[3] = ($event) => _ctx.updateCurrentPage(__props.currentPage + 1))
13636
- }, [
13637
- createVNode(ckIcon, { icon: "arrow-right" })
13638
- ])) : createCommentVNode("", true)
13639
- ])
13640
- ], 2)) : createCommentVNode("", true);
13658
+ });
13659
+ const radioAttributes = computed$2(() => {
13660
+ return {
13661
+ "aria-disabled": props.disabled,
13662
+ tabindex: props.disabled ? void 0 : "0"
13663
+ };
13664
+ });
13665
+ function handleChange(value2) {
13666
+ value2.value = value2;
13667
+ emits("change", value2);
13668
+ }
13669
+ return (_ctx, _cache) => {
13670
+ return openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index) => {
13671
+ return openBlock(), createElementBlock("label", mergeProps({
13672
+ key: `radio-${index}`,
13673
+ class: "c-Radio"
13674
+ }, unref$1(radioAttributes), {
13675
+ onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
13676
+ }, ["prevent"]), ["space"])),
13677
+ onKeyup: [
13678
+ withKeys(($event) => handleChange(item.value), ["enter"]),
13679
+ withKeys(($event) => handleChange(item.value), ["space"])
13680
+ ]
13681
+ }), [
13682
+ withDirectives(createElementVNode("input", {
13683
+ class: "c-Radio__input",
13684
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(value) ? value.value = $event : null),
13685
+ "aria-hidden": "true",
13686
+ type: "radio",
13687
+ name: __props.name,
13688
+ value: item.value,
13689
+ disabled: __props.disabled
13690
+ }, null, 8, _hoisted_2$2), [
13691
+ [vModelRadio, unref$1(value)]
13692
+ ]),
13693
+ _hoisted_3$1,
13694
+ item.label ? (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString(item.label), 1)) : createCommentVNode("", true)
13695
+ ], 16, _hoisted_1$5);
13696
+ }), 128);
13641
13697
  };
13642
13698
  }
13643
- }));
13644
- var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-4045b8e3"]]);
13645
- var ckTable__columnsManager_vue_vue_type_style_index_0_scoped_true_lang = "";
13646
- const _hoisted_1$3 = { class: "columns-manger-container" };
13647
- const _hoisted_2$1 = { class: "columns-manger__item" };
13699
+ });
13700
+ var ckRadio = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-a5198d80"]]);
13701
+ var ckSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
13702
+ const _hoisted_1$4 = ["value"];
13648
13703
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13649
13704
  props: {
13650
- modelValue: { type: Boolean, required: true },
13651
- columns: { type: Object, required: true },
13652
- columnsArray: { type: Array, required: true }
13705
+ modelValue: { default: null, type: [Boolean, Number, Object, Array, String] },
13706
+ prop: { type: String, default: "name" },
13707
+ autofocus: { type: Boolean, default: false },
13708
+ noDataText: { type: String, default: "No se encontr\xF3 nada" },
13709
+ notReduce: { type: Boolean, default: false },
13710
+ options: { type: Array, default: () => [] },
13711
+ reduceFunction: { type: Function, default: (Option) => Option.id },
13712
+ notClearable: { type: Boolean, default: false },
13713
+ clearValue: { type: [Boolean, String], default: "auto" },
13714
+ searchable: { type: [Boolean, String], default: "auto" },
13715
+ minWidth: { type: String, default: "180px" },
13716
+ noBorder: { type: Boolean, default: false },
13717
+ bgTransparent: { type: Boolean, default: false },
13718
+ disabled: { type: [Boolean, Number], default: false },
13719
+ group: { type: String, default: "" },
13720
+ groupBreak: { type: String, default: "" },
13721
+ groupVertical: { type: String, default: "" },
13722
+ label: { type: String, default: "" },
13723
+ labelAlign: { type: String, default: "" }
13653
13724
  },
13654
- emits: ["update:modelValue"],
13725
+ emits: ["update:modelValue", "click", "change"],
13655
13726
  setup(__props, { emit: emits }) {
13656
13727
  const props = __props;
13657
- let columnsCheckable = ref([]);
13658
- const isActive = computed$2({
13728
+ const { qmStr: qmStr2 } = main$1;
13729
+ const search = ref("");
13730
+ ref(null);
13731
+ const value = computed$2({
13659
13732
  get() {
13660
13733
  return props.modelValue;
13661
13734
  },
13662
13735
  set(val) {
13736
+ if (val === null)
13737
+ val = realClearValue;
13663
13738
  emits("update:modelValue", val);
13664
13739
  }
13665
13740
  });
13666
- watch(() => isActive.value, (val) => {
13667
- if (!val)
13668
- return;
13669
- setColumnsCheckable();
13741
+ const filteredOptions = computed$2(() => {
13742
+ const list = props.options.filter((option) => {
13743
+ const name = getOptionName(option);
13744
+ return qmStr2.checkContainsStr(name, search.value);
13745
+ });
13746
+ return list;
13670
13747
  });
13671
- function setColumnsCheckable() {
13672
- console.log("hoola");
13748
+ const computedClass = computed$2(() => {
13749
+ const classList2 = [];
13750
+ classList2.push(functions.getGroupClass(props));
13751
+ return classList2;
13752
+ });
13753
+ const computedStyle = computed$2(() => {
13673
13754
  const list = [];
13674
- props.columnsArray.forEach((col) => {
13675
- if (!col.unchangeable) {
13676
- list.push({
13677
- name: col.name,
13678
- title: col.title,
13679
- value: functions$1.isColumnDisplayed(col)
13680
- });
13681
- }
13682
- });
13683
- columnsCheckable.value = list;
13684
- }
13685
- function setColumnDisplayValue(colName, value) {
13686
- props.columns[colName].isDisplayed = value;
13755
+ if (props.minWidth)
13756
+ list.push({ "min-width": props.minWidth });
13757
+ return list;
13758
+ });
13759
+ computed$2(() => {
13760
+ if (props.searchable === "auto") {
13761
+ if (props.options.length < 5)
13762
+ return false;
13763
+ return true;
13764
+ }
13765
+ return props.searchable;
13766
+ });
13767
+ const realClearValue = computed$2(() => {
13768
+ switch (typeof props.modelValue) {
13769
+ case "number":
13770
+ return 0;
13771
+ case "string":
13772
+ return "";
13773
+ case "object":
13774
+ if (props.modelValue.constructor === Array)
13775
+ return [];
13776
+ return {};
13777
+ default:
13778
+ return null;
13779
+ }
13780
+ });
13781
+ computed$2(() => {
13782
+ switch (typeof props.modelValue) {
13783
+ case "number":
13784
+ return props.modelValue === 0;
13785
+ case "string":
13786
+ return props.modelValue === "";
13787
+ case "object":
13788
+ if (!props.modelValue)
13789
+ return null;
13790
+ if (props.modelValue.constructor === Array) {
13791
+ return props.modelValue.length() === 0;
13792
+ }
13793
+ return Object.keys(props.modelValue).length === 0;
13794
+ default:
13795
+ return props.modelValue === null;
13796
+ }
13797
+ });
13798
+ function onClick(event) {
13799
+ emits("click", event);
13687
13800
  }
13801
+ const onChange = (event) => {
13802
+ emits("change", event);
13803
+ };
13804
+ const getOptionKey = (option) => {
13805
+ return realReduceFunction(option);
13806
+ };
13807
+ const getOptionName = (option) => {
13808
+ if (!props.prop)
13809
+ return option;
13810
+ return option[props.prop];
13811
+ };
13812
+ const realReduceFunction = (option) => {
13813
+ if (props.notReduce)
13814
+ return option;
13815
+ return props.reduceFunction(option);
13816
+ };
13688
13817
  return (_ctx, _cache) => {
13689
- return openBlock(), createBlock(_sfc_main$e, {
13690
- modelValue: unref$1(isActive),
13691
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(isActive) ? isActive.value = $event : null),
13692
- title: "Administrador de columnas"
13693
- }, {
13694
- default: withCtx(() => [
13695
- createElementVNode("div", _hoisted_1$3, [
13696
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(columnsCheckable), (col) => {
13697
- return openBlock(), createElementBlock("div", _hoisted_2$1, [
13698
- createVNode(ckCheckbox, {
13699
- modelValue: col.value,
13700
- "onUpdate:modelValue": ($event) => col.value = $event,
13701
- onChange: ($event) => setColumnDisplayValue(col.name, col.value)
13702
- }, {
13703
- default: withCtx(() => [
13704
- createTextVNode(toDisplayString(col.title), 1)
13705
- ]),
13706
- _: 2
13707
- }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])
13708
- ]);
13709
- }), 256))
13710
- ])
13711
- ]),
13712
- _: 1
13713
- }, 8, ["modelValue"]);
13818
+ return openBlock(), createElementBlock("div", {
13819
+ class: "ck-select",
13820
+ style: normalizeStyle(unref$1(computedStyle))
13821
+ }, [
13822
+ __props.label ? (openBlock(), createBlock(ckLabel, {
13823
+ key: 0,
13824
+ align: __props.labelAlign,
13825
+ for: "ck-input"
13826
+ }, {
13827
+ default: withCtx(() => [
13828
+ createTextVNode(toDisplayString(__props.label), 1)
13829
+ ]),
13830
+ _: 1
13831
+ }, 8, ["align"])) : createCommentVNode("", true),
13832
+ withDirectives(createElementVNode("select", {
13833
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(value) ? value.value = $event : null),
13834
+ class: normalizeClass(unref$1(computedClass)),
13835
+ onClick: _cache[1] || (_cache[1] = ($event) => onClick($event)),
13836
+ onChange: _cache[2] || (_cache[2] = ($event) => onChange($event))
13837
+ }, [
13838
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(filteredOptions), (option) => {
13839
+ return openBlock(), createElementBlock("option", {
13840
+ value: getOptionKey(option),
13841
+ key: option
13842
+ }, toDisplayString(getOptionName(option)), 9, _hoisted_1$4);
13843
+ }), 128))
13844
+ ], 34), [
13845
+ [vModelSelect, unref$1(value)]
13846
+ ])
13847
+ ], 4);
13714
13848
  };
13715
13849
  }
13716
13850
  });
13717
- var TableColumnsManager = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-e6aed8c8"]]);
13718
- var ckTable_vue_vue_type_style_index_0_scoped_true_lang = "";
13719
- const _hoisted_1$2 = { class: "ck-table" };
13720
- const _hoisted_2 = {
13851
+ var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-31af160a"]]);
13852
+ var ckSwitch_vue_vue_type_style_index_0_scoped_true_lang = "";
13853
+ const _withScopeId = (n) => (pushScopeId("data-v-b6a4dfaa"), n = n(), popScopeId(), n);
13854
+ const _hoisted_1$3 = ["disabled"];
13855
+ const _hoisted_2$1 = { class: "ck-switch__slider-container" };
13856
+ const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
13857
+ const _hoisted_4 = {
13721
13858
  key: 0,
13722
- class: "ck-table__header"
13723
- };
13724
- const _hoisted_3 = {
13725
- key: 1,
13726
- class: "ck-table__header--slot"
13859
+ class: "ck-switch__content"
13727
13860
  };
13728
- const _hoisted_4 = { class: "ck-table__table-container" };
13729
- const _hoisted_5 = { key: 0 };
13730
- const _hoisted_6 = { key: 1 };
13731
13861
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13732
13862
  props: {
13733
- columns: { type: [Array, Object], required: true, default: () => [] },
13734
- hasColumnsManager: { type: Boolean, default: false },
13735
- currentPage: { type: Number, default: 0 },
13736
- itemsPerPage: { type: Number, default: 40 },
13737
- listLength: { type: Number, default: 0 },
13738
- paginationAlign: { type: String, default: "center", validator: validators.align },
13739
- search: { type: String, default: void 0 },
13740
- hideHeaderActions: { type: Boolean, default: false },
13741
- showRefreshBtn: { type: Boolean, default: false },
13742
- hideItemsPerPage: { type: Boolean, default: false },
13743
- notFullWidth: { type: Boolean, default: false }
13744
- },
13745
- emits: ["refreshList", "update:search", "update:currentPage"],
13746
- setup(__props, { emit: emits }) {
13747
- const props = __props;
13748
- const { qmObj: qmObj2 } = main$1;
13749
- const IsPopupActive = ref({
13750
- columnsManager: false
13751
- });
13752
- const columnsAreObj = computed$2(() => !qmObj2.isArray(props.columns));
13753
- const columnsArray = computed$2(() => {
13754
- if (!columnsAreObj.value)
13755
- return props.columns;
13756
- const arr = Object.values(props.columns);
13757
- const keys = Object.keys(props.columns);
13758
- arr.forEach((col, index) => {
13759
- const key = keys[index];
13760
- col.name = key;
13761
- });
13762
- return arr;
13763
- });
13764
- const filteredColumnsList = computed$2(() => {
13765
- return columnsArray.value.filter(functions$1.isColumnDisplayed);
13766
- });
13767
- const searchLocal = computed$2({
13863
+ modelValue: { type: [Boolean, Number], default: false },
13864
+ disabled: { type: Boolean, default: false },
13865
+ outlined: { type: Boolean, default: false },
13866
+ squared: { type: Boolean, default: false },
13867
+ size: { type: String, default: "m" },
13868
+ icon: { type: String, default: void 0 },
13869
+ iconPack: { type: String, default: void 0 }
13870
+ },
13871
+ emits: ["update:modelValue"],
13872
+ setup(__props, { emit: emits }) {
13873
+ const props = __props;
13874
+ const value = computed$2({
13768
13875
  get() {
13769
- return props.search;
13876
+ return props.modelValue;
13770
13877
  },
13771
13878
  set(val) {
13772
- emits("update:search", val);
13879
+ emits("update:modelValue", val);
13773
13880
  }
13774
13881
  });
13775
- const currentPageLocal = computed$2({
13776
- get() {
13777
- return props.currentPage;
13778
- },
13779
- set(val) {
13780
- emits("update:currentPage", val);
13781
- }
13882
+ const computedClass = computed$2(() => {
13883
+ const list = [];
13884
+ if (props.squared)
13885
+ list.push("is-squared");
13886
+ if (props.outlined)
13887
+ list.push("is-outlined");
13888
+ let size = "s";
13889
+ if (props.size === "m" || props.size === "l")
13890
+ size = props.size;
13891
+ list.push(`ck-switch--size-${size}`);
13892
+ return list;
13782
13893
  });
13783
- function refreshList(pageChange = false) {
13784
- emits("refreshList", pageChange);
13785
- }
13786
- function openColumnsManager() {
13787
- if (columnsAreObj.value) {
13788
- IsPopupActive.value.columnsManager = true;
13789
- } else {
13790
- console.log("ERROR ck-table", "The columns list should be an object");
13894
+ const computedAttributes = computed$2(() => {
13895
+ return {
13896
+ "aria-disabled": props.disabled,
13897
+ tabindex: props.disabled ? void 0 : "0"
13898
+ };
13899
+ });
13900
+ const iconClass = computed$2(() => {
13901
+ const list = [];
13902
+ if (props.size && props.size !== "m") {
13903
+ list.push(`ck-switch__icon-size--${props.size}`);
13791
13904
  }
13905
+ return list;
13906
+ });
13907
+ function onTrigger2() {
13908
+ value.value = !value.value;
13792
13909
  }
13793
13910
  return (_ctx, _cache) => {
13794
- return openBlock(), createElementBlock(Fragment, null, [
13795
- __props.hasColumnsManager && unref$1(columnsAreObj) ? (openBlock(), createBlock(TableColumnsManager, {
13796
- key: 0,
13797
- modelValue: IsPopupActive.value.columnsManager,
13798
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => IsPopupActive.value.columnsManager = $event),
13799
- columnsArray: unref$1(columnsArray),
13800
- columns: __props.columns
13801
- }, null, 8, ["modelValue", "columnsArray", "columns"])) : createCommentVNode("", true),
13802
- createElementVNode("div", _hoisted_1$2, [
13803
- _ctx.$slots.header || !__props.hideHeaderActions ? (openBlock(), createElementBlock("div", _hoisted_2, [
13804
- !__props.hideHeaderActions ? (openBlock(), createBlock(TableHeaderItems, {
13805
- key: 0,
13806
- search: unref$1(searchLocal),
13807
- "onUpdate:search": _cache[1] || (_cache[1] = ($event) => isRef$1(searchLocal) ? searchLocal.value = $event : null),
13808
- currentPage: __props.currentPage,
13809
- hasColumnsManager: __props.hasColumnsManager,
13810
- itemsPerPage: __props.itemsPerPage,
13811
- listLength: __props.listLength,
13812
- showRefreshBtn: __props.showRefreshBtn,
13813
- hideItemsPerPage: __props.hideItemsPerPage,
13814
- onRefreshList: _cache[2] || (_cache[2] = ($event) => refreshList($event)),
13815
- onOpenColumnsManager: _cache[3] || (_cache[3] = ($event) => openColumnsManager())
13816
- }, null, 8, ["search", "currentPage", "hasColumnsManager", "itemsPerPage", "listLength", "showRefreshBtn", "hideItemsPerPage"])) : createCommentVNode("", true),
13817
- _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_3, [
13818
- renderSlot(_ctx.$slots, "header", {}, void 0, true)
13819
- ])) : createCommentVNode("", true)
13820
- ])) : createCommentVNode("", true),
13821
- createElementVNode("div", _hoisted_4, [
13822
- createElementVNode("table", {
13823
- class: normalizeClass(["ck-table__table", { "not-full-width": __props.notFullWidth }])
13824
- }, [
13825
- unref$1(filteredColumnsList).length ? (openBlock(), createElementBlock("thead", _hoisted_5, [
13826
- createVNode(ckTr, null, {
13827
- default: withCtx(() => [
13828
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(filteredColumnsList), (col) => {
13829
- return openBlock(), createBlock(_sfc_main$7, {
13830
- key: col.title,
13831
- col
13832
- }, null, 8, ["col"]);
13833
- }), 128))
13834
- ]),
13835
- _: 1
13836
- })
13837
- ])) : createCommentVNode("", true),
13838
- createElementVNode("tbody", null, [
13839
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
13840
- ]),
13841
- _ctx.$slots.footer ? (openBlock(), createElementBlock("tfoot", _hoisted_6, [
13842
- renderSlot(_ctx.$slots, "footer", {}, void 0, true)
13843
- ])) : createCommentVNode("", true)
13844
- ], 2)
13845
- ]),
13846
- createVNode(TablePagination, {
13847
- class: "ck-table__pagination",
13848
- currentPage: unref$1(currentPageLocal),
13849
- "onUpdate:currentPage": _cache[4] || (_cache[4] = ($event) => isRef$1(currentPageLocal) ? currentPageLocal.value = $event : null),
13850
- itemsPerPage: __props.itemsPerPage,
13851
- listLength: __props.listLength,
13852
- align: __props.paginationAlign,
13853
- onRefreshList: _cache[5] || (_cache[5] = ($event) => refreshList(true))
13854
- }, null, 8, ["currentPage", "itemsPerPage", "listLength", "align"])
13855
- ])
13856
- ], 64);
13911
+ return openBlock(), createElementBlock("label", mergeProps({ class: "ck-switch" }, unref$1(computedAttributes), {
13912
+ class: unref$1(computedClass),
13913
+ onKeydown: _cache[2] || (_cache[2] = withKeys(withModifiers(() => {
13914
+ }, ["prevent"]), ["space"])),
13915
+ onKeyup: [
13916
+ _cache[3] || (_cache[3] = withKeys(($event) => onTrigger2(), ["enter"])),
13917
+ _cache[4] || (_cache[4] = withKeys(($event) => onTrigger2(), ["space"]))
13918
+ ]
13919
+ }), [
13920
+ withDirectives(createElementVNode("input", {
13921
+ class: "ck-switch__input",
13922
+ "aria-hidden": "true",
13923
+ type: "checkbox",
13924
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(value) ? value.value = $event : null),
13925
+ disabled: __props.disabled,
13926
+ onClick: _cache[1] || (_cache[1] = ($event) => onTrigger2())
13927
+ }, null, 8, _hoisted_1$3), [
13928
+ [vModelCheckbox, unref$1(value)]
13929
+ ]),
13930
+ createElementVNode("div", _hoisted_2$1, [
13931
+ _hoisted_3,
13932
+ __props.icon && unref$1(value) ? (openBlock(), createBlock(ckIcon, {
13933
+ key: 0,
13934
+ class: normalizeClass(["ck-switch__icon-left", unref$1(iconClass)]),
13935
+ icon: __props.icon,
13936
+ "icon-pack": __props.iconPack
13937
+ }, null, 8, ["icon", "icon-pack", "class"])) : createCommentVNode("", true),
13938
+ __props.icon && !unref$1(value) ? (openBlock(), createBlock(ckIcon, {
13939
+ key: 1,
13940
+ class: normalizeClass(["ck-switch__icon-right", unref$1(iconClass)]),
13941
+ icon: __props.icon,
13942
+ "icon-pack": __props.iconPack
13943
+ }, null, 8, ["icon", "icon-pack", "class"])) : createCommentVNode("", true)
13944
+ ]),
13945
+ _ctx.$slots.default ? (openBlock(), createElementBlock("span", _hoisted_4, [
13946
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
13947
+ ])) : createCommentVNode("", true)
13948
+ ], 16);
13857
13949
  };
13858
13950
  }
13859
13951
  });
13860
- var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-2c108c86"]]);
13861
- var ckTd_vue_vue_type_style_index_0_scoped_true_lang = "";
13952
+ var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-b6a4dfaa"]]);
13953
+ var ckSwitchOptions_vue_vue_type_style_index_0_scoped_true_lang = "";
13954
+ const _hoisted_1$2 = { class: "ck-switch-options__container-exterior" };
13955
+ const _hoisted_2 = ["onClick"];
13862
13956
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
13863
13957
  props: {
13864
- col: { type: Object, default: void 0 },
13865
- nowrap: { type: Boolean, default: false },
13866
- block: { type: Boolean, default: false },
13867
- autoWidth: { type: Boolean, default: false },
13868
- overflowAuto: { type: Boolean, default: false },
13869
- align: { type: String, default: void 0, validator: validators.align },
13870
- fixedWidth: { type: String, default: "" },
13871
- minWidth: { type: String, default: "" },
13872
- maxWidth: { type: String, default: "" },
13873
- maxHeight: { type: String, default: "" }
13958
+ modelValue: { type: [Boolean, Number, Object], default: 0 },
13959
+ options: { type: Array, required: true },
13960
+ prop: { type: String, default: "name" },
13961
+ notReduce: { type: Boolean, default: false },
13962
+ reduceFunction: { type: Function, default: (Option) => Option.id },
13963
+ label: { type: String, default: "" },
13964
+ labelAlign: { type: String, default: "" },
13965
+ group: { type: String, default: "" },
13966
+ groupBreak: { type: String, default: "s" },
13967
+ groupVertical: { type: String, default: "" },
13968
+ sameWidthOptions: { type: Boolean, default: false }
13874
13969
  },
13875
- setup(__props) {
13970
+ emits: ["update:modelValue", "change"],
13971
+ setup(__props, { emit: emits }) {
13876
13972
  const props = __props;
13877
- const computedTdClass = computed$2(() => {
13878
- return {
13879
- "auto-width": props.autoWidth,
13880
- "overflow-auto": props.overflowAuto
13881
- };
13882
- });
13883
- const computedSpanClass = computed$2(() => {
13884
- const list = [];
13885
- let align;
13886
- if (props.col)
13887
- align = props.col.align;
13888
- if (props.align)
13889
- align = props.align;
13890
- if (align) {
13891
- if (align === "center")
13892
- list.push("align-center");
13893
- if (align === "right")
13894
- list.push("align-right");
13973
+ const selectedOption = computed$2({
13974
+ get() {
13975
+ return props.modelValue;
13976
+ },
13977
+ set(val) {
13978
+ emits("update:modelValue", val);
13979
+ emits("change", val);
13895
13980
  }
13896
- if (props.block)
13897
- list.push("block");
13898
- if (props.block)
13899
- list.push("no-wrap-text");
13900
- return list;
13901
13981
  });
13902
- const computedStyle = computed$2(() => {
13903
- const list = {};
13904
- if (props.minWidth)
13905
- list["min-width"] = props.minWidth;
13906
- if (props.fixedWidth)
13907
- list["min-width"] = props.fixedWidth;
13908
- if (props.maxWidth)
13909
- list["max-width"] = props.maxWidth;
13910
- if (props.fixedWidth)
13911
- list["max-width"] = props.fixedWidth;
13912
- if (props.maxHeight)
13913
- list["max-height"] = props.maxHeight;
13914
- return list;
13982
+ const computedClass = computed$2(() => {
13983
+ const classList2 = [];
13984
+ classList2.push(functions.getGroupClass(props));
13985
+ return classList2;
13915
13986
  });
13916
- const isColumnDisplayed = computed$2(() => {
13917
- if (!props.col)
13918
- return true;
13919
- return functions$1.isColumnDisplayed(props.col);
13987
+ const computedItemStyle = computed$2(() => {
13988
+ const list = [];
13989
+ if (props.sameWidthOptions)
13990
+ list.push({ width: `${100 / props.options.length}%` });
13991
+ return list;
13920
13992
  });
13993
+ function getOptionValue(Option) {
13994
+ if (props.notReduce)
13995
+ return Option;
13996
+ return props.reduceFunction(Option);
13997
+ }
13921
13998
  return (_ctx, _cache) => {
13922
- return unref$1(isColumnDisplayed) ? (openBlock(), createElementBlock("td", {
13923
- key: 0,
13924
- class: normalizeClass(["ck-td", unref$1(computedTdClass)])
13925
- }, [
13926
- createElementVNode("span", {
13927
- class: normalizeClass(unref$1(computedSpanClass)),
13928
- style: normalizeStyle(unref$1(computedStyle))
13999
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [
14000
+ __props.label ? (openBlock(), createBlock(ckLabel, {
14001
+ key: 0,
14002
+ align: __props.labelAlign
14003
+ }, {
14004
+ default: withCtx(() => [
14005
+ createTextVNode(toDisplayString(__props.label), 1)
14006
+ ]),
14007
+ _: 1
14008
+ }, 8, ["align"])) : createCommentVNode("", true),
14009
+ createElementVNode("div", {
14010
+ class: normalizeClass(["ck-switch-options__container", unref$1(computedClass)])
13929
14011
  }, [
13930
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
13931
- ], 6)
13932
- ], 2)) : createCommentVNode("", true);
14012
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (Option, index) => {
14013
+ return openBlock(), createElementBlock("div", {
14014
+ class: normalizeClass(["ck-switch-options__option", { selected: unref$1(selectedOption) == getOptionValue(Option) }]),
14015
+ key: `ck-switch-options${index}`,
14016
+ style: normalizeStyle(unref$1(computedItemStyle)),
14017
+ onClick: ($event) => selectedOption.value = getOptionValue(Option)
14018
+ }, toDisplayString(Option[__props.prop]), 15, _hoisted_2);
14019
+ }), 128))
14020
+ ], 2)
14021
+ ]);
13933
14022
  };
13934
14023
  }
13935
14024
  });
13936
- var ckTd = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-63af303c"]]);
14025
+ var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-2c3e07c8"]]);
13937
14026
  var ckTextarea_vue_vue_type_style_index_0_scoped_true_lang = "";
13938
14027
  const _hoisted_1$1 = { class: "ck-textarea" };
13939
14028
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
@@ -16576,6 +16665,11 @@ var components = /* @__PURE__ */ Object.freeze({
16576
16665
  [Symbol.toStringTag]: "Module",
16577
16666
  ckDropdown,
16578
16667
  ckNavbar,
16668
+ ckNotify,
16669
+ ckTable,
16670
+ ckTd,
16671
+ ckTh,
16672
+ ckTr,
16579
16673
  ckButton,
16580
16674
  ckCheckbox,
16581
16675
  ckChip,
@@ -16583,17 +16677,13 @@ var components = /* @__PURE__ */ Object.freeze({
16583
16677
  ckImg,
16584
16678
  ckInput,
16585
16679
  ckLabel,
16586
- ckPopup: _sfc_main$e,
16680
+ ckPopup: _sfc_main$b,
16587
16681
  ckRadio,
16588
16682
  ckSelect,
16589
16683
  ckSwitch,
16590
16684
  ckSwitchOptions,
16591
- ckTable,
16592
- ckTd,
16593
16685
  ckTextarea,
16594
- ckTh,
16595
16686
  ckTooltip,
16596
- ckTr,
16597
16687
  EVENTS: events,
16598
16688
  EventBus: mitt,
16599
16689
  lockScroll,
@@ -16630,4 +16720,4 @@ const install = function installCleek(app, options) {
16630
16720
  app.component(componentName, component);
16631
16721
  });
16632
16722
  };
16633
- export { events as EVENTS, mitt as EventBus, ckButton, ckCheckbox, ckChip, ckDropdown, ckIcon, ckImg, ckInput, ckLabel, ckNavbar, _sfc_main$e as ckPopup, ckRadio, ckSelect, ckSwitch, ckSwitchOptions, ckTable, ckTd, ckTextarea, ckTh, ckTooltip, ckTr, install as default, lockScroll, unlockScroll };
16723
+ export { events as EVENTS, mitt as EventBus, ckButton, ckCheckbox, ckChip, ckDropdown, ckIcon, ckImg, ckInput, ckLabel, ckNavbar, ckNotify, _sfc_main$b as ckPopup, ckRadio, ckSelect, ckSwitch, ckSwitchOptions, ckTable, ckTd, ckTextarea, ckTh, ckTooltip, ckTr, install as default, lockScroll, unlockScroll };