cleek 2.4.24 → 2.4.27
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 +123 -105
- package/dist/cleek.umd.js +8 -8
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/cleek.es.js
CHANGED
|
@@ -29,7 +29,7 @@ var __objRest = (source2, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { pushScopeId, popScopeId, defineComponent, nextTick as nextTick$1, openBlock, createBlock, withScopeId, resolveComponent, createElementBlock, normalizeClass, normalizeStyle, withKeys, createElementVNode, Fragment, renderSlot, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h, toDisplayString, computed as computed$2, unref as unref$1, createTextVNode, watch,
|
|
32
|
+
import { pushScopeId, popScopeId, defineComponent, nextTick as nextTick$1, openBlock, createBlock, withScopeId, resolveComponent, createElementBlock, normalizeClass, normalizeStyle, withKeys, createElementVNode, Fragment, renderSlot, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h, toDisplayString, computed as computed$2, onMounted, getCurrentInstance, unref as unref$1, createTextVNode, watch, onBeforeUnmount, withDirectives, isRef as isRef$1, vModelDynamic, renderList, withModifiers, vModelRadio, vModelSelect, vModelCheckbox, vModelText, Teleport } from "vue";
|
|
33
33
|
function getBasePlacement(placement) {
|
|
34
34
|
return placement.split("-")[0];
|
|
35
35
|
}
|
|
@@ -2339,10 +2339,10 @@ const _hoisted_2$1$1 = {
|
|
|
2339
2339
|
class: "v-popper__inner"
|
|
2340
2340
|
};
|
|
2341
2341
|
const _hoisted_3$8 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-outer" }, null, -1);
|
|
2342
|
-
const _hoisted_4$
|
|
2342
|
+
const _hoisted_4$7 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-inner" }, null, -1);
|
|
2343
2343
|
const _hoisted_5$3 = [
|
|
2344
2344
|
_hoisted_3$8,
|
|
2345
|
-
_hoisted_4$
|
|
2345
|
+
_hoisted_4$7
|
|
2346
2346
|
];
|
|
2347
2347
|
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2348
2348
|
const _component_ResizeObserver = resolveComponent("ResizeObserver");
|
|
@@ -18684,6 +18684,80 @@ var _iconsCache = {
|
|
|
18684
18684
|
faZhihu
|
|
18685
18685
|
};
|
|
18686
18686
|
var style = "";
|
|
18687
|
+
var hooks8 = {
|
|
18688
|
+
getCleekOptions(getCurrentInstance2) {
|
|
18689
|
+
return getCurrentInstance2().appContext.app.config.globalProperties.$cleekOptions;
|
|
18690
|
+
},
|
|
18691
|
+
getGroupClass({
|
|
18692
|
+
group,
|
|
18693
|
+
groupVertical,
|
|
18694
|
+
widthBreaks = []
|
|
18695
|
+
} = {}, windowWidth) {
|
|
18696
|
+
const componentWidth = this.getWidthByWidthBreaks(widthBreaks, windowWidth);
|
|
18697
|
+
const classList2 = [];
|
|
18698
|
+
if (group && componentWidth !== "100%")
|
|
18699
|
+
classList2.push(`ck-component__group--${group}`);
|
|
18700
|
+
if (groupVertical)
|
|
18701
|
+
classList2.push(`ck-component__group-vertical--${groupVertical}`);
|
|
18702
|
+
return classList2;
|
|
18703
|
+
},
|
|
18704
|
+
getWidthByWidthBreaks(widthBreaks, windowWidth) {
|
|
18705
|
+
if (widthBreaks) {
|
|
18706
|
+
let realWidthBreaks = [...widthBreaks];
|
|
18707
|
+
if (realWidthBreaks.length === 2 && typeof realWidthBreaks[0] === "number" && typeof realWidthBreaks[1] === "string") {
|
|
18708
|
+
realWidthBreaks = [realWidthBreaks];
|
|
18709
|
+
}
|
|
18710
|
+
if (realWidthBreaks.length) {
|
|
18711
|
+
const first = realWidthBreaks[0];
|
|
18712
|
+
if (first[0] !== 0) {
|
|
18713
|
+
realWidthBreaks.unshift([0, "100%"]);
|
|
18714
|
+
}
|
|
18715
|
+
}
|
|
18716
|
+
let finalWidth = "";
|
|
18717
|
+
realWidthBreaks.forEach((widthBreak) => {
|
|
18718
|
+
const [windowBreak, width] = widthBreak;
|
|
18719
|
+
if ((windowWidth || 0) >= windowBreak) {
|
|
18720
|
+
finalWidth = width;
|
|
18721
|
+
}
|
|
18722
|
+
});
|
|
18723
|
+
return finalWidth;
|
|
18724
|
+
}
|
|
18725
|
+
},
|
|
18726
|
+
isColorTemplateVariable(color) {
|
|
18727
|
+
if (color === "primary")
|
|
18728
|
+
return true;
|
|
18729
|
+
if (color === "secondary")
|
|
18730
|
+
return true;
|
|
18731
|
+
if (color === "success")
|
|
18732
|
+
return true;
|
|
18733
|
+
if (color === "warning")
|
|
18734
|
+
return true;
|
|
18735
|
+
if (color === "danger")
|
|
18736
|
+
return true;
|
|
18737
|
+
if (color === "dark")
|
|
18738
|
+
return true;
|
|
18739
|
+
if (color === "light")
|
|
18740
|
+
return true;
|
|
18741
|
+
return false;
|
|
18742
|
+
},
|
|
18743
|
+
isColumnDisplayed(column) {
|
|
18744
|
+
if (column.isDisplayed === false)
|
|
18745
|
+
return false;
|
|
18746
|
+
if (column.unchangeable) {
|
|
18747
|
+
if (column.isDisplayed === true)
|
|
18748
|
+
return true;
|
|
18749
|
+
return false;
|
|
18750
|
+
}
|
|
18751
|
+
return true;
|
|
18752
|
+
},
|
|
18753
|
+
preventUnusedError(functions2) {
|
|
18754
|
+
if (Math.random() === 1) {
|
|
18755
|
+
functions2.forEach((func) => {
|
|
18756
|
+
console.log(func);
|
|
18757
|
+
});
|
|
18758
|
+
}
|
|
18759
|
+
}
|
|
18760
|
+
};
|
|
18687
18761
|
var ckDropdown_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
18688
18762
|
var _export_sfc = (sfc, props) => {
|
|
18689
18763
|
const target = sfc.__vccOpts || sfc;
|
|
@@ -18696,10 +18770,12 @@ const _hoisted_1$l = { class: "ck-dropdown__popper-container" };
|
|
|
18696
18770
|
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
18697
18771
|
props: {
|
|
18698
18772
|
dark: { type: Boolean },
|
|
18699
|
-
align: null
|
|
18773
|
+
align: null,
|
|
18774
|
+
layout: null
|
|
18700
18775
|
},
|
|
18701
18776
|
setup(__props) {
|
|
18702
18777
|
const props = __props;
|
|
18778
|
+
let cleekOptions2 = ref();
|
|
18703
18779
|
const isOpen = ref(false);
|
|
18704
18780
|
const popperRef = ref(null);
|
|
18705
18781
|
const computedClass = computed$2(() => {
|
|
@@ -18708,6 +18784,16 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
18708
18784
|
list.push(`align-${props.align}`);
|
|
18709
18785
|
return list;
|
|
18710
18786
|
});
|
|
18787
|
+
const computedClassPopper = computed$2(() => {
|
|
18788
|
+
var _a;
|
|
18789
|
+
const list = [];
|
|
18790
|
+
if (props.dark)
|
|
18791
|
+
list.push("ck-dropdown__popper--dark");
|
|
18792
|
+
const layout = props.layout || ((_a = cleekOptions2.value) == null ? void 0 : _a.styles.layout);
|
|
18793
|
+
if (layout)
|
|
18794
|
+
list.push(`layout--${layout}`);
|
|
18795
|
+
return list;
|
|
18796
|
+
});
|
|
18711
18797
|
function openClose() {
|
|
18712
18798
|
if (isOpen.value)
|
|
18713
18799
|
return;
|
|
@@ -18721,6 +18807,9 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
18721
18807
|
});
|
|
18722
18808
|
isOpen.value = true;
|
|
18723
18809
|
}
|
|
18810
|
+
onMounted(() => {
|
|
18811
|
+
cleekOptions2.value = hooks8.getCleekOptions(getCurrentInstance);
|
|
18812
|
+
});
|
|
18724
18813
|
return (_ctx, _cache) => {
|
|
18725
18814
|
return openBlock(), createElementBlock("div", {
|
|
18726
18815
|
class: normalizeClass(["ck-dropdown", unref$1(computedClass)])
|
|
@@ -18734,7 +18823,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
18734
18823
|
createElementVNode("div", _hoisted_1$l, [
|
|
18735
18824
|
isOpen.value ? (openBlock(), createElementBlock("section", {
|
|
18736
18825
|
key: 0,
|
|
18737
|
-
class: normalizeClass(["ck-dropdown__popper",
|
|
18826
|
+
class: normalizeClass(["ck-dropdown__popper", unref$1(computedClassPopper)]),
|
|
18738
18827
|
ref_key: "popperRef",
|
|
18739
18828
|
ref: popperRef
|
|
18740
18829
|
}, [
|
|
@@ -18748,7 +18837,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
18748
18837
|
};
|
|
18749
18838
|
}
|
|
18750
18839
|
});
|
|
18751
|
-
var ckDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-
|
|
18840
|
+
var ckDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-53ec1f50"]]);
|
|
18752
18841
|
var ckNavbar_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
18753
18842
|
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
18754
18843
|
props: {
|
|
@@ -18797,80 +18886,6 @@ function render2(_ctx, _cache) {
|
|
|
18797
18886
|
var ckTr_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
18798
18887
|
const _sfc_main$o = {};
|
|
18799
18888
|
var CkTr = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", render2], ["__scopeId", "data-v-519cf874"]]);
|
|
18800
|
-
var hooks8 = {
|
|
18801
|
-
getCleekOptions(getCurrentInstance2) {
|
|
18802
|
-
return getCurrentInstance2().appContext.app.config.globalProperties.$cleekOptions;
|
|
18803
|
-
},
|
|
18804
|
-
getGroupClass({
|
|
18805
|
-
group,
|
|
18806
|
-
groupVertical,
|
|
18807
|
-
widthBreaks = []
|
|
18808
|
-
} = {}, windowWidth) {
|
|
18809
|
-
const componentWidth = this.getWidthByWidthBreaks(widthBreaks, windowWidth);
|
|
18810
|
-
const classList2 = [];
|
|
18811
|
-
if (group && componentWidth !== "100%")
|
|
18812
|
-
classList2.push(`ck-component__group--${group}`);
|
|
18813
|
-
if (groupVertical)
|
|
18814
|
-
classList2.push(`ck-component__group-vertical--${groupVertical}`);
|
|
18815
|
-
return classList2;
|
|
18816
|
-
},
|
|
18817
|
-
getWidthByWidthBreaks(widthBreaks, windowWidth) {
|
|
18818
|
-
if (widthBreaks) {
|
|
18819
|
-
let realWidthBreaks = [...widthBreaks];
|
|
18820
|
-
if (realWidthBreaks.length === 2 && typeof realWidthBreaks[0] === "number" && typeof realWidthBreaks[1] === "string") {
|
|
18821
|
-
realWidthBreaks = [realWidthBreaks];
|
|
18822
|
-
}
|
|
18823
|
-
if (realWidthBreaks.length) {
|
|
18824
|
-
const first = realWidthBreaks[0];
|
|
18825
|
-
if (first[0] !== 0) {
|
|
18826
|
-
realWidthBreaks.unshift([0, "100%"]);
|
|
18827
|
-
}
|
|
18828
|
-
}
|
|
18829
|
-
let finalWidth = "";
|
|
18830
|
-
realWidthBreaks.forEach((widthBreak) => {
|
|
18831
|
-
const [windowBreak, width] = widthBreak;
|
|
18832
|
-
if ((windowWidth || 0) >= windowBreak) {
|
|
18833
|
-
finalWidth = width;
|
|
18834
|
-
}
|
|
18835
|
-
});
|
|
18836
|
-
return finalWidth;
|
|
18837
|
-
}
|
|
18838
|
-
},
|
|
18839
|
-
isColorTemplateVariable(color) {
|
|
18840
|
-
if (color === "primary")
|
|
18841
|
-
return true;
|
|
18842
|
-
if (color === "secondary")
|
|
18843
|
-
return true;
|
|
18844
|
-
if (color === "success")
|
|
18845
|
-
return true;
|
|
18846
|
-
if (color === "warning")
|
|
18847
|
-
return true;
|
|
18848
|
-
if (color === "danger")
|
|
18849
|
-
return true;
|
|
18850
|
-
if (color === "dark")
|
|
18851
|
-
return true;
|
|
18852
|
-
if (color === "light")
|
|
18853
|
-
return true;
|
|
18854
|
-
return false;
|
|
18855
|
-
},
|
|
18856
|
-
isColumnDisplayed(column) {
|
|
18857
|
-
if (column.isDisplayed === false)
|
|
18858
|
-
return false;
|
|
18859
|
-
if (column.unchangeable) {
|
|
18860
|
-
if (column.isDisplayed === true)
|
|
18861
|
-
return true;
|
|
18862
|
-
return false;
|
|
18863
|
-
}
|
|
18864
|
-
return true;
|
|
18865
|
-
},
|
|
18866
|
-
preventUnusedError(functions2) {
|
|
18867
|
-
if (Math.random() === 1) {
|
|
18868
|
-
functions2.forEach((func) => {
|
|
18869
|
-
console.log(func);
|
|
18870
|
-
});
|
|
18871
|
-
}
|
|
18872
|
-
}
|
|
18873
|
-
};
|
|
18874
18889
|
var ckTd_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
18875
18890
|
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
18876
18891
|
props: {
|
|
@@ -21302,8 +21317,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
21302
21317
|
var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-76d9dde9"]]);
|
|
21303
21318
|
var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
21304
21319
|
const _hoisted_1$e = { class: "ck-table__pagination" };
|
|
21305
|
-
const _hoisted_2$a =
|
|
21320
|
+
const _hoisted_2$a = { class: "ck-table__pagination--numbers-container" };
|
|
21306
21321
|
const _hoisted_3$7 = ["onClick"];
|
|
21322
|
+
const _hoisted_4$6 = ["onClick"];
|
|
21307
21323
|
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
21308
21324
|
props: {
|
|
21309
21325
|
currentPage: null,
|
|
@@ -21380,7 +21396,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
21380
21396
|
return (_ctx, _cache) => {
|
|
21381
21397
|
return __props.currentPage && unref$1(totalPages) > 1 ? (openBlock(), createElementBlock("div", {
|
|
21382
21398
|
key: 0,
|
|
21383
|
-
class: normalizeClass(["ck-table__pagination-container", `pagination-align--${__props.align}`])
|
|
21399
|
+
class: normalizeClass(["ck-table__pagination-container", `pagination-align--${__props.align || "center"}`])
|
|
21384
21400
|
}, [
|
|
21385
21401
|
createElementVNode("div", _hoisted_1$e, [
|
|
21386
21402
|
unref$1(hasArrowLeft) ? (openBlock(), createElementBlock("div", {
|
|
@@ -21390,28 +21406,30 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
21390
21406
|
}, [
|
|
21391
21407
|
createVNode(CkIcon, { icon: "arrow-left" })
|
|
21392
21408
|
])) : createCommentVNode("", true),
|
|
21393
|
-
(
|
|
21394
|
-
|
|
21395
|
-
|
|
21396
|
-
|
|
21397
|
-
|
|
21398
|
-
|
|
21399
|
-
|
|
21400
|
-
|
|
21401
|
-
|
|
21402
|
-
|
|
21403
|
-
|
|
21404
|
-
|
|
21405
|
-
|
|
21406
|
-
|
|
21407
|
-
|
|
21408
|
-
|
|
21409
|
-
|
|
21410
|
-
|
|
21411
|
-
|
|
21412
|
-
|
|
21413
|
-
|
|
21414
|
-
|
|
21409
|
+
createElementVNode("div", _hoisted_2$a, [
|
|
21410
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(listLeft), (num) => {
|
|
21411
|
+
return openBlock(), createElementBlock("div", {
|
|
21412
|
+
class: "ck-table__pagination-item pagination-item__left",
|
|
21413
|
+
onClick: ($event) => updateCurrentPage(num)
|
|
21414
|
+
}, toDisplayString(num), 9, _hoisted_3$7);
|
|
21415
|
+
}), 256)),
|
|
21416
|
+
createVNode(CkInput, {
|
|
21417
|
+
class: "ck-table__pagination-input",
|
|
21418
|
+
autoSelect: "",
|
|
21419
|
+
type: "number",
|
|
21420
|
+
width: "50px",
|
|
21421
|
+
align: "center",
|
|
21422
|
+
modelValue: unref$1(currentPageLocal2),
|
|
21423
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef$1(currentPageLocal2) ? currentPageLocal2.value = $event : null),
|
|
21424
|
+
onChange: _cache[2] || (_cache[2] = ($event) => validateInputNumber($event.target.value))
|
|
21425
|
+
}, null, 8, ["modelValue"]),
|
|
21426
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(listRight), (num) => {
|
|
21427
|
+
return openBlock(), createElementBlock("div", {
|
|
21428
|
+
class: "ck-table__pagination-item pagination-item__right",
|
|
21429
|
+
onClick: ($event) => updateCurrentPage(num)
|
|
21430
|
+
}, toDisplayString(num), 9, _hoisted_4$6);
|
|
21431
|
+
}), 256))
|
|
21432
|
+
]),
|
|
21415
21433
|
unref$1(hasArrowRight) ? (openBlock(), createElementBlock("div", {
|
|
21416
21434
|
key: 1,
|
|
21417
21435
|
class: "ck-table__pagination--arrow-right",
|
|
@@ -21424,7 +21442,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
21424
21442
|
};
|
|
21425
21443
|
}
|
|
21426
21444
|
});
|
|
21427
|
-
var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-
|
|
21445
|
+
var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-11bbd8e0"]]);
|
|
21428
21446
|
const EMPTY_OBJ = {};
|
|
21429
21447
|
const NOOP = () => {
|
|
21430
21448
|
};
|