@indielayer/ui 1.7.3 → 1.7.5
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/input/usage.vue +3 -2
- package/lib/components/input/Input.vue.js +56 -56
- package/lib/components/select/Select.vue.js +129 -127
- package/lib/components/textarea/Textarea.vue.js +50 -50
- package/lib/index.umd.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/input/Input.vue +11 -1
- package/src/components/select/Select.vue +6 -3
- package/src/components/textarea/Textarea.vue +11 -1
- package/src/version.ts +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
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
|
-
const
|
|
12
|
-
...
|
|
13
|
-
...
|
|
14
|
-
...
|
|
1
|
+
import { defineComponent as q, useAttrs as K, computed as R, ref as A, watch as F, openBlock as u, createBlock as p, normalizeStyle as H, unref as r, normalizeClass as L, withCtx as O, createElementVNode as $, mergeProps as D, toHandlers as W, withKeys as X, createCommentVNode as G } from "vue";
|
|
2
|
+
import { useResizeObserver as J, useEventListener as M } from "../../node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.9/node_modules/@vueuse/core/index.js";
|
|
3
|
+
import { useCSS as Q } from "../../composables/useCSS.js";
|
|
4
|
+
import { useTheme as U } from "../../composables/useTheme.js";
|
|
5
|
+
import { useCommon as f } from "../../composables/useCommon.js";
|
|
6
|
+
import { useColors as Y } from "../../composables/useColors.js";
|
|
7
|
+
import { useInputtable as a } from "../../composables/useInputtable.js";
|
|
8
|
+
import { useInteractive as c } from "../../composables/useInteractive.js";
|
|
9
|
+
import Z from "../label/Label.vue.js";
|
|
10
|
+
import _ from "../inputFooter/InputFooter.vue.js";
|
|
11
|
+
const ee = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlength", "name", "placeholder", "readonly", "value", "onKeydown"], re = {
|
|
12
|
+
...f.props(),
|
|
13
|
+
...c.props(),
|
|
14
|
+
...a.props(),
|
|
15
15
|
dir: {
|
|
16
16
|
type: String,
|
|
17
17
|
default: "ltr"
|
|
@@ -29,62 +29,62 @@ const U = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlengt
|
|
|
29
29
|
preventEnter: Boolean,
|
|
30
30
|
block: Boolean,
|
|
31
31
|
resizable: Boolean
|
|
32
|
-
},
|
|
32
|
+
}, oe = {
|
|
33
33
|
name: "XTextarea",
|
|
34
34
|
validators: {
|
|
35
|
-
...
|
|
35
|
+
...f.validators()
|
|
36
36
|
}
|
|
37
|
-
},
|
|
38
|
-
...
|
|
39
|
-
props:
|
|
40
|
-
emits:
|
|
41
|
-
setup(
|
|
42
|
-
const t =
|
|
43
|
-
|
|
37
|
+
}, ce = /* @__PURE__ */ q({
|
|
38
|
+
...oe,
|
|
39
|
+
props: re,
|
|
40
|
+
emits: a.emits(),
|
|
41
|
+
setup(h, { expose: b, emit: g }) {
|
|
42
|
+
const t = h, y = g, i = K(), v = R(() => Object.keys(i).reduce((e, s) => (s.startsWith("data-") && (e[s] = i[s]), e), {})), o = A(null);
|
|
43
|
+
J(o, n), typeof window < "u" && M(window, "resize", n), F([() => t.modelValue, () => t.size], () => {
|
|
44
44
|
setTimeout(n);
|
|
45
45
|
});
|
|
46
|
-
const
|
|
47
|
-
function
|
|
46
|
+
const w = Q("textarea"), S = Y().getPalette("primary"), k = w.get("border", S[400]);
|
|
47
|
+
function N() {
|
|
48
48
|
n();
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function T(e) {
|
|
51
51
|
t.preventEnter && e.preventDefault(), e.stopPropagation();
|
|
52
52
|
}
|
|
53
53
|
function n() {
|
|
54
54
|
t.adjustToText && o.value && (o.value.style.height = "1px", o.value.style.height = 2 + o.value.scrollHeight + "px");
|
|
55
55
|
}
|
|
56
|
-
const { focus:
|
|
56
|
+
const { focus: m, blur: z } = c(o), {
|
|
57
57
|
errorInternal: l,
|
|
58
|
-
hideFooterInternal:
|
|
59
|
-
isInsideForm:
|
|
60
|
-
inputListeners:
|
|
61
|
-
reset:
|
|
62
|
-
validate:
|
|
63
|
-
setError:
|
|
64
|
-
} =
|
|
65
|
-
return
|
|
66
|
-
style:
|
|
58
|
+
hideFooterInternal: C,
|
|
59
|
+
isInsideForm: B,
|
|
60
|
+
inputListeners: E,
|
|
61
|
+
reset: I,
|
|
62
|
+
validate: V,
|
|
63
|
+
setError: x
|
|
64
|
+
} = a(t, { focus: m, emit: y }), { styles: P, classes: d, className: j } = U("Textarea", {}, t, { errorInternal: l });
|
|
65
|
+
return b({ focus: m, blur: z, reset: I, validate: V, setError: x }), (e, s) => (u(), p(Z, {
|
|
66
|
+
style: H(r(P)),
|
|
67
67
|
block: e.block,
|
|
68
68
|
disabled: e.disabled,
|
|
69
69
|
required: e.required,
|
|
70
|
-
"is-inside-form": r(
|
|
70
|
+
"is-inside-form": r(B),
|
|
71
71
|
label: e.label,
|
|
72
|
-
class:
|
|
73
|
-
r(
|
|
74
|
-
r(
|
|
72
|
+
class: L([
|
|
73
|
+
r(j),
|
|
74
|
+
r(d).wrapper
|
|
75
75
|
]),
|
|
76
76
|
tooltip: e.tooltip
|
|
77
77
|
}, {
|
|
78
|
-
default:
|
|
79
|
-
|
|
78
|
+
default: O(() => [
|
|
79
|
+
$("textarea", D({
|
|
80
80
|
id: e.id,
|
|
81
81
|
ref_key: "elRef",
|
|
82
82
|
ref: o,
|
|
83
83
|
class: ["", [
|
|
84
|
-
r(
|
|
84
|
+
r(d).input,
|
|
85
85
|
r(l) ? "border-error-500 dark:border-error-400 focus:outline-error-500" : "focus:outline-[color:var(--x-textarea-border)]"
|
|
86
86
|
]],
|
|
87
|
-
style: r(
|
|
87
|
+
style: r(k),
|
|
88
88
|
disabled: e.disabled,
|
|
89
89
|
max: e.max,
|
|
90
90
|
maxlength: e.maxlength,
|
|
@@ -96,11 +96,11 @@ const U = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlengt
|
|
|
96
96
|
placeholder: e.placeholder,
|
|
97
97
|
readonly: e.readonly,
|
|
98
98
|
value: typeof e.modelValue < "u" ? String(e.modelValue) : ""
|
|
99
|
-
},
|
|
100
|
-
onKeydown:
|
|
101
|
-
onInput:
|
|
102
|
-
}), null, 16,
|
|
103
|
-
r(
|
|
99
|
+
}, v.value, W(r(E), !0), {
|
|
100
|
+
onKeydown: X(T, ["enter"]),
|
|
101
|
+
onInput: N
|
|
102
|
+
}), null, 16, ee),
|
|
103
|
+
r(C) ? G("", !0) : (u(), p(_, {
|
|
104
104
|
key: 0,
|
|
105
105
|
error: r(l),
|
|
106
106
|
helper: e.helper
|
|
@@ -111,5 +111,5 @@ const U = ["id", "disabled", "max", "maxlength", "min", "dir", "rows", "minlengt
|
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
export {
|
|
114
|
-
|
|
114
|
+
ce as default
|
|
115
115
|
};
|