cleek 2.1.0 → 2.1.4

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.
@@ -55,6 +55,8 @@ margin-padding-bottom(val)
55
55
 
56
56
  my-box-shadow(val = 0.05, color = black)
57
57
  box-shadow 0 4px 20px 0 rgba(color, val)
58
+ ck-box-shadow(val = 0.05, color = black)
59
+ box-shadow 0 4px 20px 0 rgba(color, val)
58
60
  // flex shortcuts
59
61
  justify-align-center()
60
62
  align-items center
@@ -1,8 +1,9 @@
1
+ @import './.custom';
1
2
  @import './align-items';
2
3
  @import './display';
4
+ @import './justify-content';
3
5
  @import './margin';
4
6
  @import './padding';
7
+ @import './position';
5
8
  @import './text-align';
6
- @import './width';
7
- @import './.custom';
8
- @import './justify-content';
9
+ @import './width';
@@ -0,0 +1,10 @@
1
+ .static
2
+ position static
3
+ .fixed
4
+ position fixed
5
+ .absolute
6
+ position absolute
7
+ .relative
8
+ position relative
9
+ .sticky
10
+ position sticky
package/dist/cleek.es.js CHANGED
@@ -17,7 +17,98 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, computed as computed$2, watch, h, openBlock, createElementBlock, normalizeClass, unref as unref$1, createBlock, createCommentVNode, ref, onMounted, getCurrentInstance, renderSlot, mergeProps, withKeys, withModifiers, createElementVNode, pushScopeId, popScopeId, normalizeStyle, withCtx, createTextVNode, toDisplayString, withDirectives, isRef as isRef$1, vModelDynamic, createVNode, Fragment, renderList, 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, onMounted, getCurrentInstance, mergeProps, withKeys, withModifiers, pushScopeId, popScopeId, withCtx, createTextVNode, toDisplayString, withDirectives, isRef as isRef$1, vModelDynamic, createVNode, Fragment, renderList, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
21
+ var ckDropdown_vue_vue_type_style_index_0_scoped_true_lang = "";
22
+ var _export_sfc = (sfc, props) => {
23
+ const target = sfc.__vccOpts || sfc;
24
+ for (const [key, val] of props) {
25
+ target[key] = val;
26
+ }
27
+ return target;
28
+ };
29
+ const _hoisted_1$j = { class: "ck-dropdown" };
30
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
31
+ props: {
32
+ triggerType: { type: String, default: "click" },
33
+ dark: { type: Boolean, default: false }
34
+ },
35
+ setup(__props) {
36
+ const isOpen = ref(false);
37
+ const popperRef = ref(null);
38
+ function openClose() {
39
+ if (isOpen.value)
40
+ return;
41
+ const closeListerner = (event) => {
42
+ if (popperRef.value != event.target)
43
+ isOpen.value = false;
44
+ window.removeEventListener("click", closeListerner);
45
+ };
46
+ setTimeout(() => {
47
+ window.addEventListener("click", closeListerner);
48
+ });
49
+ isOpen.value = true;
50
+ }
51
+ return (_ctx, _cache) => {
52
+ return openBlock(), createElementBlock("div", _hoisted_1$j, [
53
+ createElementVNode("div", {
54
+ class: "ck-dropdown__trigger",
55
+ onClick: _cache[0] || (_cache[0] = ($event) => openClose())
56
+ }, [
57
+ renderSlot(_ctx.$slots, "trigger", {}, void 0, true)
58
+ ]),
59
+ isOpen.value ? (openBlock(), createElementBlock("section", {
60
+ key: 0,
61
+ class: normalizeClass(["ck-dropdown__popper", { "ck-dropdown__popper--dark": __props.dark }]),
62
+ ref_key: "popperRef",
63
+ ref: popperRef
64
+ }, [
65
+ createElementVNode("div", {
66
+ class: normalizeClass(["ck-dropdown__popper--arrow", { "ck-dropdown__popper--arrow--dark": __props.dark }])
67
+ }, null, 2),
68
+ renderSlot(_ctx.$slots, "popper", {}, void 0, true)
69
+ ], 2)) : createCommentVNode("", true)
70
+ ]);
71
+ };
72
+ }
73
+ });
74
+ var ckDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-64a91fb4"]]);
75
+ var ckNavbar_vue_vue_type_style_index_0_scoped_true_lang = "";
76
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
77
+ props: {
78
+ padding: { type: String, default: 0 },
79
+ position: { type: String, default: "fixed" }
80
+ },
81
+ setup(__props) {
82
+ const props = __props;
83
+ const computedClassContent = computed$2(() => {
84
+ const list = [];
85
+ if (props.padding)
86
+ list.push("has-padding");
87
+ return list;
88
+ });
89
+ const computedStyle = computed$2(() => {
90
+ const list = [];
91
+ if (props.padding)
92
+ list.push({ padding: props.padding });
93
+ if (props.position)
94
+ list.push({ position: props.position });
95
+ return list;
96
+ });
97
+ return (_ctx, _cache) => {
98
+ return openBlock(), createElementBlock("div", {
99
+ class: "ck-navbar",
100
+ style: normalizeStyle(unref$1(computedStyle))
101
+ }, [
102
+ createElementVNode("div", {
103
+ class: normalizeClass(["ck-navbar__content", unref$1(computedClassContent)])
104
+ }, [
105
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
106
+ ], 2)
107
+ ], 4);
108
+ };
109
+ }
110
+ });
111
+ var ckNavbar = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-345fa562"]]);
21
112
  var validators = {
22
113
  size: (type) => {
23
114
  return ["", "xs", "s", "m", "l", "xl"].includes(type);
@@ -77,6 +168,11 @@ var functions$1 = {
77
168
  isColumnDisplayed(column) {
78
169
  if (column.isDisplayed === false)
79
170
  return false;
171
+ if (column.unchangeable) {
172
+ if (column.isDisplayed === true)
173
+ return true;
174
+ return false;
175
+ }
80
176
  return true;
81
177
  },
82
178
  getCleekOptions(getCurrentInstance2) {
@@ -11203,13 +11299,6 @@ defineComponent({
11203
11299
  }
11204
11300
  });
11205
11301
  var ckIcon_vue_vue_type_style_index_0_scoped_true_lang = "";
11206
- var _export_sfc = (sfc, props) => {
11207
- const target = sfc.__vccOpts || sfc;
11208
- for (const [key, val] of props) {
11209
- target[key] = val;
11210
- }
11211
- return target;
11212
- };
11213
11302
  const _sfc_main$l = /* @__PURE__ */ defineComponent({
11214
11303
  props: {
11215
11304
  icon: { type: [String, Array], default: "" },
@@ -12247,7 +12336,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
12247
12336
  };
12248
12337
  }
12249
12338
  });
12250
- var ckChip = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-73ff343b"]]);
12339
+ var ckChip = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-5333de26"]]);
12251
12340
  var globalVariables = {
12252
12341
  defaultFailImg: "df",
12253
12342
  imagesFolderPath: "",
@@ -12363,7 +12452,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
12363
12452
  };
12364
12453
  }
12365
12454
  });
12366
- var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-53d78f2e"]]);
12455
+ var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-acde673a"]]);
12367
12456
  var ckLabel_vue_vue_type_style_index_0_scoped_true_lang = "";
12368
12457
  const _hoisted_1$e = ["for"];
12369
12458
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
@@ -12391,7 +12480,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
12391
12480
  };
12392
12481
  }
12393
12482
  });
12394
- var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-6efffcd8"]]);
12483
+ var ckLabel = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-ef74ea02"]]);
12395
12484
  var ckInput_vue_vue_type_style_index_0_scoped_true_lang = "";
12396
12485
  const _hoisted_1$d = { class: "ck-input" };
12397
12486
  const _hoisted_2$7 = ["type", "placeholder", "id", "disabled"];
@@ -12499,7 +12588,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
12499
12588
  };
12500
12589
  }
12501
12590
  });
12502
- var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-61fababc"]]);
12591
+ var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-5db08b1e"]]);
12503
12592
  var ckPopup_vue_vue_type_style_index_0_lang = "";
12504
12593
  const _hoisted_1$c = {
12505
12594
  key: 0,
@@ -13265,7 +13354,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
13265
13354
  };
13266
13355
  }
13267
13356
  });
13268
- var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-dfbb0b9e"]]);
13357
+ var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-2c3e07c8"]]);
13269
13358
  const _hoisted_1$7 = { class: "ck-tr" };
13270
13359
  function render$1(_ctx, _cache) {
13271
13360
  return openBlock(), createElementBlock("tr", _hoisted_1$7, [
@@ -13309,7 +13398,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
13309
13398
  };
13310
13399
  }
13311
13400
  });
13312
- var ckTh = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-a6c5a34e"]]);
13401
+ var ckTh = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-c179a3c2"]]);
13313
13402
  const _sfc_main$7 = /* @__PURE__ */ defineComponent({
13314
13403
  props: {
13315
13404
  col: { type: Object, required: true }
@@ -13364,7 +13453,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13364
13453
  return value;
13365
13454
  });
13366
13455
  const itemsPerPageIsVisible = computed$2(() => {
13367
- return !props.hideItemsPerPage && props.listLength;
13456
+ return !props.hideItemsPerPage && props.listLength && props.currentPage;
13368
13457
  });
13369
13458
  const searchGroupValue = computed$2(() => {
13370
13459
  if (itemsPerPageIsVisible.value && props.hasColumnsManager) {
@@ -13418,7 +13507,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
13418
13507
  };
13419
13508
  }
13420
13509
  });
13421
- var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-38244f67"]]);
13510
+ var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-4f5cca80"]]);
13422
13511
  var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
13423
13512
  const _hoisted_1$4 = { class: "ck-table__pagination" };
13424
13513
  const _hoisted_2$2 = ["onClick"];
@@ -13546,7 +13635,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
13546
13635
  };
13547
13636
  }
13548
13637
  }));
13549
- var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-7ad6042e"]]);
13638
+ var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-4045b8e3"]]);
13550
13639
  var ckTable__columnsManager_vue_vue_type_style_index_0_scoped_true_lang = "";
13551
13640
  const _hoisted_1$3 = { class: "columns-manger-container" };
13552
13641
  const _hoisted_2$1 = { class: "columns-manger__item" };
@@ -13577,12 +13666,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13577
13666
  console.log("hoola");
13578
13667
  const list = [];
13579
13668
  props.columnsArray.forEach((col) => {
13580
- if (functions$1)
13669
+ if (!col.unchangeable) {
13581
13670
  list.push({
13582
13671
  name: col.name,
13583
13672
  title: col.title,
13584
13673
  value: functions$1.isColumnDisplayed(col)
13585
13674
  });
13675
+ }
13586
13676
  });
13587
13677
  columnsCheckable.value = list;
13588
13678
  }
@@ -13618,7 +13708,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
13618
13708
  };
13619
13709
  }
13620
13710
  });
13621
- var TableColumnsManager = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-6ae82d89"]]);
13711
+ var TableColumnsManager = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-e6aed8c8"]]);
13622
13712
  var ckTable_vue_vue_type_style_index_0_scoped_true_lang = "";
13623
13713
  const _hoisted_1$2 = { class: "ck-table" };
13624
13714
  const _hoisted_2 = {
@@ -13629,7 +13719,7 @@ const _hoisted_3 = {
13629
13719
  key: 1,
13630
13720
  class: "ck-table__header--slot"
13631
13721
  };
13632
- const _hoisted_4 = { class: "ck-table__table" };
13722
+ const _hoisted_4 = { class: "ck-table__table-container" };
13633
13723
  const _hoisted_5 = { key: 0 };
13634
13724
  const _hoisted_6 = { key: 1 };
13635
13725
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
@@ -13643,7 +13733,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13643
13733
  search: { type: String, default: void 0 },
13644
13734
  hideHeaderActions: { type: Boolean, default: false },
13645
13735
  hideRefreshBtn: { type: Boolean, default: false },
13646
- hideItemsPerPage: { type: Boolean, default: false }
13736
+ hideItemsPerPage: { type: Boolean, default: false },
13737
+ notFullWidth: { type: Boolean, default: false }
13647
13738
  },
13648
13739
  emits: ["refreshList", "update:search", "update:currentPage"],
13649
13740
  setup(__props, { emit: emits }) {
@@ -13721,28 +13812,33 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13721
13812
  renderSlot(_ctx.$slots, "header", {}, void 0, true)
13722
13813
  ])) : createCommentVNode("", true)
13723
13814
  ])) : createCommentVNode("", true),
13724
- createElementVNode("table", _hoisted_4, [
13725
- unref$1(filteredColumnsList).length ? (openBlock(), createElementBlock("thead", _hoisted_5, [
13726
- createVNode(ckTr, null, {
13727
- default: withCtx(() => [
13728
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(filteredColumnsList), (col) => {
13729
- return openBlock(), createBlock(_sfc_main$7, {
13730
- key: col.title,
13731
- col
13732
- }, null, 8, ["col"]);
13733
- }), 128))
13734
- ]),
13735
- _: 1
13736
- })
13737
- ])) : createCommentVNode("", true),
13738
- createElementVNode("tbody", null, [
13739
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
13740
- ]),
13741
- _ctx.$slots.footer ? (openBlock(), createElementBlock("tfoot", _hoisted_6, [
13742
- renderSlot(_ctx.$slots, "footer", {}, void 0, true)
13743
- ])) : createCommentVNode("", true)
13815
+ createElementVNode("div", _hoisted_4, [
13816
+ createElementVNode("table", {
13817
+ class: normalizeClass(["ck-table__table", { "not-full-width": __props.notFullWidth }])
13818
+ }, [
13819
+ unref$1(filteredColumnsList).length ? (openBlock(), createElementBlock("thead", _hoisted_5, [
13820
+ createVNode(ckTr, null, {
13821
+ default: withCtx(() => [
13822
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(filteredColumnsList), (col) => {
13823
+ return openBlock(), createBlock(_sfc_main$7, {
13824
+ key: col.title,
13825
+ col
13826
+ }, null, 8, ["col"]);
13827
+ }), 128))
13828
+ ]),
13829
+ _: 1
13830
+ })
13831
+ ])) : createCommentVNode("", true),
13832
+ createElementVNode("tbody", null, [
13833
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
13834
+ ]),
13835
+ _ctx.$slots.footer ? (openBlock(), createElementBlock("tfoot", _hoisted_6, [
13836
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
13837
+ ])) : createCommentVNode("", true)
13838
+ ], 2)
13744
13839
  ]),
13745
13840
  createVNode(TablePagination, {
13841
+ class: "ck-table__pagination",
13746
13842
  currentPage: unref$1(currentPageLocal),
13747
13843
  "onUpdate:currentPage": _cache[4] || (_cache[4] = ($event) => isRef$1(currentPageLocal) ? currentPageLocal.value = $event : null),
13748
13844
  itemsPerPage: __props.itemsPerPage,
@@ -13755,12 +13851,12 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
13755
13851
  };
13756
13852
  }
13757
13853
  });
13758
- var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-4abe8990"]]);
13854
+ var ckTable = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-a5722810"]]);
13759
13855
  var ckTd_vue_vue_type_style_index_0_scoped_true_lang = "";
13760
13856
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
13761
13857
  props: {
13762
13858
  col: { type: Object, default: void 0 },
13763
- wrap: { type: Boolean, default: false },
13859
+ nowrap: { type: Boolean, default: false },
13764
13860
  block: { type: Boolean, default: false },
13765
13861
  autoWidth: { type: Boolean, default: false },
13766
13862
  align: { type: String, default: void 0, validator: validators.align },
@@ -13792,7 +13888,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
13792
13888
  if (props.block)
13793
13889
  list.push("block");
13794
13890
  if (props.block)
13795
- list.push("wrap-text");
13891
+ list.push("no-wrap-text");
13796
13892
  return list;
13797
13893
  });
13798
13894
  const computedStyle = computed$2(() => {
@@ -13829,7 +13925,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
13829
13925
  };
13830
13926
  }
13831
13927
  });
13832
- var ckTd = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-c34b91ca"]]);
13928
+ var ckTd = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-47b8a441"]]);
13833
13929
  var ckTextarea_vue_vue_type_style_index_0_scoped_true_lang = "";
13834
13930
  const _hoisted_1$1 = { class: "ck-textarea" };
13835
13931
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
@@ -16470,6 +16566,8 @@ const unlockScroll = () => {
16470
16566
  var components = /* @__PURE__ */ Object.freeze({
16471
16567
  __proto__: null,
16472
16568
  [Symbol.toStringTag]: "Module",
16569
+ ckDropdown,
16570
+ ckNavbar,
16473
16571
  ckButton,
16474
16572
  ckCheckbox,
16475
16573
  ckChip,
@@ -16524,4 +16622,4 @@ const install = function installCleek(app, options) {
16524
16622
  app.component(componentName, component);
16525
16623
  });
16526
16624
  };
16527
- export { events as EVENTS, mitt as EventBus, ckButton, ckCheckbox, ckChip, ckIcon, ckImg, ckInput, ckLabel, _sfc_main$e as ckPopup, ckRadio, ckSelect, ckSwitch, ckSwitchOptions, ckTable, ckTd, ckTextarea, ckTh, ckTooltip, ckTr, install as default, lockScroll, unlockScroll };
16625
+ export { events as EVENTS, mitt as EventBus, ckButton, ckCheckbox, ckChip, ckDropdown, ckIcon, ckImg, ckInput, ckLabel, ckNavbar, _sfc_main$e as ckPopup, ckRadio, ckSelect, ckSwitch, ckSwitchOptions, ckTable, ckTd, ckTextarea, ckTh, ckTooltip, ckTr, install as default, lockScroll, unlockScroll };