cleek 2.1.23 → 2.2.2

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, 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, getCurrentInstance, nextTick as nextTick$1, onBeforeUnmount, withDirectives, isRef as isRef$1, vModelDynamic, Fragment, renderList, mergeProps, withKeys, withModifiers, pushScopeId, popScopeId, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
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
21
  var ckDropdown_vue_vue_type_style_index_0_scoped_true_lang = "";
22
22
  var _export_sfc = (sfc, props) => {
23
23
  const target = sfc.__vccOpts || sfc;
@@ -11518,6 +11518,24 @@ var functions = {
11518
11518
  return getCurrentInstance2().appContext.app.config.globalProperties.$cleekOptions;
11519
11519
  }
11520
11520
  };
11521
+ function useWindowWidth() {
11522
+ const windowWidth = ref(0);
11523
+ function handleWindowResize(event) {
11524
+ windowWidth.value = event.currentTarget.innerWidth;
11525
+ }
11526
+ onMounted(() => {
11527
+ nextTick$1(() => {
11528
+ window.addEventListener("resize", handleWindowResize);
11529
+ });
11530
+ windowWidth.value = window.innerWidth;
11531
+ });
11532
+ onBeforeUnmount(() => {
11533
+ window.removeEventListener("resize", handleWindowResize);
11534
+ });
11535
+ return {
11536
+ windowWidth
11537
+ };
11538
+ }
11521
11539
  var ckButton_vue_vue_type_style_index_0_scoped_true_lang = "";
11522
11540
  const _hoisted_1$g = ["title", "aria-label", "disabled"];
11523
11541
  const _sfc_main$h = /* @__PURE__ */ defineComponent({
@@ -11528,18 +11546,20 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11528
11546
  color: { type: String, default: "primary" },
11529
11547
  align: { type: String, default: "left", validator: validators.align },
11530
11548
  size: { type: String, default: "m", validator: validators.size },
11549
+ width: { type: String, default: "" },
11531
11550
  icon: { type: [String, Array], default: void 0 },
11532
11551
  iconPack: { type: String, default: void 0 },
11533
11552
  iconRight: { type: String, default: void 0 },
11534
11553
  label: { type: String, default: void 0 },
11535
11554
  labelAlign: { type: String, default: void 0 },
11536
11555
  group: { type: String, default: void 0, validator: validators.group },
11537
- groupBreak: { type: String, default: "s" },
11556
+ groupBreak: { type: String, default: "" },
11538
11557
  groupVertical: { type: String, default: void 0, validator: validators.groupVertical }
11539
11558
  },
11540
11559
  emits: ["click"],
11541
11560
  setup(__props, { emit: emits }) {
11542
11561
  const props = __props;
11562
+ const { windowWidth } = useWindowWidth();
11543
11563
  const isMounted = ref(false);
11544
11564
  const computedClass = computed$2(() => {
11545
11565
  const classList2 = [];
@@ -11551,7 +11571,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11551
11571
  classList2.push(`ck-component__border-color--${props.color}`);
11552
11572
  }
11553
11573
  }
11554
- if (props.align !== "left") {
11574
+ if (props.align === "center" || props.align === "right") {
11555
11575
  classList2.push(`ck-button__align--${props.align}`);
11556
11576
  }
11557
11577
  if (isMounted.value)
@@ -11564,6 +11584,13 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11564
11584
  classList2.push(`rs-component-size__${props.size}`);
11565
11585
  return classList2;
11566
11586
  });
11587
+ const computedStyle = computed$2(() => {
11588
+ const list = [];
11589
+ if (props.width && !props.groupBreak)
11590
+ list.push({ width: props.width });
11591
+ list.push(functions.getGroupBreakStyle(props, windowWidth.value));
11592
+ return list;
11593
+ });
11567
11594
  function onClick(event) {
11568
11595
  emits("click", event);
11569
11596
  }
@@ -11578,6 +11605,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11578
11605
  title: __props.title,
11579
11606
  "aria-label": __props.title,
11580
11607
  disabled: __props.disabled,
11608
+ style: normalizeStyle(unref$1(computedStyle)),
11581
11609
  onClick: _cache[0] || (_cache[0] = ($event) => onClick($event))
11582
11610
  }, [
11583
11611
  __props.icon ? (openBlock(), createBlock(ckIcon, {
@@ -11593,11 +11621,11 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
11593
11621
  icon: __props.iconRight,
11594
11622
  "icon-pack": __props.iconPack
11595
11623
  }, null, 8, ["icon", "icon-pack"])) : createCommentVNode("", true)
11596
- ], 10, _hoisted_1$g);
11624
+ ], 14, _hoisted_1$g);
11597
11625
  };
11598
11626
  }
11599
11627
  });
11600
- var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-0641f9bc"]]);
11628
+ var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-0b00645e"]]);
11601
11629
  var ckLabel_vue_vue_type_style_index_0_scoped_true_lang = "";
11602
11630
  const _hoisted_1$f = ["for"];
11603
11631
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
@@ -11626,24 +11654,6 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11626
11654
  }
11627
11655
  });
11628
11656
  var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-ef74ea02"]]);
11629
- function useWindowWidth() {
11630
- const windowWidth = ref(0);
11631
- function handleWindowResize(event) {
11632
- windowWidth.value = event.currentTarget.innerWidth;
11633
- }
11634
- onMounted(() => {
11635
- nextTick$1(() => {
11636
- window.addEventListener("resize", handleWindowResize);
11637
- });
11638
- windowWidth.value = window.innerWidth;
11639
- });
11640
- onBeforeUnmount(() => {
11641
- window.removeEventListener("resize", handleWindowResize);
11642
- });
11643
- return {
11644
- windowWidth
11645
- };
11646
- }
11647
11657
  var ckInput_vue_vue_type_style_index_0_scoped_true_lang = "";
11648
11658
  const _hoisted_1$e = ["autocomplete", "type", "placeholder", "disabled"];
11649
11659
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
@@ -11716,9 +11726,9 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11716
11726
  });
11717
11727
  const computedStyleInput = computed$2(() => {
11718
11728
  const list = [];
11719
- list.push(functions.getGroupBreakStyle(props, windowWidth.value));
11720
- if (props.width)
11729
+ if (props.width || !props.groupBreak)
11721
11730
  list.push({ width: props.width });
11731
+ list.push(functions.getGroupBreakStyle(props, windowWidth.value));
11722
11732
  return list;
11723
11733
  });
11724
11734
  function setFocus() {
@@ -11776,7 +11786,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
11776
11786
  };
11777
11787
  }
11778
11788
  });
11779
- var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-459e2aaf"]]);
11789
+ var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-55495d02"]]);
11780
11790
  var ckTable__headerItems_vue_vue_type_style_index_0_scoped_true_lang = "";
11781
11791
  const _hoisted_1$d = { class: "ck-table__header-items" };
11782
11792
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
@@ -13787,9 +13797,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13787
13797
  labelAlign: { type: String, default: "" }
13788
13798
  },
13789
13799
  emits: ["update:modelValue", "click", "change"],
13790
- setup(__props, { emit: emits }) {
13800
+ setup(__props, { expose, emit: emits }) {
13791
13801
  const props = __props;
13792
13802
  const { qmStr: qmStr2 } = main$1;
13803
+ const { windowWidth } = useWindowWidth();
13804
+ expose({
13805
+ setFocus
13806
+ });
13793
13807
  const search = ref("");
13794
13808
  ref(null);
13795
13809
  const value = computed$2({
@@ -13809,15 +13823,26 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13809
13823
  });
13810
13824
  return list;
13811
13825
  });
13812
- const computedClass = computed$2(() => {
13826
+ const computedClassSelect = computed$2(() => {
13813
13827
  const classList2 = [];
13814
13828
  classList2.push(functions.getGroupClass(props));
13815
13829
  return classList2;
13816
13830
  });
13831
+ const computedStyleSelect = computed$2(() => {
13832
+ const list = [];
13833
+ list.push(functions.getGroupBreakStyle(props, windowWidth.value));
13834
+ return list;
13835
+ });
13836
+ const computedClass = computed$2(() => {
13837
+ const classList2 = [];
13838
+ classList2.push(functions.getGroupClassContainer(props));
13839
+ return classList2;
13840
+ });
13817
13841
  const computedStyle = computed$2(() => {
13818
13842
  const list = [];
13819
13843
  if (props.minWidth)
13820
13844
  list.push({ "min-width": props.minWidth });
13845
+ list.push(functions.getGroupBreakStyleContainer(props, windowWidth.value));
13821
13846
  return list;
13822
13847
  });
13823
13848
  computed$2(() => {
@@ -13862,25 +13887,27 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13862
13887
  function onClick(event) {
13863
13888
  emits("click", event);
13864
13889
  }
13865
- const onChange = (event) => {
13890
+ function onChange(event) {
13866
13891
  emits("change", event);
13867
- };
13868
- const getOptionKey = (option) => {
13892
+ }
13893
+ function getOptionKey(option) {
13869
13894
  return realReduceFunction(option);
13870
- };
13871
- const getOptionName = (option) => {
13895
+ }
13896
+ function getOptionName(option) {
13872
13897
  if (!props.prop)
13873
13898
  return option;
13874
13899
  return option[props.prop];
13875
- };
13876
- const realReduceFunction = (option) => {
13900
+ }
13901
+ function realReduceFunction(option) {
13877
13902
  if (props.notReduce)
13878
13903
  return option;
13879
13904
  return props.reduceFunction(option);
13880
- };
13905
+ }
13906
+ function setFocus() {
13907
+ }
13881
13908
  return (_ctx, _cache) => {
13882
13909
  return openBlock(), createElementBlock("div", {
13883
- class: "ck-select",
13910
+ class: normalizeClass(["ck-select", unref$1(computedClass)]),
13884
13911
  style: normalizeStyle(unref$1(computedStyle))
13885
13912
  }, [
13886
13913
  __props.label ? (openBlock(), createBlock(ckLabel, {
@@ -13895,7 +13922,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13895
13922
  }, 8, ["align"])) : createCommentVNode("", true),
13896
13923
  withDirectives(createElementVNode("select", {
13897
13924
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef$1(value) ? value.value = $event : null),
13898
- class: normalizeClass(unref$1(computedClass)),
13925
+ class: normalizeClass(unref$1(computedClassSelect)),
13926
+ style: normalizeStyle(unref$1(computedStyleSelect)),
13899
13927
  onClick: _cache[1] || (_cache[1] = ($event) => onClick($event)),
13900
13928
  onChange: _cache[2] || (_cache[2] = ($event) => onChange($event))
13901
13929
  }, [
@@ -13905,14 +13933,14 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13905
13933
  key: option
13906
13934
  }, toDisplayString(getOptionName(option)), 9, _hoisted_1$4);
13907
13935
  }), 128))
13908
- ], 34), [
13936
+ ], 38), [
13909
13937
  [vModelSelect, unref$1(value)]
13910
13938
  ])
13911
- ], 4);
13939
+ ], 6);
13912
13940
  };
13913
13941
  }
13914
13942
  });
13915
- var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-31af160a"]]);
13943
+ var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-66f00b4a"]]);
13916
13944
  var ckSwitch_vue_vue_type_style_index_0_scoped_true_lang = "";
13917
13945
  const _withScopeId = (n) => (pushScopeId("data-v-b6a4dfaa"), n = n(), popScopeId(), n);
13918
13946
  const _hoisted_1$3 = ["disabled"];
@@ -14027,7 +14055,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14027
14055
  label: { type: String, default: "" },
14028
14056
  labelAlign: { type: String, default: "" },
14029
14057
  group: { type: String, default: "" },
14030
- groupBreak: { type: String, default: "s" },
14058
+ groupBreak: { type: String, default: "" },
14031
14059
  groupVertical: { type: String, default: "" },
14032
14060
  sameWidthOptions: { type: Boolean, default: false }
14033
14061
  },
@@ -14086,7 +14114,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
14086
14114
  };
14087
14115
  }
14088
14116
  });
14089
- var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-2c3e07c8"]]);
14117
+ var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b49d8f8e"]]);
14090
14118
  var ckTextarea_vue_vue_type_style_index_0_scoped_true_lang = "";
14091
14119
  const _hoisted_1$1 = { class: "ck-textarea" };
14092
14120
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({