@esportsplus/ui 0.0.14 → 0.0.15
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/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/build/components/tooltip/index.d.ts +34 -0
- package/build/components/tooltip/index.js +32 -0
- package/build/components/tooltip/menu.d.ts +23 -0
- package/build/components/tooltip/menu.js +32 -0
- package/package.json +1 -1
- package/src/components/index.ts +2 -2
- package/src/components/tooltip/index.ts +39 -0
- package/src/components/tooltip/menu.ts +53 -0
- package/src/components/root/index.ts +0 -4
- package/src/components/root/layout.ts +0 -46
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as alert } from './alert';
|
|
2
2
|
export { default as form } from './form';
|
|
3
3
|
export { default as page } from './page';
|
|
4
|
-
export { default as root } from './root';
|
|
5
4
|
export { default as scrollbar } from './scrollbar';
|
|
6
5
|
export { default as state } from './state';
|
|
6
|
+
export { default as tooltip } from './tooltip';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as alert } from './alert';
|
|
2
2
|
export { default as form } from './form';
|
|
3
3
|
export { default as page } from './page';
|
|
4
|
-
export { default as root } from './root';
|
|
5
4
|
export { default as scrollbar } from './scrollbar';
|
|
6
5
|
export { default as state } from './state';
|
|
6
|
+
export { default as tooltip } from './tooltip';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
onfocus: (active?: boolean) => {
|
|
3
|
+
content: string;
|
|
4
|
+
type: string;
|
|
5
|
+
values: never[];
|
|
6
|
+
};
|
|
7
|
+
onhover: (active?: boolean) => {
|
|
8
|
+
content: string;
|
|
9
|
+
type: string;
|
|
10
|
+
values: never[];
|
|
11
|
+
};
|
|
12
|
+
menu: (data: {
|
|
13
|
+
class?: string | undefined;
|
|
14
|
+
direction?: string | undefined;
|
|
15
|
+
items?: {
|
|
16
|
+
border?: {
|
|
17
|
+
class?: string | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
class?: string | undefined;
|
|
20
|
+
onclick?: ((...args: any[]) => void) | undefined;
|
|
21
|
+
style?: string | undefined;
|
|
22
|
+
svg?: string | undefined;
|
|
23
|
+
target?: string | undefined;
|
|
24
|
+
text: string;
|
|
25
|
+
url?: string | undefined;
|
|
26
|
+
}[] | undefined;
|
|
27
|
+
style?: string | undefined;
|
|
28
|
+
}) => {
|
|
29
|
+
content: string;
|
|
30
|
+
type: string;
|
|
31
|
+
values: never[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import { html } from '@esportsplus/template';
|
|
3
|
+
import menu from './menu';
|
|
4
|
+
const onfocus = (active = false) => {
|
|
5
|
+
let state = reactive({ active });
|
|
6
|
+
return html({
|
|
7
|
+
class: () => {
|
|
8
|
+
return `tooltip ${state.active ? '--active' : ''}`;
|
|
9
|
+
},
|
|
10
|
+
onfocusin: () => {
|
|
11
|
+
state.active = true;
|
|
12
|
+
},
|
|
13
|
+
onfocusout: () => {
|
|
14
|
+
state.active = false;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const onhover = (active = false) => {
|
|
19
|
+
let state = reactive({ active });
|
|
20
|
+
return html({
|
|
21
|
+
class: () => {
|
|
22
|
+
return `tooltip ${state.active ? '--active' : ''}`;
|
|
23
|
+
},
|
|
24
|
+
onmouseover: () => {
|
|
25
|
+
state.active = true;
|
|
26
|
+
},
|
|
27
|
+
onmouseout: () => {
|
|
28
|
+
state.active = false;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export default { onfocus, onhover, menu };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type Data = {
|
|
2
|
+
class?: string;
|
|
3
|
+
direction?: string;
|
|
4
|
+
items?: {
|
|
5
|
+
border?: {
|
|
6
|
+
class?: string;
|
|
7
|
+
};
|
|
8
|
+
class?: string;
|
|
9
|
+
onclick?: (...args: any[]) => void;
|
|
10
|
+
style?: string;
|
|
11
|
+
svg?: string;
|
|
12
|
+
target?: string;
|
|
13
|
+
text: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
}[];
|
|
16
|
+
style?: string;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: (data: Data) => {
|
|
19
|
+
content: string;
|
|
20
|
+
type: string;
|
|
21
|
+
values: never[];
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
export default (data) => html `
|
|
3
|
+
<div class="tooltip-content tooltip-content--${data?.direction || 's'} --flex-column --width-full ${data?.class || ''}" style='${data?.style || ''}'>
|
|
4
|
+
${(data?.items || []).map(item => html `
|
|
5
|
+
${item?.border ? html `
|
|
6
|
+
<div
|
|
7
|
+
class="border ${item?.border?.class || ''}"
|
|
8
|
+
style='
|
|
9
|
+
margin-left: calc(var(--margin-horizontal) * -1);
|
|
10
|
+
width: calc(100% + var(--margin-horizontal) * 2);
|
|
11
|
+
'
|
|
12
|
+
></div>
|
|
13
|
+
` : ''}
|
|
14
|
+
|
|
15
|
+
<${item.url ? 'a' : 'div'}
|
|
16
|
+
class='link --flex-vertical ${item?.class}' ${item?.onclick ? html `onclick='${item.onclick}'` : ''}
|
|
17
|
+
style='${item?.style || ''}'
|
|
18
|
+
${item?.url ? `href='${item.url}' target='${item.target || '_blank'}'` : ''}
|
|
19
|
+
>
|
|
20
|
+
${item?.svg ? html `
|
|
21
|
+
<div class="icon --margin-right --margin-300" style='margin-left: var(--size-100)'>
|
|
22
|
+
${item.svg}
|
|
23
|
+
</div>
|
|
24
|
+
` : ''}
|
|
25
|
+
|
|
26
|
+
<div class="text --color-text --flex-fill">
|
|
27
|
+
${item.text}
|
|
28
|
+
</div>
|
|
29
|
+
</${item.url ? 'a' : 'div'}>
|
|
30
|
+
`)}
|
|
31
|
+
</div>
|
|
32
|
+
`;
|
package/package.json
CHANGED
package/src/components/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as alert }from './alert';
|
|
2
2
|
export { default as form }from './form';
|
|
3
3
|
export { default as page }from './page';
|
|
4
|
-
export { default as root }from './root';
|
|
5
4
|
export { default as scrollbar }from './scrollbar';
|
|
6
|
-
export { default as state }from './state';
|
|
5
|
+
export { default as state }from './state';
|
|
6
|
+
export { default as tooltip }from './tooltip';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
+
import { html } from '@esportsplus/template';
|
|
3
|
+
import menu from './menu';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const onfocus = (active: boolean = false) => {
|
|
7
|
+
let state = reactive({ active });
|
|
8
|
+
|
|
9
|
+
return html({
|
|
10
|
+
class: () => {
|
|
11
|
+
return `tooltip ${state.active ? '--active' : ''}`;
|
|
12
|
+
},
|
|
13
|
+
onfocusin: () => {
|
|
14
|
+
state.active = true;
|
|
15
|
+
},
|
|
16
|
+
onfocusout: () => {
|
|
17
|
+
state.active = false;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const onhover = (active: boolean = false) => {
|
|
23
|
+
let state = reactive({ active });
|
|
24
|
+
|
|
25
|
+
return html({
|
|
26
|
+
class: () => {
|
|
27
|
+
return `tooltip ${state.active ? '--active' : ''}`;
|
|
28
|
+
},
|
|
29
|
+
onmouseover: () => {
|
|
30
|
+
state.active = true;
|
|
31
|
+
},
|
|
32
|
+
onmouseout: () => {
|
|
33
|
+
state.active = false;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export default { onfocus, onhover, menu };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { html } from '@esportsplus/template';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
type Data = {
|
|
5
|
+
class?: string;
|
|
6
|
+
direction?: string;
|
|
7
|
+
items?: {
|
|
8
|
+
border?: {
|
|
9
|
+
class?: string;
|
|
10
|
+
};
|
|
11
|
+
class?: string;
|
|
12
|
+
onclick?: (...args: any[]) => void;
|
|
13
|
+
style?: string;
|
|
14
|
+
svg?: string;
|
|
15
|
+
target?: string;
|
|
16
|
+
text: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
}[];
|
|
19
|
+
style?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export default (data: Data) => html`
|
|
24
|
+
<div class="tooltip-content tooltip-content--${data?.direction || 's'} --flex-column --width-full ${data?.class || ''}" style='${data?.style || ''}'>
|
|
25
|
+
${(data?.items || []).map(item => html`
|
|
26
|
+
${item?.border ? html`
|
|
27
|
+
<div
|
|
28
|
+
class="border ${item?.border?.class || ''}"
|
|
29
|
+
style='
|
|
30
|
+
margin-left: calc(var(--margin-horizontal) * -1);
|
|
31
|
+
width: calc(100% + var(--margin-horizontal) * 2);
|
|
32
|
+
'
|
|
33
|
+
></div>
|
|
34
|
+
` : ''}
|
|
35
|
+
|
|
36
|
+
<${item.url ? 'a' : 'div'}
|
|
37
|
+
class='link --flex-vertical ${item?.class}' ${item?.onclick ? html`onclick='${item.onclick}'` : ''}
|
|
38
|
+
style='${item?.style || ''}'
|
|
39
|
+
${item?.url ? `href='${item.url}' target='${item.target || '_blank'}'` : ''}
|
|
40
|
+
>
|
|
41
|
+
${item?.svg ? html`
|
|
42
|
+
<div class="icon --margin-right --margin-300" style='margin-left: var(--size-100)'>
|
|
43
|
+
${item.svg}
|
|
44
|
+
</div>
|
|
45
|
+
` : ''}
|
|
46
|
+
|
|
47
|
+
<div class="text --color-text --flex-fill">
|
|
48
|
+
${item.text}
|
|
49
|
+
</div>
|
|
50
|
+
</${item.url ? 'a' : 'div'}>
|
|
51
|
+
`)}
|
|
52
|
+
</div>
|
|
53
|
+
`;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { html } from '@esportsplus/template';
|
|
2
|
-
import { alert, scrollbar } from '~/components';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type Data = {
|
|
6
|
-
anchor?: {
|
|
7
|
-
content?: any;
|
|
8
|
-
};
|
|
9
|
-
content?: any;
|
|
10
|
-
page?: {
|
|
11
|
-
class?: string;
|
|
12
|
-
content?: any;
|
|
13
|
-
};
|
|
14
|
-
scrollbar?: {
|
|
15
|
-
style?: string;
|
|
16
|
-
};
|
|
17
|
-
site?: {
|
|
18
|
-
content?: any;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export default (data: Data = {}) => {
|
|
24
|
-
let bar = scrollbar({
|
|
25
|
-
fixed: true,
|
|
26
|
-
style: data?.scrollbar?.style
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
return html`
|
|
30
|
-
<section class='site' ${bar.attributes}>
|
|
31
|
-
<section class='page --padding-horizontal --padding-horizontal-sidebars ${data?.page?.class}'>
|
|
32
|
-
${data?.page?.content}
|
|
33
|
-
</section>
|
|
34
|
-
|
|
35
|
-
${data?.site?.content || ''}
|
|
36
|
-
${bar.html}
|
|
37
|
-
</section>
|
|
38
|
-
|
|
39
|
-
<section class='anchors'>
|
|
40
|
-
${alert.html()}
|
|
41
|
-
${data?.anchor?.content || ''}
|
|
42
|
-
</section>
|
|
43
|
-
|
|
44
|
-
${data?.content || ''}
|
|
45
|
-
`;
|
|
46
|
-
};
|