vueless 0.0.663 → 0.0.665
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/composables/useUI.ts
CHANGED
|
@@ -142,7 +142,9 @@ export default function useUI<T>(
|
|
|
142
142
|
/* Delete value key to prevent v-model overwrite. */
|
|
143
143
|
delete commonAttrs.value;
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
const reactiveProps = computed(() => ({ ...props }));
|
|
146
|
+
|
|
147
|
+
watch([config, reactiveProps, classes], updateVuelessAttrs, { immediate: true });
|
|
146
148
|
|
|
147
149
|
/**
|
|
148
150
|
* Updating Vueless attributes.
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ const index = ref(0);
|
|
|
34
34
|
const isChecked = ref(false);
|
|
35
35
|
|
|
36
36
|
const selected = computed<UCheckboxOption>(() => {
|
|
37
|
-
return props.options[index.value];
|
|
37
|
+
return props.options[index.value] || {};
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
watchEffect(setIndex);
|
|
@@ -50,7 +50,7 @@ function setIndex() {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function setChecked() {
|
|
53
|
-
setTimeout(() => (isChecked.value = !!props?.options[index.value]
|
|
53
|
+
setTimeout(() => (isChecked.value = !!props?.options[index.value]?.icon), 0);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
function onClickCheckbox() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { vuelessConfig } from "../utils/ui.ts";
|
|
2
|
-
import { getRandomId } from "../utils/helper.ts";
|
|
2
|
+
import { getRandomId, isSSR } from "../utils/helper.ts";
|
|
3
3
|
import {
|
|
4
4
|
LOCAL_STORAGE_ID,
|
|
5
5
|
DELAY_BETWEEN_CLONES,
|
|
@@ -130,10 +130,14 @@ export function clearNotifications(): void {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
export function setDelayedNotify(settings: NotifyConfig): void {
|
|
133
|
+
if (isSSR) return;
|
|
134
|
+
|
|
133
135
|
localStorage.setItem(LOCAL_STORAGE_ID, JSON.stringify(settings));
|
|
134
136
|
}
|
|
135
137
|
|
|
136
138
|
export function getDelayedNotify(): void {
|
|
139
|
+
if (isSSR) return;
|
|
140
|
+
|
|
137
141
|
const notifyData: NotifyConfig | null = JSON.parse(
|
|
138
142
|
localStorage.getItem(LOCAL_STORAGE_ID) || "null",
|
|
139
143
|
);
|
package/utils/theme.ts
CHANGED
|
@@ -50,7 +50,7 @@ export function themeInit() {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export function setColorMode(colorMode: `${ColorMode}`) {
|
|
53
|
-
const cashedColorMode = localStorage.getItem(COLOR_MODE_KEY) as ColorMode | null;
|
|
53
|
+
const cashedColorMode = isCSR ? (localStorage.getItem(COLOR_MODE_KEY) as ColorMode | null) : null;
|
|
54
54
|
|
|
55
55
|
const isDark = colorMode === ColorMode.Dark;
|
|
56
56
|
const isLight = colorMode === ColorMode.Light;
|
|
@@ -103,7 +103,7 @@ export function setTheme(config: Config = {}) {
|
|
|
103
103
|
const rounding = config?.rounding ?? vuelessConfig.rounding ?? DEFAULT_ROUNDING;
|
|
104
104
|
const roundingSm = config?.roundingSm ?? vuelessConfig.roundingSm ?? rounding / 2;
|
|
105
105
|
const roundingLg = config?.roundingLg ?? vuelessConfig.roundingLg ?? rounding * 2;
|
|
106
|
-
const isDarkMode = document.documentElement.classList.contains(DARK_MODE_SELECTOR);
|
|
106
|
+
const isDarkMode = isCSR && document.documentElement.classList.contains(DARK_MODE_SELECTOR);
|
|
107
107
|
|
|
108
108
|
let brand: BrandColors | GrayColors | typeof GRAY_COLOR =
|
|
109
109
|
config?.brand ?? vuelessConfig.brand ?? DEFAULT_BRAND_COLOR;
|