cleek 2.4.19 → 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.
@@ -1,3 +1,5 @@
1
+ .nowrap
2
+ white-space nowrap
1
3
  .w-half
2
4
  width 50%
3
5
  .help-text
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
  }
@@ -2904,7 +2904,9 @@ const cleekOptions = {
2904
2904
  popup: {
2905
2905
  textColor: "",
2906
2906
  headerAlign: "",
2907
- headerColor: ""
2907
+ headerColor: "",
2908
+ acceptBtnType: "",
2909
+ cancelBtnType: ""
2908
2910
  },
2909
2911
  styles: {
2910
2912
  layout: "base",
@@ -18682,6 +18684,80 @@ var _iconsCache = {
18682
18684
  faZhihu
18683
18685
  };
18684
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
+ };
18685
18761
  var ckDropdown_vue_vue_type_style_index_0_scoped_true_lang = "";
18686
18762
  var _export_sfc = (sfc, props) => {
18687
18763
  const target = sfc.__vccOpts || sfc;
@@ -18694,10 +18770,12 @@ const _hoisted_1$l = { class: "ck-dropdown__popper-container" };
18694
18770
  const _sfc_main$q = /* @__PURE__ */ defineComponent({
18695
18771
  props: {
18696
18772
  dark: { type: Boolean },
18697
- align: null
18773
+ align: null,
18774
+ layout: null
18698
18775
  },
18699
18776
  setup(__props) {
18700
18777
  const props = __props;
18778
+ let cleekOptions2 = ref();
18701
18779
  const isOpen = ref(false);
18702
18780
  const popperRef = ref(null);
18703
18781
  const computedClass = computed$2(() => {
@@ -18706,6 +18784,16 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
18706
18784
  list.push(`align-${props.align}`);
18707
18785
  return list;
18708
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
+ });
18709
18797
  function openClose() {
18710
18798
  if (isOpen.value)
18711
18799
  return;
@@ -18719,6 +18807,9 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
18719
18807
  });
18720
18808
  isOpen.value = true;
18721
18809
  }
18810
+ onMounted(() => {
18811
+ cleekOptions2.value = hooks8.getCleekOptions(getCurrentInstance);
18812
+ });
18722
18813
  return (_ctx, _cache) => {
18723
18814
  return openBlock(), createElementBlock("div", {
18724
18815
  class: normalizeClass(["ck-dropdown", unref$1(computedClass)])
@@ -18732,7 +18823,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
18732
18823
  createElementVNode("div", _hoisted_1$l, [
18733
18824
  isOpen.value ? (openBlock(), createElementBlock("section", {
18734
18825
  key: 0,
18735
- class: normalizeClass(["ck-dropdown__popper", { "ck-dropdown__popper--dark": __props.dark }]),
18826
+ class: normalizeClass(["ck-dropdown__popper", unref$1(computedClassPopper)]),
18736
18827
  ref_key: "popperRef",
18737
18828
  ref: popperRef
18738
18829
  }, [
@@ -18746,7 +18837,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
18746
18837
  };
18747
18838
  }
18748
18839
  });
18749
- 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"]]);
18750
18841
  var ckNavbar_vue_vue_type_style_index_0_scoped_true_lang = "";
18751
18842
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
18752
18843
  props: {
@@ -18795,74 +18886,6 @@ function render2(_ctx, _cache) {
18795
18886
  var ckTr_vue_vue_type_style_index_0_scoped_true_lang = "";
18796
18887
  const _sfc_main$o = {};
18797
18888
  var CkTr = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", render2], ["__scopeId", "data-v-519cf874"]]);
18798
- var hooks8 = {
18799
- getCleekOptions(getCurrentInstance2) {
18800
- return getCurrentInstance2().appContext.app.config.globalProperties.$cleekOptions;
18801
- },
18802
- getGroupClass({
18803
- group,
18804
- groupVertical,
18805
- widthBreaks = []
18806
- } = {}, windowWidth) {
18807
- const componentWidth = this.getWidthByWidthBreaks(widthBreaks, windowWidth);
18808
- const classList2 = [];
18809
- if (group && componentWidth !== "100%")
18810
- classList2.push(`ck-component__group--${group}`);
18811
- if (groupVertical)
18812
- classList2.push(`ck-component__group-vertical--${groupVertical}`);
18813
- return classList2;
18814
- },
18815
- getWidthByWidthBreaks(widthBreaks, windowWidth) {
18816
- if (widthBreaks) {
18817
- let realWidthBreaks = [...widthBreaks];
18818
- if (realWidthBreaks.length === 2 && typeof realWidthBreaks[0] === "number" && typeof realWidthBreaks[1] === "string") {
18819
- realWidthBreaks = [realWidthBreaks];
18820
- }
18821
- let finalWidth = "";
18822
- realWidthBreaks.forEach((widthBreak) => {
18823
- const [windowBreak, width] = widthBreak;
18824
- if ((windowWidth || 0) >= windowBreak) {
18825
- finalWidth = width;
18826
- }
18827
- });
18828
- return finalWidth;
18829
- }
18830
- },
18831
- isColorTemplateVariable(color) {
18832
- if (color === "primary")
18833
- return true;
18834
- if (color === "secondary")
18835
- return true;
18836
- if (color === "success")
18837
- return true;
18838
- if (color === "warning")
18839
- return true;
18840
- if (color === "danger")
18841
- return true;
18842
- if (color === "dark")
18843
- return true;
18844
- if (color === "light")
18845
- return true;
18846
- return false;
18847
- },
18848
- isColumnDisplayed(column) {
18849
- if (column.isDisplayed === false)
18850
- return false;
18851
- if (column.unchangeable) {
18852
- if (column.isDisplayed === true)
18853
- return true;
18854
- return false;
18855
- }
18856
- return true;
18857
- },
18858
- preventUnusedError(functions2) {
18859
- if (Math.random() === 1) {
18860
- functions2.forEach((func) => {
18861
- console.log(func);
18862
- });
18863
- }
18864
- }
18865
- };
18866
18889
  var ckTd_vue_vue_type_style_index_0_scoped_true_lang = "";
18867
18890
  const _sfc_main$n = /* @__PURE__ */ defineComponent({
18868
18891
  props: {
@@ -22272,15 +22295,17 @@ const _hoisted_6$2 = {
22272
22295
  key: 0,
22273
22296
  class: "ck-popup-slot-footer__confirm-buttons"
22274
22297
  };
22275
- const _hoisted_7 = /* @__PURE__ */ createTextVNode("Cancelar");
22276
- const _hoisted_8 = /* @__PURE__ */ createTextVNode("Aceptar");
22277
22298
  const _sfc_main$d = /* @__PURE__ */ defineComponent({
22278
22299
  props: {
22279
22300
  modelValue: { type: Boolean },
22280
22301
  title: null,
22281
22302
  confirmButtons: { type: Boolean },
22282
22303
  acceptButton: { type: Boolean },
22304
+ acceptBtnText: null,
22305
+ acceptBtnType: null,
22283
22306
  cancelButton: { type: Boolean },
22307
+ cancelBtnText: null,
22308
+ cancelBtnType: null,
22284
22309
  notClose: { type: Boolean },
22285
22310
  notCloseBtn: { type: Boolean },
22286
22311
  notCloseByBg: { type: Boolean },
@@ -22351,6 +22376,20 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
22351
22376
  }
22352
22377
  return list;
22353
22378
  });
22379
+ const realAcceptBtnType = computed$2(() => {
22380
+ if (props.cancelBtnType)
22381
+ return props.cancelBtnType;
22382
+ if (cleekOptions2.popup.cancelBtnType)
22383
+ return cleekOptions2.popup.cancelBtnType;
22384
+ return "flat";
22385
+ });
22386
+ const realCancelBtnType = computed$2(() => {
22387
+ if (props.cancelBtnType)
22388
+ return props.cancelBtnType;
22389
+ if (cleekOptions2.popup.acceptBtnType)
22390
+ return cleekOptions2.popup.acceptBtnType;
22391
+ return "outlined";
22392
+ });
22354
22393
  function onCancel() {
22355
22394
  emits("cancel");
22356
22395
  if (!props.preventCloseOnCancel)
@@ -22403,21 +22442,22 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
22403
22442
  class: "cancel-button",
22404
22443
  onClick: _cache[1] || (_cache[1] = ($event) => onCancel()),
22405
22444
  color: "danger",
22406
- type: "flat"
22445
+ type: unref$1(realCancelBtnType)
22407
22446
  }, {
22408
22447
  default: withCtx(() => [
22409
- _hoisted_7
22448
+ createTextVNode(toDisplayString(__props.cancelBtnText || "Cancelar"), 1)
22410
22449
  ]),
22411
22450
  _: 1
22412
- }),
22451
+ }, 8, ["type"]),
22413
22452
  createVNode(CkButton, {
22414
- onClick: _cache[2] || (_cache[2] = ($event) => onAccept())
22453
+ onClick: _cache[2] || (_cache[2] = ($event) => onAccept()),
22454
+ type: unref$1(realAcceptBtnType)
22415
22455
  }, {
22416
22456
  default: withCtx(() => [
22417
- _hoisted_8
22457
+ createTextVNode(toDisplayString(__props.acceptBtnText || "Aceptar"), 1)
22418
22458
  ]),
22419
22459
  _: 1
22420
- })
22460
+ }, 8, ["type"])
22421
22461
  ])) : createCommentVNode("", true)
22422
22462
  ])) : createCommentVNode("", true)
22423
22463
  ], 6)
@@ -22990,6 +23030,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
22990
23030
  clearValue: { type: [Boolean, String] },
22991
23031
  searchable: { type: [Boolean, String] },
22992
23032
  minWidth: null,
23033
+ width: null,
22993
23034
  noBorder: { type: Boolean },
22994
23035
  layout: null,
22995
23036
  borderColor: null,
@@ -23077,6 +23118,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
23077
23118
  if (!isWidthDefined && minWidth) {
23078
23119
  list.push({ "min-width": minWidth });
23079
23120
  }
23121
+ if (props.width)
23122
+ list.push({ "width": props.width });
23080
23123
  return list;
23081
23124
  });
23082
23125
  const realClearValue = computed$2(() => {
@@ -23195,10 +23238,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
23195
23238
  };
23196
23239
  }
23197
23240
  });
23198
- var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-6e28e1de"]]);
23241
+ var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-ccaf1058"]]);
23199
23242
  var ckSidebar_vue_vue_type_style_index_0_scoped_true_lang = "";
23200
23243
  const _hoisted_1$5 = {
23201
- key: 1,
23244
+ key: 0,
23202
23245
  class: "sidebar-header-title"
23203
23246
  };
23204
23247
  const _sfc_main$5 = /* @__PURE__ */ defineComponent({
@@ -23206,7 +23249,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
23206
23249
  modelValue: { type: Boolean },
23207
23250
  title: null,
23208
23251
  width: null,
23209
- rightSide: { type: Boolean }
23252
+ rightSide: { type: Boolean },
23253
+ headerColor: null,
23254
+ headerAlign: { type: Boolean },
23255
+ closeBtnAlign: null,
23256
+ notCloseBtn: { type: Boolean }
23210
23257
  },
23211
23258
  emits: ["update:modelValue"],
23212
23259
  setup(__props, { emit: emits }) {
@@ -23230,6 +23277,29 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
23230
23277
  list.push({ width: props.width });
23231
23278
  return list;
23232
23279
  });
23280
+ const computedClassHeader = computed$2(() => {
23281
+ const list = [];
23282
+ let closeBtnAlign = props.closeBtnAlign;
23283
+ if (props.notCloseBtn)
23284
+ closeBtnAlign = "hidden";
23285
+ if (closeBtnAlign)
23286
+ list.push(`close-btn--${closeBtnAlign}`);
23287
+ if (props.headerAlign)
23288
+ list.push(`align-title--${props.headerAlign}`);
23289
+ if (props.headerColor && hooks8.isColorTemplateVariable(props.headerColor)) {
23290
+ list.push(`ck-component__bg-color--${props.headerColor}`);
23291
+ }
23292
+ if (props.headerColor)
23293
+ list.push(`align-title--${props.headerColor}`);
23294
+ return list;
23295
+ });
23296
+ const computedStyleHeader = computed$2(() => {
23297
+ const list = [];
23298
+ if (props.headerColor && !hooks8.isColorTemplateVariable(props.headerColor)) {
23299
+ list.push({ "background-color": props.headerColor });
23300
+ }
23301
+ return list;
23302
+ });
23233
23303
  return (_ctx, _cache) => {
23234
23304
  const _component_ck_icon = resolveComponent("ck-icon");
23235
23305
  return unref$1(isActive) ? (openBlock(), createElementBlock("div", {
@@ -23242,21 +23312,16 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
23242
23312
  style: normalizeStyle(unref$1(computedStyle))
23243
23313
  }, [
23244
23314
  createElementVNode("div", {
23245
- class: "sidebar-header",
23246
- onClick: _cache[0] || (_cache[0] = ($event) => isActive.value = false)
23315
+ class: normalizeClass(["sidebar-header", unref$1(computedClassHeader)]),
23316
+ onClick: _cache[0] || (_cache[0] = ($event) => isActive.value = false),
23317
+ style: normalizeStyle(unref$1(computedStyleHeader))
23247
23318
  }, [
23248
- __props.rightSide ? (openBlock(), createBlock(_component_ck_icon, {
23249
- key: 0,
23250
- class: "mr-2",
23251
- icon: "times"
23252
- })) : createCommentVNode("", true),
23253
23319
  __props.title ? (openBlock(), createElementBlock("div", _hoisted_1$5, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
23254
- !__props.rightSide ? (openBlock(), createBlock(_component_ck_icon, {
23255
- key: 2,
23256
- class: "ml-2",
23320
+ createVNode(_component_ck_icon, {
23321
+ class: "close-btn",
23257
23322
  icon: "times"
23258
- })) : createCommentVNode("", true)
23259
- ]),
23323
+ })
23324
+ ], 6),
23260
23325
  createElementVNode("div", null, [
23261
23326
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
23262
23327
  ])
@@ -23265,7 +23330,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
23265
23330
  };
23266
23331
  }
23267
23332
  });
23268
- var ckSidebar = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-caa98a4c"]]);
23333
+ var ckSidebar = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2a47d044"]]);
23269
23334
  var ckSwitch_vue_vue_type_style_index_0_scoped_true_lang = "";
23270
23335
  const _withScopeId$1 = (n) => (pushScopeId("data-v-f66bfcc0"), n = n(), popScopeId(), n);
23271
23336
  const _hoisted_1$4 = ["disabled"];