@hostlink/nuxt-light 1.21.7 → 1.21.8
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
|
@@ -13,9 +13,18 @@ const value = computed({
|
|
|
13
13
|
set: (val) => props.context.node.input(val)
|
|
14
14
|
})
|
|
15
15
|
|
|
16
|
+
const label = computed(() => {
|
|
17
|
+
let l = props.context.label;
|
|
18
|
+
if (props.context.state.required) {
|
|
19
|
+
l = "* " + l
|
|
20
|
+
}
|
|
21
|
+
return l
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
|
|
16
25
|
</script>
|
|
17
26
|
<template>
|
|
18
|
-
<l-date-picker v-model="value"
|
|
27
|
+
<l-date-picker v-model="value" v-bind="context.attrs" :label="label" :error="error" :type="context.inputType"
|
|
19
28
|
:error-message="errorMessage" :disable="context.disabled">
|
|
20
29
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
21
30
|
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
@@ -45,14 +45,20 @@ const onBlur = () => {
|
|
|
45
45
|
error.value = false
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
+
|
|
49
|
+
const label = computed(() => {
|
|
50
|
+
let l = props.context.label;
|
|
51
|
+
if (props.context.state.required) {
|
|
52
|
+
l = "* " + l
|
|
53
|
+
}
|
|
54
|
+
return l
|
|
55
|
+
})
|
|
56
|
+
|
|
48
57
|
</script>
|
|
49
58
|
<template>
|
|
50
59
|
|
|
51
|
-
<l-input v-model="value"
|
|
52
|
-
:error-message="errorMessage" @blur="onBlur"
|
|
53
|
-
:disable="context.disabled"
|
|
54
|
-
|
|
55
|
-
>
|
|
60
|
+
<l-input v-model="value" v-bind="context?.attrs" :label="label" :error="error" :type="context?.inputType"
|
|
61
|
+
:error-message="errorMessage" @blur="onBlur" :disable="context.disabled">
|
|
56
62
|
|
|
57
63
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
58
64
|
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
@@ -14,17 +14,9 @@ const value = computed({
|
|
|
14
14
|
set: (val) => props.context.node.input(val)
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
//check required in parsedRules
|
|
18
|
-
let required = false;
|
|
19
|
-
for (let rule of props.context.node.props.parsedRules ?? []) {
|
|
20
|
-
if (rule.name === "required") {
|
|
21
|
-
required = true;
|
|
22
|
-
break;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
17
|
|
|
26
18
|
let clearable = false;
|
|
27
|
-
if (required) { //no clearable
|
|
19
|
+
if (props.context.state.required) { //no clearable
|
|
28
20
|
clearable = false;
|
|
29
21
|
} else {
|
|
30
22
|
clearable = true;
|
|
@@ -33,7 +25,7 @@ if (required) { //no clearable
|
|
|
33
25
|
</script>
|
|
34
26
|
<template>
|
|
35
27
|
<l-select v-model="value" :label="context.label" v-bind="context.attrs" :error="error" :error-message="errorMessage"
|
|
36
|
-
:clearable="clearable" :required="required" :disable="context.disabled">
|
|
28
|
+
:clearable="clearable" :required="context.state.required" :disable="context.disabled">
|
|
37
29
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
38
30
|
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
39
31
|
</template>
|