frappe-ui 0.1.190 → 0.1.192
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,66 +1,64 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Tooltip :text="tooltip" :disabled="!tooltip?.length">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
<button
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:class="buttonClasses"
|
|
6
|
+
@click="handleClick"
|
|
7
|
+
:disabled="isDisabled"
|
|
8
|
+
:ariaLabel="ariaLabel"
|
|
9
|
+
ref="rootRef"
|
|
10
|
+
>
|
|
11
|
+
<LoadingIndicator
|
|
12
|
+
v-if="loading"
|
|
13
|
+
:class="{
|
|
14
|
+
'h-3 w-3': size == 'sm',
|
|
15
|
+
'h-[13.5px] w-[13.5px]': size == 'md',
|
|
16
|
+
'h-[15px] w-[15px]': size == 'lg',
|
|
17
|
+
'h-4.5 w-4.5': size == 'xl' || size == '2xl',
|
|
18
|
+
}"
|
|
19
|
+
/>
|
|
20
|
+
<slot name="prefix" v-else-if="$slots['prefix'] || iconLeft">
|
|
21
|
+
<FeatherIcon
|
|
22
|
+
v-if="iconLeft && typeof iconLeft === 'string'"
|
|
23
|
+
:name="iconLeft"
|
|
24
|
+
:class="slotClasses"
|
|
25
|
+
aria-hidden="true"
|
|
20
26
|
/>
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
:name="icon"
|
|
36
|
-
:class="slotClasses"
|
|
37
|
-
:aria-label="label"
|
|
38
|
-
/>
|
|
39
|
-
<component v-else-if="icon" :is="icon" :class="slotClasses" />
|
|
40
|
-
<slot name="icon" v-else-if="$slots.icon" />
|
|
41
|
-
<div v-else-if="hasLucideIconInDefaultSlot" :class="slotClasses">
|
|
42
|
-
<slot>{{ label }}</slot>
|
|
43
|
-
</div>
|
|
44
|
-
</template>
|
|
45
|
-
<span v-else :class="{ 'sr-only': isIconButton }" class="truncate">
|
|
27
|
+
<component v-else-if="iconLeft" :is="iconLeft" :class="slotClasses" />
|
|
28
|
+
</slot>
|
|
29
|
+
|
|
30
|
+
<template v-if="loading && loadingText">{{ loadingText }}</template>
|
|
31
|
+
<template v-else-if="isIconButton && !loading">
|
|
32
|
+
<FeatherIcon
|
|
33
|
+
v-if="icon && typeof icon === 'string'"
|
|
34
|
+
:name="icon"
|
|
35
|
+
:class="slotClasses"
|
|
36
|
+
:aria-label="label"
|
|
37
|
+
/>
|
|
38
|
+
<component v-else-if="icon" :is="icon" :class="slotClasses" />
|
|
39
|
+
<slot name="icon" v-else-if="$slots.icon" />
|
|
40
|
+
<div v-else-if="hasLucideIconInDefaultSlot" :class="slotClasses">
|
|
46
41
|
<slot>{{ label }}</slot>
|
|
47
|
-
</
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
<span v-else :class="{ 'sr-only': isIconButton }" class="truncate">
|
|
45
|
+
<slot>{{ label }}</slot>
|
|
46
|
+
</span>
|
|
47
|
+
|
|
48
|
+
<slot name="suffix">
|
|
49
|
+
<FeatherIcon
|
|
50
|
+
v-if="iconRight && typeof iconRight === 'string'"
|
|
51
|
+
:name="iconRight"
|
|
52
|
+
:class="slotClasses"
|
|
53
|
+
aria-hidden="true"
|
|
54
|
+
/>
|
|
56
55
|
<component
|
|
57
56
|
v-else-if="iconRight"
|
|
58
57
|
:is="iconRight"
|
|
59
58
|
:class="slotClasses"
|
|
60
59
|
/>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</div>
|
|
60
|
+
</slot>
|
|
61
|
+
</button>
|
|
64
62
|
</Tooltip>
|
|
65
63
|
</template>
|
|
66
64
|
<script lang="ts" setup>
|
|
@@ -179,7 +177,7 @@ const buttonClasses = computed(() => {
|
|
|
179
177
|
}
|
|
180
178
|
|
|
181
179
|
return [
|
|
182
|
-
'inline-flex items-center justify-center gap-2 transition-colors focus:outline-none',
|
|
180
|
+
'inline-flex items-center justify-center gap-2 transition-colors focus:outline-none shrink-0',
|
|
183
181
|
isDisabled.value ? disabledClasses : variantClasses,
|
|
184
182
|
focusClasses,
|
|
185
183
|
sizeClasses,
|
|
@@ -34,7 +34,7 @@ const delayDuration = computed(() => props.hoverDelay * 1000)
|
|
|
34
34
|
</TooltipTrigger>
|
|
35
35
|
<TooltipPortal>
|
|
36
36
|
<TooltipContent
|
|
37
|
-
v-if="props.text || $slots.body"
|
|
37
|
+
v-if="props.text || $slots.body || $slots.content"
|
|
38
38
|
:side="props.placement"
|
|
39
39
|
:side-offset="4"
|
|
40
40
|
class="z-[100]"
|