@hostlink/nuxt-light 1.0.5 → 1.0.6
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 +1 -1
- package/dist/runtime/components/l-banner.vue +43 -0
- package/dist/runtime/components/l-btn.vue +20 -20
- package/dist/runtime/components/l-card.vue +20 -14
- package/dist/runtime/components/l-checkbox.vue +11 -4
- package/dist/runtime/components/l-date-picker.vue +26 -37
- package/dist/runtime/components/l-input.vue +5 -8
- package/dist/runtime/components/l-select.vue +48 -35
- package/dist/runtime/formkit/Checkbox.vue +3 -8
- package/dist/runtime/formkit/DatePicker.vue +3 -4
- package/dist/runtime/formkit/File.vue +3 -5
- package/dist/runtime/formkit/FilePicker.vue +3 -5
- package/dist/runtime/formkit/Input.vue +27 -7
- package/dist/runtime/formkit/Select.vue +3 -6
- package/dist/runtime/formkit/TimePicker.vue +3 -5
- package/dist/runtime/formkit/index.mjs +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type QBannerProps, type QBannerSlots } from 'quasar'
|
|
3
|
+
import { computed, useSlots } from 'vue'
|
|
4
|
+
|
|
5
|
+
export interface LBannerProps extends QBannerProps {
|
|
6
|
+
icon?: string
|
|
7
|
+
type?: 'primary' | 'secondary' | 'accent' | 'dark' | 'positive' | 'negative' | 'info' | 'warning'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<LBannerProps>(), {
|
|
11
|
+
rounded: true,
|
|
12
|
+
type: 'primary'
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const classes = computed(() => {
|
|
16
|
+
return [
|
|
17
|
+
`bg-${props.type}`,
|
|
18
|
+
'text-white'
|
|
19
|
+
]
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const localIcon = computed(() => {
|
|
23
|
+
if (props.icon) return props.icon
|
|
24
|
+
if (props.type === 'info') return 'sym_o_info'
|
|
25
|
+
if (props.type === 'warning') return 'sym_o_warning'
|
|
26
|
+
if (props.type === 'positive') return 'sym_o_check_circle_outline'
|
|
27
|
+
if (props.type === 'negative') return 'sym_o_error'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const slots = computed(() => useSlots());
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<q-banner v-bind="props" :class="classes">
|
|
35
|
+
<template v-slot:avatar v-if="localIcon">
|
|
36
|
+
<q-icon :name="localIcon" />
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<template v-for="(s, name) in slots" v-slot:[name]="props" :key="name">
|
|
40
|
+
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
41
|
+
</template>
|
|
42
|
+
</q-banner>
|
|
43
|
+
</template>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type QBtnProps } from "quasar";
|
|
3
|
+
import { ref, computed } from "vue";
|
|
4
|
+
import { q, f, useLight } from '#imports';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const label = ref(props.label);
|
|
8
|
-
if (!label.value) {
|
|
9
|
-
label.value = "";
|
|
6
|
+
export interface LBtnProps extends QBtnProps {
|
|
7
|
+
permission?: string;
|
|
10
8
|
}
|
|
11
9
|
|
|
10
|
+
const props = defineProps<LBtnProps>();
|
|
11
|
+
|
|
12
12
|
const light = useLight();
|
|
13
13
|
|
|
14
14
|
const granted = ref(false);
|
|
@@ -22,22 +22,22 @@ if (props.permission) {
|
|
|
22
22
|
granted.value = true;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
25
|
+
const attrs = computed(() => {
|
|
26
|
+
return {
|
|
27
|
+
...{
|
|
28
|
+
rounded: light.getStyle("buttonRounded"),
|
|
29
|
+
outline: light.getStyle("buttonOutline"),
|
|
30
|
+
unelevated: light.getStyle("buttonUnelevated"),
|
|
31
|
+
dense: light.getStyle("buttonDense"),
|
|
32
|
+
},
|
|
33
|
+
...props,
|
|
34
|
+
}
|
|
35
|
+
});
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
</script>
|
|
38
39
|
<template>
|
|
39
|
-
<q-btn v-bind="attrs" color="primary" v-if="granted"
|
|
40
|
-
|
|
40
|
+
<q-btn v-bind="attrs" color="primary" v-if="granted">
|
|
41
41
|
<slot></slot>
|
|
42
42
|
</q-btn>
|
|
43
43
|
</template>
|
|
@@ -1,21 +1,27 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useLight } from '
|
|
3
|
-
import {
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useLight } from '#imports'
|
|
3
|
+
import { ref, computed } from 'vue'
|
|
4
|
+
import { type QCardProps } from 'quasar';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
loading
|
|
7
|
-
title
|
|
8
|
-
}
|
|
6
|
+
export interface LCardProps extends QCardProps {
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
title?: string;
|
|
9
|
+
}
|
|
9
10
|
|
|
10
11
|
const light = useLight();
|
|
12
|
+
const props = withDefaults(defineProps<LCardProps>(), {
|
|
13
|
+
flat: undefined,
|
|
14
|
+
bordered: undefined,
|
|
15
|
+
square: undefined,
|
|
16
|
+
});
|
|
11
17
|
|
|
12
|
-
const attrs = {
|
|
13
|
-
...
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
18
|
+
const attrs = computed(() => {
|
|
19
|
+
const a = { ...props };
|
|
20
|
+
if (props.flat === undefined) a.flat = light.getStyle("cardFlat");
|
|
21
|
+
if (props.bordered === undefined) a.bordered = light.getStyle("cardBordered");
|
|
22
|
+
if (props.square === undefined) a.square = light.getStyle("cardSquare");
|
|
23
|
+
return a;
|
|
24
|
+
});
|
|
19
25
|
|
|
20
26
|
const cl = computed(() => {
|
|
21
27
|
const c = ["text-white"];
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from "vue"
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue"
|
|
3
|
+
import { type QCheckboxProps } from "quasar"
|
|
4
|
+
|
|
5
|
+
export interface LCheckboxProps extends QCheckboxProps {
|
|
6
|
+
}
|
|
3
7
|
|
|
4
8
|
const emit = defineEmits(["update:modelValue"]);
|
|
5
|
-
|
|
9
|
+
|
|
10
|
+
const props = defineProps<LCheckboxProps>()
|
|
6
11
|
|
|
7
12
|
const localValue = computed({
|
|
8
13
|
get: () => props.modelValue,
|
|
@@ -13,5 +18,7 @@ const localValue = computed({
|
|
|
13
18
|
});
|
|
14
19
|
</script>
|
|
15
20
|
<template>
|
|
16
|
-
<q-checkbox v-model="localValue" :label="$t(label)"
|
|
21
|
+
<q-checkbox v-bind="$props" v-model="localValue" :label="$t($props.label ?? '')">
|
|
22
|
+
<slot></slot>
|
|
23
|
+
</q-checkbox>
|
|
17
24
|
</template>
|
|
@@ -1,29 +1,17 @@
|
|
|
1
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts">
|
|
2
2
|
import { ref, computed, useAttrs } from "vue";
|
|
3
|
-
import { useLight } from '
|
|
3
|
+
import { useLight } from '#imports';
|
|
4
4
|
|
|
5
|
+
import { type QDateProps } from "quasar";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
export interface LDatePickerProps extends QDateProps {
|
|
8
|
+
label?: string
|
|
9
|
+
required?: boolean
|
|
10
|
+
}
|
|
7
11
|
|
|
8
|
-
const props = defineProps(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
required: false,
|
|
12
|
-
default: null
|
|
13
|
-
},
|
|
14
|
-
range: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
default: false
|
|
17
|
-
},
|
|
18
|
-
label: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: ""
|
|
21
|
-
},
|
|
22
|
-
required: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: false
|
|
25
|
-
},
|
|
26
|
-
});
|
|
12
|
+
const props = defineProps<LDatePickerProps>()
|
|
13
|
+
|
|
14
|
+
const light = useLight();
|
|
27
15
|
|
|
28
16
|
const emit = defineEmits(["update:modelValue"]);
|
|
29
17
|
const popup = ref(null);
|
|
@@ -37,16 +25,19 @@ const localValue = computed({
|
|
|
37
25
|
return props.modelValue
|
|
38
26
|
},
|
|
39
27
|
set: (value) => {
|
|
40
|
-
popup.value
|
|
28
|
+
if (popup.value) {
|
|
29
|
+
popup.value.hide();
|
|
30
|
+
}
|
|
31
|
+
|
|
41
32
|
emit('update:modelValue', value)
|
|
42
33
|
}
|
|
43
34
|
|
|
44
35
|
});
|
|
45
36
|
|
|
46
|
-
const rules = [];
|
|
37
|
+
const rules: any = [];
|
|
47
38
|
|
|
48
39
|
if (props.required) {
|
|
49
|
-
rules.push((val) => {
|
|
40
|
+
rules.push((val: any) => {
|
|
50
41
|
if (!val) {
|
|
51
42
|
return "Required";
|
|
52
43
|
}
|
|
@@ -54,7 +45,7 @@ if (props.required) {
|
|
|
54
45
|
}
|
|
55
46
|
|
|
56
47
|
if (!props.range) {
|
|
57
|
-
rules.push((val) => {
|
|
48
|
+
rules.push((val: any) => {
|
|
58
49
|
//check val is YYYY-MM-DD
|
|
59
50
|
if (val) {
|
|
60
51
|
if (!val.match(/^\d{4}-\d{2}-\d{2}$/)) {
|
|
@@ -65,23 +56,21 @@ if (!props.range) {
|
|
|
65
56
|
}
|
|
66
57
|
|
|
67
58
|
const attrs = {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
stackLabel: light.getStyle("inputStackLabel")
|
|
76
|
-
},
|
|
77
|
-
...useAttrs(),
|
|
59
|
+
filled: light.getStyle("inputFilled"),
|
|
60
|
+
outlined: light.getStyle("inputOutlined"),
|
|
61
|
+
standout: light.getStyle("inputStandout"),
|
|
62
|
+
rounded: light.getStyle("inputRounded"),
|
|
63
|
+
dense: light.getStyle("inputDense"),
|
|
64
|
+
square: light.getStyle("inputSquare"),
|
|
65
|
+
stackLabel: light.getStyle("inputStackLabel")
|
|
78
66
|
}
|
|
79
67
|
|
|
80
68
|
const mask = props.range ? "####-##-## - ####-##-##" : "####-##-##";
|
|
81
69
|
|
|
82
70
|
</script>
|
|
83
71
|
<template>
|
|
84
|
-
<q-input v-bind="attrs" v-model="localValue" :rules="rules"
|
|
72
|
+
<q-input v-bind="attrs" :label="$t(props.label ?? '')" v-model="localValue" :rules="rules" hide-bottom-space
|
|
73
|
+
:mask="mask">
|
|
85
74
|
<template v-slot:prepend>
|
|
86
75
|
<q-btn icon="sym_o_event" round dense flat>
|
|
87
76
|
<q-popup-proxy cover transition-show="scale" transition-hide="scale" ref="popup">
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, ref, useAttrs
|
|
2
|
+
import { computed, ref, useAttrs } from "vue";
|
|
3
3
|
import { useI18n } from 'vue-i18n';
|
|
4
4
|
import tc2sc from "../lib/tc2sc";
|
|
5
|
-
import { useLight } from '
|
|
5
|
+
import { useLight } from '#imports';
|
|
6
6
|
|
|
7
7
|
const i18n = useI18n();
|
|
8
8
|
const light = useLight();
|
|
@@ -165,10 +165,6 @@ const attrs = {
|
|
|
165
165
|
...useAttrs(),
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
const ss = Object.entries(useSlots()).map(([key, value]) => {
|
|
169
|
-
return key;
|
|
170
|
-
});
|
|
171
|
-
|
|
172
168
|
</script>
|
|
173
169
|
<template>
|
|
174
170
|
<q-input v-bind="attrs" :label="localLabel" v-model="localValue" :rules="new_rules" hide-bottom-space :type="localType">
|
|
@@ -184,10 +180,11 @@ const ss = Object.entries(useSlots()).map(([key, value]) => {
|
|
|
184
180
|
</q-btn>
|
|
185
181
|
</template>
|
|
186
182
|
|
|
187
|
-
<template v-for="s in
|
|
188
|
-
<slot :name="
|
|
183
|
+
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
184
|
+
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
189
185
|
</template>
|
|
190
186
|
|
|
187
|
+
|
|
191
188
|
<template v-if="localShowPassword" v-slot:append>
|
|
192
189
|
<q-icon name="sym_o_visibility" class="cursor-pointer" :color="showPassword ? 'primary' : 'grey-5'"
|
|
193
190
|
@click="isShowPassword = false" v-if="isShowPassword" />
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed, ref
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
3
|
import { useLight } from '../';
|
|
4
|
+
import { type QSelectProps } from "quasar";
|
|
5
|
+
|
|
6
|
+
const emits = defineEmits(["update:modelValue"]);
|
|
4
7
|
|
|
5
8
|
const light = useLight();
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
interface LSelectProps extends QSelectProps {
|
|
10
|
+
required?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(defineProps<LSelectProps>(), {
|
|
15
|
+
rules: () => {
|
|
16
|
+
return []
|
|
14
17
|
},
|
|
15
|
-
options: {
|
|
16
|
-
|
|
17
|
-
default: () => []
|
|
18
|
+
options: () => {
|
|
19
|
+
return []
|
|
18
20
|
},
|
|
19
|
-
optionLabel: {
|
|
20
|
-
|
|
21
|
-
default: "label"
|
|
21
|
+
optionLabel: () => {
|
|
22
|
+
return "label"
|
|
22
23
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
default: ""
|
|
24
|
+
emitValue: () => {
|
|
25
|
+
return true
|
|
26
26
|
},
|
|
27
|
+
mapOptions: () => {
|
|
28
|
+
return true
|
|
29
|
+
}
|
|
27
30
|
})
|
|
28
31
|
|
|
32
|
+
|
|
29
33
|
if (props.required) {
|
|
30
34
|
props.rules.push((val) => {
|
|
31
35
|
if (Number.isInteger(val)) {
|
|
@@ -49,31 +53,40 @@ const filterFn = (val, update, abort) => {
|
|
|
49
53
|
|
|
50
54
|
update(() => {
|
|
51
55
|
const needle = val.toLowerCase();
|
|
56
|
+
|
|
52
57
|
select_options.value = props.options.filter(v => v[props.optionLabel].toLowerCase().indexOf(needle) > -1);
|
|
53
58
|
})
|
|
54
59
|
}
|
|
55
60
|
|
|
56
|
-
|
|
57
|
-
|
|
58
61
|
const clearable = computed(() => {
|
|
59
62
|
return !props.required;
|
|
60
63
|
});
|
|
61
64
|
|
|
62
|
-
const attrs = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
const attrs = computed(() => {
|
|
66
|
+
return {
|
|
67
|
+
...{
|
|
68
|
+
filled: light.getStyle("inputFilled"),
|
|
69
|
+
outlined: light.getStyle("inputOutlined"),
|
|
70
|
+
standout: light.getStyle("inputStandout"),
|
|
71
|
+
rounded: light.getStyle("inputRounded"),
|
|
72
|
+
dense: light.getStyle("inputDense"),
|
|
73
|
+
square: light.getStyle("inputSquare"),
|
|
74
|
+
stackLabel: light.getStyle("inputStackLabel")
|
|
75
|
+
},
|
|
76
|
+
...{
|
|
77
|
+
emitValue: props.emitValue,
|
|
78
|
+
mapOptions: props.mapOptions
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const localValue = computed({
|
|
84
|
+
get: () => props.modelValue,
|
|
85
|
+
set: (value) => emits('update:modelValue', value)
|
|
86
|
+
});
|
|
74
87
|
|
|
75
88
|
</script>
|
|
76
89
|
<template>
|
|
77
|
-
<q-select v-bind="attrs" :label="$t(label)"
|
|
78
|
-
:option-label="optionLabel" hide-bottom-space :rules="rules" :clearable="clearable" />
|
|
90
|
+
<q-select v-bind="attrs" v-model="localValue" :label="$t(props.label ?? '')" :options="select_options"
|
|
91
|
+
@filter="filterFn" :option-label="optionLabel" hide-bottom-space :rules="rules" :clearable="clearable" />
|
|
79
92
|
</template>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { getErrorMessage } from 'formkit-quasar';
|
|
3
|
-
import { computed
|
|
3
|
+
import { computed } from 'vue'
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
@@ -10,18 +10,13 @@ const value = computed({
|
|
|
10
10
|
set: (val) => props.context.node.input(val)
|
|
11
11
|
})
|
|
12
12
|
|
|
13
|
-
const ss = Object.entries(useSlots()).map(([key, value]) => {
|
|
14
|
-
return key;
|
|
15
|
-
});
|
|
16
|
-
|
|
17
13
|
const { error, errorMessage } = getErrorMessage(props.context.node);
|
|
18
14
|
|
|
19
|
-
|
|
20
15
|
</script>
|
|
21
16
|
<template>
|
|
22
17
|
<l-checkbox v-model="value" :label="context.label" v-bind="context.attrs" :error="error" :error-message="errorMessage">
|
|
23
|
-
<template v-for="s in
|
|
24
|
-
<slot :name="
|
|
18
|
+
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
19
|
+
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
25
20
|
</template>
|
|
26
21
|
</l-checkbox>
|
|
27
22
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { getErrorMessage } from 'formkit-quasar';
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
@@ -13,13 +13,12 @@ const value = computed({
|
|
|
13
13
|
set: (val) => props.context.node.input(val)
|
|
14
14
|
})
|
|
15
15
|
|
|
16
|
-
const ss = Object.entries(useSlots()).map(([key]) => key);
|
|
17
16
|
</script>
|
|
18
17
|
<template>
|
|
19
18
|
<l-date-picker v-model="value" :label="context.label" v-bind="context.attrs" :error="error" :type="context.inputType"
|
|
20
19
|
:error-message="errorMessage">
|
|
21
|
-
<template v-for="s in
|
|
22
|
-
<slot :name="
|
|
20
|
+
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
21
|
+
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
23
22
|
</template>
|
|
24
23
|
</l-date-picker>
|
|
25
24
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { getErrorMessage } from 'formkit-quasar';
|
|
4
4
|
import { useLight } from '#imports';
|
|
5
5
|
|
|
@@ -15,8 +15,6 @@ const value = computed({
|
|
|
15
15
|
set: (val) => props.context.node.input(val)
|
|
16
16
|
})
|
|
17
17
|
|
|
18
|
-
const ss = Object.entries(useSlots()).map(([key]) => key);
|
|
19
|
-
|
|
20
18
|
const onBlur = () => {
|
|
21
19
|
if (errorMessage.value) {
|
|
22
20
|
error.value = true
|
|
@@ -44,8 +42,8 @@ const attrs = {
|
|
|
44
42
|
<template>
|
|
45
43
|
<q-file v-model="value" :label="context.label" v-bind="attrs" :error="error" :error-message="errorMessage"
|
|
46
44
|
@blur="onBlur">
|
|
47
|
-
<template v-for="s in
|
|
48
|
-
<slot :name="
|
|
45
|
+
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
46
|
+
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
49
47
|
</template>
|
|
50
48
|
</q-file>
|
|
51
49
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { getErrorMessage } from 'formkit-quasar';
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
@@ -13,8 +13,6 @@ const value = computed({
|
|
|
13
13
|
set: (val) => props.context.node.input(val)
|
|
14
14
|
})
|
|
15
15
|
|
|
16
|
-
const ss = Object.entries(useSlots()).map(([key]) => key);
|
|
17
|
-
|
|
18
16
|
const onBlur = () => {
|
|
19
17
|
if (errorMessage.value) {
|
|
20
18
|
error.value = true
|
|
@@ -26,8 +24,8 @@ const onBlur = () => {
|
|
|
26
24
|
<template>
|
|
27
25
|
<l-file v-model="value" :label="context.label" v-bind="context.attrs" :error="error" :type="context.inputType"
|
|
28
26
|
:error-message="errorMessage" @blur="onBlur">
|
|
29
|
-
<template v-for="s in
|
|
30
|
-
<slot :name="
|
|
27
|
+
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
28
|
+
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
31
29
|
</template>
|
|
32
30
|
</l-file>
|
|
33
31
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { getErrorMessage } from 'formkit-quasar';
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
@@ -10,10 +10,30 @@ const { error, errorMessage } = getErrorMessage(props.context.node);
|
|
|
10
10
|
|
|
11
11
|
const value = computed({
|
|
12
12
|
get: () => props.context.value,
|
|
13
|
-
set: (val) =>
|
|
14
|
-
|
|
13
|
+
set: (val) => {
|
|
14
|
+
if (props.context.number !== undefined) {
|
|
15
|
+
if (val === "") {
|
|
16
|
+
props.context.node.input(0)
|
|
17
|
+
return
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let tryprase = parseInt(val)
|
|
21
|
+
if (isNaN(tryprase)) {
|
|
22
|
+
props.context.node.input(val)
|
|
23
|
+
return
|
|
24
|
+
}
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
if (props.context.number === "integer") {
|
|
27
|
+
props.context.node.input(parseInt(val))
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
props.context.node.input(parseFloat(val))
|
|
32
|
+
} else {
|
|
33
|
+
props.context.node.input(val)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
})
|
|
17
37
|
|
|
18
38
|
const onBlur = () => {
|
|
19
39
|
if (errorMessage.value) {
|
|
@@ -23,13 +43,13 @@ const onBlur = () => {
|
|
|
23
43
|
}
|
|
24
44
|
}
|
|
25
45
|
|
|
26
|
-
|
|
27
46
|
</script>
|
|
28
47
|
<template>
|
|
29
48
|
<l-input v-model="value" :label="context.label" v-bind="context.attrs" :error="error" :type="context.inputType"
|
|
30
49
|
:error-message="errorMessage" @blur="onBlur">
|
|
31
|
-
|
|
32
|
-
|
|
50
|
+
|
|
51
|
+
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
52
|
+
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
33
53
|
</template>
|
|
34
54
|
</l-input>
|
|
35
55
|
</template>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { getErrorMessage } from 'formkit-quasar';
|
|
3
|
-
import { computed
|
|
3
|
+
import { computed } from 'vue'
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object
|
|
6
6
|
});
|
|
@@ -12,9 +12,6 @@ const value = computed({
|
|
|
12
12
|
set: (val) => props.context.node.input(val)
|
|
13
13
|
})
|
|
14
14
|
|
|
15
|
-
const ss = Object.entries(useSlots()).map(([key, value]) => {
|
|
16
|
-
return key;
|
|
17
|
-
});
|
|
18
15
|
|
|
19
16
|
//check required in parsedRules
|
|
20
17
|
let required = false;
|
|
@@ -37,8 +34,8 @@ if (required) { //no clearable
|
|
|
37
34
|
<template>
|
|
38
35
|
<l-select v-model="value" :label="context.label" v-bind="context.attrs" :error="error" :error-message="errorMessage"
|
|
39
36
|
:clearable="clearable">
|
|
40
|
-
<template v-for="s in
|
|
41
|
-
<slot :name="
|
|
37
|
+
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
38
|
+
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
42
39
|
</template>
|
|
43
40
|
</l-select>
|
|
44
41
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { getErrorMessage } from 'formkit-quasar';
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
@@ -12,14 +12,12 @@ const value = computed({
|
|
|
12
12
|
get: () => props.context.value,
|
|
13
13
|
set: (val) => props.context.node.input(val)
|
|
14
14
|
})
|
|
15
|
-
|
|
16
|
-
const ss = Object.entries(useSlots()).map(([key]) => key);
|
|
17
15
|
</script>
|
|
18
16
|
<template>
|
|
19
17
|
<l-time-picker v-model="value" :label="context.label" v-bind="context.attrs" :error="error" :type="context.inputType"
|
|
20
18
|
:error-message="errorMessage">
|
|
21
|
-
<template v-for="s in
|
|
22
|
-
<slot :name="
|
|
19
|
+
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
20
|
+
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
23
21
|
</template>
|
|
24
22
|
</l-time-picker>
|
|
25
23
|
</template>
|