@christianriedl/utils 1.0.63 → 1.0.64
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/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { reactive } from 'vue';
|
|
3
|
-
import { IConfigItem } from '@christianriedl/utils';
|
|
3
|
+
import { IConfigItem, EScope } from '@christianriedl/utils';
|
|
4
4
|
|
|
5
|
-
const props = defineProps<{item: IConfigItem; }>();
|
|
5
|
+
const props = defineProps<{item: IConfigItem; scopes: EScope }>();
|
|
6
6
|
const emits = defineEmits<{ (e: 'change', value: any): void }>();
|
|
7
7
|
|
|
8
8
|
const item = reactive(props.item);
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
const isNumber = typeof item.default === 'number';
|
|
12
12
|
const isBoolean = typeof item.default === 'boolean';
|
|
13
13
|
const isDisabled = item.doNotChange;
|
|
14
|
+
const isVisible = (item.scopes & props.scopes) != 0;
|
|
14
15
|
|
|
15
16
|
function onChange(ev: Event) {
|
|
16
17
|
emits('change', true);
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
</script>
|
|
19
20
|
|
|
20
21
|
<template>
|
|
21
|
-
<tr class="settingsline">
|
|
22
|
+
<tr v-if="isVisible" class="settingsline">
|
|
22
23
|
<td style="width:50%">{{item.description}}</td>
|
|
23
24
|
<td style="width:50%">
|
|
24
25
|
<v-switch v-if="isBoolean" v-model="item.value" :disabled="isDisabled" density="compact" hide-details marg color="primary" @change="onChange"></v-switch>
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
const emits = defineEmits<{ (e: 'configchange', item: IConfigItem): void }>();
|
|
8
8
|
const appState = inject<IAppState>('appstate')!;
|
|
9
9
|
const appConfig = inject<IAppConfig>('appconfig')!;
|
|
10
|
-
const appItems = appConfig.items.filter((i) => (i.scopes & appState.scopes) != 0);
|
|
11
10
|
|
|
12
11
|
const heightStyle = computed(() => { return { height: appState.bodyHeight.value + 'px', overflowY: 'auto' } });
|
|
13
12
|
|
|
@@ -62,7 +61,7 @@
|
|
|
62
61
|
</tr>
|
|
63
62
|
</thead>
|
|
64
63
|
<tbody>
|
|
65
|
-
<settings-line v-for="config in
|
|
64
|
+
<settings-line v-for="config in appConfig.items" :key="config.name" :item="config" :scopes="appState.scopes" @change="onChange(config)"></settings-line>
|
|
66
65
|
</tbody>
|
|
67
66
|
</v-table>
|
|
68
67
|
</v-container>
|