cleek 1.8.11 → 2.0.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.
@@ -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,96 @@ 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
+ let isMounted = ref(false);
11457
+ const imageUrl = computed(() => {
11458
+ if (!isMounted.value)
11459
+ return "";
11460
+ if (props.isFullPath)
11461
+ return props.src;
11462
+ return getImg(props.src);
11463
+ });
11464
+ const computedClass = computed(() => {
11466
11465
  const classList2 = [];
11467
- let { size } = this;
11468
- if (size === "default" && !this.sizeAbsolute && !this.width && !this.height) {
11469
- size = "m";
11466
+ if (!props.size && !props.sizeAbsolute && !props.width && !props.height) {
11467
+ props.size = "m";
11470
11468
  }
11471
- if (size)
11472
- classList2.push(`ck-img__size--${size}`);
11473
- if (this.hasBorder) {
11469
+ if (props.size)
11470
+ classList2.push(`ck-img__size--${props.size}`);
11471
+ if (props.hasBorder) {
11474
11472
  classList2.push("ck-img__has-border");
11475
- if (functions$1.isColorTemplateVariable(this.realBorderColor)) {
11476
- classList2.push(`ck-component__border-color--${this.realBorderColor}`);
11473
+ if (functions$1.isColorTemplateVariable(realBorderColor.value)) {
11474
+ classList2.push(`ck-component__border-color--${realBorderColor.value}`);
11477
11475
  }
11478
11476
  }
11479
- if (this.zoom)
11477
+ if (props.zoom)
11480
11478
  classList2.push("zoom-able");
11481
11479
  return classList2;
11482
- },
11483
- computedStyle() {
11480
+ });
11481
+ const computedStyle = computed(() => {
11484
11482
  const styleList = [];
11485
- if (this.sizeAbsolute) {
11486
- styleList.push({ width: this.sizeAbsolute });
11487
- styleList.push({ height: this.sizeAbsolute });
11483
+ if (props.sizeAbsolute) {
11484
+ styleList.push({ width: props.sizeAbsolute });
11485
+ styleList.push({ height: props.sizeAbsolute });
11488
11486
  }
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 });
11487
+ if (props.radius)
11488
+ styleList.push({ "border-radius": props.radius });
11489
+ if (props.hasBorder) {
11490
+ if (!functions$1.isColorTemplateVariable(realBorderColor.value)) {
11491
+ styleList.push({ "border-color": realBorderColor.value });
11494
11492
  }
11495
11493
  }
11496
11494
  return styleList;
11497
- },
11498
- computedImgStyle() {
11495
+ });
11496
+ const computedImgStyle = computed(() => {
11499
11497
  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 });
11498
+ if (props.radius)
11499
+ styleList.push({ "border-radius": props.radius });
11500
+ if (props.width)
11501
+ styleList.push({ width: props.width });
11502
+ if (props.height)
11503
+ styleList.push({ height: props.height });
11506
11504
  return styleList;
11507
- },
11508
- realBorderColor() {
11509
- if (this.borderColor)
11510
- return this.borderColor;
11505
+ });
11506
+ const realBorderColor = computed(() => {
11507
+ if (props.borderColor)
11508
+ return props.borderColor;
11511
11509
  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
- }
11510
+ });
11511
+ function clickImg() {
11512
+ if (props.zoom)
11513
+ ;
11514
+ }
11515
+ function getImg(src) {
11516
+ let path = "";
11517
+ console.log("context.$cleekOptions", context.$cleekOptions);
11518
+ if (context.$cleekOptions)
11519
+ path = context.$cleekOptions.imgPath;
11520
+ return `${path}${src}`;
11521
+ }
11522
+ onMounted(() => {
11523
+ context = getCurrentInstance().ctx;
11524
+ isMounted.value = true;
11525
+ });
11526
+ return (_ctx, _cache) => {
11527
+ return openBlock(), createElementBlock("div", {
11528
+ class: normalizeClass(["ck-img", unref(computedClass)]),
11529
+ style: normalizeStyle(unref(computedStyle)),
11530
+ onClick: _cache[1] || (_cache[1] = ($event) => clickImg())
11531
+ }, [
11532
+ createElementVNode("img", {
11533
+ src: unref(imageUrl),
11534
+ style: normalizeStyle(unref(computedImgStyle)),
11535
+ onError: _cache[0] || (_cache[0] = ($event) => altNeeded.value = true)
11536
+ }, null, 44, _hoisted_1$e)
11537
+ ], 6);
11538
+ };
11527
11539
  }
11528
- };
11529
- var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", render$b], ["__scopeId", "data-v-59a679e4"]]);
11540
+ });
11541
+ var ckImg = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-78f4ca32"]]);
11530
11542
  const _hoisted_1$d = ["for"];
11531
11543
  function render$a(_ctx, _cache, $props, $setup, $data, $options) {
11532
11544
  return openBlock(), createElementBlock("label", {
@@ -11662,7 +11674,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
11662
11674
  };
11663
11675
  }
11664
11676
  });
11665
- var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-6ae48508"]]);
11677
+ var ckInput = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-61fababc"]]);
11666
11678
  var ckPopup_vue_vue_type_style_index_0_lang = "";
11667
11679
  const _hoisted_1$b = {
11668
11680
  key: 0,
@@ -12033,8 +12045,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
12033
12045
  };
12034
12046
  }
12035
12047
  });
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);
12048
+ var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-02fab5ba"]]);
12049
+ const _withScopeId = (n) => (pushScopeId("data-v-022b9f3c"), n = n(), popScopeId(), n);
12038
12050
  const _hoisted_1$8 = ["disabled"];
12039
12051
  const _hoisted_2$3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "ck-switch__slider" }, null, -1));
12040
12052
  const _hoisted_3$2 = {
@@ -12107,7 +12119,7 @@ const _sfc_main$a = {
12107
12119
  }
12108
12120
  }
12109
12121
  };
12110
- var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$8], ["__scopeId", "data-v-4963b7ae"]]);
12122
+ var ckSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", render$8], ["__scopeId", "data-v-022b9f3c"]]);
12111
12123
  const _hoisted_1$7 = { class: "ck-switch-options__container-exterior" };
12112
12124
  const _hoisted_2$2 = ["onClick"];
12113
12125
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
@@ -12185,7 +12197,7 @@ const _sfc_main$9 = {
12185
12197
  }
12186
12198
  }
12187
12199
  };
12188
- var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$7], ["__scopeId", "data-v-61a29406"]]);
12200
+ var ckSwitchOptions = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", render$7], ["__scopeId", "data-v-f0c51430"]]);
12189
12201
  const _hoisted_1$6 = { class: "ck-tr" };
12190
12202
  function render$6(_ctx, _cache) {
12191
12203
  return openBlock(), createElementBlock("tr", _hoisted_1$6, [
@@ -12323,7 +12335,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
12323
12335
  };
12324
12336
  }
12325
12337
  });
12326
- var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-5fa6396e"]]);
12338
+ var TableHeaderItems = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-5c48aabc"]]);
12327
12339
  var ckTable__pagination_vue_vue_type_style_index_0_scoped_true_lang = "";
12328
12340
  const _hoisted_1$3 = { class: "ck-table__pagination" };
12329
12341
  const _hoisted_2$1 = ["onClick"];
@@ -12451,7 +12463,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues
12451
12463
  };
12452
12464
  }
12453
12465
  }));
12454
- var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-3fc0d6c6"]]);
12466
+ var TablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-7ad6042e"]]);
12455
12467
  var ckTable_vue_vue_type_style_index_0_scoped_true_lang = "";
12456
12468
  const _hoisted_1$2 = { class: "ck-table" };
12457
12469
  const _hoisted_2 = {
@@ -12647,7 +12659,7 @@ const _sfc_main$1 = {
12647
12659
  }
12648
12660
  }
12649
12661
  };
12650
- var ckTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", render$2], ["__scopeId", "data-v-54574068"]]);
12662
+ var ckTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", render$2], ["__scopeId", "data-v-ec889100"]]);
12651
12663
  var top = "top";
12652
12664
  var bottom = "bottom";
12653
12665
  var right = "right";
@@ -15268,8 +15280,33 @@ var components = /* @__PURE__ */ Object.freeze({
15268
15280
  lockScroll,
15269
15281
  unlockScroll
15270
15282
  });
15283
+ function setDefaultColors(options) {
15284
+ if (!options)
15285
+ return;
15286
+ var r = document.querySelector(":root");
15287
+ const colorList = [
15288
+ "primary",
15289
+ "secondary",
15290
+ "primary",
15291
+ "secondary",
15292
+ "success",
15293
+ "warning",
15294
+ "danger",
15295
+ "dark",
15296
+ "light"
15297
+ ];
15298
+ if (options.colors) {
15299
+ colorList.forEach((colorName) => {
15300
+ const colorValue = options.colors[colorName];
15301
+ if (colorValue)
15302
+ r.style.setProperty(`--${colorName}`, colorValue);
15303
+ });
15304
+ }
15305
+ }
15271
15306
  const install = function installCleek(app, options) {
15307
+ app.config.globalProperties.$cleekOptions = options;
15272
15308
  console.log("arranco paquete", options);
15309
+ setDefaultColors(options);
15273
15310
  Object.entries(components).forEach(([componentName, component]) => {
15274
15311
  app.component(componentName, component);
15275
15312
  });