adverich-kun-ui 0.1.118 → 0.1.119

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.
@@ -1,13 +1,13 @@
1
- import { computed as u, createElementBlock as i, createCommentVNode as n, openBlock as a, mergeProps as h, withKeys as w, withModifiers as z, createElementVNode as f, normalizeClass as r, createVNode as m, toDisplayString as c, createBlock as g, withCtx as y, createTextVNode as d } from "vue";
2
- import x from "../../../KunIcon/src/components/KunIcon.vue.js";
3
- import b from "../../../KunBtn/src/components/KunBtn.vue.js";
4
- const B = {
1
+ import { onMounted as h, computed as m, createElementBlock as i, createCommentVNode as n, openBlock as a, mergeProps as w, withKeys as z, withModifiers as B, createElementVNode as u, normalizeClass as r, createVNode as g, toDisplayString as c, createBlock as y, withCtx as x, createTextVNode as f } from "vue";
2
+ import b from "../../../KunIcon/src/components/KunIcon.vue.js";
3
+ import C from "../../../KunBtn/src/components/KunBtn.vue.js";
4
+ const V = {
5
5
  key: 0,
6
6
  class: "flex justify-center py-4"
7
- }, V = {
7
+ }, N = {
8
8
  key: 2,
9
9
  class: "flex gap-4 mt-4"
10
- }, I = {
10
+ }, K = {
11
11
  __name: "KunAlert",
12
12
  props: {
13
13
  modelValue: Boolean,
@@ -80,30 +80,20 @@ const B = {
80
80
  type: String,
81
81
  default: "p-2"
82
82
  },
83
- margin: {
84
- type: String,
85
- default: "m-2"
86
- },
87
- fullscreen: {
88
- type: Boolean,
89
- default: !1
90
- },
91
- persistent: {
92
- type: Boolean,
93
- default: !1
94
- },
95
- persistentLabel: {
96
- type: String,
97
- default: "Aceptar"
98
- },
99
- actionLabel: {
100
- type: String,
101
- default: ""
102
- }
83
+ margin: { type: String, default: "m-2" },
84
+ fullscreen: { type: Boolean, default: !1 },
85
+ persistent: { type: Boolean, default: !1 },
86
+ persistentLabel: { type: String, default: "Aceptar" },
87
+ actionLabel: { type: String, default: "" },
88
+ timeout: { type: Number, default: 2500 }
103
89
  },
104
90
  emits: ["update:modelValue", "action"],
105
- setup(e, { emit: C }) {
106
- const l = e, S = C, $ = u(() => {
91
+ setup(e, { emit: S }) {
92
+ const l = e, d = S;
93
+ h(() => setTimeout(() => {
94
+ d("update:modelValue", !1);
95
+ }, l.timeout));
96
+ const p = m(() => {
107
97
  if (l.fullscreen) return `fixed inset-0 flex items-center justify-center ${l.margin}`;
108
98
  const t = l.margin;
109
99
  switch (l.position) {
@@ -128,35 +118,35 @@ const B = {
128
118
  default:
129
119
  return `fixed top-0 left-1/2 transform -translate-x-1/2 ${t}`;
130
120
  }
131
- }), p = u(() => `${l.fullscreen ? "w-full h-full" : "w-fit"} ${l.transition}`), s = () => {
132
- S("update:modelValue", !1);
121
+ }), $ = m(() => `${l.fullscreen ? "w-full h-full" : "w-fit"} ${l.transition}`), s = () => {
122
+ d("update:modelValue", !1);
133
123
  }, k = () => {
134
124
  !l.persistent && !l.fullscreen && s();
135
125
  }, v = (t) => {
136
126
  !l.persistent && l.fullscreen && s();
137
127
  };
138
- return (t, o) => e.modelValue ? (a(), i("div", h({
128
+ return (t, o) => e.modelValue ? (a(), i("div", w({
139
129
  key: 0,
140
- class: [p.value, $.value],
130
+ class: ["px-2", [$.value, p.value]],
141
131
  style: { zIndex: e.zIndex },
142
- onClick: z(k, ["self"]),
143
- onKeydown: w(v, ["esc"]),
132
+ onClick: B(k, ["self"]),
133
+ onKeydown: z(v, ["esc"]),
144
134
  tabindex: "0"
145
135
  }, t.$attrs), [
146
- f("div", {
136
+ u("div", {
147
137
  class: r([e.alertClass, e.textColor, e.bgColor, e.borderColor])
148
138
  }, [
149
- e.icon ? (a(), i("div", B, [
150
- f("div", {
139
+ e.icon ? (a(), i("div", V, [
140
+ u("div", {
151
141
  class: r(["rounded-full p-4", e.iconBgColor])
152
142
  }, [
153
- m(x, {
143
+ g(b, {
154
144
  icon: e.icon,
155
145
  size: e.iconSize
156
146
  }, null, 8, ["icon", "size"])
157
147
  ], 2)
158
148
  ])) : n("", !0),
159
- f("div", {
149
+ u("div", {
160
150
  class: r(["text-center flex flex-col justify-center items-center", e.paddingContainer])
161
151
  }, [
162
152
  e.title ? (a(), i("div", {
@@ -167,37 +157,37 @@ const B = {
167
157
  key: 1,
168
158
  class: r(e.messageClass)
169
159
  }, c(e.message), 3)) : n("", !0),
170
- e.persistent ? (a(), i("div", V, [
171
- e.actionLabel ? (a(), g(b, {
160
+ e.persistent ? (a(), i("div", N, [
161
+ e.actionLabel ? (a(), y(C, {
172
162
  key: 0,
173
163
  onClick: o[0] || (o[0] = (L) => t.$emit("action"))
174
164
  }, {
175
- default: y(() => [
176
- d(c(e.actionLabel), 1)
165
+ default: x(() => [
166
+ f(c(e.actionLabel), 1)
177
167
  ]),
178
168
  _: 1
179
169
  })) : n("", !0),
180
- e.closable ? n("", !0) : (a(), g(b, {
170
+ e.closable ? n("", !0) : (a(), y(C, {
181
171
  key: 1,
182
172
  onClick: s
183
173
  }, {
184
- default: y(() => [
185
- d(c(e.persistentLabel), 1)
174
+ default: x(() => [
175
+ f(c(e.persistentLabel), 1)
186
176
  ]),
187
177
  _: 1
188
178
  }))
189
179
  ])) : n("", !0),
190
180
  e.closable ? (a(), i("button", {
191
181
  key: 3,
192
- class: "absolute top-0 right-1 text-xl focus:outline-none cursor-pointer",
182
+ class: "absolute top-0 right-1 px-1 text-xl focus:outline-none cursor-pointer",
193
183
  onClick: s
194
184
  }, [
195
- m(x, {
185
+ g(b, {
196
186
  icon: "hand",
197
187
  size: "text-base",
198
188
  class: "mr-1"
199
189
  }),
200
- o[1] || (o[1] = d(" × "))
190
+ o[1] || (o[1] = f(" × "))
201
191
  ])) : n("", !0)
202
192
  ], 2)
203
193
  ], 2)
@@ -205,5 +195,5 @@ const B = {
205
195
  }
206
196
  };
207
197
  export {
208
- I as default
198
+ K as default
209
199
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.118",
3
+ "version": "0.1.119",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",