@hostlink/nuxt-light 1.26.2 → 1.26.4
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-bar.vue +17 -7
- package/dist/runtime/components/l-btn.vue +27 -23
- package/dist/runtime/components/l-file-manager.vue +7 -2
- package/dist/runtime/components/l-select.vue +2 -6
- package/dist/runtime/components/l-time-picker.vue +22 -2
- package/dist/runtime/formkit/TimePicker.vue +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useLight } from '#imports';
|
|
3
|
+
import { QBar } from 'quasar';
|
|
3
4
|
import type { QBarProps } from 'quasar';
|
|
4
|
-
import { computed } from 'vue';
|
|
5
|
+
import { h, computed, useSlots } from 'vue';
|
|
6
|
+
export interface LBarProps extends QBarProps {
|
|
7
|
+
color?: string;
|
|
8
|
+
textColor?: string;
|
|
9
|
+
}
|
|
5
10
|
|
|
6
|
-
|
|
11
|
+
const props = withDefaults(defineProps<LBarProps>(), {
|
|
12
|
+
color: undefined,
|
|
13
|
+
textColor: "white"
|
|
14
|
+
});
|
|
7
15
|
|
|
8
16
|
const light = useLight();
|
|
9
17
|
const barClass = computed(() => {
|
|
10
|
-
const c = [
|
|
11
|
-
const color = light.color;
|
|
18
|
+
const c = [`text-${props.textColor}`];
|
|
19
|
+
const color = props.color || light.color;
|
|
12
20
|
c.push(`bg-${color}`);
|
|
13
21
|
return c;
|
|
14
22
|
});
|
|
23
|
+
|
|
24
|
+
const root = h(QBar, {
|
|
25
|
+
...props,
|
|
26
|
+
}, useSlots()) as any;
|
|
15
27
|
</script>
|
|
16
28
|
|
|
17
29
|
<template>
|
|
18
|
-
<
|
|
19
|
-
<slot></slot>
|
|
20
|
-
</q-bar>
|
|
30
|
+
<component :is="root" :class="barClass" />
|
|
21
31
|
</template>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { h, useSlots } from "vue";
|
|
3
|
+
import { useQuasar, QBtn } from "quasar";
|
|
4
|
+
import { useLight } from "#imports";
|
|
3
5
|
import type { QBtnProps } from "quasar";
|
|
4
|
-
import { useQuasar } from "quasar";
|
|
5
|
-
const router = useRouter();
|
|
6
6
|
|
|
7
7
|
export interface LBtnProps extends QBtnProps {
|
|
8
8
|
permission?: string;
|
|
@@ -10,33 +10,37 @@ export interface LBtnProps extends QBtnProps {
|
|
|
10
10
|
confirmTitle?: string;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const $q = useQuasar();
|
|
14
13
|
const props = withDefaults(defineProps<LBtnProps>(), {
|
|
15
14
|
permission: "",
|
|
16
15
|
confirmMessage: "",
|
|
17
16
|
confirmTitle: "Confirm",
|
|
18
17
|
});
|
|
19
18
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
$q.dialog({
|
|
24
|
-
title: props.confirmTitle,
|
|
25
|
-
message: props.confirmMessage,
|
|
26
|
-
ok: "Yes",
|
|
27
|
-
cancel: "No",
|
|
28
|
-
}).onOk(() => {
|
|
29
|
-
props.onClick?.apply(null, args);
|
|
30
|
-
});
|
|
31
|
-
} else {
|
|
32
|
-
props.onClick?.apply(null, args);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
19
|
+
const $light = useLight();
|
|
20
|
+
const $q = useQuasar();
|
|
21
|
+
const slots = useSlots() as ReturnType<typeof useSlots>;
|
|
35
22
|
|
|
23
|
+
const root = h(QBtn, {
|
|
24
|
+
...props,
|
|
25
|
+
...$light.getButtonProps(props),
|
|
26
|
+
onClick: function () {
|
|
27
|
+
const args = arguments;
|
|
28
|
+
if (props.confirmMessage) {
|
|
29
|
+
$q.dialog({
|
|
30
|
+
title: props.confirmTitle,
|
|
31
|
+
message: props.confirmMessage,
|
|
32
|
+
ok: "Yes",
|
|
33
|
+
cancel: "No",
|
|
34
|
+
}).onOk(() => {
|
|
35
|
+
props.onClick?.apply(null, args as any);
|
|
36
|
+
});
|
|
37
|
+
} else {
|
|
38
|
+
props.onClick?.apply(null, args as any);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
}, slots);
|
|
36
42
|
|
|
37
43
|
</script>
|
|
38
44
|
<template>
|
|
39
|
-
<
|
|
40
|
-
<slot></slot>
|
|
41
|
-
</q-btn>
|
|
45
|
+
<component :is="root" v-if="$light.isGranted($props.permission)"/>
|
|
42
46
|
</template>
|
|
@@ -8,6 +8,7 @@ const { humanStorageSize } = format
|
|
|
8
8
|
const light = useLight();
|
|
9
9
|
const i18n = useI18n();
|
|
10
10
|
const $q = useQuasar();
|
|
11
|
+
const $light = useLight();
|
|
11
12
|
|
|
12
13
|
const emit = defineEmits(["input", "close"]);
|
|
13
14
|
|
|
@@ -324,10 +325,14 @@ const onDeleteSelected = () => {
|
|
|
324
325
|
|
|
325
326
|
}
|
|
326
327
|
|
|
328
|
+
|
|
329
|
+
|
|
327
330
|
const onNewFolder = () => {
|
|
328
331
|
$q.dialog({
|
|
332
|
+
color: $light.color,
|
|
329
333
|
title: "New Folder",
|
|
330
334
|
prompt: {
|
|
335
|
+
|
|
331
336
|
model: "",
|
|
332
337
|
label: "Name",
|
|
333
338
|
isValid: (val) => {
|
|
@@ -660,7 +665,7 @@ selectedNodePath.value = drives[0].index.toString();
|
|
|
660
665
|
<q-list padding class="text-grey-8">
|
|
661
666
|
<q-item>
|
|
662
667
|
<q-item-section>
|
|
663
|
-
<
|
|
668
|
+
<l-btn icon="add" label="New" :disable="!selectedNodePath" :color="$light.color">
|
|
664
669
|
<q-menu>
|
|
665
670
|
<q-list>
|
|
666
671
|
<q-item clickable v-close-popup @click="onNewFolder" v-if="permission.includes('fs.folder.create')">
|
|
@@ -679,7 +684,7 @@ selectedNodePath.value = drives[0].index.toString();
|
|
|
679
684
|
</q-item>
|
|
680
685
|
</q-list>
|
|
681
686
|
</q-menu>
|
|
682
|
-
</
|
|
687
|
+
</l-btn>
|
|
683
688
|
</q-item-section>
|
|
684
689
|
</q-item>
|
|
685
690
|
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, ref } from "vue";
|
|
3
|
-
import { useLight } from '#imports';
|
|
4
3
|
import { type QSelectProps } from "quasar";
|
|
5
|
-
import { useI18n } from "vue-i18n";
|
|
6
4
|
|
|
7
5
|
const emits = defineEmits(["update:modelValue"]);
|
|
8
6
|
|
|
9
|
-
const { t } = useI18n();
|
|
10
|
-
const light = useLight();
|
|
11
7
|
interface LSelectProps extends QSelectProps {
|
|
12
8
|
required?: boolean,
|
|
13
9
|
}
|
|
14
10
|
|
|
15
|
-
|
|
16
11
|
const props = withDefaults(defineProps<LSelectProps>(), {
|
|
17
12
|
rules: () => {
|
|
18
13
|
return []
|
|
@@ -30,6 +25,7 @@ const props = withDefaults(defineProps<LSelectProps>(), {
|
|
|
30
25
|
dense: undefined,
|
|
31
26
|
square: undefined,
|
|
32
27
|
stackLabel: undefined,
|
|
28
|
+
hideBottomSpace:true
|
|
33
29
|
|
|
34
30
|
})
|
|
35
31
|
|
|
@@ -112,5 +108,5 @@ const localValue = computed({
|
|
|
112
108
|
</script>
|
|
113
109
|
<template>
|
|
114
110
|
<q-select v-bind="$light.getInputProps($props)" v-model="localValue" :options="select_options" @filter="filterFn"
|
|
115
|
-
:option-label="optionLabel"
|
|
111
|
+
:option-label="optionLabel" :rules="rules" :clearable="clearable" />
|
|
116
112
|
</template>
|
|
@@ -37,12 +37,32 @@ const localValue = computed<string | null | undefined>({
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
const rules: ValidationRule[] = [
|
|
40
|
+
const rules: ValidationRule[] = [];
|
|
41
41
|
//const rules = [];
|
|
42
42
|
if (props.required) {
|
|
43
|
-
rules.push(
|
|
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"
|
|
@@ -25,7 +25,7 @@ const label = computed(() => {
|
|
|
25
25
|
</script>
|
|
26
26
|
<template>
|
|
27
27
|
<l-time-picker v-model="value" v-bind="context.attrs" :label="label" :error="error" :type="context.inputType"
|
|
28
|
-
:error-message="errorMessage">
|
|
28
|
+
:error-message="errorMessage" >
|
|
29
29
|
<template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
|
|
30
30
|
<slot :name="name" v-bind="props ?? {}"></slot>
|
|
31
31
|
</template>
|