@christianriedl/utils 1.0.166 → 1.0.167
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/appConfig.d.ts +1 -0
- package/dist/appConfig.js +13 -4
- package/dist/appConfig.js.map +1 -1
- package/dist/logger/src/iLogger.d.ts +62 -0
- package/dist/logger/src/iLogger.js +10 -0
- package/dist/logger/src/iLogger.js.map +1 -0
- package/dist/types.d.ts +3 -0
- package/dist/useSpeechRecognition.d.ts +104 -0
- package/dist/useSpeechRecognition.js +79 -0
- package/dist/useSpeechRecognition.js.map +1 -0
- package/dist/useSpeechSynthesis.d.ts +49 -0
- package/dist/useSpeechSynthesis.js +96 -0
- package/dist/useSpeechSynthesis.js.map +1 -0
- package/dist/utils/src/helper.d.ts +28 -0
- package/dist/utils/src/helper.js +144 -0
- package/dist/utils/src/helper.js.map +1 -0
- package/dist/utils/src/iLocalStorage.d.ts +7 -0
- package/dist/utils/src/iLocalStorage.js +2 -0
- package/dist/utils/src/iLocalStorage.js.map +1 -0
- package/dist/utils/src/index.d.ts +4 -0
- package/dist/utils/src/index.js +5 -0
- package/dist/utils/src/index.js.map +1 -0
- package/dist/utils/src/localStorage.d.ts +20 -0
- package/dist/utils/src/localStorage.js +57 -0
- package/dist/utils/src/localStorage.js.map +1 -0
- package/dist/utils/src/reactiveStorage.d.ts +18 -0
- package/dist/utils/src/reactiveStorage.js +49 -0
- package/dist/utils/src/reactiveStorage.js.map +1 -0
- package/dist/utils/src/registerServiceWorker.d.ts +31 -0
- package/dist/utils/src/registerServiceWorker.js +251 -0
- package/dist/utils/src/registerServiceWorker.js.map +1 -0
- package/package.json +1 -1
- package/src/components/SettingsLine.vue +6 -5
- package/src/components/ThemeSettings.vue +13 -3
- package/src/views/SettingsPage.vue +3 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { reactive, ref } from 'vue';
|
|
2
|
+
import { reactive, ref, computed } from 'vue';
|
|
3
3
|
import { IConfigItem, IDataItem, ItemType, EScope } from '@christianriedl/utils';
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{ item: IConfigItem | IDataItem; scopes?: EScope, clearable?: boolean, op?: string, operations?: string[] }>();
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
const enumValues: ItemType[] = item.values!;
|
|
16
16
|
const description = (item as IConfigItem).description || item.name;
|
|
17
17
|
const operation = ref(props.op ? props.op : '');
|
|
18
|
+
const isClearable = computed(() => props.clearable && item.value != item.default);
|
|
18
19
|
|
|
19
20
|
function onChange() {
|
|
20
21
|
emits('change');
|
|
@@ -33,12 +34,12 @@
|
|
|
33
34
|
<v-col cols="6">{{description}}</v-col>
|
|
34
35
|
<v-col cols="props.operations ? 4 : 6">
|
|
35
36
|
<v-switch v-if="isBoolean" v-model="item.value" :disabled="isDisabled" density="compact" hide-details color="primary"
|
|
36
|
-
:append-icon="
|
|
37
|
-
<v-text-field v-if="isString" v-model="item.value" :disabled="isDisabled" :clearable="
|
|
37
|
+
:append-icon="isClearable ? '$clear' : undefined" @update:modelValue="onChange" @click:append="onClear"></v-switch>
|
|
38
|
+
<v-text-field v-if="isString" v-model="item.value" :disabled="isDisabled" :clearable="isClearable" density="compact"
|
|
38
39
|
hide-details type="string" @update:modelValue="onChange" @click:clear="onClear"></v-text-field>
|
|
39
|
-
<v-text-field v-if="isNumber" v-model="item.value" :disabled="isDisabled" :clearable="
|
|
40
|
+
<v-text-field v-if="isNumber" v-model="item.value" :disabled="isDisabled" :clearable="isClearable" density="compact"
|
|
40
41
|
hide-details type="number" @update:modelValue="onChange" @click:clear="onClear"></v-text-field>
|
|
41
|
-
<v-select v-if="isEnum" name="enum" density="compact" v-model="item.value" :disabled="isDisabled" :clearable="
|
|
42
|
+
<v-select v-if="isEnum" name="enum" density="compact" v-model="item.value" :disabled="isDisabled" :clearable="isClearable"
|
|
42
43
|
:items="enumValues" persistent-hint @update:modelValue="onChange" @click:clear="onClear" dense solo hide-details single-line>
|
|
43
44
|
</v-select>
|
|
44
45
|
</v-col>
|
|
@@ -159,9 +159,19 @@
|
|
|
159
159
|
}
|
|
160
160
|
*/
|
|
161
161
|
async function save() {
|
|
162
|
-
|
|
163
|
-
await window.navigator.clipboard.writeText(stringified);
|
|
162
|
+
let stringified = JSON.stringify(stored);
|
|
164
163
|
appConfig.localStorage.setItem('themeColors', stringified);
|
|
164
|
+
if (paletteColorOk && toPalette.value) {
|
|
165
|
+
const copy = JSON.parse(stringified) as Dictionary<Dictionary<string>>;
|
|
166
|
+
for (const basecol in copy) {
|
|
167
|
+
const col = copy[basecol];
|
|
168
|
+
for (const c in col) {
|
|
169
|
+
col[c] = nearestColorOKLab (paletteColorOk, col[c]).name;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
stringified = JSON.stringify(copy);
|
|
173
|
+
}
|
|
174
|
+
await window.navigator.clipboard.writeText(stringified);
|
|
165
175
|
}
|
|
166
176
|
function reset() {
|
|
167
177
|
appConfig.localStorage.setItem('themeColors', null);
|
|
@@ -175,7 +185,7 @@
|
|
|
175
185
|
<v-container fluid>
|
|
176
186
|
<v-row dense align="center">
|
|
177
187
|
<v-col cols="2">Select rule</v-col>
|
|
178
|
-
<v-col cols="2"><v-checkbox label="To
|
|
188
|
+
<v-col cols="2"><v-checkbox label="To Material" v-model="toPalette" hide-details></v-checkbox></v-col>
|
|
179
189
|
<v-col cols="4">Edit background</v-col>
|
|
180
190
|
<v-col cols="4">Edit text</v-col>
|
|
181
191
|
</v-row>
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
function onChange(item: IConfigItem) {
|
|
48
|
+
/*
|
|
48
49
|
if (item.name === 'smartHomeUseServerWait') {
|
|
49
50
|
const acqCycleItem = appConfig.items['smartHomeAcqCycle'];
|
|
50
51
|
if (acqCycleItem)
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
scopes.value = appState.scopes
|
|
55
56
|
});
|
|
56
57
|
}
|
|
58
|
+
*/
|
|
57
59
|
emits('configchange', item);
|
|
58
60
|
changed = true;
|
|
59
61
|
}
|
|
@@ -67,6 +69,6 @@
|
|
|
67
69
|
<v-col cols="6">Parameter</v-col>
|
|
68
70
|
</v-row>
|
|
69
71
|
<v-divider></v-divider>
|
|
70
|
-
<settings-line v-for="config in appConfig.items" :key="config.name" :item="config" :scopes="scopes" @change="onChange(config)"></settings-line>
|
|
72
|
+
<settings-line v-for="config in appConfig.items" :key="config.name" :item="config" clearable :scopes="scopes" @change="onChange(config)" @clear="onChange(config)"></settings-line>
|
|
71
73
|
</v-container>
|
|
72
74
|
</template>
|