@esportsplus/ui 0.0.20 → 0.0.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/build/components/field/description.d.ts +8 -0
- package/build/components/field/description.js +9 -0
- package/build/components/field/error.d.ts +8 -0
- package/build/components/field/error.js +11 -0
- package/build/components/field/index.d.ts +66 -0
- package/build/components/field/index.js +4 -0
- package/build/components/field/select.d.ts +36 -0
- package/build/components/field/select.js +101 -0
- package/build/components/field/text.d.ts +22 -0
- package/build/components/field/text.js +45 -0
- package/build/components/field/title.d.ts +9 -0
- package/build/components/field/title.js +18 -0
- package/build/components/form/action.d.ts +2 -2
- package/build/components/form/action.js +7 -7
- package/build/components/form/index.d.ts +8 -0
- package/build/components/form/index.js +2 -1
- package/build/components/form/input.d.ts +9 -0
- package/build/components/form/input.js +10 -0
- package/build/components/form/layout.d.ts +2 -2
- package/build/components/form/types.d.ts +2 -5
- package/build/components/index.d.ts +3 -1
- package/build/components/index.js +3 -1
- package/build/components/overlay/index.d.ts +10 -0
- package/build/components/overlay/index.js +6 -0
- package/build/components/page/header.d.ts +2 -3
- package/build/components/page/header.js +8 -8
- package/build/components/page/index.d.ts +1 -1
- package/build/components/page/layout.d.ts +2 -3
- package/build/components/root/index.d.ts +1 -19
- package/build/components/root/index.js +2 -3
- package/build/components/site/index.d.ts +13 -0
- package/build/components/site/index.js +14 -0
- package/build/components/tooltip/index.d.ts +4 -6
- package/build/components/tooltip/index.js +1 -15
- package/build/components/tooltip/menu.d.ts +4 -1
- package/build/components/tooltip/menu.js +46 -29
- package/package.json +1 -1
- package/src/components/field/description.ts +12 -0
- package/src/components/field/error.ts +14 -0
- package/src/components/field/index.ts +6 -0
- package/src/components/field/select.ts +147 -0
- package/src/components/field/text.ts +64 -0
- package/src/components/field/title.ts +21 -0
- package/src/components/form/action.ts +9 -9
- package/src/components/form/index.ts +2 -1
- package/src/components/form/input.ts +15 -0
- package/src/components/form/layout.ts +2 -2
- package/src/components/form/types.ts +2 -6
- package/src/components/index.ts +3 -1
- package/src/components/overlay/index.ts +14 -0
- package/src/components/page/header.ts +8 -15
- package/src/components/page/layout.ts +1 -7
- package/src/components/root/index.ts +2 -3
- package/src/components/site/index.ts +26 -0
- package/src/components/tooltip/index.ts +1 -17
- package/src/components/tooltip/menu.ts +53 -31
- package/src/components/root/layout.ts +0 -36
- package/src/components/state/index.ts +0 -22
|
@@ -29,22 +29,6 @@ const onclick = ({ active, toggle }: { active?: boolean, toggle?: boolean }) =>
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const onfocus = (active: boolean = false) => {
|
|
33
|
-
let state = reactive({ active });
|
|
34
|
-
|
|
35
|
-
return html({
|
|
36
|
-
class: () => {
|
|
37
|
-
return `tooltip ${state.active ? '--active' : ''}`;
|
|
38
|
-
},
|
|
39
|
-
onfocusin: () => {
|
|
40
|
-
state.active = true;
|
|
41
|
-
},
|
|
42
|
-
onfocusout: () => {
|
|
43
|
-
state.active = false;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
|
|
48
32
|
const onhover = (active: boolean = false) => {
|
|
49
33
|
let state = reactive({ active });
|
|
50
34
|
|
|
@@ -62,4 +46,4 @@ const onhover = (active: boolean = false) => {
|
|
|
62
46
|
};
|
|
63
47
|
|
|
64
48
|
|
|
65
|
-
export default { onclick,
|
|
49
|
+
export default { onclick, onhover, menu };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { effect, reactive } from '@esportsplus/reactivity';
|
|
1
2
|
import { html } from '@esportsplus/template';
|
|
2
3
|
|
|
3
4
|
|
|
@@ -16,38 +17,59 @@ type Data = {
|
|
|
16
17
|
text: string;
|
|
17
18
|
url?: string;
|
|
18
19
|
}[];
|
|
20
|
+
state: { active: boolean };
|
|
19
21
|
style?: string;
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
|
|
23
|
-
export default (data: Data) =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
25
|
+
export default (data: Data) => {
|
|
26
|
+
let state = reactive({
|
|
27
|
+
render: false
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
effect(() => {
|
|
31
|
+
if (!data.state.active || state.render) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
state.render = true;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
return () => {
|
|
39
|
+
if (!state.render) {
|
|
40
|
+
return '';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return html`
|
|
44
|
+
<div class="tooltip-content tooltip-content--${data?.direction || 's'} --flex-column --width-full ${data?.class || ''}" style='${data?.style || ''}'>
|
|
45
|
+
${(data?.items || []).map(item => html`
|
|
46
|
+
${item?.border ? html`
|
|
47
|
+
<div
|
|
48
|
+
class="border ${item?.border?.class || ''}"
|
|
49
|
+
style='
|
|
50
|
+
margin-left: calc(var(--margin-horizontal) * -1);
|
|
51
|
+
width: calc(100% + var(--margin-horizontal) * 2);
|
|
52
|
+
'
|
|
53
|
+
></div>
|
|
54
|
+
` : ''}
|
|
55
|
+
|
|
56
|
+
<${item?.url ? 'a' : 'div'}
|
|
57
|
+
class='link --flex-vertical ${item?.class}' ${item?.onclick ? html({ onclick: item.onclick }) : ''}
|
|
58
|
+
style='${item?.style || ''}'
|
|
59
|
+
${item?.url ? `href='${item.url}' target='${item.target || '_blank'}'` : ''}
|
|
60
|
+
>
|
|
61
|
+
${item?.svg ? html`
|
|
62
|
+
<div class="icon --margin-right --margin-300" style='margin-left: var(--size-100)'>
|
|
63
|
+
${item.svg}
|
|
64
|
+
</div>
|
|
65
|
+
` : ''}
|
|
66
|
+
|
|
67
|
+
<div class="text --color-text --flex-fill">
|
|
68
|
+
${item.text}
|
|
69
|
+
</div>
|
|
70
|
+
</${item?.url ? 'a' : 'div'}>
|
|
71
|
+
`)}
|
|
72
|
+
</div>
|
|
73
|
+
`;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { html } from '@esportsplus/template';
|
|
2
|
-
import { scrollbar } from '~/components';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type Data = {
|
|
6
|
-
overlay?: {
|
|
7
|
-
class?: string;
|
|
8
|
-
content?: any;
|
|
9
|
-
};
|
|
10
|
-
site?: {
|
|
11
|
-
class?: string;
|
|
12
|
-
content?: any;
|
|
13
|
-
scrollbar?: {
|
|
14
|
-
style?: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export default (data: Data = {}) => {
|
|
21
|
-
let s = scrollbar({
|
|
22
|
-
fixed: true,
|
|
23
|
-
style: data?.site?.scrollbar?.style || '--background-default: var(--color-black-400);'
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return html`
|
|
27
|
-
<section class='site ${data?.site?.class || ''}' ${s.attributes}>
|
|
28
|
-
${data?.site?.content || ''}
|
|
29
|
-
${s.html}
|
|
30
|
-
</section>
|
|
31
|
-
|
|
32
|
-
<section class='overlay ${data?.overlay?.class || ''}'>
|
|
33
|
-
${data?.overlay?.content || ''}
|
|
34
|
-
</section>
|
|
35
|
-
`;
|
|
36
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { reactive } from '@esportsplus/reactivity';
|
|
2
|
-
import { html } from '@esportsplus/template';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const onfocus = (active: boolean = false) => {
|
|
6
|
-
let state = reactive({ active });
|
|
7
|
-
|
|
8
|
-
return html({
|
|
9
|
-
class: () => {
|
|
10
|
-
return state.active ? '--active' : '';
|
|
11
|
-
},
|
|
12
|
-
onfocusin: () => {
|
|
13
|
-
state.active = true;
|
|
14
|
-
},
|
|
15
|
-
onfocusout: () => {
|
|
16
|
-
state.active = false;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export default { onfocus };
|