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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.437",
3
+ "version": "0.0.438",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -32,7 +32,7 @@
32
32
  v-bind="bodyCellNestedAttrs"
33
33
  >
34
34
  <UIcon
35
- v-if="row.row || (row.nestedData && hasSlotContent($slots['nested-content']))"
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)
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.437",
4
+ "version": "0.0.438",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",