@hostlink/nuxt-light 1.26.3 → 1.26.4
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/module.json
CHANGED
|
@@ -37,12 +37,32 @@ const localValue = computed<string | null | undefined>({
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
const rules: ValidationRule[] = [
|
|
40
|
+
const rules: ValidationRule[] = [];
|
|
41
41
|
//const rules = [];
|
|
42
42
|
if (props.required) {
|
|
43
|
-
rules.push(
|
|
43
|
+
rules.push((v: any) => !!v || t("This field is required"));
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
//check time format
|
|
47
|
+
rules.push((v: any) => {
|
|
48
|
+
if (v) {
|
|
49
|
+
const time = v.split(":");
|
|
50
|
+
if (time.length == 2) {
|
|
51
|
+
if (time[0] >= 0 && time[0] <= 23 && time[1] >= 0 && time[1] <= 59) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (time.length == 3) {
|
|
56
|
+
if (time[0] >= 0 && time[0] <= 23 && time[1] >= 0 && time[1] <= 59 && time[2] >= 0 && time[2] <= 59) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return t("Invalid time format");
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
|
|
46
66
|
</script>
|
|
47
67
|
<template>
|
|
48
68
|
<q-input v-bind="$light.getInputProps(props)" v-model="localValue" :rules="rules" :color="$light.color"
|
|
@@ -25,7 +25,7 @@ const label = computed(() => {
|
|
|
25
25
|
</script>
|
|
26
26
|
<template>
|
|
27
27
|
<l-time-picker v-model="value" v-bind="context.attrs" :label="label" :error="error" :type="context.inputType"
|
|
28
|
-
:error-message="errorMessage">
|
|
28
|
+
:error-message="errorMessage" >
|
|
29
29
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
30
30
|
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
31
31
|
</template>
|