cleek 2.2.2 → 2.3.0
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
|
@@ -18,6 +18,20 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
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, nextTick as nextTick$1, onBeforeUnmount, getCurrentInstance, withDirectives, isRef as isRef$1, vModelDynamic, Fragment, renderList, mergeProps, withKeys, withModifiers, pushScopeId, popScopeId, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
|
|
21
|
+
var defaultCleekOptions = {
|
|
22
|
+
colors: {
|
|
23
|
+
primary: "#559933",
|
|
24
|
+
secondary: "#559933",
|
|
25
|
+
success: "#559933",
|
|
26
|
+
warning: "#559933",
|
|
27
|
+
danger: "#559933",
|
|
28
|
+
dark: "#559933",
|
|
29
|
+
light: "#559933"
|
|
30
|
+
},
|
|
31
|
+
button: {
|
|
32
|
+
type: "filled"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
21
35
|
var ckDropdown_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
22
36
|
var _export_sfc = (sfc, props) => {
|
|
23
37
|
const target = sfc.__vccOpts || sfc;
|
|
@@ -11449,37 +11463,37 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
11449
11463
|
}
|
|
11450
11464
|
});
|
|
11451
11465
|
var functions = {
|
|
11452
|
-
getGroupClass({ group = "", groupVertical = "",
|
|
11466
|
+
getGroupClass({ group = "", groupVertical = "", lineBreak = "" } = {}) {
|
|
11453
11467
|
const classList2 = [];
|
|
11454
11468
|
if (group)
|
|
11455
11469
|
classList2.push(`ck-component__group--${group}`);
|
|
11456
11470
|
if (groupVertical)
|
|
11457
11471
|
classList2.push(`ck-component__group-vertical--${groupVertical}`);
|
|
11458
|
-
if (
|
|
11459
|
-
if (
|
|
11460
|
-
classList2.push(`ck-
|
|
11472
|
+
if (lineBreak) {
|
|
11473
|
+
if (lineBreak === "s") {
|
|
11474
|
+
classList2.push(`ck-component__line-break--${lineBreak}`);
|
|
11461
11475
|
}
|
|
11462
11476
|
}
|
|
11463
11477
|
return classList2;
|
|
11464
11478
|
},
|
|
11465
|
-
getGroupClassContainer({
|
|
11479
|
+
getGroupClassContainer({ lineBreak = "" } = "") {
|
|
11466
11480
|
const classList2 = [];
|
|
11467
|
-
if (
|
|
11468
|
-
if (
|
|
11469
|
-
classList2.push(`ck-
|
|
11481
|
+
if (lineBreak) {
|
|
11482
|
+
if (lineBreak === "s") {
|
|
11483
|
+
classList2.push(`ck-component__line-break-container--${lineBreak}`);
|
|
11470
11484
|
}
|
|
11471
11485
|
}
|
|
11472
11486
|
return classList2;
|
|
11473
11487
|
},
|
|
11474
|
-
|
|
11475
|
-
if (windowWidth <=
|
|
11488
|
+
getlineBreakStyleContainer({ lineBreak } = {}, windowWidth) {
|
|
11489
|
+
if (windowWidth <= lineBreak) {
|
|
11476
11490
|
return [
|
|
11477
11491
|
{ width: "100%" }
|
|
11478
11492
|
];
|
|
11479
11493
|
}
|
|
11480
11494
|
},
|
|
11481
|
-
|
|
11482
|
-
if (windowWidth <=
|
|
11495
|
+
getlineBreakStyle({ lineBreak } = {}, windowWidth) {
|
|
11496
|
+
if (windowWidth <= lineBreak) {
|
|
11483
11497
|
return [
|
|
11484
11498
|
{ width: "100%" },
|
|
11485
11499
|
{ borderRadius: "4px !important" },
|
|
@@ -11542,7 +11556,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
11542
11556
|
props: {
|
|
11543
11557
|
title: { type: String, default: void 0 },
|
|
11544
11558
|
disabled: { type: Boolean, default: false },
|
|
11545
|
-
type: { type: String, default:
|
|
11559
|
+
type: { type: String, default: void 0, validator: validators.buttonType },
|
|
11546
11560
|
color: { type: String, default: "primary" },
|
|
11547
11561
|
align: { type: String, default: "left", validator: validators.align },
|
|
11548
11562
|
size: { type: String, default: "m", validator: validators.size },
|
|
@@ -11553,19 +11567,28 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
11553
11567
|
label: { type: String, default: void 0 },
|
|
11554
11568
|
labelAlign: { type: String, default: void 0 },
|
|
11555
11569
|
group: { type: String, default: void 0, validator: validators.group },
|
|
11556
|
-
|
|
11570
|
+
lineBreak: { type: [String, Number], default: "" },
|
|
11557
11571
|
groupVertical: { type: String, default: void 0, validator: validators.groupVertical }
|
|
11558
11572
|
},
|
|
11559
11573
|
emits: ["click"],
|
|
11560
11574
|
setup(__props, { emit: emits }) {
|
|
11561
11575
|
const props = __props;
|
|
11562
11576
|
const { windowWidth } = useWindowWidth();
|
|
11577
|
+
const defaultButtonType = "outlined";
|
|
11578
|
+
let $cleekOptions;
|
|
11563
11579
|
const isMounted = ref(false);
|
|
11580
|
+
const realButtonType = computed$2(() => {
|
|
11581
|
+
if (props.type)
|
|
11582
|
+
return props.type;
|
|
11583
|
+
if (!isMounted.value && $cleekOptions)
|
|
11584
|
+
return $cleekOptions.button.type;
|
|
11585
|
+
return defaultButtonType;
|
|
11586
|
+
});
|
|
11564
11587
|
const computedClass = computed$2(() => {
|
|
11565
11588
|
const classList2 = [];
|
|
11566
11589
|
classList2.push(functions.getGroupClass(props));
|
|
11567
11590
|
if (props.color !== "primary") {
|
|
11568
|
-
if (
|
|
11591
|
+
if (realButtonType.value === "filled") {
|
|
11569
11592
|
classList2.push(`ck-component__bg-color--${props.color}`);
|
|
11570
11593
|
} else {
|
|
11571
11594
|
classList2.push(`ck-component__border-color--${props.color}`);
|
|
@@ -11574,21 +11597,16 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
11574
11597
|
if (props.align === "center" || props.align === "right") {
|
|
11575
11598
|
classList2.push(`ck-button__align--${props.align}`);
|
|
11576
11599
|
}
|
|
11577
|
-
|
|
11578
|
-
;
|
|
11579
|
-
let type = props.type;
|
|
11580
|
-
if (!validators.buttonType(props.type))
|
|
11581
|
-
type = "outlined";
|
|
11582
|
-
classList2.push(`type-${type}`);
|
|
11600
|
+
classList2.push(`type-${realButtonType.value}`);
|
|
11583
11601
|
if (props.size)
|
|
11584
11602
|
classList2.push(`rs-component-size__${props.size}`);
|
|
11585
11603
|
return classList2;
|
|
11586
11604
|
});
|
|
11587
11605
|
const computedStyle = computed$2(() => {
|
|
11588
11606
|
const list = [];
|
|
11589
|
-
if (props.width && !props.
|
|
11607
|
+
if (props.width && !props.lineBreak)
|
|
11590
11608
|
list.push({ width: props.width });
|
|
11591
|
-
list.push(functions.
|
|
11609
|
+
list.push(functions.getlineBreakStyle(props, windowWidth.value));
|
|
11592
11610
|
return list;
|
|
11593
11611
|
});
|
|
11594
11612
|
function onClick(event) {
|
|
@@ -11596,7 +11614,10 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
11596
11614
|
}
|
|
11597
11615
|
onMounted(() => {
|
|
11598
11616
|
getCurrentInstance().ctx;
|
|
11599
|
-
|
|
11617
|
+
$cleekOptions = functions.getCleekOptions(getCurrentInstance);
|
|
11618
|
+
setTimeout(() => {
|
|
11619
|
+
isMounted.value = true;
|
|
11620
|
+
}, 3e3);
|
|
11600
11621
|
});
|
|
11601
11622
|
return (_ctx, _cache) => {
|
|
11602
11623
|
return openBlock(), createElementBlock("button", {
|
|
@@ -11610,22 +11631,22 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
11610
11631
|
}, [
|
|
11611
11632
|
__props.icon ? (openBlock(), createBlock(ckIcon, {
|
|
11612
11633
|
key: 0,
|
|
11613
|
-
class: "ck-button__icon-left",
|
|
11634
|
+
class: normalizeClass(["ck-button__icon-left", { "just-icon": !_ctx.$slots.default }]),
|
|
11614
11635
|
icon: __props.icon,
|
|
11615
11636
|
"icon-pack": __props.iconPack
|
|
11616
|
-
}, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true),
|
|
11637
|
+
}, null, 8, ["icon", "icon-pack", "class"])) : createCommentVNode("", true),
|
|
11617
11638
|
renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
11618
11639
|
__props.iconRight ? (openBlock(), createBlock(ckIcon, {
|
|
11619
11640
|
key: 1,
|
|
11620
|
-
class: "ck-button__icon-right",
|
|
11641
|
+
class: normalizeClass(["ck-button__icon-right", { "just-icon": !_ctx.$slots.default }]),
|
|
11621
11642
|
icon: __props.iconRight,
|
|
11622
11643
|
"icon-pack": __props.iconPack
|
|
11623
|
-
}, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true)
|
|
11644
|
+
}, null, 8, ["icon", "icon-pack", "class"])) : createCommentVNode("", true)
|
|
11624
11645
|
], 14, _hoisted_1$g);
|
|
11625
11646
|
};
|
|
11626
11647
|
}
|
|
11627
11648
|
});
|
|
11628
|
-
var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
11649
|
+
var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-73fd023c"]]);
|
|
11629
11650
|
var ckLabel_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
11630
11651
|
const _hoisted_1$f = ["for"];
|
|
11631
11652
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
@@ -11669,7 +11690,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11669
11690
|
iconPack: { type: String, default: void 0 },
|
|
11670
11691
|
iconRight: { type: String, default: void 0 },
|
|
11671
11692
|
group: { type: String, default: void 0 },
|
|
11672
|
-
|
|
11693
|
+
lineBreak: { type: [String, Number], default: "" },
|
|
11673
11694
|
groupVertical: { type: String, default: void 0 },
|
|
11674
11695
|
hideBorder: { type: Boolean, default: false },
|
|
11675
11696
|
width: { type: String, default: void 0 },
|
|
@@ -11721,14 +11742,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11721
11742
|
});
|
|
11722
11743
|
const computedStyle = computed$2(() => {
|
|
11723
11744
|
const list = [];
|
|
11724
|
-
list.push(functions.
|
|
11745
|
+
list.push(functions.getlineBreakStyleContainer(props, windowWidth.value));
|
|
11725
11746
|
return list;
|
|
11726
11747
|
});
|
|
11727
11748
|
const computedStyleInput = computed$2(() => {
|
|
11728
11749
|
const list = [];
|
|
11729
|
-
if (props.width || !props.
|
|
11750
|
+
if (props.width || !props.lineBreak)
|
|
11730
11751
|
list.push({ width: props.width });
|
|
11731
|
-
list.push(functions.
|
|
11752
|
+
list.push(functions.getlineBreakStyle(props, windowWidth.value));
|
|
11732
11753
|
return list;
|
|
11733
11754
|
});
|
|
11734
11755
|
function setFocus() {
|
|
@@ -11786,7 +11807,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
11786
11807
|
};
|
|
11787
11808
|
}
|
|
11788
11809
|
});
|
|
11789
|
-
var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
11810
|
+
var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-77e1fa0a"]]);
|
|
11790
11811
|
var ckTable__headerItems_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
11791
11812
|
const _hoisted_1$d = { class: "ck-table__header-items" };
|
|
11792
11813
|
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
@@ -13791,7 +13812,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
13791
13812
|
bgTransparent: { type: Boolean, default: false },
|
|
13792
13813
|
disabled: { type: [Boolean, Number], default: false },
|
|
13793
13814
|
group: { type: String, default: "" },
|
|
13794
|
-
|
|
13815
|
+
lineBreak: { type: [String, Number], default: "" },
|
|
13795
13816
|
groupVertical: { type: String, default: "" },
|
|
13796
13817
|
label: { type: String, default: "" },
|
|
13797
13818
|
labelAlign: { type: String, default: "" }
|
|
@@ -13830,7 +13851,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
13830
13851
|
});
|
|
13831
13852
|
const computedStyleSelect = computed$2(() => {
|
|
13832
13853
|
const list = [];
|
|
13833
|
-
list.push(functions.
|
|
13854
|
+
list.push(functions.getlineBreakStyle(props, windowWidth.value));
|
|
13834
13855
|
return list;
|
|
13835
13856
|
});
|
|
13836
13857
|
const computedClass = computed$2(() => {
|
|
@@ -13842,7 +13863,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
13842
13863
|
const list = [];
|
|
13843
13864
|
if (props.minWidth)
|
|
13844
13865
|
list.push({ "min-width": props.minWidth });
|
|
13845
|
-
list.push(functions.
|
|
13866
|
+
list.push(functions.getlineBreakStyleContainer(props, windowWidth.value));
|
|
13846
13867
|
return list;
|
|
13847
13868
|
});
|
|
13848
13869
|
computed$2(() => {
|
|
@@ -13940,7 +13961,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
13940
13961
|
};
|
|
13941
13962
|
}
|
|
13942
13963
|
});
|
|
13943
|
-
var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
13964
|
+
var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-6217135d"]]);
|
|
13944
13965
|
var ckSwitch_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
13945
13966
|
const _withScopeId = (n) => (pushScopeId("data-v-b6a4dfaa"), n = n(), popScopeId(), n);
|
|
13946
13967
|
const _hoisted_1$3 = ["disabled"];
|
|
@@ -14055,7 +14076,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
14055
14076
|
label: { type: String, default: "" },
|
|
14056
14077
|
labelAlign: { type: String, default: "" },
|
|
14057
14078
|
group: { type: String, default: "" },
|
|
14058
|
-
|
|
14079
|
+
lineBreak: { type: [String, Number], default: "" },
|
|
14059
14080
|
groupVertical: { type: String, default: "" },
|
|
14060
14081
|
sameWidthOptions: { type: Boolean, default: false }
|
|
14061
14082
|
},
|
|
@@ -14114,7 +14135,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
14114
14135
|
};
|
|
14115
14136
|
}
|
|
14116
14137
|
});
|
|
14117
|
-
var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
14138
|
+
var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-55ea866f"]]);
|
|
14118
14139
|
var ckTextarea_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
14119
14140
|
const _hoisted_1$1 = { class: "ck-textarea" };
|
|
14120
14141
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -16781,33 +16802,31 @@ var components = /* @__PURE__ */ Object.freeze({
|
|
|
16781
16802
|
lockScroll,
|
|
16782
16803
|
unlockScroll
|
|
16783
16804
|
});
|
|
16784
|
-
function
|
|
16785
|
-
if (!options)
|
|
16786
|
-
return;
|
|
16805
|
+
function setRootColors(colors) {
|
|
16787
16806
|
var r = document.querySelector(":root");
|
|
16788
|
-
const
|
|
16789
|
-
|
|
16790
|
-
|
|
16791
|
-
|
|
16792
|
-
|
|
16793
|
-
|
|
16794
|
-
|
|
16795
|
-
|
|
16796
|
-
|
|
16797
|
-
|
|
16798
|
-
|
|
16799
|
-
|
|
16800
|
-
|
|
16801
|
-
|
|
16802
|
-
|
|
16803
|
-
|
|
16804
|
-
});
|
|
16807
|
+
for (const key in colors) {
|
|
16808
|
+
const colorValue = colors[key];
|
|
16809
|
+
r.style.setProperty(`--${key}`, colorValue);
|
|
16810
|
+
}
|
|
16811
|
+
}
|
|
16812
|
+
function getCleekOptions(userOptions) {
|
|
16813
|
+
console.log("userOptions", userOptions);
|
|
16814
|
+
const options = defaultCleekOptions;
|
|
16815
|
+
for (const category in defaultCleekOptions) {
|
|
16816
|
+
if (userOptions[category]) {
|
|
16817
|
+
for (const key in category) {
|
|
16818
|
+
const value = userOptions[category][key];
|
|
16819
|
+
if (value)
|
|
16820
|
+
options[category][key] = value;
|
|
16821
|
+
}
|
|
16822
|
+
}
|
|
16805
16823
|
}
|
|
16824
|
+
setRootColors(options);
|
|
16825
|
+
console.log("options", options);
|
|
16826
|
+
return options;
|
|
16806
16827
|
}
|
|
16807
16828
|
const install = function installCleek(app, options) {
|
|
16808
|
-
app.config.globalProperties.$cleekOptions = options;
|
|
16809
|
-
console.log("arranco paquete", options);
|
|
16810
|
-
setDefaultColors(options);
|
|
16829
|
+
app.config.globalProperties.$cleekOptions = getCleekOptions(options);
|
|
16811
16830
|
Object.entries(components).forEach(([componentName, component]) => {
|
|
16812
16831
|
app.component(componentName, component);
|
|
16813
16832
|
});
|