cleek 2.4.24 → 2.4.25

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
@@ -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, onMounted, onBeforeUnmount, getCurrentInstance, withDirectives, isRef as isRef$1, vModelDynamic, renderList, withModifiers, vModelRadio, vModelSelect, vModelCheckbox, vModelText, Teleport } from "vue";
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
  }
@@ -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", { "ck-dropdown__popper--dark": __props.dark }]),
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-ba11ff8e"]]);
18840
+ var ckDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-6bb2e656"]]);
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: {