@hostlink/nuxt-light 1.21.6 → 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 +1 -1
- package/dist/runtime/components/L/System/Setting/mail.vue +1 -7
- package/dist/runtime/components/{l-user-eventlog.vue → L/User/eventlog.vue} +2 -1
- package/dist/runtime/components/{l-user-overview.vue → L/User/overview.vue} +5 -1
- package/dist/runtime/components/l-app-main.vue +2 -1
- package/dist/runtime/components/l-btn.vue +7 -29
- package/dist/runtime/components/l-card.vue +3 -6
- package/dist/runtime/components/l-checkbox.vue +2 -18
- package/dist/runtime/components/l-date-picker.vue +5 -18
- package/dist/runtime/components/l-field.vue +1 -4
- package/dist/runtime/components/l-file-upload.vue +14 -35
- package/dist/runtime/components/l-file.vue +7 -9
- package/dist/runtime/components/l-icon-picker.vue +3253 -3272
- package/dist/runtime/components/l-input-xlsx.vue +16 -30
- package/dist/runtime/components/l-input.vue +6 -41
- package/dist/runtime/components/l-select.vue +3 -26
- package/dist/runtime/components/l-table.vue +13 -16
- package/dist/runtime/components/l-time-picker.vue +5 -32
- package/dist/runtime/formkit/DatePicker.vue +10 -1
- package/dist/runtime/formkit/File.vue +6 -12
- package/dist/runtime/formkit/Input.vue +11 -5
- package/dist/runtime/formkit/Select.vue +2 -10
- package/dist/runtime/light.d.ts +6 -10
- package/dist/runtime/light.js +61 -22
- package/dist/runtime/pages/System/menu/index.vue +61 -55
- package/dist/runtime/pages/User/setting/style.vue +88 -113
- package/package.json +1 -1
- package/dist/runtime/components/l-table-old.vue +0 -718
- package/dist/runtime/components/l-table2.vue +0 -754
- /package/dist/runtime/components/{l-user-userlog.vue → L/User/userlog.vue} +0 -0
package/dist/module.json
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { q, m } from '#imports'
|
|
3
|
-
import { useQuasar } from 'quasar'
|
|
4
|
-
const $q = useQuasar()
|
|
5
|
-
|
|
6
|
-
|
|
7
2
|
const emits = defineEmits(["submit"])
|
|
8
|
-
|
|
9
3
|
withDefaults(defineProps<{
|
|
10
4
|
mail_driver: string,
|
|
11
5
|
mail_host: string
|
|
@@ -43,7 +37,7 @@ const onLoginGmail = () => {
|
|
|
43
37
|
]" validation="required"></FormKit>
|
|
44
38
|
|
|
45
39
|
<template v-if="value.mail_driver === 'gmail'">
|
|
46
|
-
<l-btn label="Login" @click="onLoginGmail"
|
|
40
|
+
<l-btn label="Login" @click="onLoginGmail" icon="sym_o_login" />
|
|
47
41
|
</template>
|
|
48
42
|
|
|
49
43
|
<template v-else>
|
|
@@ -5,7 +5,8 @@ const props = defineProps(['id']);
|
|
|
5
5
|
<template>
|
|
6
6
|
<div>
|
|
7
7
|
<l-table row-key="eventlog_id" sort-by="eventlog_id:desc"
|
|
8
|
-
:columns="model('EventLog').columns(['eventlog_id', 'class', 'id', 'action', 'created_time'])"
|
|
8
|
+
:columns="model('EventLog').columns(['eventlog_id', 'class', 'id', 'action', 'created_time'])"
|
|
9
|
+
@request-data="async (req) => {
|
|
9
10
|
const a = {
|
|
10
11
|
listUser: {
|
|
11
12
|
__args: {
|
|
@@ -17,7 +17,8 @@ const obj = await collect("User", {
|
|
|
17
17
|
phone: true,
|
|
18
18
|
roles: true,
|
|
19
19
|
status: true,
|
|
20
|
-
join_date: true
|
|
20
|
+
join_date: true,
|
|
21
|
+
twoFactorEnabled: true,
|
|
21
22
|
}).where("user_id", props.id).first()
|
|
22
23
|
|
|
23
24
|
</script>
|
|
@@ -40,8 +41,11 @@ const obj = await collect("User", {
|
|
|
40
41
|
</l-item>
|
|
41
42
|
<l-item label="Status">{{ model('User').columns(["status"])[0].format(obj.status) }}</l-item>
|
|
42
43
|
<l-item label="Join date">{{ obj.join_date }}</l-item>
|
|
44
|
+
<l-item label="Two factor authentication">{{ obj.twoFactorEnabled ? "Yes" : "No"
|
|
45
|
+
}}</l-item>
|
|
43
46
|
</q-list>
|
|
44
47
|
</l-col>
|
|
48
|
+
|
|
45
49
|
</l-row>
|
|
46
50
|
</q-card-section>
|
|
47
51
|
</l-card>
|
|
@@ -5,7 +5,8 @@ import { useQuasar } from 'quasar';
|
|
|
5
5
|
import { useI18n } from 'vue-i18n';
|
|
6
6
|
import { ref, computed, reactive, provide, watch, toRaw } from 'vue';
|
|
7
7
|
import { useRuntimeConfig } from 'nuxt/app';
|
|
8
|
-
import { api } from '#imports';
|
|
8
|
+
import { api, } from '#imports';
|
|
9
|
+
|
|
9
10
|
|
|
10
11
|
const emits = defineEmits(["logout"]);
|
|
11
12
|
const $q = useQuasar();
|
|
@@ -1,39 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { type QBtnProps } from "quasar";
|
|
3
|
-
|
|
4
|
-
import { useLight } from '#imports';
|
|
5
|
-
import { useI18n } from "vue-i18n";
|
|
6
|
-
|
|
7
|
-
export interface LBtnProps extends QBtnProps {
|
|
3
|
+
export interface LBtnProps extends QBtnProps {
|
|
8
4
|
permission?: string;
|
|
9
5
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const attrs = computed(() => {
|
|
17
|
-
const a = {
|
|
18
|
-
...{
|
|
19
|
-
rounded: light.getStyle("buttonRounded"),
|
|
20
|
-
outline: light.getStyle("buttonOutline"),
|
|
21
|
-
unelevated: light.getStyle("buttonUnelevated"),
|
|
22
|
-
dense: light.getStyle("buttonDense"),
|
|
23
|
-
},
|
|
24
|
-
...props,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (a.label !== undefined) {
|
|
28
|
-
a.label = t(a.label)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
a.color = (props.color != undefined) ? props.color : light.color
|
|
32
|
-
return a;
|
|
6
|
+
withDefaults(defineProps<LBtnProps>(), {
|
|
7
|
+
outline: undefined,
|
|
8
|
+
rounded: undefined,
|
|
9
|
+
unelevated: undefined,
|
|
10
|
+
dense: undefined,
|
|
33
11
|
});
|
|
34
12
|
</script>
|
|
35
13
|
<template>
|
|
36
|
-
<q-btn v-
|
|
14
|
+
<q-btn v-if="$light.isGranted(permission)" v-bind="$light.getButtonProps($props)">
|
|
37
15
|
<slot></slot>
|
|
38
16
|
</q-btn>
|
|
39
17
|
</template>
|
|
@@ -8,7 +8,7 @@ const emit = defineEmits(["close"]);
|
|
|
8
8
|
const minimized = defineModel<boolean>("minimized", { default: false })
|
|
9
9
|
const maximized = defineModel<boolean>("maximized", { default: false })
|
|
10
10
|
|
|
11
|
-
export interface LCardProps extends
|
|
11
|
+
export interface LCardProps extends QCardProps {
|
|
12
12
|
loading?: boolean;
|
|
13
13
|
title?: string;
|
|
14
14
|
/**
|
|
@@ -30,11 +30,8 @@ const props = withDefaults(defineProps<LCardProps>(), {
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
const attrs = computed(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (props.bordered === undefined) a.bordered = light.getStyle("cardBordered");
|
|
36
|
-
if (props.square === undefined) a.square = light.getStyle("cardSquare");
|
|
37
|
-
return a;
|
|
33
|
+
return { ...light.styles.card, ...Object.fromEntries(Object.entries(props).filter(([key, value]) => value !== undefined)) };
|
|
34
|
+
|
|
38
35
|
});
|
|
39
36
|
|
|
40
37
|
const barClass = computed(() => {
|
|
@@ -1,25 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed } from "vue"
|
|
3
2
|
import type { QCheckboxProps } from "quasar"
|
|
4
|
-
|
|
5
|
-
export interface LCheckboxProps extends QCheckboxProps {
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const modelValue = defineModel();
|
|
9
|
-
|
|
10
|
-
const emit = defineEmits(["update:modelValue"]);
|
|
11
|
-
|
|
12
|
-
const props = defineProps<LCheckboxProps>()
|
|
13
|
-
|
|
14
|
-
const localValue = computed({
|
|
15
|
-
get: () => modelValue.value,
|
|
16
|
-
set: (value) => {
|
|
17
|
-
modelValue.value = value;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
3
|
+
defineProps<QCheckboxProps>()
|
|
20
4
|
</script>
|
|
21
5
|
<template>
|
|
22
|
-
<q-checkbox v-bind="$props"
|
|
6
|
+
<q-checkbox v-bind="$props" :color="color ?? $light.color" :label="label ? $t(label) : undefined">
|
|
23
7
|
<slot></slot>
|
|
24
8
|
</q-checkbox>
|
|
25
9
|
</template>
|
|
@@ -30,6 +30,7 @@ export interface LDatePickerProps {
|
|
|
30
30
|
range?: boolean,
|
|
31
31
|
mask?: string,
|
|
32
32
|
disable?: boolean
|
|
33
|
+
color?: string
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
const props = withDefaults(defineProps<LDatePickerProps>(), {
|
|
@@ -127,25 +128,11 @@ if (!props.range) {
|
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
const input_attrs = computed(() => {
|
|
130
|
-
let a: QInputProps = {
|
|
131
|
-
modelValue: localValue.value,
|
|
132
|
-
...props
|
|
133
|
-
}
|
|
134
131
|
|
|
132
|
+
const a = light.getInputProps(props);
|
|
135
133
|
a.rules = rules;
|
|
136
134
|
a.mask = props.range ? "####-##-## - ####-##-##" : "####-##-##"
|
|
137
135
|
|
|
138
|
-
if (props.filled == undefined) a.filled = light.getStyle("inputFilled");
|
|
139
|
-
if (props.outlined == undefined) a.outlined = light.getStyle("inputOutlined");
|
|
140
|
-
if (props.standout == undefined) a.standout = light.getStyle("inputStandout");
|
|
141
|
-
if (props.rounded == undefined) a.rounded = light.getStyle("inputRounded");
|
|
142
|
-
if (props.dense == undefined) a.dense = light.getStyle("inputDense");
|
|
143
|
-
if (props.square == undefined) a.square = light.getStyle("inputSquare");
|
|
144
|
-
if (props.stackLabel == undefined) a.stackLabel = light.getStyle("inputStackLabel");
|
|
145
|
-
|
|
146
|
-
if (props.label) {
|
|
147
|
-
a.label = t(props.label);
|
|
148
|
-
}
|
|
149
136
|
return a;
|
|
150
137
|
})
|
|
151
138
|
|
|
@@ -157,13 +144,13 @@ const date_attrs = computed(() => {
|
|
|
157
144
|
|
|
158
145
|
</script>
|
|
159
146
|
<template>
|
|
160
|
-
<q-input v-bind="input_attrs" v-model="localValue"
|
|
147
|
+
<q-input v-bind="input_attrs" v-model="localValue">
|
|
161
148
|
<template v-slot:prepend>
|
|
162
149
|
<q-btn icon="sym_o_event" round dense flat>
|
|
163
150
|
<q-popup-proxy cover transition-show="scale" transition-hide="scale" ref="popup">
|
|
164
|
-
<q-date v-bind="date_attrs" v-model="dateValue" :color="$light.color">
|
|
151
|
+
<q-date v-bind="date_attrs" v-model="dateValue" :color="color ?? $light.color">
|
|
165
152
|
<div class="row items-center justify-end">
|
|
166
|
-
<q-btn v-close-popup label="Close" :color="$light.color" flat />
|
|
153
|
+
<q-btn v-close-popup label="Close" :color="color ?? $light.color" flat />
|
|
167
154
|
</div>
|
|
168
155
|
</q-date>
|
|
169
156
|
</q-popup-proxy>
|
|
@@ -11,10 +11,7 @@ const { t } = useI18n();
|
|
|
11
11
|
|
|
12
12
|
const attrs = computed(() => {
|
|
13
13
|
|
|
14
|
-
const a = {
|
|
15
|
-
...props,
|
|
16
|
-
outlined: light.getStyle("inputOutlined"),
|
|
17
|
-
};
|
|
14
|
+
const a = { ...light.styles.input, ...JSON.parse(JSON.stringify(props)) };
|
|
18
15
|
|
|
19
16
|
if (props.label) {
|
|
20
17
|
a.label = t(props.label);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { ref, computed
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
3
|
import { useLight, m, q } from '#imports';
|
|
4
4
|
import { useQuasar } from "quasar";
|
|
5
5
|
import { useI18n } from "vue-i18n";
|
|
@@ -7,9 +7,8 @@ import { format } from 'quasar'
|
|
|
7
7
|
const { humanStorageSize } = format
|
|
8
8
|
const light = useLight();
|
|
9
9
|
const i18n = useI18n();
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
10
|
+
const $q = useQuasar();
|
|
11
|
+
const modelValue = defineModel()
|
|
13
12
|
|
|
14
13
|
const { system } = await q({
|
|
15
14
|
system: {
|
|
@@ -18,7 +17,6 @@ const { system } = await q({
|
|
|
18
17
|
})
|
|
19
18
|
|
|
20
19
|
export interface LFileProps {
|
|
21
|
-
modelValue?: string;
|
|
22
20
|
label?: string;
|
|
23
21
|
filled?: boolean;
|
|
24
22
|
outlined?: boolean;
|
|
@@ -30,6 +28,7 @@ export interface LFileProps {
|
|
|
30
28
|
path?: string;
|
|
31
29
|
accept?: string;
|
|
32
30
|
driveIndex?: number;
|
|
31
|
+
color?: string;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
const props = withDefaults(defineProps<LFileProps>(), {
|
|
@@ -45,38 +44,19 @@ const props = withDefaults(defineProps<LFileProps>(), {
|
|
|
45
44
|
driveIndex: 0
|
|
46
45
|
});
|
|
47
46
|
|
|
48
|
-
const emit = defineEmits(["update:modelValue"]);
|
|
49
|
-
|
|
50
47
|
const show = ref(false);
|
|
51
48
|
|
|
52
|
-
|
|
53
|
-
const localValue = computed({
|
|
54
|
-
get: () => props.modelValue,
|
|
55
|
-
set: (value) => emit("update:modelValue", value),
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
49
|
const attrs = computed(() => {
|
|
61
|
-
|
|
62
|
-
if (props.filled === undefined) a.filled = light.getStyle("inputFilled");
|
|
63
|
-
if (props.outlined === undefined) a.outlined = light.getStyle("inputOutlined");
|
|
64
|
-
if (props.standout === undefined) a.standout = light.getStyle("inputStandout");
|
|
65
|
-
if (props.rounded === undefined) a.rounded = light.getStyle("inputRounded");
|
|
66
|
-
if (props.dense === undefined) a.dense = light.getStyle("inputDense");
|
|
67
|
-
if (props.square === undefined) a.square = light.getStyle("inputSquare");
|
|
68
|
-
if (props.stackLabel === undefined) a.stackLabel = light.getStyle("inputStackLabel");
|
|
69
|
-
return a;
|
|
50
|
+
return { ...light.styles.input, ...JSON.parse(JSON.stringify(props)) };
|
|
70
51
|
});
|
|
71
52
|
|
|
72
|
-
|
|
73
53
|
const uploadFile = ref<File | null>(null);
|
|
74
54
|
const rename = ref(true);
|
|
75
55
|
|
|
76
56
|
const onUploadFile = async () => {
|
|
77
57
|
|
|
78
58
|
if (!uploadFile.value) {
|
|
79
|
-
|
|
59
|
+
$q.dialog({
|
|
80
60
|
title: "Error",
|
|
81
61
|
message: i18n.t("Please select a file"),
|
|
82
62
|
color: "negative"
|
|
@@ -86,7 +66,7 @@ const onUploadFile = async () => {
|
|
|
86
66
|
|
|
87
67
|
//check file size
|
|
88
68
|
if (uploadFile.value.size > system.maxUploadSize) {
|
|
89
|
-
|
|
69
|
+
$q.dialog({
|
|
90
70
|
title: "Error",
|
|
91
71
|
message: "File size is too big. Max size is " + humanStorageSize(system.maxUploadSize),
|
|
92
72
|
color: "negative"
|
|
@@ -109,7 +89,7 @@ const onUploadFile = async () => {
|
|
|
109
89
|
//remove first slash if exists
|
|
110
90
|
if (v.startsWith("/")) v = v.substr(1);
|
|
111
91
|
|
|
112
|
-
|
|
92
|
+
modelValue.value = v;
|
|
113
93
|
show.value = false;
|
|
114
94
|
uploadFile.value = null;
|
|
115
95
|
} catch (e: any) {
|
|
@@ -122,25 +102,24 @@ const onUploadFile = async () => {
|
|
|
122
102
|
}
|
|
123
103
|
$q.loading.hide();
|
|
124
104
|
|
|
125
|
-
|
|
126
|
-
|
|
127
105
|
}
|
|
128
106
|
|
|
129
107
|
</script>
|
|
130
108
|
<template>
|
|
131
|
-
<
|
|
109
|
+
<q-input v-bind="attrs" v-model="modelValue" hide-bottom-space>
|
|
132
110
|
<q-dialog v-model="show" persistent transition-show="scale" transition-hide="scale">
|
|
133
111
|
<l-card style="width:300px">
|
|
134
112
|
<q-card-section>
|
|
135
113
|
<q-file ref="file" v-model="uploadFile" name="file" :label="$t('File')" :accept="accept"
|
|
136
|
-
:hint="`Max upload size: ${humanStorageSize(system.maxUploadSize)}`"
|
|
114
|
+
:hint="`Max upload size: ${humanStorageSize(system.maxUploadSize)}`"
|
|
115
|
+
:color="attrs.color"></q-file>
|
|
137
116
|
<!-- q-checkbox v-model="rename" :label="$t('Rename file if exists')"></q-checkbox-->
|
|
138
117
|
</q-card-section>
|
|
139
118
|
|
|
140
119
|
<q-card-actions align="right">
|
|
141
|
-
<q-btn flat :label="$t('Cancel')" :color="
|
|
120
|
+
<q-btn flat :label="$t('Cancel')" :color="attrs.color" @click="uploadFile = null"
|
|
142
121
|
v-close-popup></q-btn>
|
|
143
|
-
<q-btn flat :label="$t('Upload')" :color="
|
|
122
|
+
<q-btn flat :label="$t('Upload')" :color="attrs.color" @click="onUploadFile"></q-btn>
|
|
144
123
|
</q-card-actions>
|
|
145
124
|
</l-card>
|
|
146
125
|
</q-dialog>
|
|
@@ -151,5 +130,5 @@ const onUploadFile = async () => {
|
|
|
151
130
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
152
131
|
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
153
132
|
</template>
|
|
154
|
-
</
|
|
133
|
+
</q-input>
|
|
155
134
|
</template>
|
|
@@ -14,7 +14,7 @@ export interface LFileProps {
|
|
|
14
14
|
dense?: boolean;
|
|
15
15
|
square?: boolean;
|
|
16
16
|
stackLabel?: boolean;
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const props = withDefaults(defineProps<LFileProps>(), {
|
|
@@ -45,14 +45,12 @@ const localValue = computed({
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
const attrs = computed(() => {
|
|
48
|
-
const a = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (props.square === undefined) a.square = light.getStyle("inputSquare");
|
|
55
|
-
if (props.stackLabel === undefined) a.stackLabel = light.getStyle("inputStackLabel");
|
|
48
|
+
const a = {
|
|
49
|
+
...light.styles.input,
|
|
50
|
+
...useAttrs,
|
|
51
|
+
...JSON.parse(JSON.stringify(props))
|
|
52
|
+
};
|
|
53
|
+
|
|
56
54
|
return a;
|
|
57
55
|
});
|
|
58
56
|
|