dlg-ui 1.0.4 → 1.0.6
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/addon/components/navbar.hbs +10 -5
- package/addon/components/navbar.js +10 -0
- package/addon/components/radio.js +17 -17
- package/addon/styles/addon.css +143 -129
- package/package.json +1 -1
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
<div class='navbar-wrapper'>
|
|
2
2
|
<div class='navbar-container'>
|
|
3
|
-
<div
|
|
4
|
-
|
|
3
|
+
<div
|
|
4
|
+
class='navbar-title cursor-pointer'
|
|
5
|
+
{{on 'click' (fn this.onSelect this.homeRoute)}}
|
|
6
|
+
>
|
|
7
|
+
{{this.title}}
|
|
5
8
|
</div>
|
|
6
9
|
<div class='navbar-elements'>
|
|
7
10
|
{{#each this.navbarOptions as |option|}}
|
|
8
11
|
{{#if (eq option.type 'link')}}
|
|
9
12
|
<div
|
|
10
|
-
class='navbar-selection'
|
|
13
|
+
class='navbar-selection cursor-pointer'
|
|
11
14
|
{{on 'click' (fn this.onSelect option)}}
|
|
12
15
|
>
|
|
13
16
|
{{option.label}}
|
|
14
17
|
</div>
|
|
15
18
|
{{/if}}
|
|
16
19
|
{{#if (eq option.type 'dropdown')}}
|
|
17
|
-
<div class='navbar-selection'>
|
|
20
|
+
<div class='navbar-selection cursor-pointer'>
|
|
18
21
|
<HeaderDropdown
|
|
19
22
|
@class='navbar-dropdown'
|
|
20
23
|
@options={{option.dropdownOptions}}
|
|
@@ -29,6 +32,8 @@
|
|
|
29
32
|
</div>
|
|
30
33
|
</div>
|
|
31
34
|
<div class='navbar-yield'>
|
|
32
|
-
|
|
35
|
+
<div class='navbar-body'>
|
|
36
|
+
{{yield}}
|
|
37
|
+
</div>
|
|
33
38
|
</div>
|
|
34
39
|
</div>
|
|
@@ -5,6 +5,16 @@ import { service } from '@ember/service';
|
|
|
5
5
|
export default class NavbarComponent extends Component {
|
|
6
6
|
@service router;
|
|
7
7
|
|
|
8
|
+
get title() {
|
|
9
|
+
return this.args.title || 'dlg-ui';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get homeRoute() {
|
|
13
|
+
return {
|
|
14
|
+
route: this.args.homeRoute || 'index',
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
8
18
|
get navbarOptions() {
|
|
9
19
|
let options = this.args.options;
|
|
10
20
|
return options.sort((a, b) => b.index - a.index);
|
|
@@ -3,23 +3,23 @@ import { action } from '@ember/object';
|
|
|
3
3
|
import { tracked } from '@glimmer/tracking';
|
|
4
4
|
|
|
5
5
|
export default class RadioComponent extends Component {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
@tracked
|
|
7
|
+
selectedOption = this.args.defaultOption || {};
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
get options() {
|
|
10
|
+
let options = [];
|
|
11
|
+
this.args.options.forEach((option) => {
|
|
12
|
+
if (option.label === this.selectedOption.label) {
|
|
13
|
+
option.isChecked = true;
|
|
14
|
+
}
|
|
15
|
+
options.push(option);
|
|
16
|
+
});
|
|
17
|
+
return this.args.options || [];
|
|
18
|
+
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
@action
|
|
21
|
+
onChange(option) {
|
|
22
|
+
this.selectedOption = option;
|
|
23
|
+
this.args.onChange(option);
|
|
24
|
+
}
|
|
25
25
|
}
|
package/addon/styles/addon.css
CHANGED
|
@@ -1,211 +1,225 @@
|
|
|
1
|
+
.cursor-pointer {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
.dropdown-option {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
border-bottom-style: solid;
|
|
7
|
+
border-width: 2px;
|
|
8
|
+
width: 100%;
|
|
9
|
+
padding-left: 8px;
|
|
10
|
+
padding-right: 8px;
|
|
11
|
+
padding-top: 6px;
|
|
12
|
+
padding-bottom: 6px;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
cursor: pointer;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
.dropdown-option:hover {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
background-color: black;
|
|
19
|
+
color: white;
|
|
20
|
+
border: black;
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
.dropdown-options {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
white-space: normal;
|
|
25
|
+
overflow-wrap: break-word;
|
|
26
|
+
border-style: solid;
|
|
27
|
+
border-top-style: none;
|
|
28
|
+
border-bottom-style: none;
|
|
29
|
+
border-width: 2px;
|
|
30
|
+
background-color: #f6f6f6;
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
.dropdown-placeholder {
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
font-style: italic;
|
|
35
|
+
color: #444;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
38
|
.dropdown-select {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
width: 100%;
|
|
40
|
+
padding-left: 8px;
|
|
41
|
+
padding-top: 8px;
|
|
42
|
+
padding-bottom: 8px;
|
|
43
|
+
padding-right: 20px;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
position: relative;
|
|
46
|
+
overflow: hidden;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
text-overflow: ellipsis;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
border-style: solid;
|
|
51
|
+
border-width: 2px;
|
|
52
|
+
background-color: #eee;
|
|
53
|
+
user-select: none;
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
.dropdown-select::after {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
content: '\25BC';
|
|
58
|
+
display: block;
|
|
59
|
+
position: absolute;
|
|
60
|
+
right: 0px;
|
|
61
|
+
top: 50%;
|
|
62
|
+
right: 8px;
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
transition: transform 0.3s ease;
|
|
65
|
+
top: 25%;
|
|
62
66
|
}
|
|
63
67
|
|
|
64
68
|
.dropdown-select.open::after {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
transform: rotate(-180deg);
|
|
70
|
+
transform-origin: center;
|
|
71
|
+
padding-right: 0px;
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
.dropdown-wrapper {
|
|
71
|
-
|
|
75
|
+
width: 100%;
|
|
72
76
|
}
|
|
73
77
|
|
|
74
78
|
.header-dropdown-options {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
white-space: normal;
|
|
80
|
+
overflow-wrap: break-word;
|
|
81
|
+
border-style: solid;
|
|
82
|
+
border-top-style: none;
|
|
83
|
+
border-bottom-style: none;
|
|
84
|
+
border-width: 2px;
|
|
85
|
+
background-color: #f6f6f6;
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
.header-dropdown-options.open {
|
|
85
|
-
|
|
89
|
+
border-top-style: solid;
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
.header-dropdown-select {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
width: fit-content;
|
|
94
|
+
max-width: 100%;
|
|
95
|
+
padding-top: 8px;
|
|
96
|
+
padding-bottom: 2px;
|
|
97
|
+
padding-right: 25px;
|
|
98
|
+
box-sizing: border-box;
|
|
99
|
+
position: relative;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
white-space: nowrap;
|
|
102
|
+
text-overflow: ellipsis;
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
border-bottom-style: solid;
|
|
105
|
+
border-width: 2px;
|
|
106
|
+
user-select: none;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
.header-dropdown-select.open {
|
|
106
|
-
|
|
110
|
+
border-bottom-style: none;
|
|
107
111
|
}
|
|
108
112
|
|
|
109
113
|
.header-dropdown-select::after {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
content: '\25BE';
|
|
115
|
+
display: block;
|
|
116
|
+
position: absolute;
|
|
117
|
+
right: 0px;
|
|
118
|
+
top: 20%;
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
transition: transform 0.3s ease;
|
|
121
|
+
font-size: 1.5rem;
|
|
118
122
|
}
|
|
119
123
|
|
|
120
124
|
.header-dropdown-select.open::after {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
transform: rotate(-180deg);
|
|
126
|
+
transform-origin: center;
|
|
127
|
+
padding-right: 0px;
|
|
128
|
+
top: 16%;
|
|
125
129
|
}
|
|
126
130
|
|
|
127
131
|
.header-dropdown-selected {
|
|
128
|
-
|
|
132
|
+
font-weight: bold;
|
|
129
133
|
}
|
|
130
134
|
|
|
131
135
|
.header-dropdown-wrapper {
|
|
132
|
-
|
|
136
|
+
width: 100%;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.navbar-body {
|
|
140
|
+
flex: 1 1 auto;
|
|
141
|
+
padding: 0 1em;
|
|
133
142
|
}
|
|
134
143
|
|
|
135
144
|
.navbar-container {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
background-color: #eee;
|
|
146
|
+
position: sticky;
|
|
147
|
+
top: 0;
|
|
148
|
+
left: 0;
|
|
149
|
+
min-height: 5vh;
|
|
150
|
+
height: fit-content;
|
|
151
|
+
display: flex;
|
|
152
|
+
justify-content: space-between;
|
|
153
|
+
align-items: center;
|
|
154
|
+
z-index: 10;
|
|
155
|
+
padding: 0 1em;
|
|
147
156
|
}
|
|
148
157
|
|
|
149
158
|
.navbar-dropdown .header-dropdown-options {
|
|
150
|
-
|
|
151
|
-
|
|
159
|
+
position: absolute;
|
|
160
|
+
min-width: 60px !important;
|
|
152
161
|
}
|
|
153
162
|
|
|
154
163
|
.navbar-dropdown .header-dropdown-select {
|
|
155
|
-
|
|
156
|
-
|
|
164
|
+
padding-top: 0px;
|
|
165
|
+
border-bottom-style: none;
|
|
157
166
|
}
|
|
158
167
|
|
|
159
168
|
.navbar-dropdown .header-dropdown-select::after {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
169
|
+
top: 0;
|
|
170
|
+
height: 100%;
|
|
171
|
+
display: flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
padding-top: 2px;
|
|
165
174
|
}
|
|
166
175
|
|
|
167
176
|
.navbar-dropdown .header-dropdown-selected {
|
|
168
|
-
|
|
177
|
+
font-weight: normal;
|
|
169
178
|
}
|
|
170
179
|
|
|
171
180
|
.navbar-elements {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
margin-right: 10px;
|
|
181
|
+
display: flex;
|
|
182
|
+
flex-wrap: wrap;
|
|
183
|
+
width: fit-content;
|
|
176
184
|
}
|
|
177
185
|
|
|
178
186
|
.navbar-selection {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
187
|
+
margin: 8px;
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.navbar-selection:last-child {
|
|
193
|
+
margin-right: 0;
|
|
182
194
|
}
|
|
183
195
|
|
|
184
196
|
.navbar-title {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
197
|
+
font-size: clamp(20px, 3vw, 30px);
|
|
198
|
+
margin-right: 1em;
|
|
199
|
+
width: fit-content;
|
|
200
|
+
white-space: nowrap;
|
|
201
|
+
font-weight: bold;
|
|
190
202
|
}
|
|
191
203
|
|
|
192
204
|
.navbar-wrapper {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
min-height: 100vh;
|
|
196
208
|
}
|
|
197
209
|
|
|
198
210
|
.navbar-yield {
|
|
199
|
-
|
|
200
|
-
|
|
211
|
+
display: flex;
|
|
212
|
+
justify-content: center;
|
|
213
|
+
flex: 1 1 auto;
|
|
214
|
+
padding-top: 8px;
|
|
201
215
|
}
|
|
202
216
|
|
|
203
217
|
.radio-label {
|
|
204
|
-
|
|
218
|
+
font-weight: bold;
|
|
205
219
|
}
|
|
206
220
|
|
|
207
221
|
.radio-options {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
222
|
+
display: flex;
|
|
223
|
+
flex-direction: column;
|
|
224
|
+
margin: 5px 0px 5px 0px;
|
|
225
|
+
}
|