@hostlink/nuxt-light 0.0.99 → 0.0.100
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/module.mjs +1 -2
- package/dist/runtime/components/l-app-main.vue +2 -2
- package/dist/runtime/components/l-customizer.vue +4 -3
- package/dist/runtime/components/l-table.vue +15 -2
- package/dist/runtime/lib/SystemValue.d.ts +4 -3
- package/dist/runtime/lib/SystemValue.mjs +1 -8
- package/dist/runtime/lib/sv.d.ts +4 -1
- package/dist/runtime/lib/sv.mjs +11 -8
- package/dist/runtime/types/User.mjs +4 -7
- package/package.json +1 -1
- package/dist/runtime/lib/loadSV.d.ts +0 -3
- package/dist/runtime/lib/loadSV.mjs +0 -4
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -59,8 +59,7 @@ const module = defineNuxtModule({
|
|
|
59
59
|
{ name: "getModelColumns", from },
|
|
60
60
|
{ name: "getModelFields", from },
|
|
61
61
|
{ name: "getModelField", from },
|
|
62
|
-
{ name: "getGQLFields", from }
|
|
63
|
-
{ name: "sv", from }
|
|
62
|
+
{ name: "getGQLFields", from }
|
|
64
63
|
]);
|
|
65
64
|
addPlugin({
|
|
66
65
|
src: resolver.resolve("./runtime/plugin"),
|
|
@@ -7,9 +7,9 @@ import { ref, computed, reactive, provide, watch } from 'vue';
|
|
|
7
7
|
import { useRuntimeConfig } from 'nuxt/app';
|
|
8
8
|
|
|
9
9
|
//download system value
|
|
10
|
-
import { download } from './../lib/SystemValue'
|
|
10
|
+
/* import { download } from './../lib/SystemValue'
|
|
11
11
|
await download();
|
|
12
|
-
|
|
12
|
+
*/
|
|
13
13
|
const config = useRuntimeConfig();
|
|
14
14
|
|
|
15
15
|
const appVersion = config.public.appVersion ?? '0.0.1';
|
|
@@ -31,10 +31,11 @@ const COLORS = [
|
|
|
31
31
|
|
|
32
32
|
defineEmits(['update:theme', 'update:menuOverlayHeader', 'update:dense', 'update:color', 'update:miniState', 'update:footer'])
|
|
33
33
|
|
|
34
|
-
const color = defineModel("color", { type: String, default: "primary" })
|
|
35
|
-
|
|
36
|
-
|
|
37
34
|
const props = defineProps({
|
|
35
|
+
color: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'primary'
|
|
38
|
+
},
|
|
38
39
|
menuOverlayHeader: {
|
|
39
40
|
type: Boolean,
|
|
40
41
|
default: false
|
|
@@ -20,7 +20,7 @@ const props = defineProps({
|
|
|
20
20
|
sortable?: boolean,
|
|
21
21
|
searchable?: boolean,
|
|
22
22
|
searchType?: string,
|
|
23
|
-
searchOptions?: Array<any
|
|
23
|
+
searchOptions?: Array<any> | Function,
|
|
24
24
|
searchMultiple?: boolean,
|
|
25
25
|
field?: string | Object,
|
|
26
26
|
gqlField?: string | Array<string> | Object,
|
|
@@ -95,6 +95,19 @@ props.columns?.forEach((col) => {
|
|
|
95
95
|
col.label = t(col.label)
|
|
96
96
|
})
|
|
97
97
|
|
|
98
|
+
if (props.columns) {
|
|
99
|
+
for (let i = 0; i < props.columns.length; i++) {
|
|
100
|
+
if (props.columns[i].searchOptions) {
|
|
101
|
+
let opts = props.columns[i].searchOptions;
|
|
102
|
+
if (typeof opts == "function") {
|
|
103
|
+
props.columns[i].searchOptions = await opts();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
98
111
|
const renderColumns = computed(() => {
|
|
99
112
|
if (props.columns == undefined) return undefined;
|
|
100
113
|
|
|
@@ -430,8 +443,8 @@ const filterFn = (val, update, abort) {
|
|
|
430
443
|
|
|
431
444
|
const isDark = computed(() => {
|
|
432
445
|
return light.theme == "dark";
|
|
433
|
-
|
|
434
446
|
})
|
|
447
|
+
|
|
435
448
|
</script>
|
|
436
449
|
|
|
437
450
|
<template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export declare const loadSV: (name: string) => () => Promise<{
|
|
2
|
+
label: string;
|
|
3
|
+
value: any;
|
|
4
|
+
}>;
|
|
4
5
|
export declare const getSV: (name: string, value: any) => string;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import sv from "./sv.mjs";
|
|
2
2
|
import { cache } from "./sv.mjs";
|
|
3
|
-
export const sv_data = [];
|
|
4
3
|
export const loadSV = (name) => {
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
export const download = async () => {
|
|
8
|
-
for (let i = 0; i < sv_data.length; i++) {
|
|
9
|
-
const name = sv_data[i];
|
|
10
|
-
await sv(name);
|
|
11
|
-
}
|
|
4
|
+
return () => sv(name);
|
|
12
5
|
};
|
|
13
6
|
export const getSV = (name, value) => {
|
|
14
7
|
const data = cache[name];
|
package/dist/runtime/lib/sv.d.ts
CHANGED
package/dist/runtime/lib/sv.mjs
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { query } from "@hostlink/light";
|
|
2
2
|
export const cache = {};
|
|
3
|
-
export default
|
|
3
|
+
export default (name) => {
|
|
4
4
|
if (cache[name]) {
|
|
5
5
|
return cache[name];
|
|
6
6
|
}
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const p = new Promise(async (resolve, reject) => {
|
|
8
|
+
const resp = await query({
|
|
9
|
+
systemValue: {
|
|
10
|
+
__args: {
|
|
11
|
+
name
|
|
12
|
+
}
|
|
11
13
|
}
|
|
12
|
-
}
|
|
14
|
+
});
|
|
15
|
+
cache[name] = resp.systemValue;
|
|
16
|
+
resolve(resp.systemValue);
|
|
13
17
|
});
|
|
14
|
-
|
|
15
|
-
return resp.systemValue;
|
|
18
|
+
return p;
|
|
16
19
|
};
|
|
@@ -38,13 +38,10 @@ export default {
|
|
|
38
38
|
label: "Status",
|
|
39
39
|
searchable: true,
|
|
40
40
|
searchType: "select",
|
|
41
|
-
searchOptions: [
|
|
42
|
-
label: "Active",
|
|
43
|
-
value:
|
|
44
|
-
|
|
45
|
-
label: "Inactive",
|
|
46
|
-
value: 1
|
|
47
|
-
}],
|
|
41
|
+
searchOptions: [
|
|
42
|
+
{ label: "Active", value: 0 },
|
|
43
|
+
{ label: "Inactive", value: 1 }
|
|
44
|
+
],
|
|
48
45
|
format: (value) => {
|
|
49
46
|
return ["Active", "Inactive"][value];
|
|
50
47
|
}
|
package/package.json
CHANGED