sit-onyx 0.0.0 → 0.1.0-alpha.1
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/README.md +2 -2
- package/dist/components/TestInput/TestInput.stories.d.ts +9 -0
- package/dist/components/TestInput/TestInput.vue.d.ts +50 -16
- package/dist/i18n/index.d.ts +46 -0
- package/dist/i18n/locales/en-US.json.d.ts +22 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +132 -28
- package/dist/style.css +1 -1
- package/dist/types/i18n.d.ts +59 -0
- package/dist/types/utils.d.ts +6 -0
- package/dist/utils/forms.d.ts +5 -0
- package/package.json +15 -15
- package/src/i18n/locales/de-DE.json +19 -0
- package/src/i18n/locales/en-US.json +19 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
</a>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# onyx
|
|
10
10
|
|
|
11
11
|
A design system and Vue.js component library created by [Schwarz IT](https://it.schwarz).
|
|
12
12
|
|
|
@@ -40,7 +40,7 @@ After that, import the global CSS file in your `main.ts` file:
|
|
|
40
40
|
|
|
41
41
|
```ts
|
|
42
42
|
import "sit-onyx/style.css";
|
|
43
|
-
// if you override some
|
|
43
|
+
// if you override some onyx styles (e.g. CSS variables),
|
|
44
44
|
// make sure to import your custom CSS file after the default "sit-onyx/style.css"
|
|
45
45
|
```
|
|
46
46
|
|
|
@@ -1,30 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
|
|
1
|
+
export type TestInputProps = {
|
|
2
|
+
/**
|
|
3
|
+
* The current input value
|
|
4
|
+
* TODO: remove the "number" once we separated number inputs from the other types.
|
|
5
|
+
*/
|
|
6
|
+
modelValue?: string | number;
|
|
4
7
|
/** Label to show next to the input */
|
|
5
|
-
label?: string
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
label?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Error message to show when the input is invalid. Will only show up after the input was touched.
|
|
11
|
+
* If unset, a default error message is used that is provided by onyx depending
|
|
12
|
+
* on your current locale/language and validation.
|
|
13
|
+
*/
|
|
14
|
+
errorMessage?: string;
|
|
15
|
+
/** For validation: Whether a non-empty value is required */
|
|
16
|
+
required?: boolean;
|
|
17
|
+
/** For validation: The pattern that the value must match */
|
|
18
|
+
pattern?: string;
|
|
19
|
+
/** For validation: The expected type of the input's value */
|
|
20
|
+
type?: InputType;
|
|
21
|
+
/** For validation: The upper limit of a number value */
|
|
22
|
+
max?: number;
|
|
23
|
+
/**
|
|
24
|
+
* For validation: Expected maximal length of a string value. Warning: when the value is (pre)set by code,
|
|
25
|
+
* the input invalidity can not be detected by the browser, it will only show as invalid
|
|
26
|
+
* as soon as a user interacts with the input (types something).
|
|
27
|
+
*/
|
|
28
|
+
maxLength?: number;
|
|
29
|
+
/** For validation: The lower limit of a number value */
|
|
30
|
+
min?: number;
|
|
31
|
+
/** Step size of a number value */
|
|
32
|
+
step?: number;
|
|
33
|
+
/**
|
|
34
|
+
* For validation: Expected minimal length of a string value. Warning: when the value is (pre)set by code,
|
|
35
|
+
* the input invalidity can not be detected by the browser, it will only show as invalid
|
|
36
|
+
* as soon as a user interacts with the input (types something).
|
|
37
|
+
*/
|
|
38
|
+
minLength?: number;
|
|
39
|
+
};
|
|
40
|
+
export declare const INPUT_TYPES: readonly ["email", "number", "password", "search", "tel", "text", "url"];
|
|
41
|
+
export type InputType = (typeof INPUT_TYPES)[number];
|
|
42
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TestInputProps>, {
|
|
8
43
|
modelValue: string;
|
|
9
44
|
label: string;
|
|
45
|
+
type: string;
|
|
10
46
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
-
"update:modelValue": (value: string) => void;
|
|
47
|
+
"update:modelValue": (value: string | number) => void;
|
|
12
48
|
change: (value: string) => void;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
modelValue?: string | undefined;
|
|
16
|
-
/** Label to show next to the input */
|
|
17
|
-
label?: string | undefined;
|
|
18
|
-
required?: boolean | undefined;
|
|
19
|
-
}>, {
|
|
49
|
+
validityChange: (state: ValidityState) => void;
|
|
50
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TestInputProps>, {
|
|
20
51
|
modelValue: string;
|
|
21
52
|
label: string;
|
|
53
|
+
type: string;
|
|
22
54
|
}>>> & {
|
|
23
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
55
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
24
56
|
onChange?: ((value: string) => any) | undefined;
|
|
57
|
+
onValidityChange?: ((state: ValidityState) => any) | undefined;
|
|
25
58
|
}, {
|
|
26
|
-
modelValue: string;
|
|
59
|
+
modelValue: string | number;
|
|
27
60
|
label: string;
|
|
61
|
+
type: "number" | "search" | "email" | "tel" | "url" | "password" | "text";
|
|
28
62
|
}, {}>;
|
|
29
63
|
export default _default;
|
|
30
64
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ObjectToDottedStrings } from '../types/i18n';
|
|
2
|
+
import type { DeepPartial } from '../types/utils';
|
|
3
|
+
import { type MaybeRef } from "vue";
|
|
4
|
+
import enUS from "./locales/en-US.json";
|
|
5
|
+
/** Available translations that are used by onyx components. */
|
|
6
|
+
export type OnyxTranslations = typeof enUS;
|
|
7
|
+
export type ProvideI18nOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* Current locale / language to use.
|
|
10
|
+
* If a ref is passed (e.g. the locale from the `vue-i18n` package)
|
|
11
|
+
* all onyx messages will be updated if it changes (if locale is supported).
|
|
12
|
+
* If a message is missing for your currently set locale, English will be used as fallback.
|
|
13
|
+
*
|
|
14
|
+
* @default "en-US"
|
|
15
|
+
*/
|
|
16
|
+
locale?: MaybeRef<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Available translations / messages. English is always supported. For build-in translations, see:
|
|
19
|
+
* https://onyx.schwarz/i18n/
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import deDE from "sit-onyx/locales/de-DE.json";
|
|
24
|
+
* {
|
|
25
|
+
* messages: {
|
|
26
|
+
* // English is always supported so we don't need to add it here
|
|
27
|
+
* 'de-DE': deDE
|
|
28
|
+
* }
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
messages?: Record<string, DeepPartial<OnyxTranslations>>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Provides a global i18n instance that is used by onyx.
|
|
36
|
+
* Must only be called once in the `App.vue` file of a project that consumes onyx.
|
|
37
|
+
*/
|
|
38
|
+
export declare const provideI18n: (options: ProvideI18nOptions) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Injects the onyx i18n instance.
|
|
41
|
+
* Creates a fallback if provide was never called.
|
|
42
|
+
*/
|
|
43
|
+
export declare const injectI18n: () => {
|
|
44
|
+
locale: import("vue").ComputedRef<string>;
|
|
45
|
+
t: import("vue").ComputedRef<(key: ObjectToDottedStrings<OnyxTranslations>, placeholders?: Record<string, string | number | undefined>) => string>;
|
|
46
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"validations": {
|
|
3
|
+
"tooShort": "Please lengthen this text to {minLength} characters or more (you are currently using 1 character) | Please lengthen this text to {minLength} characters or more (you are currently using {n} characters)",
|
|
4
|
+
"tooLong": "Please shorten this text to {maxLength} characters or less (you are currently using 1 character) | Please shorten this text to {maxLength} characters or less (you are currently using {n} characters)",
|
|
5
|
+
"rangeUnderflow": "Value must be greater than or equal to {min}",
|
|
6
|
+
"rangeOverflow": "Value must be less than or equal to {max}",
|
|
7
|
+
"patternMismatch": "Please match the format requested.",
|
|
8
|
+
"valueMissing": "Please fill in this field.",
|
|
9
|
+
"stepMismatch": "Please enter a value that is a multiple of {step}.",
|
|
10
|
+
"badInput": "\"{value}\" does not match the expected type.",
|
|
11
|
+
"typeMismatch": {
|
|
12
|
+
"generic": "\"{value}\" does not match the expected type.",
|
|
13
|
+
"email": "\"{value}\" must be a valid email address.",
|
|
14
|
+
"number": "\"{value}\" must be a number.",
|
|
15
|
+
"tel": "\"{value}\" must be a valid phone number.",
|
|
16
|
+
"url": "\"{value}\" must a valid URL."
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
;
|
|
21
|
+
|
|
22
|
+
export default _default;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),M={tooShort:"Please lengthen this text to {minLength} characters or more (you are currently using 1 character) | Please lengthen this text to {minLength} characters or more (you are currently using {n} characters)",tooLong:"Please shorten this text to {maxLength} characters or less (you are currently using 1 character) | Please shorten this text to {maxLength} characters or less (you are currently using {n} characters)",rangeUnderflow:"Value must be greater than or equal to {min}",rangeOverflow:"Value must be less than or equal to {max}",patternMismatch:"Please match the format requested.",valueMissing:"Please fill in this field.",stepMismatch:"Please enter a value that is a multiple of {step}.",badInput:'"{value}" does not match the expected type.',typeMismatch:{generic:'"{value}" does not match the expected type.',email:'"{value}" must be a valid email address.',number:'"{value}" must be a number.',tel:'"{value}" must be a valid phone number.',url:'"{value}" must a valid URL.'}},p={validations:M},f=Symbol(),x=a=>{const n=t.computed(()=>t.unref(a==null?void 0:a.locale)??"en-US"),e=t.computed(()=>a!=null&&a.messages&&n.value in a.messages?a.messages[n.value]:p),r=t.computed(()=>(s,i={})=>{let l=y(s,e.value)??y(s,p)??"";const o=typeof i.n=="number"?i.n:void 0;return l=P(l,o),V(l,i)});return{locale:n,t:r}},S=a=>{t.provide(f,x(a))},I=()=>t.inject(f,()=>x(),!0),y=(a,n)=>{const e=a.split(".").reduce((r,s)=>!r||typeof r=="string"?r:r[s],n);return e&&typeof e=="string"?e:void 0},P=(a,n)=>{const e=a.split(" | ").map(s=>s.trim());if(e.length<=1)return a;let r=1;return n===0&&(r=0),n&&(n<=0||n>1)&&(r=2),e.length===2?r===1?e[0]:e[1]:e[r]},V=(a,n)=>n?Object.entries(n).reduce((r,[s,i])=>i===void 0?r:r.replace(new RegExp(`{${s}}`,"gi"),i.toString()),a).replace(/\s?{.*}\s?/gi,""):a,E=a=>{if(a.valueMissing)return"valueMissing";const n=Object.entries(Object.getOwnPropertyDescriptors(ValidityState.prototype)).filter(([e,r])=>e!=="valid"&&r.enumerable).map(([e])=>e);for(const e of n)if(e in a&&a[e])return e},L={key:0,class:"onyx-input__error","aria-live":"polite"},T={class:"onyx-input__info"},C=Object.keys(p.validations.typeMismatch),N=t.defineComponent({__name:"TestInput",props:{modelValue:{default:""},label:{default:""},errorMessage:{},required:{type:Boolean},pattern:{},type:{default:"text"},max:{},maxLength:{},min:{},step:{},minLength:{}},emits:["update:modelValue","change","validityChange"],setup(a,{emit:n}){var d;const e=a,r=n,{t:s}=I(),i=t.ref(!1),l=t.ref(null),o=t.ref((d=l.value)==null?void 0:d.validity),m=t.computed({get:()=>e.modelValue,set:u=>r("update:modelValue",u)}),_=t.computed(()=>{if(!o.value||o.value.valid)return"";const u=E(o.value);if(e.errorMessage||u==="customError")return e.errorMessage;if(!u)return"";if(u==="typeMismatch"){const c=C.includes(e.type)?e.type:"generic";return s.value(`validations.typeMismatch.${c}`,{value:m.value})}return s.value(`validations.${u}`,{value:m.value,n:m.value.toString().length,minLength:e.minLength,maxLength:e.maxLength,min:e.min,max:e.max,step:e.step})}),b=u=>{const c=u.target;r("change",c.value)};return t.watch([m,l],()=>{l.value&&(o.value=l.value.validity)}),t.watch(o,u=>{u&&r("validityChange",u)},{deep:!0}),t.watch([e.errorMessage,l],()=>{l.value&&l.value.setCustomValidity(e.errorMessage||"")},{immediate:!0}),(u,c)=>{var v,g;return t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["onyx-input",{"onyx-input--touched":i.value}])},[t.createElementVNode("span",{class:t.normalizeClass(["onyx-input__label",{"onyx-input__label--required":e.required}])},t.toDisplayString(e.label),3),t.withDirectives(t.createElementVNode("input",t.mergeProps(e,{ref_key:"inputElement",ref:l,"onUpdate:modelValue":c[0]||(c[0]=h=>m.value=h),onChange:b,onBlur:c[1]||(c[1]=h=>i.value=!0)}),null,16),[[t.vModelDynamic,m.value]]),i.value&&!((v=o.value)!=null&&v.valid)?(t.openBlock(),t.createElementBlock("p",L,t.toDisplayString(_.value),1)):t.createCommentVNode("",!0),t.createElementVNode("p",T,'Model value: "'+t.toDisplayString(m.value)+'", is valid: '+t.toDisplayString((g=o.value)==null?void 0:g.valid),1)],2)}}}),O=(a,n)=>{const e=a.__vccOpts||a;for(const[r,s]of n)e[r]=s;return e},D=O(N,[["__scopeId","data-v-b84504d3"]]);exports.TestInput=D;exports.provideI18n=S;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,40 +1,144 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
1
|
+
import { provide as E, inject as C, computed as m, unref as O, defineComponent as N, ref as p, watch as d, openBlock as b, createElementBlock as M, normalizeClass as L, createElementVNode as g, toDisplayString as v, withDirectives as q, mergeProps as U, vModelDynamic as k, createCommentVNode as w } from "vue";
|
|
2
|
+
const D = {
|
|
3
|
+
tooShort: "Please lengthen this text to {minLength} characters or more (you are currently using 1 character) | Please lengthen this text to {minLength} characters or more (you are currently using {n} characters)",
|
|
4
|
+
tooLong: "Please shorten this text to {maxLength} characters or less (you are currently using 1 character) | Please shorten this text to {maxLength} characters or less (you are currently using {n} characters)",
|
|
5
|
+
rangeUnderflow: "Value must be greater than or equal to {min}",
|
|
6
|
+
rangeOverflow: "Value must be less than or equal to {max}",
|
|
7
|
+
patternMismatch: "Please match the format requested.",
|
|
8
|
+
valueMissing: "Please fill in this field.",
|
|
9
|
+
stepMismatch: "Please enter a value that is a multiple of {step}.",
|
|
10
|
+
badInput: '"{value}" does not match the expected type.',
|
|
11
|
+
typeMismatch: {
|
|
12
|
+
generic: '"{value}" does not match the expected type.',
|
|
13
|
+
email: '"{value}" must be a valid email address.',
|
|
14
|
+
number: '"{value}" must be a number.',
|
|
15
|
+
tel: '"{value}" must be a valid phone number.',
|
|
16
|
+
url: '"{value}" must a valid URL.'
|
|
17
|
+
}
|
|
18
|
+
}, h = {
|
|
19
|
+
validations: D
|
|
20
|
+
}, I = Symbol(), V = (t) => {
|
|
21
|
+
const r = m(() => O(t == null ? void 0 : t.locale) ?? "en-US"), e = m(() => t != null && t.messages && r.value in t.messages ? t.messages[r.value] : h), a = m(() => (n, u = {}) => {
|
|
22
|
+
let s = P(n, e.value) ?? P(n, h) ?? "";
|
|
23
|
+
const i = typeof u.n == "number" ? u.n : void 0;
|
|
24
|
+
return s = B(s, i), $(s, u);
|
|
25
|
+
});
|
|
26
|
+
return { locale: r, t: a };
|
|
27
|
+
}, G = (t) => {
|
|
28
|
+
E(I, V(t));
|
|
29
|
+
}, z = () => C(I, () => V(), !0), P = (t, r) => {
|
|
30
|
+
const e = t.split(".").reduce((a, n) => !a || typeof a == "string" ? a : a[n], r);
|
|
31
|
+
return e && typeof e == "string" ? e : void 0;
|
|
32
|
+
}, B = (t, r) => {
|
|
33
|
+
const e = t.split(" | ").map((n) => n.trim());
|
|
34
|
+
if (e.length <= 1)
|
|
35
|
+
return t;
|
|
36
|
+
let a = 1;
|
|
37
|
+
return r === 0 && (a = 0), r && (r <= 0 || r > 1) && (a = 2), e.length === 2 ? a === 1 ? e[0] : e[1] : e[a];
|
|
38
|
+
}, $ = (t, r) => r ? Object.entries(r).reduce((a, [n, u]) => u === void 0 ? a : a.replace(new RegExp(`{${n}}`, "gi"), u.toString()), t).replace(/\s?{.*}\s?/gi, "") : t, j = (t) => {
|
|
39
|
+
if (t.valueMissing)
|
|
40
|
+
return "valueMissing";
|
|
41
|
+
const r = Object.entries(
|
|
42
|
+
Object.getOwnPropertyDescriptors(ValidityState.prototype)
|
|
43
|
+
).filter(([e, a]) => e !== "valid" && a.enumerable).map(([e]) => e);
|
|
44
|
+
for (const e of r)
|
|
45
|
+
if (e in t && t[e])
|
|
46
|
+
return e;
|
|
47
|
+
}, R = {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: "onyx-input__error",
|
|
50
|
+
"aria-live": "polite"
|
|
51
|
+
}, A = { class: "onyx-input__info" }, Y = Object.keys(
|
|
52
|
+
h.validations.typeMismatch
|
|
53
|
+
), F = /* @__PURE__ */ N({
|
|
3
54
|
__name: "TestInput",
|
|
4
55
|
props: {
|
|
5
56
|
modelValue: { default: "" },
|
|
6
57
|
label: { default: "" },
|
|
7
|
-
|
|
58
|
+
errorMessage: {},
|
|
59
|
+
required: { type: Boolean },
|
|
60
|
+
pattern: {},
|
|
61
|
+
type: { default: "text" },
|
|
62
|
+
max: {},
|
|
63
|
+
maxLength: {},
|
|
64
|
+
min: {},
|
|
65
|
+
step: {},
|
|
66
|
+
minLength: {}
|
|
8
67
|
},
|
|
9
|
-
emits: ["update:modelValue", "change"],
|
|
10
|
-
setup(
|
|
11
|
-
|
|
68
|
+
emits: ["update:modelValue", "change", "validityChange"],
|
|
69
|
+
setup(t, { emit: r }) {
|
|
70
|
+
var y;
|
|
71
|
+
const e = t, a = r, { t: n } = z(), u = p(!1), s = p(null), i = p((y = s.value) == null ? void 0 : y.validity), c = m({
|
|
12
72
|
get: () => e.modelValue,
|
|
13
|
-
set: (
|
|
14
|
-
}),
|
|
15
|
-
|
|
73
|
+
set: (l) => a("update:modelValue", l)
|
|
74
|
+
}), S = m(() => {
|
|
75
|
+
if (!i.value || i.value.valid)
|
|
76
|
+
return "";
|
|
77
|
+
const l = j(i.value);
|
|
78
|
+
if (e.errorMessage || l === "customError")
|
|
79
|
+
return e.errorMessage;
|
|
80
|
+
if (!l)
|
|
81
|
+
return "";
|
|
82
|
+
if (l === "typeMismatch") {
|
|
83
|
+
const o = Y.includes(e.type) ? e.type : "generic";
|
|
84
|
+
return n.value(`validations.typeMismatch.${o}`, { value: c.value });
|
|
85
|
+
}
|
|
86
|
+
return n.value(`validations.${l}`, {
|
|
87
|
+
value: c.value,
|
|
88
|
+
n: c.value.toString().length,
|
|
89
|
+
minLength: e.minLength,
|
|
90
|
+
maxLength: e.maxLength,
|
|
91
|
+
min: e.min,
|
|
92
|
+
max: e.max,
|
|
93
|
+
step: e.step
|
|
94
|
+
});
|
|
95
|
+
}), T = (l) => {
|
|
96
|
+
const o = l.target;
|
|
16
97
|
a("change", o.value);
|
|
17
98
|
};
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
99
|
+
return d([c, s], () => {
|
|
100
|
+
s.value && (i.value = s.value.validity);
|
|
101
|
+
}), d(
|
|
102
|
+
i,
|
|
103
|
+
(l) => {
|
|
104
|
+
l && a("validityChange", l);
|
|
105
|
+
},
|
|
106
|
+
{ deep: !0 }
|
|
107
|
+
), d(
|
|
108
|
+
[e.errorMessage, s],
|
|
109
|
+
() => {
|
|
110
|
+
s.value && s.value.setCustomValidity(e.errorMessage || "");
|
|
111
|
+
},
|
|
112
|
+
{ immediate: !0 }
|
|
113
|
+
), (l, o) => {
|
|
114
|
+
var f, x;
|
|
115
|
+
return b(), M("label", {
|
|
116
|
+
class: L(["onyx-input", { "onyx-input--touched": u.value }])
|
|
117
|
+
}, [
|
|
118
|
+
g("span", {
|
|
119
|
+
class: L(["onyx-input__label", { "onyx-input__label--required": e.required }])
|
|
120
|
+
}, v(e.label), 3),
|
|
121
|
+
q(g("input", U(e, {
|
|
122
|
+
ref_key: "inputElement",
|
|
123
|
+
ref: s,
|
|
124
|
+
"onUpdate:modelValue": o[0] || (o[0] = (_) => c.value = _),
|
|
125
|
+
onChange: T,
|
|
126
|
+
onBlur: o[1] || (o[1] = (_) => u.value = !0)
|
|
127
|
+
}), null, 16), [
|
|
128
|
+
[k, c.value]
|
|
129
|
+
]),
|
|
130
|
+
u.value && !((f = i.value) != null && f.valid) ? (b(), M("p", R, v(S.value), 1)) : w("", !0),
|
|
131
|
+
g("p", A, 'Model value: "' + v(c.value) + '", is valid: ' + v((x = i.value) == null ? void 0 : x.valid), 1)
|
|
132
|
+
], 2);
|
|
133
|
+
};
|
|
31
134
|
}
|
|
32
|
-
}),
|
|
33
|
-
const e =
|
|
34
|
-
for (const [a,
|
|
35
|
-
e[a] =
|
|
135
|
+
}), J = (t, r) => {
|
|
136
|
+
const e = t.__vccOpts || t;
|
|
137
|
+
for (const [a, n] of r)
|
|
138
|
+
e[a] = n;
|
|
36
139
|
return e;
|
|
37
|
-
},
|
|
140
|
+
}, H = /* @__PURE__ */ J(F, [["__scopeId", "data-v-b84504d3"]]);
|
|
38
141
|
export {
|
|
39
|
-
|
|
142
|
+
H as TestInput,
|
|
143
|
+
G as provideI18n
|
|
40
144
|
};
|