cleek 2.0.0 → 2.0.1
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 +83 -78
- package/dist/cleek.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +3 -2
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, onMounted, getCurrentInstance, 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);
|
|
@@ -80,7 +80,7 @@ var functions$1 = {
|
|
|
80
80
|
};
|
|
81
81
|
var globalVariables = {
|
|
82
82
|
defaultFailImg: "df",
|
|
83
|
-
imagesFolderPath: "",
|
|
83
|
+
imagesFolderPath: "asd",
|
|
84
84
|
defaultImgBorderColor: "#EEEEEE"
|
|
85
85
|
};
|
|
86
86
|
/*!
|
|
@@ -11202,7 +11202,7 @@ defineComponent({
|
|
|
11202
11202
|
};
|
|
11203
11203
|
}
|
|
11204
11204
|
});
|
|
11205
|
-
function render$
|
|
11205
|
+
function render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11206
11206
|
const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
|
|
11207
11207
|
return openBlock(), createElementBlock("div", {
|
|
11208
11208
|
class: normalizeClass(["ck-icon", $options.computedClass]),
|
|
@@ -11278,9 +11278,9 @@ const _sfc_main$j = {
|
|
|
11278
11278
|
}
|
|
11279
11279
|
}
|
|
11280
11280
|
};
|
|
11281
|
-
var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$
|
|
11281
|
+
var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$d], ["__scopeId", "data-v-77d9963a"]]);
|
|
11282
11282
|
const _hoisted_1$g = ["title", "aria-label", "disabled"];
|
|
11283
|
-
function render$
|
|
11283
|
+
function render$c(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11284
11284
|
const _component_ck_icon = resolveComponent("ck-icon");
|
|
11285
11285
|
return openBlock(), createElementBlock("button", {
|
|
11286
11286
|
type: "button",
|
|
@@ -11363,7 +11363,7 @@ const _sfc_main$i = {
|
|
|
11363
11363
|
}
|
|
11364
11364
|
}
|
|
11365
11365
|
};
|
|
11366
|
-
var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$
|
|
11366
|
+
var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$c], ["__scopeId", "data-v-a687842a"]]);
|
|
11367
11367
|
const _withScopeId$2 = (n) => (pushScopeId("data-v-69dfa524"), n = n(), popScopeId(), n);
|
|
11368
11368
|
const _hoisted_1$f = ["disabled", "checked"];
|
|
11369
11369
|
const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
|
|
@@ -11371,7 +11371,7 @@ const _hoisted_3$5 = {
|
|
|
11371
11371
|
key: 0,
|
|
11372
11372
|
class: "c-Checkbox__label"
|
|
11373
11373
|
};
|
|
11374
|
-
function render$
|
|
11374
|
+
function render$b(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11375
11375
|
return openBlock(), createElementBlock("label", mergeProps({ class: "ck-checkbox" }, $options.checkboxAttributes, {
|
|
11376
11376
|
onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
|
|
11377
11377
|
}, ["prevent"]), ["space"])),
|
|
@@ -11431,23 +11431,10 @@ const _sfc_main$h = {
|
|
|
11431
11431
|
}
|
|
11432
11432
|
}
|
|
11433
11433
|
};
|
|
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
|
-
}
|
|
11434
|
+
var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$b], ["__scopeId", "data-v-69dfa524"]]);
|
|
11449
11435
|
var ckImg_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
11450
|
-
const
|
|
11436
|
+
const _hoisted_1$e = ["src"];
|
|
11437
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
11451
11438
|
props: {
|
|
11452
11439
|
src: { type: String, default: "" },
|
|
11453
11440
|
isFullPath: { type: Boolean, default: false },
|
|
@@ -11462,77 +11449,92 @@ const _sfc_main$g = {
|
|
|
11462
11449
|
radius: { type: String, default: "" },
|
|
11463
11450
|
borderColor: { type: String, default: "" }
|
|
11464
11451
|
},
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11452
|
+
setup(__props) {
|
|
11453
|
+
const props = __props;
|
|
11454
|
+
const altNeeded = ref(false);
|
|
11455
|
+
let context;
|
|
11456
|
+
const imageUrl = computed(() => {
|
|
11457
|
+
if (props.isFullPath)
|
|
11458
|
+
return props.src;
|
|
11459
|
+
return getImg(props.src);
|
|
11460
|
+
});
|
|
11461
|
+
const computedClass = computed(() => {
|
|
11472
11462
|
const classList2 = [];
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
size = "m";
|
|
11463
|
+
if (!props.size && !props.sizeAbsolute && !props.width && !props.height) {
|
|
11464
|
+
props.size = "m";
|
|
11476
11465
|
}
|
|
11477
|
-
if (size)
|
|
11478
|
-
classList2.push(`ck-img__size--${size}`);
|
|
11479
|
-
if (
|
|
11466
|
+
if (props.size)
|
|
11467
|
+
classList2.push(`ck-img__size--${props.size}`);
|
|
11468
|
+
if (props.hasBorder) {
|
|
11480
11469
|
classList2.push("ck-img__has-border");
|
|
11481
|
-
if (functions$1.isColorTemplateVariable(
|
|
11482
|
-
classList2.push(`ck-component__border-color--${
|
|
11470
|
+
if (functions$1.isColorTemplateVariable(realBorderColor.value)) {
|
|
11471
|
+
classList2.push(`ck-component__border-color--${realBorderColor.value}`);
|
|
11483
11472
|
}
|
|
11484
11473
|
}
|
|
11485
|
-
if (
|
|
11474
|
+
if (props.zoom)
|
|
11486
11475
|
classList2.push("zoom-able");
|
|
11487
11476
|
return classList2;
|
|
11488
|
-
}
|
|
11489
|
-
computedStyle() {
|
|
11477
|
+
});
|
|
11478
|
+
const computedStyle = computed(() => {
|
|
11490
11479
|
const styleList = [];
|
|
11491
|
-
if (
|
|
11492
|
-
styleList.push({ width:
|
|
11493
|
-
styleList.push({ height:
|
|
11480
|
+
if (props.sizeAbsolute) {
|
|
11481
|
+
styleList.push({ width: props.sizeAbsolute });
|
|
11482
|
+
styleList.push({ height: props.sizeAbsolute });
|
|
11494
11483
|
}
|
|
11495
|
-
if (
|
|
11496
|
-
styleList.push({ "border-radius":
|
|
11497
|
-
if (
|
|
11498
|
-
if (!functions$1.isColorTemplateVariable(
|
|
11499
|
-
styleList.push({ "border-color":
|
|
11484
|
+
if (props.radius)
|
|
11485
|
+
styleList.push({ "border-radius": props.radius });
|
|
11486
|
+
if (props.hasBorder) {
|
|
11487
|
+
if (!functions$1.isColorTemplateVariable(realBorderColor.value)) {
|
|
11488
|
+
styleList.push({ "border-color": realBorderColor.value });
|
|
11500
11489
|
}
|
|
11501
11490
|
}
|
|
11502
11491
|
return styleList;
|
|
11503
|
-
}
|
|
11504
|
-
computedImgStyle() {
|
|
11492
|
+
});
|
|
11493
|
+
const computedImgStyle = computed(() => {
|
|
11505
11494
|
const styleList = [];
|
|
11506
|
-
if (
|
|
11507
|
-
styleList.push({ "border-radius":
|
|
11508
|
-
if (
|
|
11509
|
-
styleList.push({ width:
|
|
11510
|
-
if (
|
|
11511
|
-
styleList.push({ height:
|
|
11495
|
+
if (props.radius)
|
|
11496
|
+
styleList.push({ "border-radius": props.radius });
|
|
11497
|
+
if (props.width)
|
|
11498
|
+
styleList.push({ width: props.width });
|
|
11499
|
+
if (props.height)
|
|
11500
|
+
styleList.push({ height: props.height });
|
|
11512
11501
|
return styleList;
|
|
11513
|
-
}
|
|
11514
|
-
realBorderColor() {
|
|
11515
|
-
if (
|
|
11516
|
-
return
|
|
11502
|
+
});
|
|
11503
|
+
const realBorderColor = computed(() => {
|
|
11504
|
+
if (props.borderColor)
|
|
11505
|
+
return props.borderColor;
|
|
11517
11506
|
return globalVariables.defaultImgBorderColor;
|
|
11518
|
-
}
|
|
11519
|
-
|
|
11520
|
-
|
|
11521
|
-
|
|
11522
|
-
|
|
11523
|
-
|
|
11524
|
-
|
|
11525
|
-
|
|
11526
|
-
|
|
11527
|
-
|
|
11528
|
-
}
|
|
11529
|
-
}
|
|
11530
|
-
|
|
11531
|
-
|
|
11532
|
-
}
|
|
11507
|
+
});
|
|
11508
|
+
function clickImg() {
|
|
11509
|
+
if (props.zoom)
|
|
11510
|
+
;
|
|
11511
|
+
}
|
|
11512
|
+
function getImg(src) {
|
|
11513
|
+
let path = "";
|
|
11514
|
+
console.log("context.$cleekOptions", context.$cleekOptions);
|
|
11515
|
+
if (context.$cleekOptions.imgPath)
|
|
11516
|
+
path = context.$cleekOptions.imgPath;
|
|
11517
|
+
return `${path}${src}`;
|
|
11518
|
+
}
|
|
11519
|
+
onMounted(() => {
|
|
11520
|
+
context = getCurrentInstance().ctx;
|
|
11521
|
+
});
|
|
11522
|
+
return (_ctx, _cache) => {
|
|
11523
|
+
return openBlock(), createElementBlock("div", {
|
|
11524
|
+
class: normalizeClass(["ck-img", unref(computedClass)]),
|
|
11525
|
+
style: normalizeStyle(unref(computedStyle)),
|
|
11526
|
+
onClick: _cache[1] || (_cache[1] = ($event) => clickImg())
|
|
11527
|
+
}, [
|
|
11528
|
+
createElementVNode("img", {
|
|
11529
|
+
src: unref(imageUrl),
|
|
11530
|
+
style: normalizeStyle(unref(computedImgStyle)),
|
|
11531
|
+
onError: _cache[0] || (_cache[0] = ($event) => altNeeded.value = true)
|
|
11532
|
+
}, null, 44, _hoisted_1$e)
|
|
11533
|
+
], 6);
|
|
11534
|
+
};
|
|
11533
11535
|
}
|
|
11534
|
-
};
|
|
11535
|
-
var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["
|
|
11536
|
+
});
|
|
11537
|
+
var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-66708ebe"]]);
|
|
11536
11538
|
const _hoisted_1$d = ["for"];
|
|
11537
11539
|
function render$a(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11538
11540
|
return openBlock(), createElementBlock("label", {
|
|
@@ -15275,6 +15277,8 @@ var components = /* @__PURE__ */ Object.freeze({
|
|
|
15275
15277
|
unlockScroll
|
|
15276
15278
|
});
|
|
15277
15279
|
function setDefaultColors(options) {
|
|
15280
|
+
if (!options)
|
|
15281
|
+
return;
|
|
15278
15282
|
var r = document.querySelector(":root");
|
|
15279
15283
|
const colorList = [
|
|
15280
15284
|
"primary",
|
|
@@ -15296,6 +15300,7 @@ function setDefaultColors(options) {
|
|
|
15296
15300
|
}
|
|
15297
15301
|
}
|
|
15298
15302
|
const install = function installCleek(app, options) {
|
|
15303
|
+
app.config.globalProperties.$cleekOptions = options;
|
|
15299
15304
|
console.log("arranco paquete", options);
|
|
15300
15305
|
setDefaultColors(options);
|
|
15301
15306
|
Object.entries(components).forEach(([componentName, component]) => {
|