cleek 2.4.17 → 2.4.18

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