frappe-ui 0.1.21 → 0.1.23
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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex justify-between gap-2">
|
|
3
|
+
<slot>
|
|
4
|
+
<slot name="left">
|
|
5
|
+
<TabButtons
|
|
6
|
+
v-model="pageLengthCount"
|
|
7
|
+
:buttons="pageLengthOptions.map((o) => ({ label: o, value: o }))"
|
|
8
|
+
/>
|
|
9
|
+
</slot>
|
|
10
|
+
<slot name="right">
|
|
11
|
+
<div class="flex items-center">
|
|
12
|
+
<Button
|
|
13
|
+
v-if="showLoadMore"
|
|
14
|
+
label="Load More"
|
|
15
|
+
@click="emit('loadMore')"
|
|
16
|
+
/>
|
|
17
|
+
<div v-if="showLoadMore" class="mx-3 h-[80%] border-l" />
|
|
18
|
+
<div class="flex items-center gap-1 text-base text-gray-600">
|
|
19
|
+
<div>{{ options.rowCount || '0' }}</div>
|
|
20
|
+
<div>of</div>
|
|
21
|
+
<div>{{ options.totalCount || '0' }}</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</slot>
|
|
25
|
+
</slot>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
<script setup>
|
|
29
|
+
import TabButtons from '../TabButtons.vue'
|
|
30
|
+
import { ref, computed } from 'vue'
|
|
31
|
+
|
|
32
|
+
const props = defineProps({
|
|
33
|
+
modelValue: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 20,
|
|
36
|
+
},
|
|
37
|
+
options: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default: () => ({
|
|
40
|
+
rowCount: 0,
|
|
41
|
+
totalCount: 0,
|
|
42
|
+
pageLengthOptions: [20, 50, 100],
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const emit = defineEmits(['update:modelValue', 'loadMore'])
|
|
48
|
+
|
|
49
|
+
const pageLengthCount = computed({
|
|
50
|
+
get: () => props.modelValue,
|
|
51
|
+
set: (value) => emit('update:modelValue', value),
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const pageLengthOptions = ref(props.options.pageLengthOptions || [20, 50, 100])
|
|
55
|
+
|
|
56
|
+
const showLoadMore = computed(() => {
|
|
57
|
+
return (
|
|
58
|
+
props.options.rowCount &&
|
|
59
|
+
props.options.totalCount &&
|
|
60
|
+
props.options.rowCount < props.options.totalCount
|
|
61
|
+
)
|
|
62
|
+
})
|
|
63
|
+
</script>
|
package/src/components/Tabs.vue
CHANGED
|
@@ -6,18 +6,21 @@
|
|
|
6
6
|
:selectedIndex="changedIndex"
|
|
7
7
|
@change="(idx) => (changedIndex = idx)"
|
|
8
8
|
>
|
|
9
|
-
<TabList
|
|
9
|
+
<TabList
|
|
10
|
+
class="relative flex items-center gap-6 overflow-x-auto border-b pl-5"
|
|
11
|
+
:class="tablistClass"
|
|
12
|
+
>
|
|
10
13
|
<Tab
|
|
11
14
|
ref="tabRef"
|
|
12
15
|
as="template"
|
|
13
16
|
v-for="(tab, i) in tabs"
|
|
14
17
|
:key="i"
|
|
15
18
|
v-slot="{ selected }"
|
|
16
|
-
class="focus:outline-none focus:transition-none
|
|
19
|
+
class="focus:outline-none focus:transition-none"
|
|
17
20
|
>
|
|
18
21
|
<slot name="tab" v-bind="{ tab, selected }">
|
|
19
22
|
<button
|
|
20
|
-
class="
|
|
23
|
+
class="flex items-center gap-2 border-b border-transparent py-2.5 text-base text-gray-600 duration-300 ease-in-out hover:border-gray-400 hover:text-gray-900"
|
|
21
24
|
:class="{ 'text-gray-900': selected }"
|
|
22
25
|
>
|
|
23
26
|
<component v-if="tab.icon" :is="tab.icon" class="h-5" />
|
|
@@ -27,12 +30,12 @@
|
|
|
27
30
|
</Tab>
|
|
28
31
|
<div
|
|
29
32
|
ref="indicator"
|
|
30
|
-
class="absolute
|
|
33
|
+
class="absolute bottom-0 h-px bg-gray-900"
|
|
31
34
|
:class="transitionClass"
|
|
32
35
|
:style="{ left: `${indicatorLeft}px` }"
|
|
33
36
|
/>
|
|
34
37
|
</TabList>
|
|
35
|
-
<TabPanels class="flex flex-1 overflow-hidden">
|
|
38
|
+
<TabPanels class="flex flex-1 overflow-hidden" :class="tabPanelClass">
|
|
36
39
|
<TabPanel
|
|
37
40
|
class="flex flex-1 flex-col overflow-y-auto focus:outline-none"
|
|
38
41
|
v-for="(tab, i) in tabs"
|
|
@@ -57,6 +60,14 @@ const props = defineProps({
|
|
|
57
60
|
type: Number,
|
|
58
61
|
default: 0,
|
|
59
62
|
},
|
|
63
|
+
tablistClass: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: '',
|
|
66
|
+
},
|
|
67
|
+
tabPanelClass: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: '',
|
|
70
|
+
},
|
|
60
71
|
options: {
|
|
61
72
|
type: Object,
|
|
62
73
|
default: () => ({
|
package/src/index.js
CHANGED
|
@@ -45,6 +45,7 @@ export { default as ListRows } from './components/ListView/ListRows.vue'
|
|
|
45
45
|
export { default as ListRow } from './components/ListView/ListRow.vue'
|
|
46
46
|
export { default as ListRowItem } from './components/ListView/ListRowItem.vue'
|
|
47
47
|
export { default as ListSelectBanner } from './components/ListView/ListSelectBanner.vue'
|
|
48
|
+
export { default as ListFooter } from './components/ListView/ListFooter.vue'
|
|
48
49
|
export { default as Toast } from './components/Toast.vue'
|
|
49
50
|
export { toast, Toasts } from './components/toast.js'
|
|
50
51
|
export { default as Tooltip } from './components/Tooltip.vue'
|