@hostlink/nuxt-light 1.21.7 → 1.21.9
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-add-btn.vue +4 -17
- package/dist/runtime/components/l-field.vue +11 -23
- package/dist/runtime/components/l-input.vue +1 -0
- package/dist/runtime/components/l-tab.vue +0 -3
- package/dist/runtime/formkit/DatePicker.vue +13 -1
- package/dist/runtime/formkit/Input.vue +14 -7
- package/dist/runtime/formkit/OptionGroup.vue +12 -2
- package/dist/runtime/formkit/Select.vue +2 -10
- package/dist/runtime/formkit/TimePicker.vue +12 -2
- package/dist/runtime/light.js +32 -33
- package/dist/runtime/pages/User/add.vue +2 -1
- package/dist/runtime/pages/User/setting/style.vue +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,28 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { useRoute } from "vue-router"
|
|
3
|
-
const route = useRoute();
|
|
4
|
-
|
|
5
|
-
//get relative path
|
|
6
|
-
const relativePath = route.path.split("/").slice(1).join("/");
|
|
7
|
-
|
|
8
2
|
const props = defineProps({
|
|
9
3
|
label: {
|
|
10
4
|
type: String,
|
|
11
5
|
default: "Add"
|
|
12
6
|
},
|
|
13
|
-
to:
|
|
14
|
-
|
|
15
|
-
default: null
|
|
16
|
-
}
|
|
7
|
+
to: String,
|
|
8
|
+
color: String
|
|
17
9
|
});
|
|
18
|
-
|
|
19
|
-
const to = props.to ?? relativePath + "/add";
|
|
20
|
-
|
|
21
10
|
</script>
|
|
22
11
|
<template>
|
|
23
|
-
<l-btn
|
|
24
|
-
<q-tooltip>
|
|
25
|
-
{{ $t(label) }}
|
|
26
|
-
</q-tooltip>
|
|
12
|
+
<l-btn icon="sym_o_add" v-bind="$props" :to="to ?? $route.path + '/add'">
|
|
13
|
+
<q-tooltip>{{ $t(label) }}</q-tooltip>
|
|
27
14
|
</l-btn>
|
|
28
15
|
</template>
|
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useLight } from '#imports';
|
|
3
|
-
import { computed } from 'vue';
|
|
4
|
-
import { useI18n } from 'vue-i18n';
|
|
5
|
-
|
|
6
2
|
import type { QFieldProps } from 'quasar';
|
|
7
|
-
const props = defineProps<QFieldProps>()
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (props.label) {
|
|
17
|
-
a.label = t(props.label);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (props.color === undefined) {
|
|
21
|
-
a.color = light.color
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return a;
|
|
3
|
+
const props = withDefaults(defineProps<QFieldProps>(), {
|
|
4
|
+
outlined: undefined,
|
|
5
|
+
filled: undefined,
|
|
6
|
+
standout: undefined,
|
|
7
|
+
rounded: undefined,
|
|
8
|
+
square: undefined,
|
|
9
|
+
stackLabel: undefined,
|
|
10
|
+
dark: undefined,
|
|
11
|
+
dense: undefined,
|
|
25
12
|
});
|
|
26
13
|
|
|
27
14
|
</script>
|
|
28
15
|
<template>
|
|
29
|
-
|
|
16
|
+
|
|
17
|
+
<q-field v-bind="$light.getInputProps($props)">
|
|
30
18
|
<slot></slot>
|
|
31
19
|
</q-field>
|
|
32
20
|
</template>
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { QTabPanelProps, QTabProps } from 'quasar';
|
|
3
3
|
import { getCurrentInstance } from 'vue';
|
|
4
|
-
import { useI18n } from 'vue-i18n';
|
|
5
|
-
|
|
6
|
-
const { t } = useI18n();
|
|
7
4
|
|
|
8
5
|
const instance = getCurrentInstance();
|
|
9
6
|
defineProps<QTabPanelProps | QTabProps>()
|
|
@@ -1,11 +1,14 @@
|
|
|
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
6
|
const props = defineProps({
|
|
6
7
|
context: Object
|
|
7
8
|
});
|
|
8
9
|
|
|
10
|
+
const { t } = useI18n()
|
|
11
|
+
|
|
9
12
|
const { error, errorMessage } = getErrorMessage(props.context.node);
|
|
10
13
|
|
|
11
14
|
const value = computed({
|
|
@@ -13,9 +16,18 @@ const value = computed({
|
|
|
13
16
|
set: (val) => props.context.node.input(val)
|
|
14
17
|
})
|
|
15
18
|
|
|
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
|
+
|
|
16
28
|
</script>
|
|
17
29
|
<template>
|
|
18
|
-
<l-date-picker v-model="value"
|
|
30
|
+
<l-date-picker v-model="value" v-bind="context.attrs" :label="label" :error="error" :type="context.inputType"
|
|
19
31
|
:error-message="errorMessage" :disable="context.disabled">
|
|
20
32
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
21
33
|
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { getErrorMessage } from 'formkit-quasar';
|
|
4
|
+
import { useI18n } from 'vue-i18n';
|
|
4
5
|
|
|
5
6
|
const props = defineProps({
|
|
6
7
|
context: {
|
|
@@ -9,8 +10,9 @@ const props = defineProps({
|
|
|
9
10
|
}
|
|
10
11
|
});
|
|
11
12
|
|
|
12
|
-
const {
|
|
13
|
+
const { t } = useI18n()
|
|
13
14
|
|
|
15
|
+
const { error, errorMessage } = getErrorMessage(props.context.node);
|
|
14
16
|
const value = computed({
|
|
15
17
|
get: () => props.context?.value,
|
|
16
18
|
set: (val) => {
|
|
@@ -45,14 +47,19 @@ const onBlur = () => {
|
|
|
45
47
|
error.value = false
|
|
46
48
|
}
|
|
47
49
|
}
|
|
50
|
+
|
|
51
|
+
const label = computed(() => {
|
|
52
|
+
let l = t(props.context.label);
|
|
53
|
+
if (props.context.state.required) {
|
|
54
|
+
l = "* " + l
|
|
55
|
+
}
|
|
56
|
+
return l
|
|
57
|
+
})
|
|
58
|
+
|
|
48
59
|
</script>
|
|
49
60
|
<template>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
:error-message="errorMessage" @blur="onBlur"
|
|
53
|
-
:disable="context.disabled"
|
|
54
|
-
|
|
55
|
-
>
|
|
61
|
+
<l-input v-model="value" v-bind="context?.attrs" :label="label" :error="error" :type="context?.inputType"
|
|
62
|
+
:error-message="errorMessage" @blur="onBlur" :disable="context.disabled">
|
|
56
63
|
|
|
57
64
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
58
65
|
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import { useLight } from '#imports';
|
|
2
3
|
import { computed } from 'vue'
|
|
3
4
|
import { getErrorMessage } from 'formkit-quasar';
|
|
4
5
|
|
|
6
|
+
const light = useLight();
|
|
5
7
|
const props = defineProps({
|
|
6
8
|
context: Object
|
|
7
9
|
});
|
|
@@ -13,10 +15,18 @@ const value = computed({
|
|
|
13
15
|
set: (val) => props.context.node.input(val)
|
|
14
16
|
})
|
|
15
17
|
|
|
18
|
+
const outlined = computed(() => {
|
|
19
|
+
return props.context.attrs.outlined != undefined ? props.context.attrs.outlined : light.styles.input.outlined;
|
|
20
|
+
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
|
|
16
24
|
</script>
|
|
17
25
|
<template>
|
|
18
|
-
<l-field stack-label :label="context.label" :error="error" :error-message="errorMessage"
|
|
19
|
-
|
|
26
|
+
<l-field stack-label :label="context.label" :error="error" :error-message="errorMessage" :outlined="outlined"
|
|
27
|
+
hide-bottom-space>
|
|
28
|
+
<q-option-group type="checkbox" :options="context.options" v-model="value" inline v-bind="context.attrs"
|
|
29
|
+
:color="$light.color">
|
|
20
30
|
</q-option-group>
|
|
21
31
|
</l-field>
|
|
22
32
|
</template>
|
|
@@ -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>
|
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { getErrorMessage } from 'formkit-quasar';
|
|
4
|
-
|
|
4
|
+
import { useI18n } from 'vue-i18n';
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
context: Object
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
+
const { t } = useI18n()
|
|
10
|
+
|
|
9
11
|
const { error, errorMessage } = getErrorMessage(props.context.node);
|
|
10
12
|
|
|
11
13
|
const value = computed({
|
|
12
14
|
get: () => props.context.value,
|
|
13
15
|
set: (val) => props.context.node.input(val)
|
|
14
16
|
})
|
|
17
|
+
|
|
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
|
+
})
|
|
15
25
|
</script>
|
|
16
26
|
<template>
|
|
17
|
-
<l-time-picker v-model="value"
|
|
27
|
+
<l-time-picker v-model="value" v-bind="context.attrs" :label="label" :error="error" :type="context.inputType"
|
|
18
28
|
:error-message="errorMessage">
|
|
19
29
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
20
30
|
<slot :name="name" v-bind="props ?? {}"></slot>
|
package/dist/runtime/light.js
CHANGED
|
@@ -32,36 +32,35 @@ const COLOR_CODE = {
|
|
|
32
32
|
dark: "#4b4b4b"
|
|
33
33
|
};
|
|
34
34
|
let styles = {};
|
|
35
|
-
const defaultStyle = {
|
|
36
|
-
table: {
|
|
37
|
-
dense: true,
|
|
38
|
-
flat: true,
|
|
39
|
-
bordered: true,
|
|
40
|
-
separator: "cell"
|
|
41
|
-
},
|
|
42
|
-
card: {
|
|
43
|
-
flat: true,
|
|
44
|
-
bordered: true,
|
|
45
|
-
square: false
|
|
46
|
-
},
|
|
47
|
-
button: {
|
|
48
|
-
outline: true,
|
|
49
|
-
rounded: true,
|
|
50
|
-
unelevated: false,
|
|
51
|
-
dense: false
|
|
52
|
-
},
|
|
53
|
-
input: {
|
|
54
|
-
filled: false,
|
|
55
|
-
outlined: true,
|
|
56
|
-
standout: false,
|
|
57
|
-
rounded: false,
|
|
58
|
-
dense: true,
|
|
59
|
-
square: false,
|
|
60
|
-
stackLabel: false
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
35
|
const light = reactive({
|
|
64
|
-
styles: {
|
|
36
|
+
styles: {
|
|
37
|
+
table: {
|
|
38
|
+
dense: true,
|
|
39
|
+
flat: true,
|
|
40
|
+
bordered: true,
|
|
41
|
+
separator: "cell"
|
|
42
|
+
},
|
|
43
|
+
card: {
|
|
44
|
+
flat: true,
|
|
45
|
+
bordered: true,
|
|
46
|
+
square: false
|
|
47
|
+
},
|
|
48
|
+
button: {
|
|
49
|
+
outline: true,
|
|
50
|
+
rounded: true,
|
|
51
|
+
unelevated: false,
|
|
52
|
+
dense: false
|
|
53
|
+
},
|
|
54
|
+
input: {
|
|
55
|
+
filled: false,
|
|
56
|
+
outlined: true,
|
|
57
|
+
standout: false,
|
|
58
|
+
rounded: false,
|
|
59
|
+
dense: true,
|
|
60
|
+
square: false,
|
|
61
|
+
stackLabel: true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
65
64
|
version: packageJson.version,
|
|
66
65
|
errors: [],
|
|
67
66
|
$q: null,
|
|
@@ -206,10 +205,10 @@ const light = reactive({
|
|
|
206
205
|
init(styles2) {
|
|
207
206
|
light.color = styles2.color || "primary";
|
|
208
207
|
light.theme = styles2.theme || "semi-dark";
|
|
209
|
-
styles2.input = { ...
|
|
210
|
-
styles2.card = { ...
|
|
211
|
-
styles2.button = { ...
|
|
212
|
-
styles2.table = { ...
|
|
208
|
+
styles2.input = { ...light.styles.input, ...styles2.input || {} };
|
|
209
|
+
styles2.card = { ...light.styles.card, ...styles2.card || {} };
|
|
210
|
+
styles2.button = { ...light.styles.button, ...styles2.button || {} };
|
|
211
|
+
styles2.table = { ...light.styles.table, ...styles2.table || {} };
|
|
213
212
|
light.styles = styles2;
|
|
214
213
|
watch(() => light.theme, async () => {
|
|
215
214
|
await light.setStyle("theme", light.theme);
|
|
@@ -80,7 +80,8 @@ const languages = tt.app.languages.map((lang) => {
|
|
|
80
80
|
<FormKit type="l-date-picker" label="Join date" name="join_date" validation="required" />
|
|
81
81
|
<FormKit type="l-date-picker" label="Expiry date" name="expiry_date" />
|
|
82
82
|
<FormKit type="l-select" label="Status" name="status" :options="options" validation="required" />
|
|
83
|
-
<FormKit type="l-select" label="Language" name="language" :options="languages"
|
|
83
|
+
<FormKit type="l-select" label="Language" name="language" :options="languages"
|
|
84
|
+
validation="required" />
|
|
84
85
|
<FormKit type="l-input" label="Default page" name="default_page" />
|
|
85
86
|
|
|
86
87
|
<FormKit type="l-option-group" label="Roles" name="roles" :options="roles ?? []" />
|
|
@@ -148,7 +148,7 @@ const preview = ref({})
|
|
|
148
148
|
{ name: 'A', phone: '123' },
|
|
149
149
|
{ name: 'B', phone: '456' },
|
|
150
150
|
{ name: 'C', phone: '789' },
|
|
151
|
-
]" v-bind="styles.table">
|
|
151
|
+
]" v-bind="styles.table" selection="multiple">
|
|
152
152
|
|
|
153
153
|
<template #body-cell-action="props">
|
|
154
154
|
<q-td auto-width>
|