@wikicasa-dev/components 1.8.1 → 1.8.3
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,48 +1,39 @@
|
|
|
1
1
|
import { defineComponent as s, openBlock as a, createElementBlock as l, normalizeClass as t, withModifiers as o, createElementVNode as n, createCommentVNode as r } from "vue";
|
|
2
|
-
import { _ as
|
|
3
|
-
import './assets/BaseFloatingLabel.css';const
|
|
4
|
-
|
|
2
|
+
import { _ as d } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
3
|
+
import './assets/BaseFloatingLabel.css';const u = ["for"], k = ["innerHTML"], m = /* @__PURE__ */ s({
|
|
4
|
+
__name: "BaseFloatingLabel",
|
|
5
5
|
props: {
|
|
6
|
-
labelState: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
isValid: {
|
|
11
|
-
type: Boolean,
|
|
12
|
-
default: () => null
|
|
13
|
-
},
|
|
14
|
-
labelText: {
|
|
15
|
-
type: String,
|
|
16
|
-
required: !0
|
|
17
|
-
},
|
|
18
|
-
disabled: {
|
|
19
|
-
type: [String, Boolean],
|
|
20
|
-
default: !1
|
|
21
|
-
}
|
|
6
|
+
labelState: { default: "inline-label" },
|
|
7
|
+
isValid: { default: null },
|
|
8
|
+
labelText: {},
|
|
9
|
+
disabled: { type: [String, Boolean], default: !1 }
|
|
22
10
|
},
|
|
23
|
-
emits: ["click"]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
11
|
+
emits: ["click"],
|
|
12
|
+
setup(p, { emit: b }) {
|
|
13
|
+
return (e, i) => (a(), l("label", {
|
|
14
|
+
for: e.$attrs.for,
|
|
15
|
+
class: t(["uikit-absolute uikit-left-15px uikit-h-5 uikit-text-sm", [
|
|
16
|
+
e.labelState,
|
|
17
|
+
{ "uikit-text-w-secondary": e.disabled },
|
|
18
|
+
e.$attrs["label-classes"]
|
|
19
|
+
]]),
|
|
20
|
+
onClick: i[0] || (i[0] = o((f) => e.$emit("click"), ["stop"]))
|
|
21
|
+
}, [
|
|
22
|
+
n("span", {
|
|
23
|
+
class: t(["uikit-text uikit-font-medium uikit-text-w-black", { "!uikit-text-w-secondary": e.disabled }]),
|
|
24
|
+
innerHTML: e.labelText
|
|
25
|
+
}, null, 10, k),
|
|
26
|
+
e.$attrs.required ? (a(), l("sup", {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: t(["uikit-absolute -uikit-top-[0.3rem] uikit-text", [
|
|
29
|
+
{ "uikit-text-w-secondary": e.disabled },
|
|
30
|
+
{ "uikit-text-w-danger": e.isValid === !1 },
|
|
31
|
+
{ "uikit-text-w-primary": (e.isValid || e.isValid === null) && !e.disabled }
|
|
32
|
+
]])
|
|
33
|
+
}, " *", 2)) : r("", !0)
|
|
34
|
+
], 10, u));
|
|
35
|
+
}
|
|
36
|
+
}), y = /* @__PURE__ */ d(m, [["__scopeId", "data-v-5a3dceb6"]]);
|
|
46
37
|
export {
|
|
47
|
-
|
|
38
|
+
y as default
|
|
48
39
|
};
|
package/dist/BaseTextarea.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useFloatingLabel as
|
|
4
|
-
import { _ as
|
|
5
|
-
import './assets/BaseTextarea.css';const
|
|
1
|
+
import { defineComponent as $, mergeModels as f, useModel as h, ref as x, watch as L, openBlock as k, createElementBlock as b, normalizeClass as s, createElementVNode as o, unref as l, withModifiers as d, createCommentVNode as p, createVNode as M, nextTick as F } from "vue";
|
|
2
|
+
import B from "./BaseFloatingLabel.js";
|
|
3
|
+
import { useFloatingLabel as z } from "./useFloatingLabel.js";
|
|
4
|
+
import { _ as C } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
|
+
import './assets/BaseTextarea.css';const E = ["id", "data-cy", "rows", "disabled", "aria-labelledby", "readonly", "value"], H = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "uikit-visible uikit-float-none uikit-ml-2 uikit-block uikit-h-3 uikit-w-auto uikit-max-w-full uikit-overflow-hidden uikit-whitespace-nowrap uikit-p-0 uikit-text uikit-duration-[50s] uikit-ease-out"
|
|
8
|
-
},
|
|
8
|
+
}, I = ["innerHTML"], q = ["innerHTML"], A = /* @__PURE__ */ $({
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
__name: "BaseTextarea",
|
|
11
11
|
props: /* @__PURE__ */ f({
|
|
@@ -19,21 +19,22 @@ import './assets/BaseTextarea.css';const H = ["id", "data-cy", "rows", "disabled
|
|
|
19
19
|
}),
|
|
20
20
|
emits: /* @__PURE__ */ f(["focusin", "focusout", "click", "keydown"], ["update:modelValue"]),
|
|
21
21
|
setup(v, { expose: m, emit: c }) {
|
|
22
|
-
const
|
|
22
|
+
const r = h(v, "modelValue"), n = c, {
|
|
23
23
|
labelState: a,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
handleFocusIn: w,
|
|
25
|
+
handleFocusOut: g,
|
|
26
|
+
setFloatingLabel: y,
|
|
27
|
+
setInlineLabel: V
|
|
28
|
+
} = z(n), i = x(null);
|
|
29
|
+
L(
|
|
30
|
+
r,
|
|
31
|
+
(e) => {
|
|
32
|
+
`${e}`.length && a.value !== "floating-label" ? y() : !e?.length && a.value !== "inline-label" && document.activeElement !== i.value && V();
|
|
33
|
+
},
|
|
34
|
+
{ immediate: !0 }
|
|
35
|
+
);
|
|
36
|
+
const T = ({ target: e }) => {
|
|
37
|
+
r.value = e.value;
|
|
37
38
|
};
|
|
38
39
|
return m({
|
|
39
40
|
disableTextarea: () => {
|
|
@@ -43,7 +44,7 @@ import './assets/BaseTextarea.css';const H = ["id", "data-cy", "rows", "disabled
|
|
|
43
44
|
i.value && (i.value.value = "");
|
|
44
45
|
},
|
|
45
46
|
focusDisabledTextarea: () => {
|
|
46
|
-
i.value && (i.value.removeAttribute("readonly"), i.value.classList.remove("disabled"),
|
|
47
|
+
i.value && (i.value.removeAttribute("readonly"), i.value.classList.remove("disabled"), F(() => {
|
|
47
48
|
i.value && i.value.focus();
|
|
48
49
|
}));
|
|
49
50
|
}
|
|
@@ -70,13 +71,13 @@ import './assets/BaseTextarea.css';const H = ["id", "data-cy", "rows", "disabled
|
|
|
70
71
|
disabled: e.$attrs.disabled,
|
|
71
72
|
"aria-labelledby": e.$attrs.id,
|
|
72
73
|
readonly: e.$attrs.readonly,
|
|
73
|
-
onFocusin: t[0] || (t[0] = d((
|
|
74
|
-
onFocusout: t[1] || (t[1] = d((
|
|
75
|
-
onInput: d(
|
|
76
|
-
onKeydown: t[2] || (t[2] = d((
|
|
77
|
-
onClick: t[3] || (t[3] = (
|
|
78
|
-
value:
|
|
79
|
-
}, null, 42,
|
|
74
|
+
onFocusin: t[0] || (t[0] = d((u) => l(w)(), ["stop"])),
|
|
75
|
+
onFocusout: t[1] || (t[1] = d((u) => l(g)(`${r.value}`.trim()), ["stop"])),
|
|
76
|
+
onInput: d(T, ["stop"]),
|
|
77
|
+
onKeydown: t[2] || (t[2] = d((u) => n("keydown", u), ["stop"])),
|
|
78
|
+
onClick: t[3] || (t[3] = (u) => n("click", u)),
|
|
79
|
+
value: r.value
|
|
80
|
+
}, null, 42, E),
|
|
80
81
|
o("fieldset", {
|
|
81
82
|
class: s(["uikit-pointer-events-none uikit-absolute -uikit-top-0 uikit-bottom-[3px] uikit-left-0 uikit-right-0 uikit-m-0 uikit-min-w-0 uikit-overflow-hidden uikit-rounded-xs uikit-border uikit-border-solid uikit-bg-white uikit-p-0 uikit-px-2 uikit-text-start uikit-transition-[border] uikit-duration-100 uikit-ease-out peer-focus/fieldset:uikit-border-2 peer-focus/fieldset:uikit-border-w-primary peer-disabled/fieldset:uikit-bg-w-cultured peer-[&.disabled]/fieldset:uikit-bg-w-cultured peer-focus/fieldset:[&.is-invalid]:uikit-border-w-danger", [
|
|
82
83
|
{ "is-invalid": e.isValid === !1, "is-valid": e.isValid },
|
|
@@ -85,7 +86,7 @@ import './assets/BaseTextarea.css';const H = ["id", "data-cy", "rows", "disabled
|
|
|
85
86
|
{ "uikit-border-w-secondary": e.isValid === null }
|
|
86
87
|
]])
|
|
87
88
|
}, [
|
|
88
|
-
e.labelText ? (k(), b("legend",
|
|
89
|
+
e.labelText ? (k(), b("legend", H, [
|
|
89
90
|
o("span", {
|
|
90
91
|
class: s(["uikit-px-5px uikit-opacity-0", [
|
|
91
92
|
{
|
|
@@ -96,10 +97,10 @@ import './assets/BaseTextarea.css';const H = ["id", "data-cy", "rows", "disabled
|
|
|
96
97
|
}
|
|
97
98
|
]]),
|
|
98
99
|
innerHTML: e.labelText
|
|
99
|
-
}, null, 10,
|
|
100
|
+
}, null, 10, I)
|
|
100
101
|
])) : p("", !0)
|
|
101
102
|
], 2),
|
|
102
|
-
|
|
103
|
+
M(B, {
|
|
103
104
|
for: e.$attrs.id,
|
|
104
105
|
"label-text": e.labelText,
|
|
105
106
|
"label-state": l(a),
|
|
@@ -117,10 +118,10 @@ import './assets/BaseTextarea.css';const H = ["id", "data-cy", "rows", "disabled
|
|
|
117
118
|
e.isValid === !1 ? "uikit-mt-1 uikit-text-12 uikit-text-w-danger" : "uikit-mt-1 uikit-text-12 uikit-text-w-primary"
|
|
118
119
|
),
|
|
119
120
|
innerHTML: e.isValid === !1 ? e.feedback.invalid : e.feedback.valid
|
|
120
|
-
}, null, 10,
|
|
121
|
+
}, null, 10, q)) : p("", !0)
|
|
121
122
|
], 2));
|
|
122
123
|
}
|
|
123
|
-
}),
|
|
124
|
+
}), J = /* @__PURE__ */ C(A, [["__scopeId", "data-v-b3053514"]]);
|
|
124
125
|
export {
|
|
125
|
-
|
|
126
|
+
J as default
|
|
126
127
|
};
|
|
@@ -1,41 +1,27 @@
|
|
|
1
1
|
import { Nullable } from '@wikicasa-dev/types';
|
|
2
2
|
|
|
3
3
|
type LabelState = "inline-label" | "floating-label";
|
|
4
|
-
declare const _default: import('vue').DefineComponent<{
|
|
5
|
-
labelState
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
isValid: {
|
|
27
|
-
type: () => Nullable<boolean>;
|
|
28
|
-
default: () => Nullable<boolean>;
|
|
29
|
-
};
|
|
30
|
-
labelText: {
|
|
31
|
-
type: StringConstructor;
|
|
32
|
-
required: true;
|
|
33
|
-
};
|
|
34
|
-
disabled: {
|
|
35
|
-
type: (BooleanConstructor | StringConstructor)[];
|
|
36
|
-
default: boolean;
|
|
37
|
-
};
|
|
38
|
-
}>> & {
|
|
4
|
+
declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
5
|
+
labelState?: LabelState;
|
|
6
|
+
isValid?: Nullable<boolean>;
|
|
7
|
+
labelText: string;
|
|
8
|
+
disabled?: string | boolean;
|
|
9
|
+
}>, {
|
|
10
|
+
labelState: string;
|
|
11
|
+
isValid: null;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
+
click: (...args: any[]) => void;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
16
|
+
labelState?: LabelState;
|
|
17
|
+
isValid?: Nullable<boolean>;
|
|
18
|
+
labelText: string;
|
|
19
|
+
disabled?: string | boolean;
|
|
20
|
+
}>, {
|
|
21
|
+
labelState: string;
|
|
22
|
+
isValid: null;
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
}>>> & {
|
|
39
25
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
40
26
|
}, {
|
|
41
27
|
labelState: LabelState;
|
|
@@ -43,3 +29,20 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
43
29
|
disabled: string | boolean;
|
|
44
30
|
}, {}>;
|
|
45
31
|
export default _default;
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
type __VLS_WithDefaults<P, D> = {
|
|
42
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
43
|
+
default: D[K];
|
|
44
|
+
}> : P[K];
|
|
45
|
+
};
|
|
46
|
+
type __VLS_Prettify<T> = {
|
|
47
|
+
[K in keyof T]: T[K];
|
|
48
|
+
} & {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.floating-label[data-v-
|
|
1
|
+
.floating-label[data-v-5a3dceb6]{top:-10px;left:1.25rem;border-radius:5px;font-size:14px;line-height:18px}.inline-label[data-v-5a3dceb6]{top:.75rem;background-color:transparent;font-size:16px;line-height:20px}.inline-label>span[data-v-5a3dceb6]{--tw-text-opacity: 1;color:rgb(109 118 135 / var(--tw-text-opacity))}.floating-label[data-v-5a3dceb6],.inline-label[data-v-5a3dceb6]{transition-property:top,left;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;will-change:top,left}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.invalid-bg[data-v-
|
|
1
|
+
.invalid-bg[data-v-b3053514]{--invalid-img: url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMicgaGVpZ2h0PScxMicgZmlsbD0nbm9uZScgc3Ryb2tlPScjRkE0RjY0Jz48Y2lyY2xlIGN4PSc2JyBjeT0nNicgcj0nNC41Jy8+PHBhdGggc3Ryb2tlLWxpbmVqb2luPSdyb3VuZCcgZD0nTTUuOCAzLjZoLjRMNiA2LjV6Jy8+PGNpcmNsZSBjeD0nNicgY3k9JzguMicgcj0nLjYnIGZpbGw9JyNGQTRGNjQnIHN0cm9rZT0nbm9uZScvPjwvc3ZnPg==);background-image:var(--invalid-img)}.valid-bg[data-v-b3053514]{--valid-img: url(data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA4IDgnPjxwYXRoIGZpbGw9JyMyQjVERkYnIGQ9J00yLjMgNi43My42IDQuNTNjLS40LTEuMDQuNDYtMS40IDEuMS0uOGwxLjEgMS40IDMuNC0zLjhjLjYtLjYzIDEuNi0uMjcgMS4yLjdsLTQgNC42Yy0uNDMuNS0uOC40LTEuMS4xeicvPjwvc3ZnPg==);background-image:var(--valid-img)}.invalid-bg[data-v-b3053514],.valid-bg[data-v-b3053514]{background-position:top 0px right 12px;background-size:20px}.textarea-scrollbar[data-v-b3053514]::-webkit-scrollbar{width:8px;height:6px}.textarea-scrollbar[data-v-b3053514]::-webkit-scrollbar-track{--tw-bg-opacity: 1;background-color:rgb(244 247 255 / var(--tw-bg-opacity))}.textarea-scrollbar[data-v-b3053514]::-webkit-scrollbar-thumb{border-radius:5px;--tw-bg-opacity: 1;background-color:rgb(180 194 240 / var(--tw-bg-opacity))}.is-valid.textarea-scrollbar[data-v-b3053514]::-webkit-scrollbar-thumb{background-color:#2b5dff!important}.is-invalid.textarea-scrollbar[data-v-b3053514]::-webkit-scrollbar-thumb{background-color:#fa4f64!important}
|