vueless 0.0.437 → 0.0.438
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 +1 -1
- package/ui.data-table/UTableRow.vue +22 -2
- package/web-types.json +1 -1
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
v-bind="bodyCellNestedAttrs"
|
|
33
33
|
>
|
|
34
34
|
<UIcon
|
|
35
|
-
v-if="
|
|
35
|
+
v-if="isShownToggleIcon"
|
|
36
36
|
size="xs"
|
|
37
37
|
internal
|
|
38
38
|
interactive
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
</template>
|
|
148
148
|
|
|
149
149
|
<script setup>
|
|
150
|
-
import { computed, onMounted, ref } from "vue";
|
|
150
|
+
import { computed, onMounted, ref, useSlots } from "vue";
|
|
151
151
|
import { cx } from "../utils/utilUI.js";
|
|
152
152
|
import useUI from "../composables/useUI.js";
|
|
153
153
|
|
|
@@ -208,6 +208,7 @@ const emit = defineEmits(["toggleRowVisibility", "click", "click-cell"]);
|
|
|
208
208
|
const selectedRows = defineModel("selectedRows", { type: Array, default: () => [] });
|
|
209
209
|
|
|
210
210
|
const cellRef = ref([]);
|
|
211
|
+
const slots = useSlots();
|
|
211
212
|
|
|
212
213
|
useMutationObserver(cellRef, setCellTitle, { childList: true });
|
|
213
214
|
|
|
@@ -231,6 +232,25 @@ const shift = computed(() => (props.row.row ? 1.5 : 2));
|
|
|
231
232
|
|
|
232
233
|
const isSingleNestedRow = computed(() => !Array.isArray(props.row.row));
|
|
233
234
|
|
|
235
|
+
const isNestedRowEmpty = computed(() => {
|
|
236
|
+
if (!props.row.row) return true;
|
|
237
|
+
|
|
238
|
+
if (Array.isArray(props.row.row)) {
|
|
239
|
+
return props.row.row.some(
|
|
240
|
+
(nestedRow) => !Object.keys(getFilteredRow(nestedRow, props.columns)).length,
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return !Object.keys(getFilteredRow(props.row.row, props.columns)).length;
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
const isShownToggleIcon = computed(() => {
|
|
248
|
+
return (
|
|
249
|
+
(props.row.row && !isNestedRowEmpty.value) ||
|
|
250
|
+
(props.row.nestedData && hasSlotContent(slots["nested-content"]))
|
|
251
|
+
);
|
|
252
|
+
});
|
|
253
|
+
|
|
234
254
|
const getToggleIconName = computed(() => (row) => {
|
|
235
255
|
const isHiddenNestedRow = Array.isArray(row.row)
|
|
236
256
|
? row.row.some((nestedRow) => nestedRow.isHidden)
|