adverich-kun-ui 0.1.47 → 0.1.49
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/adverich-kun-ui.css +1 -1
- package/dist/components/KunCard/src/components/KunCard.vue.js +49 -50
- package/dist/components/KunCard/src/composables/kunCardProps.js +43 -0
- package/dist/components/KunCard/src/composables/useCard.js +16 -0
- package/dist/components/KunCardActions/src/components/KunCardActions.vue.js +22 -0
- package/dist/components/KunCardActions/src/composables/kunCardActionsProps.js +35 -0
- package/dist/components/KunCardActions/src/composables/useCardActions.js +19 -0
- package/dist/components/KunCardItem/src/components/KunCardItem.vue.js +22 -0
- package/dist/components/KunCardItem/src/composables/kunCardItemProps.js +21 -0
- package/dist/components/KunCardItem/src/composables/useCardItem.js +17 -0
- package/dist/components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js +24 -0
- package/dist/components/KunCardSubtitle/src/composables/kunCardSubtitleProps.js +25 -0
- package/dist/components/KunCardSubtitle/src/composables/useCardSubtitle.js +15 -0
- package/dist/components/KunCardText/src/components/KunCardText.vue.js +21 -56
- package/dist/components/KunCardText/src/composables/kunCardTextProps.js +25 -0
- package/dist/components/KunCardText/src/composables/useCardText.js +15 -0
- package/dist/components/KunCardTitle/src/components/KunCardTitle.vue.js +61 -0
- package/dist/components/KunCardTitle/src/composables/kunCardTitleProps.js +58 -0
- package/dist/components/KunCardTitle/src/composables/useCardTitle.js +25 -0
- package/dist/components/KunCol/src/components/KunCol.vue.js +53 -0
- package/dist/components/KunContainer/src/components/KunContainer.vue.js +41 -0
- package/dist/components/KunForm/src/components/KunForm.vue.js +62 -0
- package/dist/components/KunLoaderCircular/src/components/KunLoaderCircular.vue.js +42 -0
- package/dist/components/KunRow/src/components/KunRow.vue.js +57 -0
- package/dist/components/KunSlider/src/components/KunSlider.vue.js +52 -0
- package/dist/components/KunSlider/src/composables/useSlider.js +17 -0
- package/dist/components/KunSlider/src/composables/useSliderProps.js +49 -0
- package/dist/components/KunTextField/src/components/KunTextField.vue.js +79 -65
- package/dist/components/KunTextField/src/composables/KunTextFieldProps.js +19 -7
- package/dist/index.js +77 -47
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
title: {
|
|
3
|
+
type: String,
|
|
4
|
+
default: null
|
|
5
|
+
},
|
|
6
|
+
subtitle: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: null
|
|
9
|
+
},
|
|
10
|
+
prepend: {
|
|
11
|
+
type: [String, Object, Function],
|
|
12
|
+
default: null
|
|
13
|
+
},
|
|
14
|
+
append: {
|
|
15
|
+
type: [String, Object, Function],
|
|
16
|
+
default: null
|
|
17
|
+
},
|
|
18
|
+
bgColor: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "bg-white"
|
|
21
|
+
},
|
|
22
|
+
textColor: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "text-gray-800"
|
|
25
|
+
},
|
|
26
|
+
dense: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
flat: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
rounded: {
|
|
35
|
+
type: [Boolean, String],
|
|
36
|
+
default: !1,
|
|
37
|
+
validator: (t) => typeof t == "boolean" || ["sm", "md", "lg", "xl"].includes(t)
|
|
38
|
+
},
|
|
39
|
+
height: {
|
|
40
|
+
type: [String, Number],
|
|
41
|
+
default: "auto"
|
|
42
|
+
},
|
|
43
|
+
width: {
|
|
44
|
+
type: [String, Number],
|
|
45
|
+
default: "full"
|
|
46
|
+
},
|
|
47
|
+
class: {
|
|
48
|
+
type: [String, Array, Object],
|
|
49
|
+
default: null
|
|
50
|
+
},
|
|
51
|
+
style: {
|
|
52
|
+
type: Object,
|
|
53
|
+
default: null
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
e as kunCardTitleProps
|
|
58
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { computed as e } from "vue";
|
|
2
|
+
function c(t) {
|
|
3
|
+
const d = e(() => !!t.prepend), i = e(() => !!t.append), h = e(() => [
|
|
4
|
+
t.dense ? "py-1 px-2 text-sm" : "py-3 px-4 text-base",
|
|
5
|
+
t.flat ? "shadow-none" : "shadow",
|
|
6
|
+
t.rounded === !0 ? "rounded-md" : t.rounded ? `rounded-${t.rounded}` : "",
|
|
7
|
+
t.bgColor,
|
|
8
|
+
t.textColor,
|
|
9
|
+
t.class
|
|
10
|
+
].filter(Boolean)), u = e(() => {
|
|
11
|
+
const n = t.style || {};
|
|
12
|
+
return t.height && (n.height = typeof t.height == "number" ? `${t.height}px` : t.height), t.width && (n.width = typeof t.width == "number" ? `${t.width}px` : t.width), n;
|
|
13
|
+
}), o = e(() => t.dense ? "font-medium" : "font-semibold"), a = e(() => "text-xs opacity-75 mt-1");
|
|
14
|
+
return {
|
|
15
|
+
hasPrependIcon: d,
|
|
16
|
+
hasAppendIcon: i,
|
|
17
|
+
containerClass: h,
|
|
18
|
+
containerStyle: u,
|
|
19
|
+
titleClass: o,
|
|
20
|
+
subtitleClass: a
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
c as useCardTitle
|
|
25
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { computed as f, createElementBlock as a, openBlock as p, normalizeStyle as i, normalizeClass as o, renderSlot as m } from "vue";
|
|
2
|
+
const d = {
|
|
3
|
+
__name: "KunCol",
|
|
4
|
+
props: {
|
|
5
|
+
cols: {
|
|
6
|
+
type: [String, Number, Boolean],
|
|
7
|
+
default: !1
|
|
8
|
+
},
|
|
9
|
+
sm: { type: [String, Number], default: null },
|
|
10
|
+
md: { type: [String, Number], default: null },
|
|
11
|
+
lg: { type: [String, Number], default: null },
|
|
12
|
+
xl: { type: [String, Number], default: null },
|
|
13
|
+
offset: { type: [String, Number], default: null },
|
|
14
|
+
smOffset: { type: [String, Number], default: null },
|
|
15
|
+
mdOffset: { type: [String, Number], default: null },
|
|
16
|
+
lgOffset: { type: [String, Number], default: null },
|
|
17
|
+
xlOffset: { type: [String, Number], default: null },
|
|
18
|
+
order: { type: [String, Number], default: null },
|
|
19
|
+
alignSelf: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: null,
|
|
22
|
+
validator: (t) => ["start", "center", "end", "auto", null].includes(t)
|
|
23
|
+
},
|
|
24
|
+
class: { type: [String, Array, Object], default: null },
|
|
25
|
+
style: { type: Object, default: null }
|
|
26
|
+
},
|
|
27
|
+
setup(t) {
|
|
28
|
+
const e = t, r = f(() => {
|
|
29
|
+
const l = [];
|
|
30
|
+
if (l.push("px-4"), e.cols)
|
|
31
|
+
if (e.cols === "auto")
|
|
32
|
+
l.push("grow");
|
|
33
|
+
else {
|
|
34
|
+
const s = parseInt(e.cols);
|
|
35
|
+
isNaN(s) || l.push(`w-${s * 8.33333333}%`);
|
|
36
|
+
}
|
|
37
|
+
else
|
|
38
|
+
l.push("grow");
|
|
39
|
+
return e.sm && l.push(`sm:w-${parseInt(e.sm) * 8.33333333}%`), e.md && l.push(`md:w-${parseInt(e.md) * 8.33333333}%`), e.lg && l.push(`lg:w-${parseInt(e.lg) * 8.33333333}%`), e.xl && l.push(`xl:w-${parseInt(e.xl) * 8.33333333}%`), e.offset && l.push(`ml-${parseInt(e.offset) * 8.33333333}%`), e.smOffset && l.push(`sm:ml-${parseInt(e.smOffset) * 8.33333333}%`), e.mdOffset && l.push(`md:ml-${parseInt(e.mdOffset) * 8.33333333}%`), e.lgOffset && l.push(`lg:ml-${parseInt(e.lgOffset) * 8.33333333}%`), e.xlOffset && l.push(`xl:ml-${parseInt(e.xlOffset) * 8.33333333}%`), e.order && l.push(`order-${e.order}`), e.alignSelf === "start" ? l.push("self-start") : e.alignSelf === "center" ? l.push("self-center") : e.alignSelf === "end" && l.push("self-end"), e.class && (Array.isArray(e.class) ? l.push(...e.class) : typeof e.class == "string" ? l.push(...e.class.split(" ")) : typeof e.class == "object" && Object.entries(e.class).forEach(([s, n]) => {
|
|
40
|
+
n && l.push(s);
|
|
41
|
+
})), l;
|
|
42
|
+
}), u = f(() => e.style || {});
|
|
43
|
+
return (l, s) => (p(), a("div", {
|
|
44
|
+
class: o(r.value),
|
|
45
|
+
style: i(u.value)
|
|
46
|
+
}, [
|
|
47
|
+
m(l.$slots, "default")
|
|
48
|
+
], 6));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
d as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { computed as t, createElementBlock as o, openBlock as u, normalizeStyle as p, normalizeClass as f, renderSlot as i } from "vue";
|
|
2
|
+
const x = {
|
|
3
|
+
__name: "KunContainer",
|
|
4
|
+
props: {
|
|
5
|
+
fluid: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: !1
|
|
8
|
+
},
|
|
9
|
+
class: {
|
|
10
|
+
type: [String, Array, Object],
|
|
11
|
+
default: null
|
|
12
|
+
},
|
|
13
|
+
style: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: null
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(a) {
|
|
19
|
+
const e = a, r = t(() => {
|
|
20
|
+
const s = ["w-full", "mx-auto", "px-4", "sm:px-6", "lg:px-8"];
|
|
21
|
+
return e.fluid || s.push(
|
|
22
|
+
"max-w-screen-sm",
|
|
23
|
+
"sm:max-w-screen-md",
|
|
24
|
+
"md:max-w-screen-lg",
|
|
25
|
+
"lg:max-w-screen-xl",
|
|
26
|
+
"xl:max-w-screen-2xl"
|
|
27
|
+
), e.class && (Array.isArray(e.class) ? s.push(...e.class) : typeof e.class == "string" ? s.push(...e.class.split(" ")) : typeof e.class == "object" && Object.entries(e.class).forEach(([l, n]) => {
|
|
28
|
+
n && s.push(l);
|
|
29
|
+
})), s;
|
|
30
|
+
}), c = t(() => e.style || {});
|
|
31
|
+
return (s, l) => (u(), o("div", {
|
|
32
|
+
class: f(r.value),
|
|
33
|
+
style: p(c.value)
|
|
34
|
+
}, [
|
|
35
|
+
i(s.$slots, "default")
|
|
36
|
+
], 6));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
x as default
|
|
41
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ref as n, provide as s, createElementBlock as v, openBlock as g, normalizeClass as h, withModifiers as x, renderSlot as y } from "vue";
|
|
2
|
+
const F = {
|
|
3
|
+
__name: "KunForm",
|
|
4
|
+
props: {
|
|
5
|
+
gap: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: "space-y-4"
|
|
8
|
+
},
|
|
9
|
+
padding: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: "px-2 py-4"
|
|
12
|
+
},
|
|
13
|
+
maxWidth: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "max-w-full"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(o, { expose: u }) {
|
|
19
|
+
const i = o, t = n([]), r = n(!0);
|
|
20
|
+
function d(e) {
|
|
21
|
+
t.value.push(e);
|
|
22
|
+
}
|
|
23
|
+
function c(e) {
|
|
24
|
+
t.value = t.value.filter((a) => a !== e);
|
|
25
|
+
}
|
|
26
|
+
async function l() {
|
|
27
|
+
const e = await Promise.all(
|
|
28
|
+
t.value.map(async (a) => await a.validate())
|
|
29
|
+
);
|
|
30
|
+
return r.value = e.every((a) => a === !0), { valid: r.value };
|
|
31
|
+
}
|
|
32
|
+
function f() {
|
|
33
|
+
t.value.forEach((e) => {
|
|
34
|
+
e.reset && e.reset();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function p() {
|
|
38
|
+
t.value.forEach((e) => {
|
|
39
|
+
e.resetValidation && e.resetValidation();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function m() {
|
|
43
|
+
l().then(({ valid: e }) => {
|
|
44
|
+
e && $emit("submit");
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return s("registerField", d), s("unregisterField", c), u({
|
|
48
|
+
validate: l,
|
|
49
|
+
reset: f,
|
|
50
|
+
resetValidation: p
|
|
51
|
+
}), (e, a) => (g(), v("form", {
|
|
52
|
+
onSubmit: x(m, ["prevent"]),
|
|
53
|
+
novalidate: "",
|
|
54
|
+
class: h(`flex flex-col w-full ${i.gap} ${i.padding} ${i.maxWidth}`)
|
|
55
|
+
}, [
|
|
56
|
+
y(e.$slots, "default")
|
|
57
|
+
], 34));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
F as default
|
|
62
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { computed as i, createElementBlock as l, openBlock as p, normalizeStyle as u } from "vue";
|
|
2
|
+
const g = {
|
|
3
|
+
__name: "KunLoaderCircular",
|
|
4
|
+
props: {
|
|
5
|
+
size: {
|
|
6
|
+
type: [Number, String],
|
|
7
|
+
default: 48
|
|
8
|
+
},
|
|
9
|
+
width: {
|
|
10
|
+
type: [Number, String],
|
|
11
|
+
default: 6
|
|
12
|
+
},
|
|
13
|
+
gradient: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "conic-gradient(from 0deg, #e5e7eb, #3b82f6)"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(s) {
|
|
19
|
+
const a = s, o = i(() => Number(a.size)), c = i(() => Number(a.width)), d = i(() => {
|
|
20
|
+
const e = o.value, n = c.value, r = e / 2, t = r - n;
|
|
21
|
+
return {
|
|
22
|
+
width: `${e}px`,
|
|
23
|
+
height: `${e}px`,
|
|
24
|
+
backgroundImage: a.gradient,
|
|
25
|
+
borderRadius: "50%",
|
|
26
|
+
WebkitMaskImage: `radial-gradient(circle ${t}px at center, transparent ${t}px, white ${r}px)`,
|
|
27
|
+
maskImage: `radial-gradient(circle ${t}px at center, transparent ${t}px, white ${r}px)`,
|
|
28
|
+
WebkitMaskComposite: "destination-in",
|
|
29
|
+
maskComposite: "intersect"
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
return (e, n) => (p(), l("div", {
|
|
33
|
+
class: "relative inline-block animate-spin",
|
|
34
|
+
style: u(d.value),
|
|
35
|
+
role: "status",
|
|
36
|
+
"aria-label": "Loading"
|
|
37
|
+
}, null, 4));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
g as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { computed as r, createElementBlock as i, openBlock as f, normalizeStyle as c, normalizeClass as o, renderSlot as p } from "vue";
|
|
2
|
+
const y = {
|
|
3
|
+
__name: "KunRow",
|
|
4
|
+
props: {
|
|
5
|
+
noGutters: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: !1
|
|
8
|
+
},
|
|
9
|
+
align: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: null,
|
|
12
|
+
// center, start, end, stretch
|
|
13
|
+
validator: (t) => ["start", "center", "end", "stretch", null].includes(t)
|
|
14
|
+
},
|
|
15
|
+
justify: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: null,
|
|
18
|
+
// start, center, end, space-between, space-around
|
|
19
|
+
validator: (t) => ["start", "center", "end", "space-between", "space-around", null].includes(t)
|
|
20
|
+
},
|
|
21
|
+
dense: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
direction: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: null,
|
|
28
|
+
// row, row-reverse
|
|
29
|
+
validator: (t) => ["row", "row-reverse", null].includes(t)
|
|
30
|
+
},
|
|
31
|
+
class: {
|
|
32
|
+
type: [String, Array, Object],
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
style: {
|
|
36
|
+
type: Object,
|
|
37
|
+
default: null
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
setup(t) {
|
|
41
|
+
const e = t, n = r(() => {
|
|
42
|
+
const s = ["flex", "flex-wrap"];
|
|
43
|
+
return e.direction === "row-reverse" ? s.push("flex-row-reverse") : s.push("flex-row"), e.align === "center" ? s.push("items-center") : e.align === "start" ? s.push("items-start") : e.align === "end" ? s.push("items-end") : e.align === "stretch" && s.push("items-stretch"), e.justify === "center" ? s.push("justify-center") : e.justify === "end" ? s.push("justify-end") : e.justify === "start" ? s.push("justify-start") : e.justify === "space-between" ? s.push("justify-between") : e.justify === "space-around" && s.push("justify-around"), e.noGutters || (e.dense ? s.push("-mx-1") : s.push("-mx-4")), e.class && (Array.isArray(e.class) ? s.push(...e.class) : typeof e.class == "string" ? s.push(...e.class.split(" ")) : typeof e.class == "object" && Object.entries(e.class).forEach(([l, u]) => {
|
|
44
|
+
u && s.push(l);
|
|
45
|
+
})), s;
|
|
46
|
+
}), a = r(() => e.style || {});
|
|
47
|
+
return (s, l) => (f(), i("div", {
|
|
48
|
+
class: o(n.value),
|
|
49
|
+
style: c(a.value)
|
|
50
|
+
}, [
|
|
51
|
+
p(s.$slots, "default")
|
|
52
|
+
], 6));
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
y as default
|
|
57
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createElementBlock as n, openBlock as i, normalizeStyle as d, normalizeClass as u, createCommentVNode as m, createElementVNode as t, toDisplayString as l, withDirectives as v, isRef as g, vModelText as h, unref as r } from "vue";
|
|
2
|
+
import { useSliderProps as x } from "../composables/useSliderProps.js";
|
|
3
|
+
import { useSlider as k } from "../composables/useSlider.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import w from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const S = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "mb-2 text-sm font-medium text-gray-700"
|
|
9
|
+
}, V = { class: "relative flex items-center h-8" }, _ = ["min", "max", "step", "disabled"], j = { class: "flex justify-between text-xs text-gray-500 mt-1" }, z = {
|
|
10
|
+
__name: "KunSlider",
|
|
11
|
+
props: x(),
|
|
12
|
+
emits: ["update:modelValue"],
|
|
13
|
+
setup(p, { emit: f }) {
|
|
14
|
+
const c = f, o = p, { internalValue: s, thumbPosition: b } = k(o, c);
|
|
15
|
+
return (e, a) => (i(), n("div", {
|
|
16
|
+
class: u(["kun-slider", { "kun-slider--disabled": e.disabled }, o.class]),
|
|
17
|
+
style: d(o.style)
|
|
18
|
+
}, [
|
|
19
|
+
e.label ? (i(), n("div", S, l(e.label), 1)) : m("", !0),
|
|
20
|
+
t("div", V, [
|
|
21
|
+
v(t("input", {
|
|
22
|
+
"onUpdate:modelValue": a[0] || (a[0] = (y) => g(s) ? s.value = y : null),
|
|
23
|
+
type: "range",
|
|
24
|
+
min: e.min,
|
|
25
|
+
max: e.max,
|
|
26
|
+
step: e.step,
|
|
27
|
+
disabled: e.disabled,
|
|
28
|
+
class: u(["w-full h-1 rounded-full appearance-none cursor-pointer bg-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500", { "cursor-not-allowed opacity-60": e.disabled }])
|
|
29
|
+
}, null, 10, _), [
|
|
30
|
+
[
|
|
31
|
+
h,
|
|
32
|
+
r(s),
|
|
33
|
+
void 0,
|
|
34
|
+
{ number: !0 }
|
|
35
|
+
]
|
|
36
|
+
]),
|
|
37
|
+
e.thumbLabel && !e.disabled ? (i(), n("div", {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "absolute -top-7 left-0 w-8 h-8 flex items-center justify-center text-xs text-white bg-blue-500 rounded-full pointer-events-none origin-bottom",
|
|
40
|
+
style: d({ transform: r(b) })
|
|
41
|
+
}, l(r(s)), 5)) : m("", !0)
|
|
42
|
+
]),
|
|
43
|
+
t("div", j, [
|
|
44
|
+
t("span", null, l(e.min), 1),
|
|
45
|
+
t("span", null, l(e.max), 1)
|
|
46
|
+
])
|
|
47
|
+
], 6));
|
|
48
|
+
}
|
|
49
|
+
}, N = /* @__PURE__ */ w(z, [["__scopeId", "data-v-2ef65466"]]);
|
|
50
|
+
export {
|
|
51
|
+
N as default
|
|
52
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { computed as r } from "vue";
|
|
2
|
+
function i(t, m) {
|
|
3
|
+
const n = r({
|
|
4
|
+
get: () => Number(t.modelValue),
|
|
5
|
+
set: (e) => m("update:modelValue", e)
|
|
6
|
+
}), o = r(() => {
|
|
7
|
+
const e = Number(t.min), u = Number(t.max), a = Number(n.value);
|
|
8
|
+
return u === e ? 0 : `calc(${(a - e) / (u - e) * 100}% - 1rem)`;
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
internalValue: n,
|
|
12
|
+
thumbPosition: o
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
i as useSlider
|
|
17
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const e = () => ({
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: [Number, String],
|
|
4
|
+
default: 0
|
|
5
|
+
},
|
|
6
|
+
min: {
|
|
7
|
+
type: [Number, String],
|
|
8
|
+
default: 0
|
|
9
|
+
},
|
|
10
|
+
max: {
|
|
11
|
+
type: [Number, String],
|
|
12
|
+
default: 100
|
|
13
|
+
},
|
|
14
|
+
step: {
|
|
15
|
+
type: [Number, String],
|
|
16
|
+
default: 1
|
|
17
|
+
},
|
|
18
|
+
label: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: null
|
|
21
|
+
},
|
|
22
|
+
thumbLabel: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !0
|
|
25
|
+
},
|
|
26
|
+
ticks: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
tickSize: {
|
|
31
|
+
type: [Number, String],
|
|
32
|
+
default: 2
|
|
33
|
+
},
|
|
34
|
+
disabled: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
},
|
|
38
|
+
class: {
|
|
39
|
+
type: [String, Array, Object],
|
|
40
|
+
default: null
|
|
41
|
+
},
|
|
42
|
+
style: {
|
|
43
|
+
type: Object,
|
|
44
|
+
default: null
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
e as useSliderProps
|
|
49
|
+
};
|
|
@@ -1,75 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { inject as v, ref as h, watch as P, computed as y, onUnmounted as j, createElementBlock as o, openBlock as u, createElementVNode as w, createCommentVNode as i, normalizeClass as C, renderSlot as V, toDisplayString as d, withKeys as N } from "vue";
|
|
2
|
+
import S from "../composables/KunTextFieldProps.js";
|
|
3
|
+
const T = {
|
|
4
|
+
class: "w-full flex justify-center my-2",
|
|
5
|
+
style: { cursor: "text" }
|
|
6
|
+
}, $ = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "mr-2"
|
|
9
|
+
}, z = ["type", "value", "placeholder"], D = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "ml-2"
|
|
12
|
+
}, M = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "text-red-500 text-sm mt-1 w-full text-left pl-1"
|
|
15
|
+
}, A = {
|
|
4
16
|
__name: "KunTextField",
|
|
5
|
-
props:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
props: { ...S },
|
|
18
|
+
emits: ["update:modelValue", "focusInput", "blurInput", "pressEsc", "clickInput"],
|
|
19
|
+
setup(g, { expose: F, emit: E }) {
|
|
20
|
+
const t = g, p = E, b = v("registerField"), k = v("unregisterField"), l = h(t.modelValue), n = h(!1);
|
|
21
|
+
P(
|
|
22
|
+
() => t.modelValue,
|
|
23
|
+
(e) => {
|
|
24
|
+
l.value = e;
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
async function c() {
|
|
28
|
+
for (const e of t.rules) {
|
|
29
|
+
const r = await Promise.resolve(e(l.value));
|
|
30
|
+
if (r !== !0) return r;
|
|
31
|
+
}
|
|
32
|
+
return !0;
|
|
16
33
|
}
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
w(l.value);
|
|
23
|
-
};
|
|
24
|
-
watch(s, (e) => {
|
|
25
|
-
n = e;
|
|
26
|
-
});
|
|
27
|
-
let n = s.value;
|
|
28
|
-
const F = () => {
|
|
29
|
-
f("rounded-b-none"), n = "", d("focusInput");
|
|
30
|
-
}, b = () => {
|
|
31
|
-
n = s.value, f("");
|
|
32
|
-
}, E = () => {
|
|
33
|
-
o.value, o.value && o.value.blur(), d("pressEsc");
|
|
34
|
-
}, c = ref("");
|
|
35
|
-
function f(e) {
|
|
36
|
-
c.value = e;
|
|
34
|
+
const f = y(() => !n.value || t.error ? t.errorMessage : c()), m = y(
|
|
35
|
+
() => t.error || !!f.value && n.value
|
|
36
|
+
);
|
|
37
|
+
function I(e) {
|
|
38
|
+
l.value = e.target.value, p("update:modelValue", l.value);
|
|
37
39
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
function x() {
|
|
41
|
+
n.value = !0, p("blurInput");
|
|
42
|
+
}
|
|
43
|
+
async function s() {
|
|
44
|
+
return n.value = !0, await c() === !0;
|
|
45
|
+
}
|
|
46
|
+
function B() {
|
|
47
|
+
l.value = t.modelValue, n.value = !1;
|
|
48
|
+
}
|
|
49
|
+
function K() {
|
|
50
|
+
n.value = !1;
|
|
51
|
+
}
|
|
52
|
+
return b({ validate: s }), j(() => {
|
|
53
|
+
k({ validate: s });
|
|
54
|
+
}), F({
|
|
55
|
+
validate: s,
|
|
56
|
+
reset: B,
|
|
57
|
+
resetValidation: K
|
|
58
|
+
}), (e, r) => (u(), o("div", T, [
|
|
59
|
+
w("div", {
|
|
60
|
+
class: C([
|
|
61
|
+
"w-full h-full text-field-style flex flex-row items-center px-2",
|
|
62
|
+
e.rounded ? "rounded" : "",
|
|
63
|
+
m.value ? "border border-red-500 bg-red-50" : ""
|
|
64
|
+
])
|
|
47
65
|
}, [
|
|
48
|
-
e.prefix ? (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, null, 40, K)
|
|
65
|
-
]),
|
|
66
|
-
t(e.$slots, "append-inner"),
|
|
67
|
-
e.suffix ? (a(), r("div", S, V(e.suffix), 1)) : g("", !0)
|
|
66
|
+
e.prefix ? (u(), o("div", $, d(e.prefix), 1)) : i("", !0),
|
|
67
|
+
V(e.$slots, "prepend-inner"),
|
|
68
|
+
w("input", {
|
|
69
|
+
ref: "inputField",
|
|
70
|
+
type: e.type,
|
|
71
|
+
value: l.value,
|
|
72
|
+
autocomplete: "off",
|
|
73
|
+
class: "h-full w-full bg-transparent focus:outline-none text-center",
|
|
74
|
+
placeholder: e.inputPlaceholder,
|
|
75
|
+
onInput: I,
|
|
76
|
+
onBlur: x,
|
|
77
|
+
onKeydown: r[0] || (r[0] = N((...a) => e.handleEscape && e.handleEscape(...a), ["escape"])),
|
|
78
|
+
onFocus: r[1] || (r[1] = (...a) => e.handleFocus && e.handleFocus(...a))
|
|
79
|
+
}, null, 40, z),
|
|
80
|
+
V(e.$slots, "append-inner"),
|
|
81
|
+
e.suffix ? (u(), o("div", D, d(e.suffix), 1)) : i("", !0)
|
|
68
82
|
], 2),
|
|
69
|
-
|
|
83
|
+
m.value ? (u(), o("div", M, d(f.value), 1)) : i("", !0)
|
|
70
84
|
]));
|
|
71
85
|
}
|
|
72
86
|
};
|
|
73
87
|
export {
|
|
74
|
-
|
|
88
|
+
A as default
|
|
75
89
|
};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
const e = {
|
|
2
|
+
modelValue: {
|
|
3
|
+
type: [String, Number],
|
|
4
|
+
default: ""
|
|
5
|
+
},
|
|
2
6
|
type: {
|
|
3
7
|
type: String,
|
|
4
8
|
default: "text"
|
|
5
9
|
},
|
|
10
|
+
placeholder: {
|
|
11
|
+
type: null,
|
|
12
|
+
default: "text"
|
|
13
|
+
},
|
|
6
14
|
locale: {
|
|
7
15
|
type: String,
|
|
8
16
|
default: "ar-ES"
|
|
9
17
|
},
|
|
10
|
-
precision: {
|
|
11
|
-
type: Number,
|
|
12
|
-
default: 2
|
|
13
|
-
},
|
|
14
18
|
prefix: {
|
|
15
19
|
type: String,
|
|
16
20
|
default: ""
|
|
@@ -19,13 +23,21 @@ const e = {
|
|
|
19
23
|
type: String,
|
|
20
24
|
default: ""
|
|
21
25
|
},
|
|
22
|
-
|
|
26
|
+
rounded: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "rounded"
|
|
29
|
+
},
|
|
30
|
+
error: {
|
|
23
31
|
type: Boolean,
|
|
24
32
|
default: !1
|
|
25
33
|
},
|
|
26
|
-
|
|
34
|
+
errorMessage: {
|
|
27
35
|
type: String,
|
|
28
|
-
default: "
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
rules: {
|
|
39
|
+
type: Array,
|
|
40
|
+
default: () => []
|
|
29
41
|
}
|
|
30
42
|
};
|
|
31
43
|
export {
|