@dile/ui 2.0.6 → 2.1.0
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/modal/src/DileModalHelp.js +16 -4
- 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 +5 -5
|
@@ -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';
|
|
@@ -13,14 +13,19 @@ export class DileModalHelp extends LitElement {
|
|
|
13
13
|
--dile-modal-height: auto;
|
|
14
14
|
--dile-modal-max-height: 95vh;
|
|
15
15
|
color: #303030;
|
|
16
|
+
--dile-icon-rounded-background-color: var(--dile-primary-color, #2962FF);
|
|
17
|
+
--dile-icon-color: var(--dile-modal-help-icon-color, #fff);
|
|
16
18
|
}
|
|
17
19
|
h1 {
|
|
18
20
|
margin: 0 0 1rem;
|
|
19
21
|
font-size: 1.5rem;
|
|
20
22
|
font-weight: 300;
|
|
21
|
-
color: var(--primary-dark-color);
|
|
23
|
+
color: var(--primary-dark-color, #303030);
|
|
22
24
|
padding-bottom: 0.5rem;
|
|
23
|
-
border-bottom: 1px solid var(--primary-color);
|
|
25
|
+
border-bottom: 1px solid var(--primary-color, #2962FF);
|
|
26
|
+
}
|
|
27
|
+
dile-icon {
|
|
28
|
+
cursor: pointer;
|
|
24
29
|
}
|
|
25
30
|
.content {
|
|
26
31
|
overflow: auto;
|
|
@@ -57,7 +62,7 @@ export class DileModalHelp extends LitElement {
|
|
|
57
62
|
render() {
|
|
58
63
|
return html`
|
|
59
64
|
${this.onlyIcon
|
|
60
|
-
? html`<dile-icon .icon=${this.icon} @click=${this.open}></dile-icon>`
|
|
65
|
+
? html`<dile-icon .icon=${this.icon} @click=${this.open} rounded></dile-icon>`
|
|
61
66
|
: html`
|
|
62
67
|
<dile-button-icon
|
|
63
68
|
.icon="${this.icon}"
|
|
@@ -77,7 +82,14 @@ export class DileModalHelp extends LitElement {
|
|
|
77
82
|
`;
|
|
78
83
|
}
|
|
79
84
|
|
|
85
|
+
get elmodal() {
|
|
86
|
+
return this.shadowRoot.getElementById('elmodal');
|
|
87
|
+
}
|
|
88
|
+
|
|
80
89
|
open() {
|
|
81
|
-
this.
|
|
90
|
+
this.elmodal.open();
|
|
91
|
+
}
|
|
92
|
+
close() {
|
|
93
|
+
this.elmodal.close();
|
|
82
94
|
}
|
|
83
95
|
}
|
|
@@ -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.1.0",
|
|
4
4
|
"description": "UI Core components from dile-components.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/Polydile/
|
|
11
|
+
"url": "git+https://github.com/Polydile/dile-components.git"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"ui"
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/Polydile/Components/issues"
|
|
20
20
|
},
|
|
21
|
-
"homepage": "https://
|
|
21
|
+
"homepage": "https://dile-components.polydile.com/",
|
|
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": "9d26c17d9855b73203b87535fd2a8b83c890b4cb"
|
|
30
30
|
}
|