cleek 1.8.10 → 2.0.1

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.
@@ -0,0 +1,9 @@
1
+ *
2
+ box-sizing border-box
3
+ margin 0
4
+ padding 0
5
+ a
6
+ color unset
7
+ text-decoration unset
8
+ ul
9
+ list-style-type none
@@ -79,5 +79,5 @@ inline-flex-all-center()
79
79
  // min-height rsComponentsHeight + heightDiference
80
80
  // background-color white
81
81
  // &:focus-within
82
- // border-color $color-primary
82
+ // border-color var(--primary)
83
83
  // my-box-shadow()
@@ -1,3 +1,4 @@
1
+ @import './align-items';
1
2
  @import './display';
2
3
  @import './margin';
3
4
  @import './padding';
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, computed, watch, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, renderSlot, mergeProps, withKeys, withModifiers, createElementVNode, pushScopeId, popScopeId, normalizeStyle, withCtx, createTextVNode, toDisplayString, withDirectives, isRef, unref, vModelDynamic, createVNode, Fragment, renderList, vModelRadio, ref, vModelSelect, vModelCheckbox, vModelText } from "vue";
20
+ import { defineComponent, computed, watch, h, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode, renderSlot, mergeProps, withKeys, withModifiers, createElementVNode, pushScopeId, popScopeId, ref, onMounted, getCurrentInstance, unref, normalizeStyle, withCtx, createTextVNode, toDisplayString, withDirectives, isRef, vModelDynamic, createVNode, Fragment, renderList, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
21
21
  var validators = {
22
22
  size: (type) => {
23
23
  return ["", "xs", "s", "m", "l", "xl"].includes(type);
@@ -80,7 +80,7 @@ var functions$1 = {
80
80
  };
81
81
  var globalVariables = {
82
82
  defaultFailImg: "df",
83
- imagesFolderPath: "",
83
+ imagesFolderPath: "asd",
84
84
  defaultImgBorderColor: "#EEEEEE"
85
85
  };
86
86
  /*!
@@ -11202,7 +11202,7 @@ defineComponent({
11202
11202
  };
11203
11203
  }
11204
11204
  });
11205
- function render$e(_ctx, _cache, $props, $setup, $data, $options) {
11205
+ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
11206
11206
  const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
11207
11207
  return openBlock(), createElementBlock("div", {
11208
11208
  class: normalizeClass(["ck-icon", $options.computedClass]),
@@ -11278,9 +11278,9 @@ const _sfc_main$j = {
11278
11278
  }
11279
11279
  }
11280
11280
  };
11281
- var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$e], ["__scopeId", "data-v-77d9963a"]]);
11281
+ var ckIcon = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", render$d], ["__scopeId", "data-v-77d9963a"]]);
11282
11282
  const _hoisted_1$g = ["title", "aria-label", "disabled"];
11283
- function render$d(_ctx, _cache, $props, $setup, $data, $options) {
11283
+ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
11284
11284
  const _component_ck_icon = resolveComponent("ck-icon");
11285
11285
  return openBlock(), createElementBlock("button", {
11286
11286
  type: "button",
@@ -11306,7 +11306,9 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
11306
11306
  ], 10, _hoisted_1$g);
11307
11307
  }
11308
11308
  var ckButton_vue_vue_type_style_index_0_scoped_true_lang = "";
11309
- const defaults = { type: "outlined" };
11309
+ const defaultType = "outlined";
11310
+ const defaultColor = "primary";
11311
+ const defaultAlign = "left";
11310
11312
  const _sfc_main$i = {
11311
11313
  name: "CkButton",
11312
11314
  components: {
@@ -11314,9 +11316,10 @@ const _sfc_main$i = {
11314
11316
  },
11315
11317
  props: {
11316
11318
  title: { type: String, default: void 0 },
11317
- type: { type: String, default: defaults.type, validator: validators.buttonType },
11318
- color: { type: String, default: "" },
11319
11319
  disabled: { type: Boolean, default: false },
11320
+ type: { type: String, default: defaultType, validator: validators.buttonType },
11321
+ color: { type: String, default: defaultColor },
11322
+ align: { type: String, default: defaultAlign, validator: validators.align },
11320
11323
  icon: { type: [String, Array], default: void 0 },
11321
11324
  iconPack: { type: String, default: void 0 },
11322
11325
  iconRight: { type: String, default: void 0 },
@@ -11331,13 +11334,16 @@ const _sfc_main$i = {
11331
11334
  computedClass() {
11332
11335
  const classList2 = [];
11333
11336
  classList2.push(functions$1.getGroupClass(this));
11334
- if (this.color) {
11337
+ if (this.color !== defaultColor) {
11335
11338
  if (this.type === "filled") {
11336
11339
  classList2.push(`ck-component__bg-color--${this.color}`);
11337
11340
  } else {
11338
11341
  classList2.push(`ck-component__border-color--${this.color}`);
11339
11342
  }
11340
11343
  }
11344
+ if (this.align !== defaultAlign) {
11345
+ classList2.push(`ck-button__align--${this.align}`);
11346
+ }
11341
11347
  if (!this.$slots.default) {
11342
11348
  if (this.icon || this.iconRight) {
11343
11349
  if (!(this.icon && this.iconRight))
@@ -11346,7 +11352,7 @@ const _sfc_main$i = {
11346
11352
  }
11347
11353
  let type = this.type;
11348
11354
  if (!validators.buttonType(this.type))
11349
- type = defaults.type;
11355
+ type = defaultType;
11350
11356
  classList2.push(`type-${type}`);
11351
11357
  return classList2;
11352
11358
  }
@@ -11357,15 +11363,15 @@ const _sfc_main$i = {
11357
11363
  }
11358
11364
  }
11359
11365
  };
11360
- var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$d], ["__scopeId", "data-v-dfa2f586"]]);
11361
- const _withScopeId$2 = (n) => (pushScopeId("data-v-64a6608c"), n = n(), popScopeId(), n);
11366
+ var ckButton = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", render$c], ["__scopeId", "data-v-a687842a"]]);
11367
+ const _withScopeId$2 = (n) => (pushScopeId("data-v-69dfa524"), n = n(), popScopeId(), n);
11362
11368
  const _hoisted_1$f = ["disabled", "checked"];
11363
11369
  const _hoisted_2$7 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-checkbox__element" }, null, -1));
11364
11370
  const _hoisted_3$5 = {
11365
11371
  key: 0,
11366
11372
  class: "c-Checkbox__label"
11367
11373
  };
11368
- function render$c(_ctx, _cache, $props, $setup, $data, $options) {
11374
+ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
11369
11375
  return openBlock(), createElementBlock("label", mergeProps({ class: "ck-checkbox" }, $options.checkboxAttributes, {
11370
11376
  onKeydown: _cache[1] || (_cache[1] = withKeys(withModifiers(() => {
11371
11377
  }, ["prevent"]), ["space"])),
@@ -11425,23 +11431,10 @@ const _sfc_main$h = {
11425
11431
  }
11426
11432
  }
11427
11433
  };
11428
- var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$c], ["__scopeId", "data-v-64a6608c"]]);
11429
- const _hoisted_1$e = ["src"];
11430
- function render$b(_ctx, _cache, $props, $setup, $data, $options) {
11431
- return openBlock(), createElementBlock("div", {
11432
- class: normalizeClass(["ck-img", $options.computedClass]),
11433
- style: normalizeStyle($options.computedStyle),
11434
- onClick: _cache[1] || (_cache[1] = ($event) => $options.clickImg())
11435
- }, [
11436
- createElementVNode("img", {
11437
- src: $options.imageUrl,
11438
- style: normalizeStyle($options.computedImgStyle),
11439
- onError: _cache[0] || (_cache[0] = ($event) => _ctx.altNeeded = true)
11440
- }, null, 44, _hoisted_1$e)
11441
- ], 6);
11442
- }
11434
+ var ckCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", render$b], ["__scopeId", "data-v-69dfa524"]]);
11443
11435
  var ckImg_vue_vue_type_style_index_0_scoped_true_lang = "";
11444
- const _sfc_main$g = {
11436
+ const _hoisted_1$e = ["src"];
11437
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
11445
11438
  props: {
11446
11439
  src: { type: String, default: "" },
11447
11440
  isFullPath: { type: Boolean, default: false },
@@ -11456,77 +11449,92 @@ const _sfc_main$g = {
11456
11449
  radius: { type: String, default: "" },
11457
11450
  borderColor: { type: String, default: "" }
11458
11451
  },
11459
- computed: {
11460
- imageUrl() {
11461
- if (this.isFullPath)
11462
- return this.src;
11463
- return this.getImg(this.src);
11464
- },
11465
- computedClass() {
11452
+ setup(__props) {
11453
+ const props = __props;
11454
+ const altNeeded = ref(false);
11455
+ let context;
11456
+ const imageUrl = computed(() => {
11457
+ if (props.isFullPath)
11458
+ return props.src;
11459
+ return getImg(props.src);
11460
+ });
11461
+ const computedClass = computed(() => {
11466
11462
  const classList2 = [];
11467
- let { size } = this;
11468
- if (size === "default" && !this.sizeAbsolute && !this.width && !this.height) {
11469
- size = "m";
11463
+ if (!props.size && !props.sizeAbsolute && !props.width && !props.height) {
11464
+ props.size = "m";
11470
11465
  }
11471
- if (size)
11472
- classList2.push(`ck-img__size--${size}`);
11473
- if (this.hasBorder) {
11466
+ if (props.size)
11467
+ classList2.push(`ck-img__size--${props.size}`);
11468
+ if (props.hasBorder) {
11474
11469
  classList2.push("ck-img__has-border");
11475
- if (functions$1.isColorTemplateVariable(this.realBorderColor)) {
11476
- classList2.push(`ck-component__border-color--${this.realBorderColor}`);
11470
+ if (functions$1.isColorTemplateVariable(realBorderColor.value)) {
11471
+ classList2.push(`ck-component__border-color--${realBorderColor.value}`);
11477
11472
  }
11478
11473
  }
11479
- if (this.zoom)
11474
+ if (props.zoom)
11480
11475
  classList2.push("zoom-able");
11481
11476
  return classList2;
11482
- },
11483
- computedStyle() {
11477
+ });
11478
+ const computedStyle = computed(() => {
11484
11479
  const styleList = [];
11485
- if (this.sizeAbsolute) {
11486
- styleList.push({ width: this.sizeAbsolute });
11487
- styleList.push({ height: this.sizeAbsolute });
11480
+ if (props.sizeAbsolute) {
11481
+ styleList.push({ width: props.sizeAbsolute });
11482
+ styleList.push({ height: props.sizeAbsolute });
11488
11483
  }
11489
- if (this.radius)
11490
- styleList.push({ "border-radius": this.radius });
11491
- if (this.hasBorder) {
11492
- if (!functions$1.isColorTemplateVariable(this.realBorderColor)) {
11493
- styleList.push({ "border-color": this.realBorderColor });
11484
+ if (props.radius)
11485
+ styleList.push({ "border-radius": props.radius });
11486
+ if (props.hasBorder) {
11487
+ if (!functions$1.isColorTemplateVariable(realBorderColor.value)) {
11488
+ styleList.push({ "border-color": realBorderColor.value });
11494
11489
  }
11495
11490
  }
11496
11491
  return styleList;
11497
- },
11498
- computedImgStyle() {
11492
+ });
11493
+ const computedImgStyle = computed(() => {
11499
11494
  const styleList = [];
11500
- if (this.radius)
11501
- styleList.push({ "border-radius": this.radius });
11502
- if (this.width)
11503
- styleList.push({ width: this.width });
11504
- if (this.height)
11505
- styleList.push({ height: this.height });
11495
+ if (props.radius)
11496
+ styleList.push({ "border-radius": props.radius });
11497
+ if (props.width)
11498
+ styleList.push({ width: props.width });
11499
+ if (props.height)
11500
+ styleList.push({ height: props.height });
11506
11501
  return styleList;
11507
- },
11508
- realBorderColor() {
11509
- if (this.borderColor)
11510
- return this.borderColor;
11502
+ });
11503
+ const realBorderColor = computed(() => {
11504
+ if (props.borderColor)
11505
+ return props.borderColor;
11511
11506
  return globalVariables.defaultImgBorderColor;
11512
- }
11513
- },
11514
- methods: {
11515
- clickImg() {
11516
- if (this.zoom) {
11517
- console.log("hola");
11518
- this.$store.dispatch("layout/setZoomImgPath", this.imageUrl);
11519
- if (this.zoomTitle) {
11520
- return this.$store.dispatch("layout/setZoomImgTitle", this.zoomTitle);
11521
- }
11522
- }
11523
- },
11524
- getImg(src) {
11525
- return `${globalVariables.imagesFolderPath}${src}`;
11526
- }
11507
+ });
11508
+ function clickImg() {
11509
+ if (props.zoom)
11510
+ ;
11511
+ }
11512
+ function getImg(src) {
11513
+ let path = "";
11514
+ console.log("context.$cleekOptions", context.$cleekOptions);
11515
+ if (context.$cleekOptions.imgPath)
11516
+ path = context.$cleekOptions.imgPath;
11517
+ return `${path}${src}`;
11518
+ }
11519
+ onMounted(() => {
11520
+ context = getCurrentInstance().ctx;
11521
+ });
11522
+ return (_ctx, _cache) => {
11523
+ return openBlock(), createElementBlock("div", {
11524
+ class: normalizeClass(["ck-img", unref(computedClass)]),
11525
+ style: normalizeStyle(unref(computedStyle)),
11526
+ onClick: _cache[1] || (_cache[1] = ($event) => clickImg())
11527
+ }, [
11528
+ createElementVNode("img", {
11529
+ src: unref(imageUrl),
11530
+ style: normalizeStyle(unref(computedImgStyle)),
11531
+ onError: _cache[0] || (_cache[0] = ($event) => altNeeded.value = true)
11532
+ }, null, 44, _hoisted_1$e)
11533
+ ], 6);
11534
+ };
11527
11535
  }
11528
- };
11529
- var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", render$b], ["__scopeId", "data-v-38b603bf"]]);
11536
+ });
11537
+ var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-66708ebe"]]);
11530
11538
  const _hoisted_1$d = ["for"];
11531
11539
  function render$a(_ctx, _cache, $props, $setup, $data, $options) {
11532
11540
  return openBlock(), createElementBlock("label", {
@@ -11662,7 +11670,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11662
11670
  };
11663
11671
  }
11664
11672
  });
11665
- var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-6ae48508"]]);
11673
+ var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-61fababc"]]);
11666
11674
  var ckPopup_vue_vue_type_style_index_0_lang = "";
11667
11675
  const _hoisted_1$b = {
11668
11676
  key: 0,
@@ -12033,8 +12041,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
12033
12041
  };
12034
12042
  }
12035
12043
  });
12036
- var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-41e8ae57"]]);
12037
- const _withScopeId = (n) => (pushScopeId("data-v-4963b7ae"), n = n(), popScopeId(), n);
12044
+ var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-02fab5ba"]]);
12045
+ const _withScopeId = (n) => (pushScopeId("data-v-022b9f3c"), n = n(), popScopeId(), n);
12038
12046
  const _hoisted_1$8 = ["disabled"];
12039
12047
  const _hoisted_2$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
12040
12048
  const _hoisted_3$2 = {
@@ -12107,7 +12115,7 @@ const _sfc_main$a = {
12107
12115
  }
12108
12116
  }
12109
12117
  };
12110
- var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$8], ["__scopeId", "data-v-4963b7ae"]]);
12118
+ var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$8], ["__scopeId", "data-v-022b9f3c"]]);
12111
12119
  const _hoisted_1$7 = { class: "ck-switch-options__container-exterior" };
12112
12120
  const _hoisted_2$2 = ["onClick"];
12113
12121
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
@@ -12185,7 +12193,7 @@ const _sfc_main$9 = {
12185
12193
  }
12186
12194
  }
12187
12195
  };
12188
- var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$7], ["__scopeId", "data-v-61a29406"]]);
12196
+ var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$7], ["__scopeId", "data-v-f0c51430"]]);
12189
12197
  const _hoisted_1$6 = { class: "ck-tr" };
12190
12198
  function render$6(_ctx, _cache) {
12191
12199
  return openBlock(), createElementBlock("tr", _hoisted_1$6, [
@@ -12323,7 +12331,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
12323
12331
  };
12324
12332
  }
12325
12333
  });
12326
- var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-5fa6396e"]]);
12334
+ var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-5c48aabc"]]);
12327
12335
  var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
12328
12336
  const _hoisted_1$3 = { class: "ck-table__pagination" };
12329
12337
  const _hoisted_2$1 = ["onClick"];
@@ -12451,7 +12459,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
12451
12459
  };
12452
12460
  }
12453
12461
  }));
12454
- var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-3fc0d6c6"]]);
12462
+ var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-7ad6042e"]]);
12455
12463
  var ckTable_vue_vue_type_style_index_0_scoped_true_lang = "";
12456
12464
  const _hoisted_1$2 = { class: "ck-table" };
12457
12465
  const _hoisted_2 = {
@@ -12647,7 +12655,7 @@ const _sfc_main$1 = {
12647
12655
  }
12648
12656
  }
12649
12657
  };
12650
- var ckTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", render$2], ["__scopeId", "data-v-54574068"]]);
12658
+ var ckTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", render$2], ["__scopeId", "data-v-ec889100"]]);
12651
12659
  var top = "top";
12652
12660
  var bottom = "bottom";
12653
12661
  var right = "right";
@@ -15268,8 +15276,33 @@ var components = /* @__PURE__ */ Object.freeze({
15268
15276
  lockScroll,
15269
15277
  unlockScroll
15270
15278
  });
15279
+ function setDefaultColors(options) {
15280
+ if (!options)
15281
+ return;
15282
+ var r = document.querySelector(":root");
15283
+ const colorList = [
15284
+ "primary",
15285
+ "secondary",
15286
+ "primary",
15287
+ "secondary",
15288
+ "success",
15289
+ "warning",
15290
+ "danger",
15291
+ "dark",
15292
+ "light"
15293
+ ];
15294
+ if (options.colors) {
15295
+ colorList.forEach((colorName) => {
15296
+ const colorValue = options.colors[colorName];
15297
+ if (colorValue)
15298
+ r.style.setProperty(`--${colorName}`, colorValue);
15299
+ });
15300
+ }
15301
+ }
15271
15302
  const install = function installCleek(app, options) {
15303
+ app.config.globalProperties.$cleekOptions = options;
15272
15304
  console.log("arranco paquete", options);
15305
+ setDefaultColors(options);
15273
15306
  Object.entries(components).forEach(([componentName, component]) => {
15274
15307
  app.component(componentName, component);
15275
15308
  });