vueless 0.0.664 → 0.0.666
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
|
@@ -46,7 +46,9 @@ const toggleIconConfig = computed(() => {
|
|
|
46
46
|
const nestedRow = props.row?.row;
|
|
47
47
|
let isShown = false;
|
|
48
48
|
|
|
49
|
-
if (
|
|
49
|
+
if (props.row.nestedData) {
|
|
50
|
+
isShown = Boolean(props.row.nestedData.isShown);
|
|
51
|
+
} else if (Array.isArray(nestedRow)) {
|
|
50
52
|
isShown = nestedRow.some((row) => row.isShown);
|
|
51
53
|
} else {
|
|
52
54
|
isShown = Boolean(nestedRow?.isShown);
|
|
@@ -76,10 +78,16 @@ const isNestedRowEmpty = computed(() => {
|
|
|
76
78
|
return !Object.keys(mapRowColumns(props.row.row, props.columns)).length;
|
|
77
79
|
});
|
|
78
80
|
|
|
81
|
+
const isNestedDataEmpty = computed(() => {
|
|
82
|
+
if (!props.row.nestedData) return true;
|
|
83
|
+
|
|
84
|
+
return !props.row.nestedData.rows || !props.row.nestedData.rows.length;
|
|
85
|
+
});
|
|
86
|
+
|
|
79
87
|
const isShownToggleIcon = computed(() => {
|
|
80
88
|
return (
|
|
81
89
|
(props.row.row && !isNestedRowEmpty.value) ||
|
|
82
|
-
(props.row.nestedData && hasSlotContent(slots["nested-content"]))
|
|
90
|
+
(props.row.nestedData && !isNestedDataEmpty.value && hasSlotContent(slots["nested-content"]))
|
|
83
91
|
);
|
|
84
92
|
});
|
|
85
93
|
|
|
@@ -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() {
|
package/utils/theme.ts
CHANGED
|
@@ -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;
|