@indielayer/ui 1.14.5 → 1.15.0
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/docs/pages/component/avatar/usage.vue +1 -1
- package/docs/pages/component/input/usage.vue +22 -8
- package/docs/pages/component/table/selectable.vue +1 -1
- package/docs/pages/component/table/virtual.vue +2 -1
- package/docs/pages/component/tag/usage.vue +1 -1
- package/docs/pages/component/textarea/usage.vue +22 -8
- package/lib/components/avatar/Avatar.vue2.js +20 -19
- package/lib/components/avatar/theme/Avatar.base.theme.js +9 -12
- package/lib/components/datepicker/Datepicker.vue.js +1 -1
- package/lib/components/drawer/Drawer.vue.js +66 -60
- package/lib/components/input/Input.vue.d.ts +8 -0
- package/lib/components/input/Input.vue.js +84 -69
- package/lib/components/inputFooter/InputFooter.vue.d.ts +13 -2
- package/lib/components/inputFooter/InputFooter.vue.js +35 -19
- package/lib/components/inputFooter/theme/InputFooter.base.theme.js +3 -1
- package/lib/components/inputFooter/theme/InputFooter.carbon.theme.js +3 -1
- package/lib/components/popover/Popover.vue.d.ts +1 -1
- package/lib/components/select/Select.vue.d.ts +38 -10
- package/lib/components/select/Select.vue.js +210 -200
- package/lib/components/table/Table.vue.d.ts +55 -19
- package/lib/components/table/Table.vue.js +256 -214
- package/lib/components/table/TableCell.vue.d.ts +9 -0
- package/lib/components/table/TableCell.vue.js +45 -21
- package/lib/components/table/TableHeader.vue.js +14 -14
- package/lib/components/table/theme/TableCell.base.theme.js +3 -3
- package/lib/components/tag/Tag.vue.d.ts +3 -0
- package/lib/components/tag/Tag.vue.js +37 -35
- package/lib/components/textarea/Textarea.vue.d.ts +19 -3
- package/lib/components/textarea/Textarea.vue.js +98 -76
- package/lib/components/textarea/theme/Textarea.base.theme.js +2 -1
- package/lib/components/textarea/theme/Textarea.carbon.theme.js +2 -1
- package/lib/components/upload/Upload.vue.js +91 -86
- package/lib/index.js +1 -1
- package/lib/index.umd.js +4 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/avatar/Avatar.vue +2 -2
- package/src/components/avatar/theme/Avatar.base.theme.ts +0 -5
- package/src/components/datepicker/Datepicker.vue +6 -1
- package/src/components/drawer/Drawer.vue +13 -2
- package/src/components/input/Input.vue +27 -2
- package/src/components/inputFooter/InputFooter.vue +35 -3
- package/src/components/inputFooter/theme/InputFooter.base.theme.ts +2 -0
- package/src/components/inputFooter/theme/InputFooter.carbon.theme.ts +2 -0
- package/src/components/select/Select.vue +21 -8
- package/src/components/table/Table.vue +170 -48
- package/src/components/table/TableCell.vue +23 -0
- package/src/components/table/TableHeader.vue +2 -2
- package/src/components/table/theme/TableCell.base.theme.ts +20 -11
- package/src/components/tag/Tag.vue +8 -3
- package/src/components/textarea/Textarea.vue +63 -30
- package/src/components/textarea/theme/Textarea.base.theme.ts +2 -0
- package/src/components/textarea/theme/Textarea.carbon.theme.ts +2 -0
- package/src/components/upload/Upload.vue +12 -2
- package/src/version.ts +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as h, computed as f, openBlock as o, createElementBlock as m, normalizeClass as n, unref as l, normalizeStyle as c, createBlock as g, resolveDynamicComponent as v, mergeProps as y, withCtx as b, createElementVNode as w, renderSlot as p } from "vue";
|
|
2
|
+
import { useTheme as S } from "../../composables/useTheme.js";
|
|
3
|
+
const i = {
|
|
4
4
|
textAlign: [null, "left", "center", "right", "justify"],
|
|
5
5
|
verticalAlign: [null, "baseline", "bottom", "middle", "text-bottom", "text-top", "top"]
|
|
6
|
-
},
|
|
6
|
+
}, C = {
|
|
7
7
|
textAlign: {
|
|
8
8
|
type: String,
|
|
9
|
-
validator: (
|
|
9
|
+
validator: (a) => i.textAlign.includes(a)
|
|
10
10
|
},
|
|
11
11
|
truncate: Boolean,
|
|
12
12
|
dense: Boolean,
|
|
@@ -14,28 +14,52 @@ const o = {
|
|
|
14
14
|
verticalAlign: {
|
|
15
15
|
type: String,
|
|
16
16
|
default: "middle",
|
|
17
|
-
validator: (
|
|
18
|
-
}
|
|
19
|
-
|
|
17
|
+
validator: (a) => i.verticalAlign.includes(a)
|
|
18
|
+
},
|
|
19
|
+
to: [String, Object],
|
|
20
|
+
href: String,
|
|
21
|
+
target: String
|
|
22
|
+
}, k = {
|
|
20
23
|
name: "XTableCell",
|
|
21
|
-
validators:
|
|
22
|
-
},
|
|
23
|
-
...
|
|
24
|
-
props:
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
27
|
-
return (
|
|
28
|
-
|
|
29
|
-
class:
|
|
24
|
+
validators: i
|
|
25
|
+
}, N = /* @__PURE__ */ h({
|
|
26
|
+
...k,
|
|
27
|
+
props: C,
|
|
28
|
+
setup(a) {
|
|
29
|
+
const r = a, t = f(() => typeof r.width == "number" ? `${r.width}px` : r.width), { styles: s, classes: d, className: u } = S("TableCell", {}, r);
|
|
30
|
+
return (e, A) => e.to || e.href ? (o(), m("td", {
|
|
31
|
+
key: 0,
|
|
32
|
+
class: n(["relative", l(u)]),
|
|
33
|
+
style: c([{ width: t.value, minWidth: t.value, maxWidth: t.value }])
|
|
34
|
+
}, [
|
|
35
|
+
(o(), g(v(e.to ? "router-link" : "a"), y(e.href ? { href: e.href } : {}, {
|
|
36
|
+
target: e.target,
|
|
37
|
+
to: e.to,
|
|
38
|
+
style: l(s),
|
|
39
|
+
class: l(d).wrapper
|
|
40
|
+
}), {
|
|
41
|
+
default: b(() => [
|
|
42
|
+
w("div", {
|
|
43
|
+
class: n([e.truncate ? "truncate" : ""])
|
|
44
|
+
}, [
|
|
45
|
+
p(e.$slots, "default")
|
|
46
|
+
], 2)
|
|
47
|
+
]),
|
|
48
|
+
_: 3
|
|
49
|
+
}, 16, ["target", "to", "style", "class"]))
|
|
50
|
+
], 6)) : (o(), m("td", {
|
|
51
|
+
key: 1,
|
|
52
|
+
style: c([l(s), { width: t.value, minWidth: t.value, maxWidth: t.value }]),
|
|
53
|
+
class: n([
|
|
30
54
|
"relative",
|
|
31
|
-
|
|
32
|
-
|
|
55
|
+
l(u),
|
|
56
|
+
l(d).wrapper
|
|
33
57
|
])
|
|
34
58
|
}, [
|
|
35
|
-
|
|
59
|
+
p(e.$slots, "default")
|
|
36
60
|
], 6));
|
|
37
61
|
}
|
|
38
62
|
});
|
|
39
63
|
export {
|
|
40
|
-
|
|
64
|
+
N as default
|
|
41
65
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as g, openBlock as o, createElementBlock as n, normalizeStyle as k, unref as s, normalizeClass as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as g, openBlock as o, createElementBlock as n, normalizeStyle as k, unref as s, normalizeClass as i, createElementVNode as r, renderSlot as c, createBlock as h, createCommentVNode as p, Fragment as m } from "vue";
|
|
2
|
+
import { useTheme as v } from "../../composables/useTheme.js";
|
|
3
|
+
import x from "../tooltip/ToggleTip.vue.js";
|
|
4
|
+
const b = { class: "flex items-center gap-1" }, B = {
|
|
5
5
|
key: 2,
|
|
6
6
|
d: "m3 9l4-4l4 4M7 5v14m14-4l-4 4l-4-4m4 4V5"
|
|
7
7
|
}, d = {
|
|
@@ -23,28 +23,28 @@ const x = { class: "flex items-center gap-1" }, B = {
|
|
|
23
23
|
...C,
|
|
24
24
|
props: A,
|
|
25
25
|
setup(l) {
|
|
26
|
-
const u = l, { styles: y, classes:
|
|
26
|
+
const u = l, { styles: y, classes: a, className: f } = v("TableHeader", {}, u);
|
|
27
27
|
return (e, t) => (o(), n("th", {
|
|
28
28
|
style: k(s(y)),
|
|
29
|
-
class:
|
|
29
|
+
class: i([s(f), s(a).th, "group/th"])
|
|
30
30
|
}, [
|
|
31
31
|
r("div", {
|
|
32
|
-
class:
|
|
32
|
+
class: i(s(a).header)
|
|
33
33
|
}, [
|
|
34
|
-
r("div",
|
|
35
|
-
|
|
36
|
-
e.tooltip ? (o(),
|
|
34
|
+
r("div", b, [
|
|
35
|
+
c(e.$slots, "default"),
|
|
36
|
+
e.tooltip ? (o(), h(x, {
|
|
37
37
|
key: 0,
|
|
38
38
|
content: e.tooltip
|
|
39
39
|
}, null, 8, ["content"])) : p("", !0)
|
|
40
40
|
]),
|
|
41
41
|
e.sortable ? (o(), n("svg", {
|
|
42
42
|
key: 0,
|
|
43
|
-
class:
|
|
44
|
-
s(
|
|
43
|
+
class: i(["shrink-0", [
|
|
44
|
+
s(a).sortIcon,
|
|
45
45
|
e.textAlign === "right" ? "-mr-4 -translate-x-4" : "-ml-4 translate-x-4",
|
|
46
|
-
[e.sort && [1, -1].includes(e.sort) ? "" : "
|
|
47
|
-
[e.sort !== -1 && e.sort !== 1 ? "text-secondary-400 dark:text-secondary-500" : "text-primary-
|
|
46
|
+
[e.sort && [1, -1].includes(e.sort) ? "" : "group-hover/th:text-secondary-500 dark:group-hover/th:text-secondary-400"],
|
|
47
|
+
[e.sort !== -1 && e.sort !== 1 ? "text-secondary-400 dark:text-secondary-500" : "text-primary-500 dark:text-primary-400"]
|
|
48
48
|
]]),
|
|
49
49
|
width: "24",
|
|
50
50
|
height: "24",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const i = {
|
|
2
2
|
classes: {
|
|
3
|
-
wrapper: ({ props:
|
|
4
|
-
const
|
|
5
|
-
return
|
|
3
|
+
wrapper: ({ props: t }) => {
|
|
4
|
+
const e = ["px-3"];
|
|
5
|
+
return e.push(t.dense ? "h-9 py-0.5" : "h-11 py-1"), t.to || t.href ? (e.push("flex items-center"), t.textAlign === "left" ? e.push("justify-start") : t.textAlign === "center" ? e.push("justify-center") : t.textAlign === "right" ? e.push("justify-end") : t.textAlign === "justify" && e.push("justify-center")) : (t.textAlign === "left" ? e.push("text-left") : t.textAlign === "center" ? e.push("text-center") : t.textAlign === "right" ? e.push("text-right") : t.textAlign === "justify" && e.push("text-justify"), t.verticalAlign === "baseline" ? e.push("align-baseline") : t.verticalAlign === "bottom" ? e.push("align-bottom") : t.verticalAlign === "middle" ? e.push("align-middle") : t.verticalAlign === "text-bottom" ? e.push("align-text-bottom") : t.verticalAlign === "text-top" ? e.push("align-text-top") : t.verticalAlign === "top" && e.push("align-top")), t.truncate && e.push("truncate"), e;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
8
|
}, l = i;
|
|
@@ -10,6 +10,7 @@ declare const tagProps: {
|
|
|
10
10
|
outlined: BooleanConstructor;
|
|
11
11
|
filled: BooleanConstructor;
|
|
12
12
|
disabled: BooleanConstructor;
|
|
13
|
+
to: (ObjectConstructor | StringConstructor)[];
|
|
13
14
|
color: {
|
|
14
15
|
readonly type: StringConstructor;
|
|
15
16
|
readonly default: string | undefined;
|
|
@@ -34,6 +35,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
34
35
|
outlined: BooleanConstructor;
|
|
35
36
|
filled: BooleanConstructor;
|
|
36
37
|
disabled: BooleanConstructor;
|
|
38
|
+
to: (ObjectConstructor | StringConstructor)[];
|
|
37
39
|
color: {
|
|
38
40
|
readonly type: StringConstructor;
|
|
39
41
|
readonly default: string | undefined;
|
|
@@ -53,6 +55,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
53
55
|
outlined: BooleanConstructor;
|
|
54
56
|
filled: BooleanConstructor;
|
|
55
57
|
disabled: BooleanConstructor;
|
|
58
|
+
to: (ObjectConstructor | StringConstructor)[];
|
|
56
59
|
color: {
|
|
57
60
|
readonly type: StringConstructor;
|
|
58
61
|
readonly default: string | undefined;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useColors as
|
|
1
|
+
import { defineComponent as k, computed as l, useAttrs as x, openBlock as n, createBlock as h, resolveDynamicComponent as y, normalizeClass as t, unref as r, normalizeStyle as z, withCtx as B, createElementVNode as s, renderSlot as i, createElementBlock as C, createVNode as S, withModifiers as _, createCommentVNode as w } from "vue";
|
|
2
|
+
import { useColors as N } from "../../composables/useColors.js";
|
|
3
3
|
import { useCommon as d } from "../../composables/useCommon.js";
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import { closeIcon as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
4
|
+
import { useTheme as T } from "../../composables/useTheme.js";
|
|
5
|
+
import { closeIcon as $ } from "../../common/icons.js";
|
|
6
|
+
import V from "../icon/Icon.vue.js";
|
|
7
|
+
const E = { class: "flex items-center gap-2" }, I = { class: "truncate" }, j = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "absolute right-1.5 top-0 h-full flex items-center"
|
|
10
|
-
},
|
|
10
|
+
}, A = {
|
|
11
11
|
...d.props(),
|
|
12
|
-
...
|
|
12
|
+
...N.props("secondary"),
|
|
13
13
|
tag: {
|
|
14
14
|
type: String,
|
|
15
15
|
default: "span"
|
|
@@ -18,54 +18,56 @@ const $ = { class: "flex items-center gap-2" }, w = { class: "truncate" }, T = {
|
|
|
18
18
|
removable: Boolean,
|
|
19
19
|
outlined: Boolean,
|
|
20
20
|
filled: Boolean,
|
|
21
|
-
disabled: Boolean
|
|
22
|
-
|
|
21
|
+
disabled: Boolean,
|
|
22
|
+
to: [String, Object]
|
|
23
|
+
}, D = {
|
|
23
24
|
name: "XTag",
|
|
24
25
|
validators: {
|
|
25
26
|
...d.validators()
|
|
26
27
|
}
|
|
27
|
-
},
|
|
28
|
-
...
|
|
29
|
-
props:
|
|
28
|
+
}, G = /* @__PURE__ */ k({
|
|
29
|
+
...D,
|
|
30
|
+
props: A,
|
|
30
31
|
emits: ["remove"],
|
|
31
|
-
setup(
|
|
32
|
-
const o =
|
|
33
|
-
return (e, a) => (
|
|
34
|
-
|
|
32
|
+
setup(c) {
|
|
33
|
+
const o = c, m = l(() => o.size === "xs" ? "xs" : o.size === "sm" ? "sm" : o.size === "lg" ? "md" : o.size === "xl" ? "lg" : "sm"), u = x(), p = l(() => u.href ? "a" : o.to ? "router-link" : o.tag), { styles: f, classes: g, className: v } = T("Tag", {}, o);
|
|
34
|
+
return (e, a) => (n(), h(y(p.value), {
|
|
35
|
+
to: e.to,
|
|
36
|
+
class: t([
|
|
35
37
|
"text-[color:var(--x-tag-text)] dark:text-[color:var(--x-tag-dark-text)] border relative",
|
|
36
38
|
[
|
|
37
|
-
r(
|
|
38
|
-
r(
|
|
39
|
+
r(v),
|
|
40
|
+
r(g).wrapper,
|
|
39
41
|
e.outlined ? "border-[color:var(--x-tag-border)] dark:border-[color:var(--x-tag-dark-border)]" : "!border-transparent bg-[color:var(--x-tag-bg)] dark:bg-[color:var(--x-tag-dark-bg)]",
|
|
40
42
|
e.rounded ? "rounded-full" : "rounded"
|
|
41
43
|
]
|
|
42
44
|
]),
|
|
43
|
-
style:
|
|
45
|
+
style: z(r(f))
|
|
44
46
|
}, {
|
|
45
|
-
default:
|
|
46
|
-
|
|
47
|
-
class:
|
|
47
|
+
default: B(() => [
|
|
48
|
+
s("span", {
|
|
49
|
+
class: t(["max-w-full", { "pr-4": e.removable }])
|
|
48
50
|
}, [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
s("div", E, [
|
|
52
|
+
i(e.$slots, "prefix"),
|
|
53
|
+
s("div", I, [
|
|
54
|
+
i(e.$slots, "default")
|
|
53
55
|
])
|
|
54
56
|
]),
|
|
55
|
-
e.removable ? (
|
|
56
|
-
|
|
57
|
+
e.removable ? (n(), C("div", j, [
|
|
58
|
+
S(V, {
|
|
57
59
|
size: m.value,
|
|
58
|
-
icon: r(
|
|
59
|
-
class:
|
|
60
|
-
onClick: a[0] || (a[0] = (
|
|
60
|
+
icon: r($),
|
|
61
|
+
class: t(["cursor-pointer transition-colors duration-150", [e.disabled ? "text-secondary-400" : "hover:text-secondary-500"]]),
|
|
62
|
+
onClick: a[0] || (a[0] = _((b) => !e.disabled && e.$emit("remove", b), ["prevent"]))
|
|
61
63
|
}, null, 8, ["size", "icon", "class"])
|
|
62
|
-
])) :
|
|
64
|
+
])) : w("", !0)
|
|
63
65
|
], 2)
|
|
64
66
|
]),
|
|
65
67
|
_: 3
|
|
66
|
-
}, 8, ["style", "class"]));
|
|
68
|
+
}, 8, ["to", "style", "class"]));
|
|
67
69
|
}
|
|
68
70
|
});
|
|
69
71
|
export {
|
|
70
|
-
|
|
72
|
+
G as default
|
|
71
73
|
};
|
|
@@ -18,6 +18,8 @@ declare const textareaProps: {
|
|
|
18
18
|
preventEnter: BooleanConstructor;
|
|
19
19
|
block: BooleanConstructor;
|
|
20
20
|
resizable: BooleanConstructor;
|
|
21
|
+
showCounter: BooleanConstructor;
|
|
22
|
+
clearable: BooleanConstructor;
|
|
21
23
|
modelValue: {
|
|
22
24
|
readonly type: import("vue").PropType<string | number | boolean | object | any[] | undefined>;
|
|
23
25
|
readonly default: undefined;
|
|
@@ -54,13 +56,13 @@ declare const textareaProps: {
|
|
|
54
56
|
};
|
|
55
57
|
};
|
|
56
58
|
export type TextareaProps = ExtractPublicPropTypes<typeof textareaProps>;
|
|
57
|
-
type InternalClasses = 'wrapper' | 'input';
|
|
59
|
+
type InternalClasses = 'wrapper' | 'input' | 'icon';
|
|
58
60
|
type InternalExtraData = {
|
|
59
61
|
errorInternal: Ref<boolean>;
|
|
60
62
|
};
|
|
61
63
|
export interface TextareaTheme extends ThemeComponent<TextareaProps, InternalClasses, InternalExtraData> {
|
|
62
64
|
}
|
|
63
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
65
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
64
66
|
dir: {
|
|
65
67
|
type: StringConstructor;
|
|
66
68
|
default: string;
|
|
@@ -78,6 +80,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
78
80
|
preventEnter: BooleanConstructor;
|
|
79
81
|
block: BooleanConstructor;
|
|
80
82
|
resizable: BooleanConstructor;
|
|
83
|
+
showCounter: BooleanConstructor;
|
|
84
|
+
clearable: BooleanConstructor;
|
|
81
85
|
modelValue: {
|
|
82
86
|
readonly type: import("vue").PropType<string | number | boolean | object | any[] | undefined>;
|
|
83
87
|
readonly default: undefined;
|
|
@@ -136,6 +140,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
136
140
|
preventEnter: BooleanConstructor;
|
|
137
141
|
block: BooleanConstructor;
|
|
138
142
|
resizable: BooleanConstructor;
|
|
143
|
+
showCounter: BooleanConstructor;
|
|
144
|
+
clearable: BooleanConstructor;
|
|
139
145
|
modelValue: {
|
|
140
146
|
readonly type: import("vue").PropType<string | number | boolean | object | any[] | undefined>;
|
|
141
147
|
readonly default: undefined;
|
|
@@ -185,10 +191,20 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
185
191
|
hideFooter: boolean;
|
|
186
192
|
rules: unknown[];
|
|
187
193
|
skipFormRegistry: boolean;
|
|
194
|
+
clearable: boolean;
|
|
188
195
|
dir: string;
|
|
196
|
+
showCounter: boolean;
|
|
189
197
|
rows: string | number;
|
|
190
198
|
adjustToText: boolean;
|
|
191
199
|
preventEnter: boolean;
|
|
192
200
|
resizable: boolean;
|
|
193
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any
|
|
201
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
202
|
+
prefix?(_: {}): any;
|
|
203
|
+
suffix?(_: {}): any;
|
|
204
|
+
}>;
|
|
194
205
|
export default _default;
|
|
206
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
207
|
+
new (): {
|
|
208
|
+
$slots: S;
|
|
209
|
+
};
|
|
210
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useResizeObserver as
|
|
3
|
-
import { useCSS as
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import { useCommon as
|
|
6
|
-
import { useColors as
|
|
7
|
-
import { useInputtable as
|
|
8
|
-
import { useInteractive as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
...
|
|
1
|
+
import { defineComponent as K, useAttrs as O, computed as i, ref as D, watch as W, openBlock as m, createBlock as u, normalizeStyle as X, unref as r, normalizeClass as h, withCtx as G, createElementVNode as b, renderSlot as g, mergeProps as J, toHandlers as M, withKeys as Q, createCommentVNode as v } from "vue";
|
|
2
|
+
import { useResizeObserver as U, useEventListener as Y } from "../../node_modules/.pnpm/@vueuse_core@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/core/index.js";
|
|
3
|
+
import { useCSS as Z } from "../../composables/useCSS.js";
|
|
4
|
+
import { useTheme as _ } from "../../composables/useTheme.js";
|
|
5
|
+
import { useCommon as y } from "../../composables/useCommon.js";
|
|
6
|
+
import { useColors as ee } from "../../composables/useColors.js";
|
|
7
|
+
import { useInputtable as d } from "../../composables/useInputtable.js";
|
|
8
|
+
import { useInteractive as w } from "../../composables/useInteractive.js";
|
|
9
|
+
import re from "../label/Label.vue.js";
|
|
10
|
+
import oe from "../inputFooter/InputFooter.vue.js";
|
|
11
|
+
import te from "../icon/Icon.vue.js";
|
|
12
|
+
import { closeIcon as ne } from "../../common/icons.js";
|
|
13
|
+
const se = { class: "relative" }, le = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlength", "name", "placeholder", "readonly", "value"], ae = {
|
|
14
|
+
...y.props(),
|
|
15
|
+
...w.props(),
|
|
16
|
+
...d.props(),
|
|
15
17
|
dir: {
|
|
16
18
|
type: String,
|
|
17
19
|
default: "ltr"
|
|
@@ -28,88 +30,108 @@ const ee = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minleng
|
|
|
28
30
|
adjustToText: Boolean,
|
|
29
31
|
preventEnter: Boolean,
|
|
30
32
|
block: Boolean,
|
|
31
|
-
resizable: Boolean
|
|
32
|
-
|
|
33
|
+
resizable: Boolean,
|
|
34
|
+
showCounter: Boolean,
|
|
35
|
+
clearable: Boolean
|
|
36
|
+
}, ie = {
|
|
33
37
|
name: "XTextarea",
|
|
34
38
|
validators: {
|
|
35
|
-
...
|
|
39
|
+
...y.validators()
|
|
36
40
|
}
|
|
37
|
-
},
|
|
38
|
-
...
|
|
39
|
-
props:
|
|
40
|
-
emits:
|
|
41
|
-
setup(
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
setTimeout(
|
|
41
|
+
}, ke = /* @__PURE__ */ K({
|
|
42
|
+
...ie,
|
|
43
|
+
props: ae,
|
|
44
|
+
emits: d.emits(),
|
|
45
|
+
setup(S, { expose: C, emit: k }) {
|
|
46
|
+
const o = S, z = k, p = O(), B = i(() => Object.keys(p).reduce((e, n) => (n.startsWith("data-") && (e[n] = p[n]), e), {})), t = D(null);
|
|
47
|
+
U(t, s), typeof window < "u" && Y(window, "resize", s), W([() => o.modelValue, () => o.size], () => {
|
|
48
|
+
setTimeout(s);
|
|
45
49
|
});
|
|
46
|
-
const
|
|
47
|
-
function
|
|
48
|
-
|
|
50
|
+
const I = Z("textarea"), N = ee().getPalette("primary"), T = I.get("border", N[400]);
|
|
51
|
+
function V() {
|
|
52
|
+
s();
|
|
49
53
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
54
|
+
function E(e) {
|
|
55
|
+
o.preventEnter && e.preventDefault(), e.stopPropagation();
|
|
52
56
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
57
|
+
function s() {
|
|
58
|
+
o.adjustToText && t.value && (t.value.style.height = "1px", t.value.style.height = 2 + t.value.scrollHeight + "px");
|
|
55
59
|
}
|
|
56
|
-
const { focus:
|
|
60
|
+
const { focus: c, blur: $ } = w(t), {
|
|
57
61
|
errorInternal: l,
|
|
58
|
-
hideFooterInternal:
|
|
59
|
-
isInsideForm:
|
|
60
|
-
inputListeners:
|
|
61
|
-
reset:
|
|
62
|
-
validate:
|
|
63
|
-
setError:
|
|
64
|
-
} =
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
hideFooterInternal: x,
|
|
63
|
+
isInsideForm: P,
|
|
64
|
+
inputListeners: j,
|
|
65
|
+
reset: f,
|
|
66
|
+
validate: q,
|
|
67
|
+
setError: L
|
|
68
|
+
} = d(o, { focus: c, emit: z }), R = i(() => {
|
|
69
|
+
const e = o.modelValue;
|
|
70
|
+
return e ? String(e).length : 0;
|
|
71
|
+
}), A = i(() => o.clearable && o.modelValue !== ""), { styles: F, classes: a, className: H } = _("Textarea", {}, o, { errorInternal: l });
|
|
72
|
+
return C({ focus: c, blur: $, reset: f, validate: q, setError: L }), (e, n) => (m(), u(re, {
|
|
73
|
+
style: X(r(F)),
|
|
67
74
|
block: e.block,
|
|
68
75
|
disabled: e.disabled,
|
|
69
76
|
required: e.required,
|
|
70
|
-
"is-inside-form": r(
|
|
77
|
+
"is-inside-form": r(P),
|
|
71
78
|
label: e.label,
|
|
72
|
-
class:
|
|
73
|
-
r(
|
|
74
|
-
r(
|
|
79
|
+
class: h([
|
|
80
|
+
r(H),
|
|
81
|
+
r(a).wrapper
|
|
75
82
|
]),
|
|
76
83
|
tooltip: e.tooltip
|
|
77
84
|
}, {
|
|
78
|
-
default:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
85
|
+
default: G(() => [
|
|
86
|
+
b("div", se, [
|
|
87
|
+
g(e.$slots, "prefix"),
|
|
88
|
+
b("textarea", J({
|
|
89
|
+
id: e.id,
|
|
90
|
+
ref_key: "elRef",
|
|
91
|
+
ref: t,
|
|
92
|
+
class: ["", [
|
|
93
|
+
r(a).input,
|
|
94
|
+
r(l) ? "border-error-500 dark:border-error-400 focus:outline-error-500" : "focus:outline-[color:var(--x-textarea-border)]"
|
|
95
|
+
]],
|
|
96
|
+
style: r(T),
|
|
97
|
+
disabled: e.disabled,
|
|
98
|
+
max: e.max,
|
|
99
|
+
maxlength: e.maxlength,
|
|
100
|
+
min: e.min,
|
|
101
|
+
dir: e.dir,
|
|
102
|
+
rows: e.rows,
|
|
103
|
+
minlength: e.minlength,
|
|
104
|
+
name: e.name,
|
|
105
|
+
placeholder: e.placeholder,
|
|
106
|
+
readonly: e.readonly,
|
|
107
|
+
value: typeof e.modelValue < "u" ? String(e.modelValue) : ""
|
|
108
|
+
}, B.value, M(r(j), !0), {
|
|
109
|
+
onKeydown: Q(E, ["enter"]),
|
|
110
|
+
onInput: V
|
|
111
|
+
}), null, 16, le),
|
|
112
|
+
g(e.$slots, "suffix", {}, () => [
|
|
113
|
+
A.value ? (m(), u(te, {
|
|
114
|
+
key: 0,
|
|
115
|
+
size: e.size,
|
|
116
|
+
icon: r(ne),
|
|
117
|
+
class: h(["right-2 cursor-pointer", r(a).icon]),
|
|
118
|
+
onClick: n[0] || (n[0] = (ue) => r(f)())
|
|
119
|
+
}, null, 8, ["size", "icon", "class"])) : v("", !0)
|
|
120
|
+
])
|
|
121
|
+
]),
|
|
122
|
+
r(x) ? v("", !0) : (m(), u(oe, {
|
|
104
123
|
key: 0,
|
|
105
124
|
error: r(l),
|
|
106
|
-
helper: e.helper
|
|
107
|
-
|
|
125
|
+
helper: e.helper,
|
|
126
|
+
"character-count": R.value,
|
|
127
|
+
"max-characters": e.maxlength,
|
|
128
|
+
"show-counter": e.showCounter
|
|
129
|
+
}, null, 8, ["error", "helper", "character-count", "max-characters", "show-counter"]))
|
|
108
130
|
]),
|
|
109
|
-
_:
|
|
131
|
+
_: 3
|
|
110
132
|
}, 8, ["style", "block", "disabled", "required", "is-inside-form", "label", "class", "tooltip"]));
|
|
111
133
|
}
|
|
112
134
|
});
|
|
113
135
|
export {
|
|
114
|
-
|
|
136
|
+
ke as default
|
|
115
137
|
};
|
|
@@ -4,7 +4,8 @@ const a = {
|
|
|
4
4
|
input: ({ props: s, data: r }) => {
|
|
5
5
|
const e = ["appearance-none block w-full placeholder-secondary-400 dark:placeholder-secondary-500 outline-transparent outline outline-2 outline-offset-[-1px] transition duration-150 ease-in-out border-secondary-300 dark:border-secondary-700 border shadow-sm rounded-md"];
|
|
6
6
|
return s.resizable || e.push("resize-none"), !r.errorInternal && !s.disabled && e.push("hover:border-secondary-400 dark:hover:border-secondary-500"), s.size === "xs" ? e.push("px-2 py-1 text-xs") : s.size === "sm" ? e.push("px-2 py-1.5 text-sm") : s.size === "lg" ? e.push("px-4 py-3 text-lg") : s.size === "xl" ? e.push("px-5 py-4 text-xl") : e.push("px-3 py-2"), e.push(s.disabled ? "bg-secondary-100 dark:bg-secondary-700 text-secondary-400 dark:text-secondary-600 cursor-not-allowed" : "bg-white dark:bg-secondary-800 text-secondary-700 dark:text-secondary-200"), e;
|
|
7
|
-
}
|
|
7
|
+
},
|
|
8
|
+
icon: "text-secondary-600 dark:text-secondary-300 absolute my-auto inset-y-0"
|
|
8
9
|
}
|
|
9
10
|
}, t = a;
|
|
10
11
|
export {
|
|
@@ -4,7 +4,8 @@ const a = {
|
|
|
4
4
|
input: ({ props: r, data: s }) => {
|
|
5
5
|
const e = ["resize-none appearance-none block w-full placeholder-secondary-400 dark:placeholder-secondary-500 outline-transparent outline outline-2 outline-offset-[-1px] transition duration-150 ease-in-out border-secondary-300 dark:border-secondary-700 border-b text-sm px-4"];
|
|
6
6
|
return !s.errorInternal && !r.disabled && e.push("hover:border-secondary-400 dark:hover:border-secondary-500"), r.size === "xs" || r.size === "sm" ? e.push("py-1.5") : r.size === "lg" || r.size === "xl" ? e.push("py-3.5") : e.push("py-2.5"), r.disabled ? e.push("bg-secondary-100 dark:bg-secondary-900 text-secondary-300 cursor-not-allowed") : r.readonly ? e.push("bg-white dark:bg-secondary-900 text-secondary-700") : e.push("bg-secondary-50 dark:bg-secondary-800 text-secondary-700 dark:text-secondary-200"), e;
|
|
7
|
-
}
|
|
7
|
+
},
|
|
8
|
+
icon: "text-secondary-600 dark:text-secondary-300 absolute my-auto inset-y-0"
|
|
8
9
|
}
|
|
9
10
|
}, n = a;
|
|
10
11
|
export {
|