cleek 2.4.17 → 2.4.20

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
@@ -2901,6 +2901,11 @@ const cleekOptions = {
2901
2901
  img: {
2902
2902
  basePath: ""
2903
2903
  },
2904
+ popup: {
2905
+ textColor: "",
2906
+ headerAlign: "",
2907
+ headerColor: ""
2908
+ },
2904
2909
  styles: {
2905
2910
  layout: "base",
2906
2911
  borderColor: "#dae1e7"
@@ -18813,6 +18818,12 @@ var hooks8 = {
18813
18818
  if (realWidthBreaks.length === 2 && typeof realWidthBreaks[0] === "number" && typeof realWidthBreaks[1] === "string") {
18814
18819
  realWidthBreaks = [realWidthBreaks];
18815
18820
  }
18821
+ if (realWidthBreaks.length) {
18822
+ const first = realWidthBreaks[0];
18823
+ if (first[0] !== 0) {
18824
+ realWidthBreaks.unshift([0, "100%"]);
18825
+ }
18826
+ }
18816
18827
  let finalWidth = "";
18817
18828
  realWidthBreaks.forEach((widthBreak) => {
18818
18829
  const [windowBreak, width] = widthBreak;
@@ -22254,37 +22265,43 @@ const _hoisted_1$c = {
22254
22265
  class: "ck-popup"
22255
22266
  };
22256
22267
  const _hoisted_2$8 = /* @__PURE__ */ createElementVNode("div", { class: "blackout" }, null, -1);
22257
- const _hoisted_3$5 = { class: "ck-popup__slot-header" };
22258
- const _hoisted_4$5 = {
22268
+ const _hoisted_3$5 = {
22259
22269
  key: 0,
22260
22270
  class: "ck-popup__title"
22261
22271
  };
22262
- const _hoisted_5$2 = { class: "ck-popup__slot-body" };
22263
- const _hoisted_6$2 = {
22272
+ const _hoisted_4$5 = { class: "ck-popup__slot-body" };
22273
+ const _hoisted_5$2 = {
22264
22274
  key: 0,
22265
22275
  class: "ck-popup__slot-footer"
22266
22276
  };
22267
- const _hoisted_7 = {
22277
+ const _hoisted_6$2 = {
22268
22278
  key: 0,
22269
22279
  class: "ck-popup-slot-footer__confirm-buttons"
22270
22280
  };
22271
- const _hoisted_8 = /* @__PURE__ */ createTextVNode("Cancelar");
22272
- const _hoisted_9 = /* @__PURE__ */ createTextVNode("Aceptar");
22281
+ const _hoisted_7 = /* @__PURE__ */ createTextVNode("Cancelar");
22282
+ const _hoisted_8 = /* @__PURE__ */ createTextVNode("Aceptar");
22273
22283
  const _sfc_main$d = /* @__PURE__ */ defineComponent({
22274
22284
  props: {
22275
22285
  modelValue: { type: Boolean },
22276
22286
  title: null,
22277
22287
  confirmButtons: { type: Boolean },
22288
+ acceptButton: { type: Boolean },
22289
+ cancelButton: { type: Boolean },
22278
22290
  notClose: { type: Boolean },
22279
22291
  notCloseBtn: { type: Boolean },
22280
22292
  notCloseByBg: { type: Boolean },
22281
22293
  preventCloseOnCancel: { type: Boolean },
22282
22294
  width: null,
22283
- maxWidth: null
22295
+ maxWidth: null,
22296
+ layout: null,
22297
+ textColor: null,
22298
+ headerColor: null,
22299
+ headerAlign: null
22284
22300
  },
22285
22301
  emits: ["update:modelValue", "cancel", "accept"],
22286
22302
  setup(__props, { emit: emits }) {
22287
22303
  const props = __props;
22304
+ let cleekOptions2 = ref();
22288
22305
  const isActive = computed$2({
22289
22306
  get() {
22290
22307
  return props.modelValue;
@@ -22293,12 +22310,51 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
22293
22310
  emits("update:modelValue", val);
22294
22311
  }
22295
22312
  });
22313
+ const computedClassContent = computed$2(() => {
22314
+ var _a, _b;
22315
+ const list = [];
22316
+ const layout = props.layout || ((_a = cleekOptions2.value) == null ? void 0 : _a.styles.layout);
22317
+ if (layout)
22318
+ list.push(layout);
22319
+ const textColor = props.textColor || ((_b = cleekOptions2.value) == null ? void 0 : _b.popup.textColor);
22320
+ if (textColor && hooks8.isColorTemplateVariable(textColor)) {
22321
+ list.push(`ck-component__color--${textColor}`);
22322
+ }
22323
+ return list;
22324
+ });
22296
22325
  const computedStyleContent = computed$2(() => {
22326
+ var _a;
22297
22327
  const list = [];
22298
22328
  if (props.maxWidth)
22299
22329
  list.push({ maxWidth: props.maxWidth });
22300
22330
  if (props.width)
22301
22331
  list.push({ width: props.width });
22332
+ const textColor = props.textColor || ((_a = cleekOptions2.value) == null ? void 0 : _a.popup.textColor);
22333
+ if (textColor && !hooks8.isColorTemplateVariable(textColor)) {
22334
+ list.push(`ck-component__color--${textColor}`);
22335
+ list.push({ color: textColor });
22336
+ }
22337
+ return list;
22338
+ });
22339
+ const computedStyleHeader = computed$2(() => {
22340
+ var _a;
22341
+ const list = [];
22342
+ const headerColor = props.headerColor || ((_a = cleekOptions2.value) == null ? void 0 : _a.popup.headerColor);
22343
+ if (headerColor && !hooks8.isColorTemplateVariable(headerColor)) {
22344
+ list.push({ backgroundColor: headerColor });
22345
+ }
22346
+ return list;
22347
+ });
22348
+ const computedClassHeader = computed$2(() => {
22349
+ var _a, _b;
22350
+ const list = [];
22351
+ const headerAlign = props.headerAlign || ((_a = cleekOptions2.value) == null ? void 0 : _a.popup.headerAlign);
22352
+ if (headerAlign)
22353
+ list.push(`header-align--${headerAlign}`);
22354
+ const headerColor = props.headerColor || ((_b = cleekOptions2.value) == null ? void 0 : _b.popup.headerColor);
22355
+ if (headerColor && hooks8.isColorTemplateVariable(headerColor)) {
22356
+ list.push(`ck-component__bg-color--${headerColor}`);
22357
+ }
22302
22358
  return list;
22303
22359
  });
22304
22360
  function onCancel() {
@@ -22314,6 +22370,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
22314
22370
  return;
22315
22371
  isActive.value = false;
22316
22372
  }
22373
+ onMounted(() => {
22374
+ cleekOptions2.value = hooks8.getCleekOptions(getCurrentInstance);
22375
+ });
22317
22376
  return (_ctx, _cache) => {
22318
22377
  return unref$1(isActive) ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
22319
22378
  _hoisted_2$8,
@@ -22322,27 +22381,30 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
22322
22381
  onClick: _cache[4] || (_cache[4] = ($event) => onBgClick())
22323
22382
  }, [
22324
22383
  createElementVNode("div", {
22325
- class: "ck-popup__content",
22384
+ class: normalizeClass(["ck-popup__content", unref$1(computedClassContent)]),
22326
22385
  onClick: _cache[3] || (_cache[3] = withModifiers(() => {
22327
22386
  }, ["stop"])),
22328
22387
  style: normalizeStyle(unref$1(computedStyleContent))
22329
22388
  }, [
22330
- createElementVNode("div", _hoisted_3$5, [
22331
- __props.title ? (openBlock(), createElementBlock("h3", _hoisted_4$5, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
22389
+ createElementVNode("div", {
22390
+ class: normalizeClass(["ck-popup__slot-header", unref$1(computedClassHeader)]),
22391
+ style: normalizeStyle(unref$1(computedStyleHeader))
22392
+ }, [
22393
+ __props.title ? (openBlock(), createElementBlock("h3", _hoisted_3$5, toDisplayString(__props.title), 1)) : createCommentVNode("", true),
22332
22394
  renderSlot(_ctx.$slots, "header"),
22333
22395
  !(__props.notCloseBtn || __props.notClose) ? (openBlock(), createBlock(CkIcon, {
22334
22396
  key: 1,
22335
- class: "close",
22397
+ class: "icon-close",
22336
22398
  icon: "times",
22337
22399
  onClick: _cache[0] || (_cache[0] = ($event) => isActive.value = false)
22338
22400
  })) : createCommentVNode("", true)
22339
- ]),
22340
- createElementVNode("div", _hoisted_5$2, [
22401
+ ], 6),
22402
+ createElementVNode("div", _hoisted_4$5, [
22341
22403
  renderSlot(_ctx.$slots, "default")
22342
22404
  ]),
22343
- _ctx.$slots.footer || __props.confirmButtons ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
22405
+ _ctx.$slots.footer || __props.confirmButtons || __props.acceptButton || __props.cancelButton ? (openBlock(), createElementBlock("div", _hoisted_5$2, [
22344
22406
  renderSlot(_ctx.$slots, "footer"),
22345
- __props.confirmButtons ? (openBlock(), createElementBlock("div", _hoisted_7, [
22407
+ __props.confirmButtons ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
22346
22408
  createVNode(CkButton, {
22347
22409
  class: "cancel-button",
22348
22410
  onClick: _cache[1] || (_cache[1] = ($event) => onCancel()),
@@ -22350,7 +22412,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
22350
22412
  type: "flat"
22351
22413
  }, {
22352
22414
  default: withCtx(() => [
22353
- _hoisted_8
22415
+ _hoisted_7
22354
22416
  ]),
22355
22417
  _: 1
22356
22418
  }),
@@ -22358,13 +22420,13 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
22358
22420
  onClick: _cache[2] || (_cache[2] = ($event) => onAccept())
22359
22421
  }, {
22360
22422
  default: withCtx(() => [
22361
- _hoisted_9
22423
+ _hoisted_8
22362
22424
  ]),
22363
22425
  _: 1
22364
22426
  })
22365
22427
  ])) : createCommentVNode("", true)
22366
22428
  ])) : createCommentVNode("", true)
22367
- ], 4)
22429
+ ], 6)
22368
22430
  ])
22369
22431
  ])) : createCommentVNode("", true);
22370
22432
  };