cleek 1.8.12 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cleek.es.js
CHANGED
|
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { defineComponent, computed, watch, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, renderSlot, mergeProps, withKeys, withModifiers, createElementVNode, pushScopeId, popScopeId, normalizeStyle, withCtx, createTextVNode, toDisplayString, withDirectives, isRef,
|
|
20
|
+
import { defineComponent, computed, watch, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, renderSlot, mergeProps, withKeys, withModifiers, createElementVNode, pushScopeId, popScopeId, ref, getCurrentInstance, onMounted, unref, normalizeStyle, withCtx, createTextVNode, toDisplayString, withDirectives, isRef, vModelDynamic, createVNode, Fragment, renderList, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
|
|
21
21
|
var validators = {
|
|
22
22
|
size: (type) => {
|
|
23
23
|
return ["", "xs", "s", "m", "l", "xl"].includes(type);
|
|
@@ -76,11 +76,14 @@ var functions$1 = {
|
|
|
76
76
|
},
|
|
77
77
|
isTableColumnsVisible(col) {
|
|
78
78
|
return !col.isHidden;
|
|
79
|
+
},
|
|
80
|
+
getCleekOptions(getCurrentInstance2) {
|
|
81
|
+
return getCurrentInstance2().appContext.app.config.globalProperties.$cleekOptions;
|
|
79
82
|
}
|
|
80
83
|
};
|
|
81
84
|
var globalVariables = {
|
|
82
85
|
defaultFailImg: "df",
|
|
83
|
-
imagesFolderPath: "",
|
|
86
|
+
imagesFolderPath: "asd",
|
|
84
87
|
defaultImgBorderColor: "#EEEEEE"
|
|
85
88
|
};
|
|
86
89
|
/*!
|
|
@@ -11202,7 +11205,7 @@ defineComponent({
|
|
|
11202
11205
|
};
|
|
11203
11206
|
}
|
|
11204
11207
|
});
|
|
11205
|
-
function render$
|
|
11208
|
+
function render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11206
11209
|
const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
|
|
11207
11210
|
return openBlock(), createElementBlock("div", {
|
|
11208
11211
|
class: normalizeClass(["ck-icon", $options.computedClass]),
|
|
@@ -11278,9 +11281,9 @@ const _sfc_main$j = {
|
|
|
11278
11281
|
}
|
|
11279
11282
|
}
|
|
11280
11283
|
};
|
|
11281
|
-
var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$
|
|
11284
|
+
var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$d], ["__scopeId", "data-v-77d9963a"]]);
|
|
11282
11285
|
const _hoisted_1$g = ["title", "aria-label", "disabled"];
|
|
11283
|
-
function render$
|
|
11286
|
+
function render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11284
11287
|
const _component_ck_icon = resolveComponent("ck-icon");
|
|
11285
11288
|
return openBlock(), createElementBlock("button", {
|
|
11286
11289
|
type: "button",
|
|
@@ -11363,15 +11366,15 @@ const _sfc_main$i = {
|
|
|
11363
11366
|
}
|
|
11364
11367
|
}
|
|
11365
11368
|
};
|
|
11366
|
-
var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$
|
|
11367
|
-
const _withScopeId$2 = (n) => (pushScopeId("data-v-
|
|
11369
|
+
var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$c], ["__scopeId", "data-v-a687842a"]]);
|
|
11370
|
+
const _withScopeId$2 = (n) => (pushScopeId("data-v-69dfa524"), n = n(), popScopeId(), n);
|
|
11368
11371
|
const _hoisted_1$f = ["disabled", "checked"];
|
|
11369
11372
|
const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
|
|
11370
11373
|
const _hoisted_3$5 = {
|
|
11371
11374
|
key: 0,
|
|
11372
11375
|
class: "c-Checkbox__label"
|
|
11373
11376
|
};
|
|
11374
|
-
function render$
|
|
11377
|
+
function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11375
11378
|
return openBlock(), createElementBlock("label", mergeProps({ class: "ck-checkbox" }, $options.checkboxAttributes, {
|
|
11376
11379
|
onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
|
|
11377
11380
|
}, ["prevent"]), ["space"])),
|
|
@@ -11431,23 +11434,10 @@ const _sfc_main$h = {
|
|
|
11431
11434
|
}
|
|
11432
11435
|
}
|
|
11433
11436
|
};
|
|
11434
|
-
var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$
|
|
11435
|
-
const _hoisted_1$e = ["src"];
|
|
11436
|
-
function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11437
|
-
return openBlock(), createElementBlock("div", {
|
|
11438
|
-
class: normalizeClass(["ck-img", $options.computedClass]),
|
|
11439
|
-
style: normalizeStyle($options.computedStyle),
|
|
11440
|
-
onClick: _cache[1] || (_cache[1] = ($event) => $options.clickImg())
|
|
11441
|
-
}, [
|
|
11442
|
-
createElementVNode("img", {
|
|
11443
|
-
src: $options.imageUrl,
|
|
11444
|
-
style: normalizeStyle($options.computedImgStyle),
|
|
11445
|
-
onError: _cache[0] || (_cache[0] = ($event) => _ctx.altNeeded = true)
|
|
11446
|
-
}, null, 44, _hoisted_1$e)
|
|
11447
|
-
], 6);
|
|
11448
|
-
}
|
|
11437
|
+
var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$b], ["__scopeId", "data-v-69dfa524"]]);
|
|
11449
11438
|
var ckImg_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
11450
|
-
const
|
|
11439
|
+
const _hoisted_1$e = ["src"];
|
|
11440
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
11451
11441
|
props: {
|
|
11452
11442
|
src: { type: String, default: "" },
|
|
11453
11443
|
isFullPath: { type: Boolean, default: false },
|
|
@@ -11462,77 +11452,96 @@ const _sfc_main$g = {
|
|
|
11462
11452
|
radius: { type: String, default: "" },
|
|
11463
11453
|
borderColor: { type: String, default: "" }
|
|
11464
11454
|
},
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11455
|
+
setup(__props) {
|
|
11456
|
+
const props = __props;
|
|
11457
|
+
const altNeeded = ref(false);
|
|
11458
|
+
let isMounted = ref(false);
|
|
11459
|
+
const imageUrl = computed(() => {
|
|
11460
|
+
if (!isMounted.value)
|
|
11461
|
+
return "";
|
|
11462
|
+
if (props.isFullPath)
|
|
11463
|
+
return props.src;
|
|
11464
|
+
return getImg(props.src);
|
|
11465
|
+
});
|
|
11466
|
+
const computedClass = computed(() => {
|
|
11472
11467
|
const classList2 = [];
|
|
11473
|
-
let
|
|
11474
|
-
if (size
|
|
11468
|
+
let size = props.size;
|
|
11469
|
+
if (!size && !props.sizeAbsolute && !props.width && !props.height) {
|
|
11475
11470
|
size = "m";
|
|
11476
11471
|
}
|
|
11477
11472
|
if (size)
|
|
11478
11473
|
classList2.push(`ck-img__size--${size}`);
|
|
11479
|
-
if (
|
|
11474
|
+
if (props.hasBorder) {
|
|
11480
11475
|
classList2.push("ck-img__has-border");
|
|
11481
|
-
if (functions$1.isColorTemplateVariable(
|
|
11482
|
-
classList2.push(`ck-component__border-color--${
|
|
11476
|
+
if (functions$1.isColorTemplateVariable(realBorderColor.value)) {
|
|
11477
|
+
classList2.push(`ck-component__border-color--${realBorderColor.value}`);
|
|
11483
11478
|
}
|
|
11484
11479
|
}
|
|
11485
|
-
if (
|
|
11480
|
+
if (props.zoom)
|
|
11486
11481
|
classList2.push("zoom-able");
|
|
11487
11482
|
return classList2;
|
|
11488
|
-
}
|
|
11489
|
-
computedStyle() {
|
|
11483
|
+
});
|
|
11484
|
+
const computedStyle = computed(() => {
|
|
11490
11485
|
const styleList = [];
|
|
11491
|
-
if (
|
|
11492
|
-
styleList.push({ width:
|
|
11493
|
-
styleList.push({ height:
|
|
11486
|
+
if (props.sizeAbsolute) {
|
|
11487
|
+
styleList.push({ width: props.sizeAbsolute });
|
|
11488
|
+
styleList.push({ height: props.sizeAbsolute });
|
|
11494
11489
|
}
|
|
11495
|
-
if (
|
|
11496
|
-
styleList.push({ "border-radius":
|
|
11497
|
-
if (
|
|
11498
|
-
if (!functions$1.isColorTemplateVariable(
|
|
11499
|
-
styleList.push({ "border-color":
|
|
11490
|
+
if (props.radius)
|
|
11491
|
+
styleList.push({ "border-radius": props.radius });
|
|
11492
|
+
if (props.hasBorder) {
|
|
11493
|
+
if (!functions$1.isColorTemplateVariable(realBorderColor.value)) {
|
|
11494
|
+
styleList.push({ "border-color": realBorderColor.value });
|
|
11500
11495
|
}
|
|
11501
11496
|
}
|
|
11502
11497
|
return styleList;
|
|
11503
|
-
}
|
|
11504
|
-
computedImgStyle() {
|
|
11498
|
+
});
|
|
11499
|
+
const computedImgStyle = computed(() => {
|
|
11505
11500
|
const styleList = [];
|
|
11506
|
-
if (
|
|
11507
|
-
styleList.push({ "border-radius":
|
|
11508
|
-
if (
|
|
11509
|
-
styleList.push({ width:
|
|
11510
|
-
if (
|
|
11511
|
-
styleList.push({ height:
|
|
11501
|
+
if (props.radius)
|
|
11502
|
+
styleList.push({ "border-radius": props.radius });
|
|
11503
|
+
if (props.width)
|
|
11504
|
+
styleList.push({ width: props.width });
|
|
11505
|
+
if (props.height)
|
|
11506
|
+
styleList.push({ height: props.height });
|
|
11512
11507
|
return styleList;
|
|
11513
|
-
}
|
|
11514
|
-
realBorderColor() {
|
|
11515
|
-
if (
|
|
11516
|
-
return
|
|
11508
|
+
});
|
|
11509
|
+
const realBorderColor = computed(() => {
|
|
11510
|
+
if (props.borderColor)
|
|
11511
|
+
return props.borderColor;
|
|
11517
11512
|
return globalVariables.defaultImgBorderColor;
|
|
11518
|
-
}
|
|
11519
|
-
|
|
11520
|
-
|
|
11521
|
-
|
|
11522
|
-
|
|
11523
|
-
|
|
11524
|
-
|
|
11525
|
-
|
|
11526
|
-
|
|
11527
|
-
|
|
11528
|
-
}
|
|
11529
|
-
}
|
|
11530
|
-
|
|
11531
|
-
|
|
11532
|
-
|
|
11513
|
+
});
|
|
11514
|
+
function clickImg() {
|
|
11515
|
+
if (props.zoom)
|
|
11516
|
+
;
|
|
11517
|
+
}
|
|
11518
|
+
function getImg(src) {
|
|
11519
|
+
let path = "";
|
|
11520
|
+
const $cleekOptions = functions$1.getCleekOptions(getCurrentInstance);
|
|
11521
|
+
if ($cleekOptions)
|
|
11522
|
+
path = $cleekOptions.imgPath;
|
|
11523
|
+
return `${path}${src}`;
|
|
11524
|
+
}
|
|
11525
|
+
onMounted(() => {
|
|
11526
|
+
getCurrentInstance().ctx;
|
|
11527
|
+
isMounted.value = true;
|
|
11528
|
+
});
|
|
11529
|
+
return (_ctx, _cache) => {
|
|
11530
|
+
return openBlock(), createElementBlock("div", {
|
|
11531
|
+
class: normalizeClass(["ck-img", unref(computedClass)]),
|
|
11532
|
+
style: normalizeStyle(unref(computedStyle)),
|
|
11533
|
+
onClick: _cache[1] || (_cache[1] = ($event) => clickImg())
|
|
11534
|
+
}, [
|
|
11535
|
+
createElementVNode("img", {
|
|
11536
|
+
src: unref(imageUrl),
|
|
11537
|
+
style: normalizeStyle(unref(computedImgStyle)),
|
|
11538
|
+
onError: _cache[0] || (_cache[0] = ($event) => altNeeded.value = true)
|
|
11539
|
+
}, null, 44, _hoisted_1$e)
|
|
11540
|
+
], 6);
|
|
11541
|
+
};
|
|
11533
11542
|
}
|
|
11534
|
-
};
|
|
11535
|
-
var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["
|
|
11543
|
+
});
|
|
11544
|
+
var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-b201891c"]]);
|
|
11536
11545
|
const _hoisted_1$d = ["for"];
|
|
11537
11546
|
function render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11538
11547
|
return openBlock(), createElementBlock("label", {
|
|
@@ -11668,7 +11677,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
11668
11677
|
};
|
|
11669
11678
|
}
|
|
11670
11679
|
});
|
|
11671
|
-
var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-
|
|
11680
|
+
var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-61fababc"]]);
|
|
11672
11681
|
var ckPopup_vue_vue_type_style_index_0_lang = "";
|
|
11673
11682
|
const _hoisted_1$b = {
|
|
11674
11683
|
key: 0,
|
|
@@ -12039,8 +12048,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
12039
12048
|
};
|
|
12040
12049
|
}
|
|
12041
12050
|
});
|
|
12042
|
-
var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-
|
|
12043
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
12051
|
+
var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-02fab5ba"]]);
|
|
12052
|
+
const _withScopeId = (n) => (pushScopeId("data-v-022b9f3c"), n = n(), popScopeId(), n);
|
|
12044
12053
|
const _hoisted_1$8 = ["disabled"];
|
|
12045
12054
|
const _hoisted_2$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
|
|
12046
12055
|
const _hoisted_3$2 = {
|
|
@@ -12113,7 +12122,7 @@ const _sfc_main$a = {
|
|
|
12113
12122
|
}
|
|
12114
12123
|
}
|
|
12115
12124
|
};
|
|
12116
|
-
var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$8], ["__scopeId", "data-v-
|
|
12125
|
+
var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$8], ["__scopeId", "data-v-022b9f3c"]]);
|
|
12117
12126
|
const _hoisted_1$7 = { class: "ck-switch-options__container-exterior" };
|
|
12118
12127
|
const _hoisted_2$2 = ["onClick"];
|
|
12119
12128
|
function render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -12191,7 +12200,7 @@ const _sfc_main$9 = {
|
|
|
12191
12200
|
}
|
|
12192
12201
|
}
|
|
12193
12202
|
};
|
|
12194
|
-
var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$7], ["__scopeId", "data-v-
|
|
12203
|
+
var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$7], ["__scopeId", "data-v-f0c51430"]]);
|
|
12195
12204
|
const _hoisted_1$6 = { class: "ck-tr" };
|
|
12196
12205
|
function render$6(_ctx, _cache) {
|
|
12197
12206
|
return openBlock(), createElementBlock("tr", _hoisted_1$6, [
|
|
@@ -12329,7 +12338,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
12329
12338
|
};
|
|
12330
12339
|
}
|
|
12331
12340
|
});
|
|
12332
|
-
var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-
|
|
12341
|
+
var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-5c48aabc"]]);
|
|
12333
12342
|
var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
12334
12343
|
const _hoisted_1$3 = { class: "ck-table__pagination" };
|
|
12335
12344
|
const _hoisted_2$1 = ["onClick"];
|
|
@@ -12457,7 +12466,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
|
|
|
12457
12466
|
};
|
|
12458
12467
|
}
|
|
12459
12468
|
}));
|
|
12460
|
-
var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
12469
|
+
var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-7ad6042e"]]);
|
|
12461
12470
|
var ckTable_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
12462
12471
|
const _hoisted_1$2 = { class: "ck-table" };
|
|
12463
12472
|
const _hoisted_2 = {
|
|
@@ -12653,7 +12662,7 @@ const _sfc_main$1 = {
|
|
|
12653
12662
|
}
|
|
12654
12663
|
}
|
|
12655
12664
|
};
|
|
12656
|
-
var ckTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", render$2], ["__scopeId", "data-v-
|
|
12665
|
+
var ckTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", render$2], ["__scopeId", "data-v-ec889100"]]);
|
|
12657
12666
|
var top = "top";
|
|
12658
12667
|
var bottom = "bottom";
|
|
12659
12668
|
var right = "right";
|
|
@@ -15274,8 +15283,33 @@ var components = /* @__PURE__ */ Object.freeze({
|
|
|
15274
15283
|
lockScroll,
|
|
15275
15284
|
unlockScroll
|
|
15276
15285
|
});
|
|
15286
|
+
function setDefaultColors(options) {
|
|
15287
|
+
if (!options)
|
|
15288
|
+
return;
|
|
15289
|
+
var r = document.querySelector(":root");
|
|
15290
|
+
const colorList = [
|
|
15291
|
+
"primary",
|
|
15292
|
+
"secondary",
|
|
15293
|
+
"primary",
|
|
15294
|
+
"secondary",
|
|
15295
|
+
"success",
|
|
15296
|
+
"warning",
|
|
15297
|
+
"danger",
|
|
15298
|
+
"dark",
|
|
15299
|
+
"light"
|
|
15300
|
+
];
|
|
15301
|
+
if (options.colors) {
|
|
15302
|
+
colorList.forEach((colorName) => {
|
|
15303
|
+
const colorValue = options.colors[colorName];
|
|
15304
|
+
if (colorValue)
|
|
15305
|
+
r.style.setProperty(`--${colorName}`, colorValue);
|
|
15306
|
+
});
|
|
15307
|
+
}
|
|
15308
|
+
}
|
|
15277
15309
|
const install = function installCleek(app, options) {
|
|
15310
|
+
app.config.globalProperties.$cleekOptions = options;
|
|
15278
15311
|
console.log("arranco paquete", options);
|
|
15312
|
+
setDefaultColors(options);
|
|
15279
15313
|
Object.entries(components).forEach(([componentName, component]) => {
|
|
15280
15314
|
app.component(componentName, component);
|
|
15281
15315
|
});
|