@dile/ui 2.0.5 → 2.0.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/components/avatar/src/DileAvatar.js +8 -2
- package/components/hamburger/index.js +1 -1
- package/components/nav/src/DileNav.js +1 -1
- package/components/radio-group/radio-group.js +1 -0
- package/components/rating-scale-question/rating-scale-question.js +1 -0
- package/components/slide-menu/index.js +1 -0
- package/components/slide-menu/slide-menu.js +3 -0
- package/components/slide-menu/src/DileSlideMenu.js +115 -0
- package/components/slide-show/src/DileSlideShow.js +1 -1
- package/package.json +3 -3
|
@@ -7,6 +7,7 @@ export class DileAvatar extends LitElement {
|
|
|
7
7
|
display: inline-block;
|
|
8
8
|
}
|
|
9
9
|
div {
|
|
10
|
+
font-family: var(--dile-avatar-font-family, Arial, sans-serif);
|
|
10
11
|
display: inline-block;
|
|
11
12
|
background-repeat: no-repeat;
|
|
12
13
|
background-position: center;
|
|
@@ -15,13 +16,18 @@ export class DileAvatar extends LitElement {
|
|
|
15
16
|
height: var(--dile-avatar-size, 36px);
|
|
16
17
|
border-radius: var(--dile-avatar-size, 36px);
|
|
17
18
|
background-size: var(--dile-avatar-size, 36px);
|
|
18
|
-
background-color: var(--dile-avatar-background-color, #ddd);
|
|
19
|
+
background-color: var(--dile-avatar-background-color, var(--dile-primary-color, #ddd));
|
|
19
20
|
color: var(--dile-avatar-color, #888);
|
|
20
21
|
text-align: center;
|
|
21
|
-
font-size: calc(var(--dile-avatar-size, 36px) -
|
|
22
|
+
font-size: calc(var(--dile-avatar-size, 36px) - 14px);
|
|
22
23
|
font-weight: bold;
|
|
23
24
|
text-transform: uppercase;
|
|
24
25
|
}
|
|
26
|
+
.initial {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
}
|
|
25
31
|
`;
|
|
26
32
|
}
|
|
27
33
|
static get properties() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { DileHamburger } from './src/DileHamburger.js';
|
|
1
|
+
export { DileHamburger } from './src/DileHamburger.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DileSlideMenu } from './src/DileSlideMenu.js';
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { LitElement, html, css } from 'lit';
|
|
2
|
+
import { DileSlideDown } from '../../../mixins/slide-down';
|
|
3
|
+
import { arrowDropDownIcon } from '@dile/icons';
|
|
4
|
+
import '@dile/ui/components/icon/icon.js';
|
|
5
|
+
|
|
6
|
+
export class DileSlideMenu extends DileSlideDown(LitElement) {
|
|
7
|
+
static get properties() {
|
|
8
|
+
return {
|
|
9
|
+
opened: { type: Boolean },
|
|
10
|
+
label: { type: String },
|
|
11
|
+
icon: { type: Object },
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.opened = false;
|
|
18
|
+
this.label = "Menu";
|
|
19
|
+
this.icon = arrowDropDownIcon;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static get styles() {
|
|
23
|
+
return css`
|
|
24
|
+
* {
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
27
|
+
:host {
|
|
28
|
+
display: block;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#content {
|
|
32
|
+
height: 0;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
transition: height 0.5s ease-in;
|
|
35
|
+
-webkit-transition: height 0.5s ease-in;
|
|
36
|
+
padding: 1px 0;
|
|
37
|
+
}
|
|
38
|
+
.container {
|
|
39
|
+
padding: 1px 0;
|
|
40
|
+
}
|
|
41
|
+
nav {
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
font-size: var(--dile-slide-menu-font-size, 1em);
|
|
46
|
+
color: var(--dile-foreground-color, #303030);
|
|
47
|
+
font-weight: var(--dile-slide-menu-font-weight, bold);
|
|
48
|
+
text-decoration: var(--dile-slide-menu-text-decoration, none);
|
|
49
|
+
--dile-icon-color: var(--dile-foreground-color, #303030);
|
|
50
|
+
margin: var(--dile-slide-menu-control-margin, 0 0 0.25rem 0);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
dile-icon {
|
|
54
|
+
transform: var(--dile-slide-menu-closed-transform, rotate(-90deg));
|
|
55
|
+
transition: transform 0.5s ease;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
nav.opened dile-icon {
|
|
59
|
+
transform: var(--dile-slide-menu-opened-transform, rotate(0deg));
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
firstUpdated() {
|
|
65
|
+
this.content = this.shadowRoot.getElementById('content');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
updated(changedProperties) {
|
|
69
|
+
if(changedProperties.has('opened') && this.opened != undefined) {
|
|
70
|
+
if(this.opened) {
|
|
71
|
+
this.slideShow(this.content);
|
|
72
|
+
} else {
|
|
73
|
+
this.slideHide(this.content);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
render() {
|
|
79
|
+
return html`
|
|
80
|
+
<nav @click="${this.toggle}" class="${this.opened ? 'opened' : ''}">
|
|
81
|
+
<dile-icon .icon=${this.icon}></dile-icon>
|
|
82
|
+
<span>
|
|
83
|
+
${this.label}
|
|
84
|
+
</span>
|
|
85
|
+
</nav>
|
|
86
|
+
<div id="content">
|
|
87
|
+
<div class="container">
|
|
88
|
+
<slot></slot>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
toggle() {
|
|
95
|
+
if (this.opened) {
|
|
96
|
+
this.close();
|
|
97
|
+
} else {
|
|
98
|
+
this.open();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
open() {
|
|
103
|
+
if(! this.opened) {
|
|
104
|
+
this.slideShow(this.content);
|
|
105
|
+
this.opened = true;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
close() {
|
|
110
|
+
if(this.opened) {
|
|
111
|
+
this.slideHide(this.content);
|
|
112
|
+
this.opened = false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -39,7 +39,7 @@ export class DileSlideShow extends DileSlideDown(LitElement) {
|
|
|
39
39
|
padding-top: 0.5em;
|
|
40
40
|
cursor: pointer;
|
|
41
41
|
text-align: var(--dile-slide-show-align-control, left);
|
|
42
|
-
font-size: var(--dile-slide-
|
|
42
|
+
font-size: var(--dile-slide-show-font-size, 1em);
|
|
43
43
|
color: var(--dile-slide-show-text-color, #39c);
|
|
44
44
|
font-weight: var(--dile-slide-show-font-weight, bold);
|
|
45
45
|
text-decoration: var(--dile-slide-show-text-decoration, none);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dile/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "UI Core components from dile-components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/Polydile/Components#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@dile/icons": "^2.0.
|
|
23
|
+
"@dile/icons": "^2.0.3",
|
|
24
24
|
"lit": "^2.7.0 || ^3.0.0"
|
|
25
25
|
},
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "7d521acefdc4edef45f7f4c3dd0f454013a9e75a"
|
|
30
30
|
}
|