fmihel-windeco-components 2.0.0-beta.6 → 2.0.0-beta.7
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/jsx/NavBar/NavItem.jsx +31 -26
- package/jsx/NavBar/NavLogo.jsx +5 -3
- package/jsx/NavBar.jsx +26 -61
- package/jsx/arch/NavBar/NavItem.jsx +45 -0
- package/jsx/arch/NavBar/NavLogo.jsx +23 -0
- package/jsx/arch/NavBar.jsx +81 -0
- package/package.json +1 -1
- package/style/Container.scss +1 -1
- package/style/NavBar.scss +160 -180
- package/style/arch/NavBar.scss +236 -0
- package/style/vars.scss +76 -23
- /package/jsx/{NavBar → arch/NavBar}/NavMenu.jsx +0 -0
package/jsx/NavBar/NavItem.jsx
CHANGED
|
@@ -1,45 +1,50 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import Collapse from '../Collapse.jsx';
|
|
2
3
|
|
|
3
|
-
export function isNavItem(o) {
|
|
4
|
-
return typeof o === 'function' && (o.name === 'NavItem' || o._originalClass === 'NavItem');
|
|
5
|
-
}
|
|
6
4
|
function NavItem({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
className = NavItem.global.className,
|
|
10
|
-
addClass = NavItem.global.addClass,
|
|
11
|
-
style = NavItem.global.style,
|
|
12
|
-
onClick = undefined,
|
|
5
|
+
id,
|
|
6
|
+
caption,
|
|
13
7
|
children,
|
|
8
|
+
active = false,
|
|
9
|
+
open = false,
|
|
10
|
+
onClick = NavItem.global.onClick,
|
|
14
11
|
|
|
15
12
|
}) {
|
|
13
|
+
const [opened, setOpened] = useState(open);
|
|
16
14
|
const click = () => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
let current = opened;
|
|
16
|
+
if (children) {
|
|
17
|
+
current = !opened;
|
|
18
|
+
setOpened(current);
|
|
19
|
+
}
|
|
20
|
+
if (onClick) {
|
|
21
|
+
onClick({
|
|
22
|
+
id, open: current, caption, active,
|
|
23
|
+
});
|
|
24
24
|
}
|
|
25
|
-
return '';
|
|
26
25
|
};
|
|
26
|
+
|
|
27
27
|
return (
|
|
28
28
|
<div
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
nav-item=""
|
|
30
|
+
{...(opened ? { opened: '' } : {})}
|
|
31
|
+
{...(active ? { active: '' } : {})}
|
|
32
32
|
>
|
|
33
|
-
{
|
|
33
|
+
<div caption="" onClick={click}>
|
|
34
|
+
<div text="" >{caption || 'item'}</div>
|
|
35
|
+
{(children) && <div img=""/>}
|
|
36
|
+
</div>
|
|
37
|
+
{(children) && <Collapse expand={opened} attr={{ childs: '' }}>
|
|
38
|
+
{children}
|
|
39
|
+
</Collapse>
|
|
40
|
+
}
|
|
34
41
|
</div>
|
|
35
42
|
);
|
|
36
43
|
}
|
|
37
|
-
NavItem._originalClass = 'NavItem';
|
|
38
44
|
|
|
45
|
+
// NavItem._className='NavItem';
|
|
39
46
|
NavItem.global = {
|
|
40
|
-
|
|
41
|
-
addClass: '',
|
|
42
|
-
style: {},
|
|
47
|
+
onClick: undefined,
|
|
43
48
|
|
|
44
49
|
};
|
|
45
50
|
export default NavItem;
|
package/jsx/NavBar/NavLogo.jsx
CHANGED
|
@@ -2,15 +2,16 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
function NavLogo({
|
|
4
4
|
className = NavLogo.global.className,
|
|
5
|
-
addClass = NavLogo.global.addClass,
|
|
6
5
|
style = NavLogo.global.style,
|
|
7
|
-
|
|
6
|
+
caption = NavLogo.global.caption,
|
|
8
7
|
children,
|
|
9
8
|
}) {
|
|
10
9
|
return (
|
|
11
|
-
<div
|
|
10
|
+
<div
|
|
11
|
+
{...className ? { className } : {}}
|
|
12
12
|
style={{ ...NavLogo.global.style, ...style }}
|
|
13
13
|
>
|
|
14
|
+
{(caption) && caption }
|
|
14
15
|
{children}
|
|
15
16
|
</div>
|
|
16
17
|
);
|
|
@@ -20,6 +21,7 @@ NavLogo.global = {
|
|
|
20
21
|
className: 'wd-nav-logo',
|
|
21
22
|
addClass: '',
|
|
22
23
|
style: {},
|
|
24
|
+
caption: 'logo',
|
|
23
25
|
|
|
24
26
|
};
|
|
25
27
|
|
package/jsx/NavBar.jsx
CHANGED
|
@@ -1,72 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
let _collapse = [];
|
|
8
|
-
export const collapse = (p = undefined) => {
|
|
9
|
-
if (p === undefined) {
|
|
10
|
-
_collapse.map((close) => close());
|
|
11
|
-
} else if (p.add) {
|
|
12
|
-
_collapse.push(p.add);
|
|
13
|
-
} else if (p.remove) {
|
|
14
|
-
_collapse = _collapse.filter((it) => it === p.remove);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
1
|
+
/* eslint-disable no-nested-ternary */
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import Collapse from './Collapse.jsx';
|
|
4
|
+
import getId from './Utils/getId.js';
|
|
5
|
+
import DefaultLogo from './NavBar/NavLogo.jsx';
|
|
17
6
|
|
|
18
7
|
function NavBar({
|
|
19
|
-
|
|
8
|
+
id = getId('navbar'),
|
|
20
9
|
className = NavBar.global.className,
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
style = { ...NavBar.global.style },
|
|
11
|
+
Logo = undefined,
|
|
23
12
|
children,
|
|
24
13
|
}) {
|
|
25
|
-
const [
|
|
26
|
-
const
|
|
27
|
-
const toggleMenu = () => {
|
|
28
|
-
setItemsState(itemsState === 'close' ? 'open' : 'close');
|
|
29
|
-
};
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
const close = () => {
|
|
32
|
-
setItemsState('close');
|
|
33
|
-
};
|
|
34
|
-
collapse({ add: close });
|
|
14
|
+
const [collapse, setCollapse] = useState(true);
|
|
15
|
+
const childs = Array.isArray(children) ? children : [children];
|
|
35
16
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
const resize = () => {
|
|
43
|
-
const current = isCompact();
|
|
44
|
-
if (current !== compact) {
|
|
45
|
-
setCompact(current);
|
|
46
|
-
setItemsState('close');
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const removeResizeScreen = onResizeScreen(resize);
|
|
50
|
-
resize();
|
|
51
|
-
return () => {
|
|
52
|
-
removeResizeScreen();
|
|
53
|
-
};
|
|
54
|
-
}, [compact]);
|
|
55
|
-
//console.log('children',children,Array.isArray(children));
|
|
56
|
-
let childs = Array.isArray(children)?children:[children];
|
|
17
|
+
const navBtnClick = () => {
|
|
18
|
+
setCollapse(!collapse);
|
|
19
|
+
};
|
|
20
|
+
const typeLogo = typeof Logo;
|
|
57
21
|
return (
|
|
58
|
-
<div
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className={ `${className} ${addClass}`}
|
|
22
|
+
<div navbar=""
|
|
23
|
+
id={id}
|
|
24
|
+
{...className ? { className } : {}}
|
|
62
25
|
style={{ ...NavBar.global.style, ...style }}
|
|
63
26
|
>
|
|
64
|
-
<div
|
|
65
|
-
|
|
66
|
-
|
|
27
|
+
<div nav-panel="">
|
|
28
|
+
{typeLogo === 'string' && <DefaultLogo caption={Logo}/>}
|
|
29
|
+
{typeLogo !== 'string' && Logo && <Logo/>}
|
|
30
|
+
|
|
31
|
+
<div nav-empty=""></div>
|
|
32
|
+
<div nav-btn="" onClick={navBtnClick}>≡</div>
|
|
67
33
|
</div>
|
|
68
|
-
<div
|
|
69
|
-
{childs
|
|
34
|
+
<div nav-menu="" {...(!collapse ? { expand: '' } : {})}>
|
|
35
|
+
{childs}
|
|
70
36
|
</div>
|
|
71
37
|
</div>
|
|
72
38
|
);
|
|
@@ -74,8 +40,7 @@ function NavBar({
|
|
|
74
40
|
|
|
75
41
|
NavBar.global = {
|
|
76
42
|
className: 'wd-navbar',
|
|
77
|
-
addClass: '',
|
|
78
43
|
style: {},
|
|
79
|
-
|
|
80
44
|
};
|
|
45
|
+
|
|
81
46
|
export default NavBar;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export function isNavItem(o) {
|
|
4
|
+
return typeof o === 'function' && (o.name === 'NavItem' || o._originalClass === 'NavItem');
|
|
5
|
+
}
|
|
6
|
+
function NavItem({
|
|
7
|
+
caption = undefined,
|
|
8
|
+
link,
|
|
9
|
+
className = NavItem.global.className,
|
|
10
|
+
addClass = NavItem.global.addClass,
|
|
11
|
+
style = NavItem.global.style,
|
|
12
|
+
onClick = undefined,
|
|
13
|
+
children,
|
|
14
|
+
|
|
15
|
+
}) {
|
|
16
|
+
const click = () => {
|
|
17
|
+
if (onClick) onClick({ link });
|
|
18
|
+
};
|
|
19
|
+
const text = () => {
|
|
20
|
+
if (caption) {
|
|
21
|
+
return typeof caption === 'string' ? <span it="cap">{caption}</span> : caption;
|
|
22
|
+
} if (children) {
|
|
23
|
+
return typeof children === 'string' ? <span it="cap">{children}</span> : children;
|
|
24
|
+
}
|
|
25
|
+
return '';
|
|
26
|
+
};
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
className={ `${className} ${addClass}`}
|
|
30
|
+
style={{ ...NavItem.global.style, ...style }}
|
|
31
|
+
onClick={click}
|
|
32
|
+
>
|
|
33
|
+
{text()}
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
NavItem._originalClass = 'NavItem';
|
|
38
|
+
|
|
39
|
+
NavItem.global = {
|
|
40
|
+
className: 'wd-nav-item',
|
|
41
|
+
addClass: '',
|
|
42
|
+
style: {},
|
|
43
|
+
|
|
44
|
+
};
|
|
45
|
+
export default NavItem;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
function NavLogo({
|
|
4
|
+
className = NavLogo.global.className,
|
|
5
|
+
addClass = NavLogo.global.addClass,
|
|
6
|
+
style = NavLogo.global.style,
|
|
7
|
+
children,
|
|
8
|
+
}) {
|
|
9
|
+
return (
|
|
10
|
+
<div className={ `${className} ${addClass}`}
|
|
11
|
+
style={{ ...NavLogo.global.style, ...style }}
|
|
12
|
+
>
|
|
13
|
+
{children}
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
NavLogo.global = {
|
|
19
|
+
className: 'wd-nav-logo',
|
|
20
|
+
style: {},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default NavLogo;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import NavItem, { isNavItem } from './NavBar/NavItem.jsx';
|
|
3
|
+
import { isNavMenu } from './NavBar/NavMenu.jsx';
|
|
4
|
+
import onResizeScreen from './Utils/onResizeScreen.js';
|
|
5
|
+
import isCompact from './Utils/isCompact.js';
|
|
6
|
+
|
|
7
|
+
let _collapse = [];
|
|
8
|
+
export const collapse = (p = undefined) => {
|
|
9
|
+
if (p === undefined) {
|
|
10
|
+
_collapse.map((close) => close());
|
|
11
|
+
} else if (p.add) {
|
|
12
|
+
_collapse.push(p.add);
|
|
13
|
+
} else if (p.remove) {
|
|
14
|
+
_collapse = _collapse.filter((it) => it === p.remove);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
function NavBar({
|
|
19
|
+
Logo = undefined,
|
|
20
|
+
className = NavBar.global.className,
|
|
21
|
+
addClass = NavBar.global.addClass,
|
|
22
|
+
style = NavBar.global.style,
|
|
23
|
+
children,
|
|
24
|
+
}) {
|
|
25
|
+
const [compact, setCompact] = useState(isCompact());
|
|
26
|
+
const [itemsState, setItemsState] = useState('close');
|
|
27
|
+
const toggleMenu = () => {
|
|
28
|
+
setItemsState(itemsState === 'close' ? 'open' : 'close');
|
|
29
|
+
};
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const close = () => {
|
|
32
|
+
setItemsState('close');
|
|
33
|
+
};
|
|
34
|
+
collapse({ add: close });
|
|
35
|
+
|
|
36
|
+
return () => {
|
|
37
|
+
collapse({ remove: close });
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const resize = () => {
|
|
43
|
+
const current = isCompact();
|
|
44
|
+
if (current !== compact) {
|
|
45
|
+
setCompact(current);
|
|
46
|
+
setItemsState('close');
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const removeResizeScreen = onResizeScreen(resize);
|
|
50
|
+
resize();
|
|
51
|
+
return () => {
|
|
52
|
+
removeResizeScreen();
|
|
53
|
+
};
|
|
54
|
+
}, [compact]);
|
|
55
|
+
//console.log('children',children,Array.isArray(children));
|
|
56
|
+
let childs = Array.isArray(children)?children:[children];
|
|
57
|
+
return (
|
|
58
|
+
<div
|
|
59
|
+
it='navbar'
|
|
60
|
+
state={`${itemsState}`}
|
|
61
|
+
className={ `${className} ${addClass}`}
|
|
62
|
+
style={{ ...NavBar.global.style, ...style }}
|
|
63
|
+
>
|
|
64
|
+
<div it='nav-panel'>
|
|
65
|
+
<div it="nav-logo">{Logo && <Logo/>}</div>
|
|
66
|
+
<div it="nav-btn-close" className="wd-nav-btn" onClick={toggleMenu}>≡</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div it={'nav-items'} className="wd-scrollbar">
|
|
69
|
+
{childs.map((it, key) => ((isNavItem(it.type) || isNavMenu(it.type)) ? it : <NavItem key={key}>{it}</NavItem>))}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
NavBar.global = {
|
|
76
|
+
className: 'wd-navbar',
|
|
77
|
+
addClass: '',
|
|
78
|
+
style: {},
|
|
79
|
+
|
|
80
|
+
};
|
|
81
|
+
export default NavBar;
|
package/package.json
CHANGED
package/style/Container.scss
CHANGED
package/style/NavBar.scss
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use "sass:meta";
|
|
2
2
|
@import './vars.scss';
|
|
3
3
|
|
|
4
|
+
@each $name,$width in $wd-widths{
|
|
5
|
+
.nav-container-#{$name}{
|
|
6
|
+
height: 100%;
|
|
7
|
+
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: nowrap;
|
|
10
|
+
justify-content: flex-start;
|
|
11
|
+
align-content: stretch;
|
|
12
|
+
align-items: stretch;
|
|
13
|
+
|
|
14
|
+
flex-direction: row;
|
|
15
|
+
@include less-than($name){
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.nav-content{
|
|
23
|
+
//border: 1px dashed red;
|
|
24
|
+
flex:1 1 auto;
|
|
25
|
+
overflow: auto;
|
|
26
|
+
}
|
|
27
|
+
|
|
4
28
|
|
|
5
29
|
@mixin define(){
|
|
6
30
|
$themes:$wd-themes;
|
|
@@ -15,222 +39,178 @@
|
|
|
15
39
|
}
|
|
16
40
|
|
|
17
41
|
$size:var(--wd-size);
|
|
18
|
-
$panel-height:calc($size*1.5);
|
|
19
|
-
$bg:var(--wd-deep);
|
|
20
|
-
$color:var(--wd-color);
|
|
21
|
-
$orange:var(--wd-orange);
|
|
22
|
-
$border:var(--wd-border);
|
|
23
42
|
$gap:var(--wd-gap);
|
|
24
|
-
$
|
|
43
|
+
$size-item:calc(var(--wd-size)*0.8);
|
|
25
44
|
$tick:$wd-tick;
|
|
26
|
-
$invert:50%;//var(--cb-invert);
|
|
27
45
|
|
|
28
|
-
.wd-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
@include display-flex-vert-stretch();
|
|
44
|
-
@media screen and (min-width: $mobile-width) {
|
|
45
|
-
flex-direction: row;
|
|
46
|
+
.wd-navbar{
|
|
47
|
+
min-width:250px;
|
|
48
|
+
|
|
49
|
+
[nav-menu]{
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
padding-left: $gap;
|
|
52
|
+
padding-right: $gap;
|
|
53
|
+
}
|
|
54
|
+
[nav-item]{
|
|
55
|
+
min-height:$size;
|
|
56
|
+
line-height: $size;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
[nav-item]{
|
|
59
|
+
padding-left:calc($size*0.5);
|
|
46
60
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
[caption]{
|
|
62
|
+
&:hover{
|
|
63
|
+
color: var(--nav-color-hover);
|
|
64
|
+
//text-shadow: 0px 0px 1px var(--nav-color-hover);
|
|
65
|
+
}
|
|
66
|
+
[img]{
|
|
67
|
+
width: $size;
|
|
68
|
+
background-image: url($tick);
|
|
69
|
+
background-repeat: no-repeat, no-repeat;
|
|
70
|
+
background-position: center;
|
|
71
|
+
filter:invert(50%);
|
|
72
|
+
transition: transform 0.2s;
|
|
52
73
|
}
|
|
53
74
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
>div[it='nav-logo']{
|
|
63
|
-
@include stretch();
|
|
64
|
-
line-height: $panel-height;
|
|
75
|
+
&[opened]{
|
|
76
|
+
>[caption]{
|
|
77
|
+
//color:var(--wd-highlight);
|
|
78
|
+
//text-shadow: 0px 0px 0.5px var(--wd-highlight);
|
|
79
|
+
[img]{
|
|
80
|
+
transform: rotate(180deg);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
65
83
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
84
|
+
&[active]{
|
|
85
|
+
>[caption]{
|
|
86
|
+
color:var(--wd-highlight);
|
|
87
|
+
//text-shadow: 0px 0px 0.5px var(--wd-highlight);
|
|
70
88
|
}
|
|
71
89
|
}
|
|
72
90
|
}
|
|
73
|
-
|
|
74
|
-
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[navbar]{
|
|
94
|
+
//border:1px dashed yellowgreen;
|
|
95
|
+
@include less-large{
|
|
96
|
+
max-height: 80%;
|
|
97
|
+
}
|
|
98
|
+
|
|
75
99
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-wrap: nowrap;
|
|
102
|
+
justify-content: flex-start;
|
|
103
|
+
align-content: stretch;
|
|
104
|
+
align-items: stretch;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
|
|
107
|
+
[nav-panel]{
|
|
108
|
+
|
|
109
|
+
display: flex;
|
|
110
|
+
flex-wrap: nowrap;
|
|
111
|
+
justify-content: flex-start;
|
|
112
|
+
align-content: stretch;
|
|
113
|
+
align-items: center;
|
|
114
|
+
flex-direction: row;
|
|
80
115
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
height:
|
|
84
|
-
|
|
85
|
-
|
|
116
|
+
|
|
117
|
+
[nav-btn]{
|
|
118
|
+
min-height: $size;
|
|
119
|
+
min-width: $size;
|
|
120
|
+
font-size:2rem;
|
|
121
|
+
text-align: center;
|
|
122
|
+
cursor:pointer;
|
|
123
|
+
@include more-large{
|
|
124
|
+
display: none;
|
|
86
125
|
}
|
|
87
126
|
}
|
|
88
127
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
@
|
|
92
|
-
|
|
128
|
+
[nav-empty]{
|
|
129
|
+
flex:1 1 auto;
|
|
130
|
+
@include more-large{
|
|
131
|
+
display:none;
|
|
93
132
|
}
|
|
94
133
|
}
|
|
95
134
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
>div{
|
|
104
|
-
&:nth-child(1){
|
|
105
|
-
@include stretch();
|
|
106
|
-
}
|
|
107
|
-
&:nth-child(2){
|
|
108
|
-
width: $size;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
135
|
+
[nav-menu]{
|
|
136
|
+
|
|
137
|
+
overflow: auto;
|
|
138
|
+
@include wd-scrollbar();
|
|
139
|
+
|
|
140
|
+
@include less-large{
|
|
141
|
+
height:0px;
|
|
111
142
|
}
|
|
112
|
-
&[
|
|
113
|
-
|
|
114
|
-
|
|
143
|
+
&[expand]{
|
|
144
|
+
height:auto !important;
|
|
145
|
+
min-height: auto !important;
|
|
115
146
|
}
|
|
147
|
+
//@include less-large{
|
|
148
|
+
/*
|
|
149
|
+
position: absolute;
|
|
150
|
+
right:0px;
|
|
151
|
+
top:0px;
|
|
152
|
+
background-color: gray;
|
|
153
|
+
height: 100%;
|
|
154
|
+
width:0px;
|
|
155
|
+
*/
|
|
156
|
+
//}
|
|
116
157
|
}
|
|
117
158
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
text-align: center;
|
|
128
|
-
line-height: $panel-height;
|
|
129
|
-
cursor: pointer;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
//-------------------------------------------------
|
|
133
|
-
.wd-nav-item{
|
|
134
|
-
min-height: $size;
|
|
135
|
-
line-height: $size;
|
|
136
|
-
padding-left: $gap;
|
|
137
|
-
padding-right: $gap;
|
|
138
|
-
[it='cap']{
|
|
139
|
-
display: block;
|
|
140
|
-
width: 100%;
|
|
141
|
-
&:hover{
|
|
142
|
-
cursor: pointer;
|
|
143
|
-
color: var(--nav-color-hover);
|
|
144
|
-
text-shadow: 0px 0px 1px var(--nav-color-hover);
|
|
159
|
+
[caption]{
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-wrap: nowrap;
|
|
162
|
+
justify-content: flex-start;
|
|
163
|
+
align-content: stretch;
|
|
164
|
+
align-items: stretch;
|
|
165
|
+
flex-direction: row;
|
|
166
|
+
[text]{
|
|
167
|
+
flex: 1 1 auto;
|
|
145
168
|
}
|
|
146
169
|
}
|
|
147
170
|
}
|
|
148
|
-
.wd-nav-top{
|
|
149
|
-
.wd-nav-item{
|
|
150
|
-
@media screen and (min-width: $mobile-width) {
|
|
151
|
-
@include display-flex-center(column);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
.wd-nav-item-stretch{
|
|
156
|
-
min-height: 0px !important;
|
|
157
|
-
height: 0px;
|
|
158
|
-
@include stretch();
|
|
159
|
-
|
|
160
|
-
@media screen and (max-width: $mobile-width) {
|
|
161
|
-
@include no-stretch();
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
//-------------------------------------------------
|
|
165
|
-
.wd-nav-menu{
|
|
166
|
-
min-height: $size;
|
|
167
|
-
//border-bottom: 1px dashed $border;
|
|
168
171
|
|
|
169
|
-
>div{
|
|
170
|
-
&[it='nav-menu-head']{
|
|
171
|
-
line-height: $size;
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
background-position: center;
|
|
181
|
-
filter:invert($invert);
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
@each $name,$width in $wd-widths{
|
|
176
|
+
.nav-container-#{$name}{
|
|
177
|
+
[navbar]{
|
|
178
|
+
@include more-than($name){
|
|
179
|
+
max-height: none !important;
|
|
182
180
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
color: var(--nav-color-hover);
|
|
186
|
-
text-shadow: 0px 0px 1px var(--nav-color-hover);
|
|
181
|
+
@include less-than($name){
|
|
182
|
+
max-height: 80%;
|
|
187
183
|
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
border-color: rgba(0,0,0,0) !important;
|
|
184
|
+
[nav-btn]{
|
|
185
|
+
display: block;
|
|
186
|
+
@include more-than($name){
|
|
187
|
+
display: none !important;
|
|
193
188
|
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
189
|
+
}
|
|
190
|
+
[nav-empty]{
|
|
191
|
+
@include more-than($name){
|
|
192
|
+
display:none !important;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
[nav-menu]{
|
|
196
|
+
height:auto;
|
|
197
|
+
@include less-than($name){
|
|
198
|
+
height:0px;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
205
201
|
}
|
|
206
202
|
}
|
|
207
203
|
}
|
|
208
204
|
|
|
209
|
-
.wd-nav-dialog{
|
|
210
|
-
.wd-dialog-content{
|
|
211
|
-
overflow: hidden;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
.wd-nav-top{
|
|
215
|
-
.wd-nav-menu{
|
|
216
|
-
@media screen and (min-width: $mobile-width) {
|
|
217
|
-
@include display-flex-center(column);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
//-------------------------------------------------
|
|
222
|
-
|
|
223
205
|
.wd-nav-logo{
|
|
224
|
-
min-height: $
|
|
225
|
-
line-height: $
|
|
226
|
-
min-width: calc($size*3);
|
|
206
|
+
min-height: calc($size*1.5);
|
|
207
|
+
line-height: calc($size*1.5);
|
|
227
208
|
padding-left: $gap;
|
|
228
|
-
|
|
229
|
-
color
|
|
230
|
-
text-shadow: 1px 1px 2px $orange;
|
|
209
|
+
padding-right: $gap;
|
|
210
|
+
color:var(--wd-orange);
|
|
231
211
|
}
|
|
232
|
-
|
|
212
|
+
|
|
233
213
|
}
|
|
234
214
|
|
|
235
|
-
@include define();
|
|
236
215
|
|
|
216
|
+
@include define();
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
@use 'sass:meta';
|
|
2
|
+
@import './vars.scss';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
@mixin define(){
|
|
6
|
+
$themes:$wd-themes;
|
|
7
|
+
$hovers:$wd-high;
|
|
8
|
+
$hovers-color:$wd-color;
|
|
9
|
+
|
|
10
|
+
@each $theme in $themes{
|
|
11
|
+
#{getThemingRootClass($theme)}{
|
|
12
|
+
//--nav-bg-hover:#{meta.inspect(blendColors($colors:$hovers,$theme:$theme,$level:-5%))};
|
|
13
|
+
--nav-color-hover:#{meta.inspect(blendColors($colors:$hovers-color,$theme:$theme,$level:-30%))};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
$size:var(--wd-size);
|
|
18
|
+
$panel-height:calc($size*1.5);
|
|
19
|
+
$bg:var(--wd-deep);
|
|
20
|
+
$color:var(--wd-color);
|
|
21
|
+
$orange:var(--wd-orange);
|
|
22
|
+
$border:var(--wd-border);
|
|
23
|
+
$gap:var(--wd-gap);
|
|
24
|
+
$mobile-width:$wd-large-width;
|
|
25
|
+
$tick:$wd-tick;
|
|
26
|
+
$invert:50%;//var(--cb-invert);
|
|
27
|
+
|
|
28
|
+
.wd-nav-left{
|
|
29
|
+
|
|
30
|
+
@include display-flex-vert-stretch();
|
|
31
|
+
@media screen and (min-width: $mobile-width) {
|
|
32
|
+
flex-direction: row;
|
|
33
|
+
}
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.wd-nav-top{
|
|
38
|
+
@include display-flex-vert-stretch();
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
|
|
41
|
+
>div[it='navbar']{
|
|
42
|
+
|
|
43
|
+
@include display-flex-vert-stretch();
|
|
44
|
+
@media screen and (min-width: $mobile-width) {
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
>div[it='nav-items']{
|
|
49
|
+
display:block;
|
|
50
|
+
@media screen and (min-width: $mobile-width) {
|
|
51
|
+
@include display-flex-horiz-stretch();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
div[it='navbar']{
|
|
58
|
+
@include display-flex-vert-stretch();
|
|
59
|
+
>div[it='nav-panel']{
|
|
60
|
+
min-height: $panel-height;
|
|
61
|
+
@include display-flex-horiz-center();
|
|
62
|
+
>div[it='nav-logo']{
|
|
63
|
+
@include stretch();
|
|
64
|
+
line-height: $panel-height;
|
|
65
|
+
}
|
|
66
|
+
>div[it='nav-btn-close']{
|
|
67
|
+
width: $panel-height;
|
|
68
|
+
@media screen and (min-width: $mobile-width) {
|
|
69
|
+
display: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@include transition(height 0.4s);
|
|
75
|
+
|
|
76
|
+
>div[it='nav-items']{
|
|
77
|
+
overflow-x: hidden;
|
|
78
|
+
overflow-y: auto;
|
|
79
|
+
@include stretch();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&[state='open']{
|
|
83
|
+
height: 90% !important;
|
|
84
|
+
@media screen and (min-width: $mobile-width) {
|
|
85
|
+
height: auto !important;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&[state='close']{
|
|
90
|
+
height: $panel-height !important;
|
|
91
|
+
@media screen and (min-width: $mobile-width) {
|
|
92
|
+
height: auto !important;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
}//navbar
|
|
97
|
+
|
|
98
|
+
div[it='nav-menu']{
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
div{
|
|
101
|
+
&[it='nav-menu-head']{
|
|
102
|
+
@include display-flex-horiz-stretch();
|
|
103
|
+
>div{
|
|
104
|
+
&:nth-child(1){
|
|
105
|
+
@include stretch();
|
|
106
|
+
}
|
|
107
|
+
&:nth-child(2){
|
|
108
|
+
width: $size;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
&[it='nav-menu-items']{
|
|
113
|
+
@include stretch();
|
|
114
|
+
padding-left: $size;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
//@include transition(height 0.4s);
|
|
120
|
+
//height: 0px;
|
|
121
|
+
&[expand='expand']{
|
|
122
|
+
height: auto;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.wd-nav-btn{
|
|
127
|
+
text-align: center;
|
|
128
|
+
line-height: $panel-height;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
//-------------------------------------------------
|
|
133
|
+
.wd-nav-item{
|
|
134
|
+
min-height: $size;
|
|
135
|
+
line-height: $size;
|
|
136
|
+
padding-left: $gap;
|
|
137
|
+
padding-right: $gap;
|
|
138
|
+
[it='cap']{
|
|
139
|
+
display: block;
|
|
140
|
+
width: 100%;
|
|
141
|
+
&:hover{
|
|
142
|
+
cursor: pointer;
|
|
143
|
+
color: var(--nav-color-hover);
|
|
144
|
+
text-shadow: 0px 0px 1px var(--nav-color-hover);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.wd-nav-top{
|
|
149
|
+
.wd-nav-item{
|
|
150
|
+
@media screen and (min-width: $mobile-width) {
|
|
151
|
+
@include display-flex-center(column);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
.wd-nav-item-stretch{
|
|
156
|
+
min-height: 0px !important;
|
|
157
|
+
height: 0px;
|
|
158
|
+
@include stretch();
|
|
159
|
+
|
|
160
|
+
@media screen and (max-width: $mobile-width) {
|
|
161
|
+
@include no-stretch();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
//-------------------------------------------------
|
|
165
|
+
.wd-nav-menu{
|
|
166
|
+
min-height: $size;
|
|
167
|
+
//border-bottom: 1px dashed $border;
|
|
168
|
+
|
|
169
|
+
>div{
|
|
170
|
+
&[it='nav-menu-head']{
|
|
171
|
+
line-height: $size;
|
|
172
|
+
|
|
173
|
+
padding-left: $gap;
|
|
174
|
+
padding-right: $gap;
|
|
175
|
+
|
|
176
|
+
>div[it='nav-menu-btn']{
|
|
177
|
+
width: $size;
|
|
178
|
+
background-image: url($tick);
|
|
179
|
+
background-repeat: no-repeat, no-repeat;
|
|
180
|
+
background-position: center;
|
|
181
|
+
filter:invert($invert);
|
|
182
|
+
}
|
|
183
|
+
&:hover{
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
color: var(--nav-color-hover);
|
|
186
|
+
text-shadow: 0px 0px 1px var(--nav-color-hover);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
&[it='nav-menu-items']{
|
|
190
|
+
>div{
|
|
191
|
+
&:last-child{
|
|
192
|
+
border-color: rgba(0,0,0,0) !important;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
&[expand='expand']{
|
|
198
|
+
>div[it='nav-menu-head'] >div[it='nav-menu-btn']{
|
|
199
|
+
transform: rotate(180deg);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
&[as='popup']{
|
|
203
|
+
>div[it='nav-menu-head'] >div[it='nav-menu-btn']{
|
|
204
|
+
//transform: rotate(-90deg) !important;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.wd-nav-dialog{
|
|
210
|
+
.wd-dialog-content{
|
|
211
|
+
overflow: hidden;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
.wd-nav-top{
|
|
215
|
+
.wd-nav-menu{
|
|
216
|
+
@media screen and (min-width: $mobile-width) {
|
|
217
|
+
@include display-flex-center(column);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
//-------------------------------------------------
|
|
222
|
+
|
|
223
|
+
.wd-nav-logo{
|
|
224
|
+
min-height: $panel-height;
|
|
225
|
+
line-height: $panel-height;
|
|
226
|
+
min-width: calc($size*3);
|
|
227
|
+
padding-left: $gap;
|
|
228
|
+
font-size: 1.2rem;
|
|
229
|
+
color:$orange;
|
|
230
|
+
text-shadow: 1px 1px 2px $orange;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@include define();
|
|
236
|
+
|
package/style/vars.scss
CHANGED
|
@@ -15,13 +15,13 @@ $wd-padding:$wd-gap;
|
|
|
15
15
|
$wd-radius:0.25rem;
|
|
16
16
|
$wd-font-size:14px !default;
|
|
17
17
|
$wd-font-family:font-family('verdana') !default;
|
|
18
|
-
$wd-max-mobile-width:900px;
|
|
19
|
-
$wd-min-mobile-width:700px;
|
|
20
18
|
|
|
21
19
|
$wd-large-width:900px;
|
|
22
20
|
$wd-middle-width:700px;
|
|
23
21
|
$wd-small-width:500px;
|
|
24
22
|
|
|
23
|
+
$wd-widths:('small':$wd-small-width,'middle':$wd-middle-width,'large':$wd-small-width);
|
|
24
|
+
|
|
25
25
|
$wd-bg:('light':#EDF2F9,'dark':#0B1727) !default;
|
|
26
26
|
$wd-color:('light':#83909F,'dark':#9DA9BB) !default;
|
|
27
27
|
$wd-label:('light':#5E6E82,'dark':#9DA9BB) !default;
|
|
@@ -172,61 +172,114 @@ $wd-bootstrap-vars:(
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
@mixin
|
|
176
|
-
@media screen and (width
|
|
175
|
+
@mixin less-large{
|
|
176
|
+
@media screen and (width <= $wd-large-width) {
|
|
177
177
|
@content;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
@mixin
|
|
182
|
-
@media screen and (
|
|
181
|
+
@mixin less-middle{
|
|
182
|
+
@media screen and ( width <= $wd-middle-width) {
|
|
183
183
|
@content;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
@mixin
|
|
187
|
+
@mixin less-small{
|
|
188
188
|
@media screen and ( width <= $wd-small-width) {
|
|
189
189
|
@content;
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
|
|
194
|
+
@mixin more-large{
|
|
195
|
+
@media screen and (width > $wd-large-width) {
|
|
196
|
+
@content;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@mixin more-middle{
|
|
201
|
+
@media screen and ( width > $wd-middle-width) {
|
|
202
|
+
@content;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
@mixin more-small{
|
|
207
|
+
@media screen and ( width > $wd-small-width) {
|
|
208
|
+
@content;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
.hide-less-large{
|
|
214
|
+
@include less-large{
|
|
195
215
|
display: none !important;
|
|
196
216
|
}
|
|
197
217
|
}
|
|
198
218
|
|
|
199
|
-
.hide-
|
|
200
|
-
@include
|
|
219
|
+
.hide-less-middle{
|
|
220
|
+
@include less-middle{
|
|
201
221
|
display: none !important;
|
|
202
222
|
}
|
|
203
223
|
}
|
|
204
224
|
|
|
205
|
-
.hide-
|
|
206
|
-
@include
|
|
225
|
+
.hide-less-small{
|
|
226
|
+
@include less-small{
|
|
207
227
|
display: none !important;
|
|
208
228
|
}
|
|
209
229
|
}
|
|
210
230
|
|
|
211
231
|
|
|
212
|
-
|
|
213
|
-
@
|
|
214
|
-
|
|
215
|
-
@content;
|
|
232
|
+
.hide-more-large{
|
|
233
|
+
@include more-large{
|
|
234
|
+
display: none !important;
|
|
216
235
|
}
|
|
217
236
|
}
|
|
218
237
|
|
|
219
|
-
|
|
220
|
-
@
|
|
221
|
-
|
|
238
|
+
.hide-more-middle{
|
|
239
|
+
@include more-middle{
|
|
240
|
+
display: none !important;
|
|
222
241
|
}
|
|
223
242
|
}
|
|
224
243
|
|
|
225
|
-
.hide-
|
|
226
|
-
@include
|
|
244
|
+
.hide-more-small{
|
|
245
|
+
@include more-small{
|
|
227
246
|
display: none !important;
|
|
228
247
|
}
|
|
229
248
|
}
|
|
230
249
|
|
|
231
250
|
|
|
232
|
-
|
|
251
|
+
@mixin less-than($name){
|
|
252
|
+
@if ($name == 'large'){
|
|
253
|
+
@include less-large{
|
|
254
|
+
@content;
|
|
255
|
+
}
|
|
256
|
+
}@else if($name == 'middle'){
|
|
257
|
+
@include less-middle{
|
|
258
|
+
@content;
|
|
259
|
+
}
|
|
260
|
+
}@else if($name == 'small'){
|
|
261
|
+
@include less-small{
|
|
262
|
+
@content;
|
|
263
|
+
}
|
|
264
|
+
}@else{
|
|
265
|
+
@error 'not define code for width'+$name;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@mixin more-than($name){
|
|
270
|
+
@if ($name == 'large'){
|
|
271
|
+
@include more-large{
|
|
272
|
+
@content;
|
|
273
|
+
}
|
|
274
|
+
}@else if($name == 'middle'){
|
|
275
|
+
@include more-middle{
|
|
276
|
+
@content;
|
|
277
|
+
}
|
|
278
|
+
}@else if($name == 'small'){
|
|
279
|
+
@include more-small{
|
|
280
|
+
@content;
|
|
281
|
+
}
|
|
282
|
+
}@else{
|
|
283
|
+
@error 'not define code for width'+$name;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
File without changes
|