flowbite-svelte 0.17.1 → 0.17.4
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/CHANGELOG.md +21 -0
- package/buttongroups/ButtonGroupItem.svelte +2 -2
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/package.json +4 -3
- package/tooltips/Tooltip.svelte +126 -107
- package/tooltips/Tooltip.svelte.d.ts +9 -7
- package/types.d.ts +2 -2
- package/utils/clickOutside.d.ts +3 -0
- package/utils/clickOutside.js +15 -0
- package/tooltips/LightTooltip.svelte +0 -120
- package/tooltips/LightTooltip.svelte.d.ts +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.17.4](https://github.com/themesberg/flowbite-svelte/compare/v0.17.3...v0.17.4) (2022-06-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* update Tooltip component ([d0cc06e](https://github.com/themesberg/flowbite-svelte/commit/d0cc06e991e5677463a5625b4abaee2a6edef3fc))
|
|
11
|
+
|
|
12
|
+
### [0.17.3](https://github.com/themesberg/flowbite-svelte/compare/v0.17.2...v0.17.3) (2022-06-14)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* update ButtonGroupItem border ([365b6d2](https://github.com/themesberg/flowbite-svelte/commit/365b6d2b21b903a8b15057a9bb009e0d3d65e884))
|
|
18
|
+
|
|
19
|
+
### [0.17.2](https://github.com/themesberg/flowbite-svelte/compare/v0.17.1...v0.17.2) (2022-06-08)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* change type string to typeof SvelteComponent ([277c3e2](https://github.com/themesberg/flowbite-svelte/commit/277c3e24201088aa051726ae16f2e12f66a8a69e))
|
|
25
|
+
|
|
5
26
|
### [0.17.1](https://github.com/themesberg/flowbite-svelte/compare/v0.17.0...v0.17.1) (2022-06-07)
|
|
6
27
|
|
|
7
28
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>export let type = 'button';
|
|
2
|
-
export let btnClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white first:rounded-l-lg border-t border-b
|
|
3
|
-
export let outlineClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent
|
|
2
|
+
export let btnClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white first:rounded-l-lg border-t border-b last:rounded-r-md border-l last:border-r border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-blue-500 dark:focus:text-white';
|
|
3
|
+
export let outlineClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent first:rounded-l-lg border-t border-b last:rounded-r-md border-l last:border-r border-gray-900 hover:bg-gray-900 hover:text-white focus:z-10 focus:ring-2 focus:ring-gray-500 focus:bg-gray-900 focus:text-white dark:border-white dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:bg-gray-700';
|
|
4
4
|
export let outline = false;
|
|
5
5
|
export let href = '';
|
|
6
6
|
if (outline) {
|
package/index.d.ts
CHANGED
|
@@ -97,4 +97,3 @@ export { default as TimelineItemHorizontal } from './timelines/TimelineItemHoriz
|
|
|
97
97
|
export { default as TimelineItemVertical } from './timelines/TimelineItemVertical.svelte';
|
|
98
98
|
export { default as Toast } from './toasts/Toast.svelte';
|
|
99
99
|
export { default as Tooltip } from './tooltips/Tooltip.svelte';
|
|
100
|
-
export { default as LightTooltip } from './tooltips/LightTooltip.svelte';
|
package/index.js
CHANGED
|
@@ -123,4 +123,3 @@ export { default as TimelineItemVertical } from './timelines/TimelineItemVertica
|
|
|
123
123
|
export { default as Toast } from './toasts/Toast.svelte';
|
|
124
124
|
// Tooltips
|
|
125
125
|
export { default as Tooltip } from './tooltips/Tooltip.svelte';
|
|
126
|
-
export { default as LightTooltip } from './tooltips/LightTooltip.svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.4",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"eslint": "^7.32.0",
|
|
23
23
|
"eslint-config-prettier": "^8.3.0",
|
|
24
24
|
"eslint-plugin-svelte3": "^3.2.1",
|
|
25
|
-
"flowbite-svelte": "^0.13.8",
|
|
26
25
|
"mdsvex": "^0.10.5",
|
|
27
26
|
"postcss": "^8.4.12",
|
|
28
27
|
"postcss-load-config": "^3.1.4",
|
|
@@ -76,6 +75,8 @@
|
|
|
76
75
|
"url": "https://github.com/themesberg/flowbite-svelte"
|
|
77
76
|
},
|
|
78
77
|
"dependencies": {
|
|
78
|
+
"@floating-ui/dom": "^0.5.3",
|
|
79
|
+
"classnames": "^2.3.1",
|
|
79
80
|
"flowbite": "^1.4.2",
|
|
80
81
|
"svelte-heros": "^2.2.2"
|
|
81
82
|
},
|
|
@@ -194,9 +195,9 @@
|
|
|
194
195
|
"./timelines/TimelineItemHorizontal.svelte": "./timelines/TimelineItemHorizontal.svelte",
|
|
195
196
|
"./timelines/TimelineItemVertical.svelte": "./timelines/TimelineItemVertical.svelte",
|
|
196
197
|
"./toasts/Toast.svelte": "./toasts/Toast.svelte",
|
|
197
|
-
"./tooltips/LightTooltip.svelte": "./tooltips/LightTooltip.svelte",
|
|
198
198
|
"./tooltips/Tooltip.svelte": "./tooltips/Tooltip.svelte",
|
|
199
199
|
"./types": "./types.js",
|
|
200
|
+
"./utils/clickOutside": "./utils/clickOutside.js",
|
|
200
201
|
"./utils/generateId": "./utils/generateId.js"
|
|
201
202
|
},
|
|
202
203
|
"svelte": "./index.js"
|
package/tooltips/Tooltip.svelte
CHANGED
|
@@ -1,113 +1,132 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export let
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
import { browser } from '$app/env';
|
|
3
|
+
import { clickOutside } from '../utils/clickOutside';
|
|
4
|
+
import { computePosition, flip, shift, offset, autoPlacement, arrow as arrowFloat } from '@floating-ui/dom';
|
|
5
|
+
import { onDestroy } from 'svelte';
|
|
6
|
+
export let placement = 'top';
|
|
7
|
+
export let trigger = 'hover';
|
|
8
|
+
export let style = 'dark';
|
|
9
|
+
export let content = '';
|
|
10
|
+
export let animation = 'duration-300';
|
|
11
|
+
export let arrow = true;
|
|
12
|
+
let open = false;
|
|
13
|
+
const floatingPlacement = ({ placement }) => {
|
|
14
|
+
return placement === 'auto' ? undefined : placement;
|
|
15
|
+
};
|
|
16
|
+
const floatingArrowPlacement = ({ placement }) => {
|
|
17
|
+
if (!placement) {
|
|
18
|
+
return 'top';
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
top: 'bottom',
|
|
22
|
+
right: 'left',
|
|
23
|
+
bottom: 'top',
|
|
24
|
+
left: 'right'
|
|
25
|
+
}[placement.split('-')[0]];
|
|
26
|
+
};
|
|
27
|
+
const floatingMiddleware = ({ arrowRef, placement }) => {
|
|
28
|
+
const middleware = [];
|
|
29
|
+
middleware.push(offset(8));
|
|
30
|
+
middleware.push(placement === 'auto' ? autoPlacement() : flip());
|
|
31
|
+
middleware.push(shift({ padding: 8 }));
|
|
32
|
+
if (arrowRef) {
|
|
33
|
+
middleware.push(arrowFloat({ element: arrowRef }));
|
|
34
|
+
}
|
|
35
|
+
return middleware;
|
|
36
|
+
};
|
|
37
|
+
let placementData;
|
|
38
|
+
let tooltipRef, triggerRef, arrowRef;
|
|
39
|
+
const updatePosition = () => computePosition(triggerRef, tooltipRef, {
|
|
40
|
+
middleware: floatingMiddleware({ arrowRef, placement }),
|
|
41
|
+
placement: floatingPlacement({ placement })
|
|
42
|
+
}).then((data) => (placementData = data));
|
|
43
|
+
let attachedScroll = false;
|
|
44
|
+
$: browser && tooltipRef && open && updatePosition();
|
|
45
|
+
$: {
|
|
46
|
+
if (browser && open && !attachedScroll) {
|
|
47
|
+
attachedScroll = true;
|
|
48
|
+
window.addEventListener('scroll', updatePosition, true);
|
|
49
|
+
}
|
|
50
|
+
else if (!open && attachedScroll) {
|
|
51
|
+
attachedScroll = false;
|
|
52
|
+
window.removeEventListener('scroll', updatePosition, true);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
onDestroy(() => {
|
|
56
|
+
if (attachedScroll) {
|
|
57
|
+
attachedScroll = false;
|
|
58
|
+
window.removeEventListener('scroll', updatePosition, true);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
7
61
|
</script>
|
|
8
62
|
|
|
9
|
-
<
|
|
10
|
-
|
|
63
|
+
<svelte:window on:resize={() => open && updatePosition()} />
|
|
64
|
+
|
|
65
|
+
<div>
|
|
66
|
+
<div
|
|
67
|
+
class="w-fit"
|
|
68
|
+
bind:this={triggerRef}
|
|
69
|
+
on:mouseenter={() => {
|
|
70
|
+
if (trigger === 'hover') {
|
|
71
|
+
open = true;
|
|
72
|
+
}
|
|
73
|
+
}}
|
|
74
|
+
on:mouseleave={() => {
|
|
75
|
+
if (open && trigger === 'hover') {
|
|
76
|
+
open = false;
|
|
77
|
+
}
|
|
78
|
+
}}
|
|
79
|
+
on:click={() => {
|
|
80
|
+
if (trigger === 'click') {
|
|
81
|
+
open = !open;
|
|
82
|
+
}
|
|
83
|
+
}}
|
|
84
|
+
use:clickOutside={() => {
|
|
85
|
+
if (open) {
|
|
86
|
+
open = false;
|
|
87
|
+
}
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
11
90
|
<slot />
|
|
12
|
-
</
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div
|
|
94
|
+
bind:this={tooltipRef}
|
|
95
|
+
data-testid="tooltip"
|
|
96
|
+
class={classNames(
|
|
97
|
+
'absolute inline-block rounded-lg py-2 px-3 text-sm font-medium shadow-sm',
|
|
98
|
+
animation !== false && `transition-opacity ${animation}`,
|
|
99
|
+
{
|
|
100
|
+
'invisible opacity-0': !open,
|
|
101
|
+
'bg-gray-900 text-white dark:bg-gray-700': style === 'dark',
|
|
102
|
+
'border border-gray-200 bg-white text-gray-900': style === 'light',
|
|
103
|
+
'border border-gray-200 bg-white text-gray-900 dark:border-none dark:bg-gray-700 dark:text-white':
|
|
104
|
+
style === 'auto'
|
|
105
|
+
},
|
|
106
|
+
$$props.class
|
|
107
|
+
)}
|
|
108
|
+
style={`left:${placementData?.x}px;top:${placementData?.y}px;position:${placementData?.strategy}`}
|
|
109
|
+
>
|
|
110
|
+
<div class="relative z-20">
|
|
111
|
+
<slot name="content">
|
|
112
|
+
{content}
|
|
113
|
+
</slot>
|
|
114
|
+
</div>
|
|
115
|
+
{#if arrow}
|
|
116
|
+
<div
|
|
117
|
+
class={classNames('absolute z-10 h-2 w-2 rotate-45', {
|
|
118
|
+
'bg-gray-900 dark:bg-gray-700': style === 'dark',
|
|
119
|
+
'bg-white': style === 'light',
|
|
120
|
+
'bg-white dark:bg-gray-700': style === 'auto'
|
|
121
|
+
})}
|
|
122
|
+
data-testid="tooltip-arrow"
|
|
123
|
+
style={`left:${placementData?.middlewareData.arrow?.x}px;top:${
|
|
124
|
+
placementData?.middlewareData.arrow?.y
|
|
125
|
+
}px;${floatingArrowPlacement({ placement: placementData?.placement })}:-4px`}
|
|
126
|
+
bind:this={arrowRef}
|
|
127
|
+
>
|
|
128
|
+
|
|
129
|
+
</div>
|
|
18
130
|
{/if}
|
|
19
131
|
</div>
|
|
20
132
|
</div>
|
|
21
|
-
|
|
22
|
-
<style>
|
|
23
|
-
.tooltip-wrapper {
|
|
24
|
-
position: relative;
|
|
25
|
-
display: inline-block;
|
|
26
|
-
}
|
|
27
|
-
.tooltip {
|
|
28
|
-
position: absolute;
|
|
29
|
-
font-family: inherit;
|
|
30
|
-
display: inline-block;
|
|
31
|
-
white-space: nowrap;
|
|
32
|
-
color: inherit;
|
|
33
|
-
opacity: 0;
|
|
34
|
-
visibility: hidden;
|
|
35
|
-
transition: opacity 150ms, visibility 150ms;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.tooltip.top:after {
|
|
39
|
-
content: '';
|
|
40
|
-
position: absolute;
|
|
41
|
-
top: 100%;
|
|
42
|
-
left: 50%;
|
|
43
|
-
margin-left: -10px;
|
|
44
|
-
border-width: 5px;
|
|
45
|
-
border-style: solid;
|
|
46
|
-
border-color: rgb(55 65 81) transparent transparent transparent;
|
|
47
|
-
}
|
|
48
|
-
.tooltip.bottom::after {
|
|
49
|
-
content: '';
|
|
50
|
-
position: absolute;
|
|
51
|
-
top: -30%;
|
|
52
|
-
left: 50%;
|
|
53
|
-
margin-left: -10px;
|
|
54
|
-
border-width: 5px;
|
|
55
|
-
border-style: solid;
|
|
56
|
-
border-color: transparent transparent rgb(55 65 81) transparent;
|
|
57
|
-
}
|
|
58
|
-
.tooltip.right::after {
|
|
59
|
-
content: '';
|
|
60
|
-
position: absolute;
|
|
61
|
-
/* vertically center */
|
|
62
|
-
top: 50%;
|
|
63
|
-
transform: translateY(-50%);
|
|
64
|
-
/* position tooltip correctly */
|
|
65
|
-
right: 100%;
|
|
66
|
-
margin-left: -5px;
|
|
67
|
-
|
|
68
|
-
border-width: 5px;
|
|
69
|
-
border-style: solid;
|
|
70
|
-
border-color: transparent rgb(55 65 81) transparent transparent;
|
|
71
|
-
}
|
|
72
|
-
.tooltip.left::after {
|
|
73
|
-
content: '';
|
|
74
|
-
position: absolute;
|
|
75
|
-
/* vertically center */
|
|
76
|
-
top: 50%;
|
|
77
|
-
transform: translateY(-50%);
|
|
78
|
-
/* position tooltip correctly */
|
|
79
|
-
left: 100%;
|
|
80
|
-
/* margin-left: -5px; */
|
|
81
|
-
border-width: 5px;
|
|
82
|
-
border-style: solid;
|
|
83
|
-
border-color: transparent transparent transparent rgb(55 65 81);
|
|
84
|
-
}
|
|
85
|
-
.tooltip.top {
|
|
86
|
-
left: 50%;
|
|
87
|
-
transform: translate(-50%, -100%);
|
|
88
|
-
margin-top: -8px;
|
|
89
|
-
}
|
|
90
|
-
.tooltip.bottom {
|
|
91
|
-
left: 50%;
|
|
92
|
-
bottom: 0px;
|
|
93
|
-
transform: translate(-50%, 100%);
|
|
94
|
-
/* margin-bottom: -px; */
|
|
95
|
-
}
|
|
96
|
-
.tooltip.left {
|
|
97
|
-
left: 0;
|
|
98
|
-
transform: translateX(-100%);
|
|
99
|
-
margin-left: -8px;
|
|
100
|
-
}
|
|
101
|
-
.tooltip.right {
|
|
102
|
-
right: 0;
|
|
103
|
-
transform: translateX(100%);
|
|
104
|
-
margin-right: 0px;
|
|
105
|
-
}
|
|
106
|
-
.tooltip.active {
|
|
107
|
-
opacity: 1;
|
|
108
|
-
visibility: initial;
|
|
109
|
-
}
|
|
110
|
-
.tooltip-slot:hover + .tooltip {
|
|
111
|
-
opacity: 1;
|
|
112
|
-
visibility: initial;
|
|
113
|
-
}</style>
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Placement } from '@floating-ui/dom';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
placement?: 'auto' | Placement;
|
|
7
|
+
trigger?: 'hover' | 'click';
|
|
8
|
+
style?: 'dark' | 'light' | 'auto';
|
|
9
|
+
content?: string;
|
|
10
|
+
animation?: false | `duration-${number}`;
|
|
11
|
+
arrow?: boolean;
|
|
10
12
|
};
|
|
11
13
|
events: {
|
|
12
14
|
[evt: string]: CustomEvent<any>;
|
|
13
15
|
};
|
|
14
16
|
slots: {
|
|
15
17
|
default: {};
|
|
16
|
-
|
|
18
|
+
content: {};
|
|
17
19
|
};
|
|
18
20
|
};
|
|
19
21
|
export declare type TooltipProps = typeof __propDef.props;
|
package/types.d.ts
CHANGED
|
@@ -79,13 +79,13 @@ export interface GroupTimelineType {
|
|
|
79
79
|
comment?: string | HTMLElement;
|
|
80
80
|
}
|
|
81
81
|
export interface IconType {
|
|
82
|
-
name:
|
|
82
|
+
name: typeof SvelteComponent;
|
|
83
83
|
size?: number;
|
|
84
84
|
color?: Colors;
|
|
85
85
|
class?: string;
|
|
86
86
|
}
|
|
87
87
|
export interface IconTabType {
|
|
88
|
-
name:
|
|
88
|
+
name: typeof SvelteComponent;
|
|
89
89
|
active: boolean;
|
|
90
90
|
href: string;
|
|
91
91
|
rel?: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function clickOutside(node, callback) {
|
|
2
|
+
const handleClick = (event) => {
|
|
3
|
+
if (!event?.target)
|
|
4
|
+
return;
|
|
5
|
+
if (node && !node.contains(event.target) && !event.defaultPrevented) {
|
|
6
|
+
callback();
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
document.addEventListener('click', handleClick, true);
|
|
10
|
+
return {
|
|
11
|
+
destroy() {
|
|
12
|
+
document.removeEventListener('click', handleClick, true);
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
<script>export let tip;
|
|
2
|
-
export let top = false;
|
|
3
|
-
export let right = false;
|
|
4
|
-
export let bottom = false;
|
|
5
|
-
export let left = false;
|
|
6
|
-
export let active = false;
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<div class="tooltip-wrapper">
|
|
10
|
-
<span class="tooltip-slot">
|
|
11
|
-
<slot />
|
|
12
|
-
</span>
|
|
13
|
-
<div
|
|
14
|
-
class="inline-block absolute invisible z-10 py-2 px-3 bg-white rounded-lg border border-gray-200 shadow-sm opacity-0 tooltip"
|
|
15
|
-
class:active
|
|
16
|
-
class:left
|
|
17
|
-
class:right
|
|
18
|
-
class:bottom
|
|
19
|
-
class:top
|
|
20
|
-
>
|
|
21
|
-
{#if tip}
|
|
22
|
-
<div class="text-sm font-medium text-gray-900">{tip}</div>
|
|
23
|
-
{:else}
|
|
24
|
-
<slot name="custom-tip" />
|
|
25
|
-
{/if}
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<style>
|
|
30
|
-
.tooltip-wrapper {
|
|
31
|
-
position: relative;
|
|
32
|
-
display: inline-block;
|
|
33
|
-
}
|
|
34
|
-
.tooltip {
|
|
35
|
-
position: absolute;
|
|
36
|
-
font-family: inherit;
|
|
37
|
-
display: inline-block;
|
|
38
|
-
white-space: nowrap;
|
|
39
|
-
color: inherit;
|
|
40
|
-
opacity: 0;
|
|
41
|
-
visibility: hidden;
|
|
42
|
-
transition: opacity 150ms, visibility 150ms;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.tooltip.top:after {
|
|
46
|
-
content: '';
|
|
47
|
-
position: absolute;
|
|
48
|
-
top: 100%;
|
|
49
|
-
left: 50%;
|
|
50
|
-
margin-left: -10px;
|
|
51
|
-
border-width: 5px;
|
|
52
|
-
border-style: solid;
|
|
53
|
-
border-color: #ddd transparent transparent transparent;
|
|
54
|
-
}
|
|
55
|
-
.tooltip.bottom::after {
|
|
56
|
-
content: '';
|
|
57
|
-
position: absolute;
|
|
58
|
-
top: -30%;
|
|
59
|
-
left: 50%;
|
|
60
|
-
margin-left: -10px;
|
|
61
|
-
border-width: 5px;
|
|
62
|
-
border-style: solid;
|
|
63
|
-
border-color: transparent transparent #ddd transparent;
|
|
64
|
-
}
|
|
65
|
-
.tooltip.right::after {
|
|
66
|
-
content: '';
|
|
67
|
-
position: absolute;
|
|
68
|
-
/* vertically center */
|
|
69
|
-
top: 50%;
|
|
70
|
-
transform: translateY(-50%);
|
|
71
|
-
/* position tooltip correctly */
|
|
72
|
-
right: 100%;
|
|
73
|
-
margin-left: -5px;
|
|
74
|
-
|
|
75
|
-
border-width: 5px;
|
|
76
|
-
border-style: solid;
|
|
77
|
-
border-color: transparent #ddd transparent transparent;
|
|
78
|
-
}
|
|
79
|
-
.tooltip.left::after {
|
|
80
|
-
content: '';
|
|
81
|
-
position: absolute;
|
|
82
|
-
/* vertically center */
|
|
83
|
-
top: 50%;
|
|
84
|
-
transform: translateY(-50%);
|
|
85
|
-
/* position tooltip correctly */
|
|
86
|
-
left: 100%;
|
|
87
|
-
/* margin-left: -5px; */
|
|
88
|
-
border-width: 5px;
|
|
89
|
-
border-style: solid;
|
|
90
|
-
border-color: transparent transparent transparent #ddd;
|
|
91
|
-
}
|
|
92
|
-
.tooltip.top {
|
|
93
|
-
left: 50%;
|
|
94
|
-
transform: translate(-50%, -100%);
|
|
95
|
-
margin-top: -8px;
|
|
96
|
-
}
|
|
97
|
-
.tooltip.bottom {
|
|
98
|
-
left: 50%;
|
|
99
|
-
bottom: 0px;
|
|
100
|
-
transform: translate(-50%, 100%);
|
|
101
|
-
/* margin-bottom: -px; */
|
|
102
|
-
}
|
|
103
|
-
.tooltip.left {
|
|
104
|
-
left: 0;
|
|
105
|
-
transform: translateX(-100%);
|
|
106
|
-
margin-left: -8px;
|
|
107
|
-
}
|
|
108
|
-
.tooltip.right {
|
|
109
|
-
right: 0;
|
|
110
|
-
transform: translateX(100%);
|
|
111
|
-
margin-right: 0px;
|
|
112
|
-
}
|
|
113
|
-
.tooltip.active {
|
|
114
|
-
opacity: 1;
|
|
115
|
-
visibility: initial;
|
|
116
|
-
}
|
|
117
|
-
.tooltip-slot:hover + .tooltip {
|
|
118
|
-
opacity: 1;
|
|
119
|
-
visibility: initial;
|
|
120
|
-
}</style>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
tip: string;
|
|
5
|
-
top?: boolean;
|
|
6
|
-
right?: boolean;
|
|
7
|
-
bottom?: boolean;
|
|
8
|
-
left?: boolean;
|
|
9
|
-
active?: boolean;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
};
|
|
14
|
-
slots: {
|
|
15
|
-
default: {};
|
|
16
|
-
'custom-tip': {};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export declare type LightTooltipProps = typeof __propDef.props;
|
|
20
|
-
export declare type LightTooltipEvents = typeof __propDef.events;
|
|
21
|
-
export declare type LightTooltipSlots = typeof __propDef.slots;
|
|
22
|
-
export default class LightTooltip extends SvelteComponentTyped<LightTooltipProps, LightTooltipEvents, LightTooltipSlots> {
|
|
23
|
-
}
|
|
24
|
-
export {};
|