frappe-ui 0.1.21 → 0.1.22

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": "frappe-ui",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.js",
6
6
  "scripts": {
@@ -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/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'