@hostlink/nuxt-light 1.26.3 → 1.26.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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.26.3",
4
+ "version": "1.26.5",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -37,12 +37,32 @@ const localValue = computed<string | null | undefined>({
37
37
  }
38
38
  });
39
39
 
40
- const rules: ValidationRule[] = ["timeOrFulltime"];
40
+ const rules: ValidationRule[] = [];
41
41
  //const rules = [];
42
42
  if (props.required) {
43
- rules.push(val => !!val || 'Required.');
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"
@@ -1,14 +1,11 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
3
  import { getErrorMessage } from 'formkit-quasar';
4
- import { useI18n } from 'vue-i18n';
5
4
 
6
5
  const props = defineProps({
7
6
  context: Object
8
7
  });
9
8
 
10
- const { t } = useI18n()
11
-
12
9
  const { error, errorMessage } = getErrorMessage(props.context.node);
13
10
 
14
11
  const value = computed({
@@ -16,15 +13,6 @@ const value = computed({
16
13
  set: (val) => props.context.node.input(val)
17
14
  })
18
15
 
19
- /* const label = computed(() => {
20
- let l = t(props.context.label);
21
- if (props.context.state.required) {
22
- l = "* " + l
23
- }
24
- return l
25
- })
26
-
27
- */
28
16
  </script>
29
17
  <template>
30
18
  <l-date-picker v-model="value" v-bind="context.attrs" :label="context.label" :error="error"
@@ -1,13 +1,11 @@
1
1
  <script setup>
2
2
  import { computed } from 'vue'
3
3
  import { getErrorMessage } from 'formkit-quasar';
4
- import { useI18n } from 'vue-i18n';
4
+
5
5
  const props = defineProps({
6
6
  context: Object
7
7
  });
8
8
 
9
- const { t } = useI18n()
10
-
11
9
  const { error, errorMessage } = getErrorMessage(props.context.node);
12
10
 
13
11
  const value = computed({
@@ -15,17 +13,11 @@ const value = computed({
15
13
  set: (val) => props.context.node.input(val)
16
14
  })
17
15
 
18
- const label = computed(() => {
19
- let l = t(props.context.label);
20
- if (props.context.state.required) {
21
- l = "* " + l
22
- }
23
- return l
24
- })
16
+
25
17
  </script>
26
18
  <template>
27
- <l-time-picker v-model="value" v-bind="context.attrs" :label="label" :error="error" :type="context.inputType"
28
- :error-message="errorMessage">
19
+ <l-time-picker v-model="value" v-bind="context.attrs" :label="context.label" :error="error" :type="context.inputType"
20
+ :error-message="errorMessage" :disable="context.disabled" :required="context.state.required">
29
21
  <template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
30
22
  <slot :name="name" v-bind="props ?? {}"></slot>
31
23
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.26.3",
3
+ "version": "1.26.5",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",