frappe-ui 0.1.50 → 0.1.52
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
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://github.com/frappe/frappe-ui">
|
|
3
|
-
<img src="./
|
|
3
|
+
<img src="./frappe-ui.svg" width="250" />
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
<h1 style="font-size: 24px" align="center">Rapidly build modern frontends for Frappe apps</h1>
|
|
@@ -56,7 +56,7 @@ Now, you can import needed components and start using it:
|
|
|
56
56
|
|
|
57
57
|
```html
|
|
58
58
|
<template>
|
|
59
|
-
<
|
|
59
|
+
<button>Click me</button>
|
|
60
60
|
</template>
|
|
61
61
|
<script>
|
|
62
62
|
import { Button } from 'frappe-ui'
|
|
@@ -51,7 +51,11 @@ export default {
|
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
53
|
methods: {
|
|
54
|
-
openFileSelector() {
|
|
54
|
+
openFileSelector(type) {
|
|
55
|
+
if (type) {
|
|
56
|
+
// change inputs filetype to accept the type of file you want to upload
|
|
57
|
+
this.$refs['input'].accept = type
|
|
58
|
+
}
|
|
55
59
|
this.$refs['input'].click()
|
|
56
60
|
},
|
|
57
61
|
async onFileAdd(e) {
|
|
@@ -4,6 +4,7 @@ import Tooltip from './Tooltip.vue'
|
|
|
4
4
|
import Button from '../Button.vue'
|
|
5
5
|
|
|
6
6
|
const placement = ref('top')
|
|
7
|
+
const disabled = ref(true)
|
|
7
8
|
</script>
|
|
8
9
|
<template>
|
|
9
10
|
<Story :layout="{ type: 'grid', width: '300px' }">
|
|
@@ -16,6 +17,16 @@ const placement = ref('top')
|
|
|
16
17
|
<Button theme="red">Delete</Button>
|
|
17
18
|
</Tooltip>
|
|
18
19
|
</Variant>
|
|
20
|
+
<Variant title="disabled">
|
|
21
|
+
<Tooltip
|
|
22
|
+
text="disabled tooltip"
|
|
23
|
+
:disabled="disabled"
|
|
24
|
+
:hover-delay="1"
|
|
25
|
+
:placement="placement"
|
|
26
|
+
>
|
|
27
|
+
<Button theme="red">Delete</Button>
|
|
28
|
+
</Tooltip>
|
|
29
|
+
</Variant>
|
|
19
30
|
<Variant title="with slot">
|
|
20
31
|
<Tooltip arrow-class="fill-white" :placement="placement">
|
|
21
32
|
<template #body>
|
|
@@ -21,12 +21,14 @@ const props = withDefaults(
|
|
|
21
21
|
hoverDelay?: number
|
|
22
22
|
placement?: TooltipContentProps['side']
|
|
23
23
|
arrowClass?: HTMLAttributes['class']
|
|
24
|
+
disabled?: boolean
|
|
24
25
|
}>(),
|
|
25
26
|
{
|
|
26
27
|
text: '',
|
|
27
28
|
placement: 'top',
|
|
28
29
|
hoverDelay: 0.5,
|
|
29
30
|
arrowClass: 'fill-gray-900',
|
|
31
|
+
disabled: false,
|
|
30
32
|
}
|
|
31
33
|
)
|
|
32
34
|
|
|
@@ -34,7 +36,8 @@ const delayDuration = computed(() => props.hoverDelay * 1000)
|
|
|
34
36
|
</script>
|
|
35
37
|
|
|
36
38
|
<template>
|
|
37
|
-
<
|
|
39
|
+
<slot v-if="disabled" />
|
|
40
|
+
<TooltipProvider v-else :delayDuration="delayDuration">
|
|
38
41
|
<TooltipRoot>
|
|
39
42
|
<TooltipTrigger as-child>
|
|
40
43
|
<slot />
|
|
@@ -44,6 +47,7 @@ const delayDuration = computed(() => props.hoverDelay * 1000)
|
|
|
44
47
|
v-if="props.text || $slots.body"
|
|
45
48
|
:side="props.placement"
|
|
46
49
|
:side-offset="4"
|
|
50
|
+
class="z-10"
|
|
47
51
|
>
|
|
48
52
|
<slot name="body">
|
|
49
53
|
<div
|