frappe-ui 0.1.39 → 0.1.41
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,22 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex items-center
|
|
3
|
-
<button
|
|
2
|
+
<div class="flex items-center">
|
|
3
|
+
<button
|
|
4
|
+
@click="toggleGroup"
|
|
5
|
+
class="ml-[3px] mr-[11px] rounded p-1 hover:bg-gray-100"
|
|
6
|
+
>
|
|
4
7
|
<DownSolid
|
|
5
8
|
class="h-4 w-4 text-gray-900 transition-transform duration-200"
|
|
6
9
|
:class="[group.collapsed ? '-rotate-90' : '']"
|
|
7
10
|
/>
|
|
8
11
|
</button>
|
|
9
|
-
<div class="
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
<div class="w-full py-1.5 pr-2">
|
|
13
|
+
<component
|
|
14
|
+
v-if="list.slots['group-header']"
|
|
15
|
+
:is="list.slots['group-header']"
|
|
16
|
+
v-bind="{ group }"
|
|
17
|
+
/>
|
|
18
|
+
<span v-else class="text-base font-medium leading-6">
|
|
19
|
+
{{ group.group }}
|
|
20
|
+
</span>
|
|
15
21
|
</div>
|
|
16
22
|
</div>
|
|
17
23
|
<div class="mx-2 h-px border-t border-gray-200"></div>
|
|
18
24
|
</template>
|
|
19
25
|
<script setup>
|
|
26
|
+
import { inject } from 'vue'
|
|
20
27
|
import DownSolid from '../../icons/DownSolid.vue'
|
|
21
28
|
|
|
22
29
|
const props = defineProps({
|
|
@@ -26,6 +33,8 @@ const props = defineProps({
|
|
|
26
33
|
},
|
|
27
34
|
})
|
|
28
35
|
|
|
36
|
+
const list = inject('list')
|
|
37
|
+
|
|
29
38
|
function toggleGroup() {
|
|
30
39
|
if (props.group.collapsed == null) {
|
|
31
40
|
props.group.collapsed = false
|
|
@@ -98,7 +98,9 @@ const selectable = computed(() => {
|
|
|
98
98
|
})
|
|
99
99
|
|
|
100
100
|
let showGroupedRows = computed(() => {
|
|
101
|
-
return props.rows.every(
|
|
101
|
+
return props.rows.every(
|
|
102
|
+
(row) => row.group && row.rows && Array.isArray(row.rows)
|
|
103
|
+
)
|
|
102
104
|
})
|
|
103
105
|
|
|
104
106
|
function toggleRow(row) {
|
|
@@ -372,18 +372,12 @@ const custom_rows = [
|
|
|
372
372
|
resizeColumn: state.resizeColumn,
|
|
373
373
|
}"
|
|
374
374
|
row-key="id"
|
|
375
|
-
v-slot="{ showGroupedRows, selectable }"
|
|
376
375
|
>
|
|
377
|
-
<
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
</span>
|
|
383
|
-
</template>
|
|
384
|
-
</ListGroups>
|
|
385
|
-
<ListRows v-else />
|
|
386
|
-
<ListSelectBanner v-if="selectable" />
|
|
376
|
+
<template #group-header="{ group }">
|
|
377
|
+
<span class="text-base font-medium leading-6 text-gray-900">
|
|
378
|
+
{{ group.group }} ({{ group.rows.length }})
|
|
379
|
+
</span>
|
|
380
|
+
</template>
|
|
387
381
|
</ListView>
|
|
388
382
|
</Variant>
|
|
389
383
|
<Variant title="Cell Slot">
|