dlg-ui 1.0.3 → 1.0.5

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.
@@ -1,20 +1,23 @@
1
1
  <div class='navbar-wrapper'>
2
2
  <div class='navbar-container'>
3
- <div class='navbar-title'>
4
- dlg-ui
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}}
@@ -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);
@@ -24,10 +34,10 @@ export default class NavbarComponent extends Component {
24
34
  if (this.args.onSelect) {
25
35
  this.args.onSelect(value);
26
36
  }
27
- if (!this.args.preventDefault && !this.value.param) {
37
+ if (!this.args.preventDefault && !value.param) {
28
38
  this.router.transitionTo(value.route);
29
- } else if (!this.args.preventDefault && this.value.param) {
30
- this.router.transitionTo(value.route, this.value.param);
39
+ } else if (!this.args.preventDefault && value.param) {
40
+ this.router.transitionTo(value.route, value.param);
31
41
  }
32
42
  }
33
43
  }
@@ -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
- @tracked
7
- selectedOption = this.args.defaultOption || {};
6
+ @tracked
7
+ selectedOption = this.args.defaultOption || {};
8
8
 
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
- }
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
- @action
21
- onChange(option) {
22
- this.selectedOption = option;
23
- this.args.onChange(option);
24
- }
20
+ @action
21
+ onChange(option) {
22
+ this.selectedOption = option;
23
+ this.args.onChange(option);
24
+ }
25
25
  }
@@ -1,211 +1,215 @@
1
+ .cursor-pointer {
2
+ cursor: pointer;
3
+ }
4
+
1
5
  .dropdown-option {
2
- border-bottom-style: solid;
3
- border-width: 2px;
4
- width: 100%;
5
- padding-left: 8px;
6
- padding-right: 8px;
7
- padding-top: 6px;
8
- padding-bottom: 6px;
9
- box-sizing: border-box;
10
- cursor: pointer;
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
- background-color: black;
15
- color: white;
16
- border: black;
18
+ background-color: black;
19
+ color: white;
20
+ border: black;
17
21
  }
18
22
 
19
23
  .dropdown-options {
20
- white-space: normal;
21
- overflow-wrap: break-word;
22
- border-style: solid;
23
- border-top-style: none;
24
- border-bottom-style: none;
25
- border-width: 2px;
26
- background-color: #f6f6f6;
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
- font-style: italic;
31
- color: #444;
34
+ font-style: italic;
35
+ color: #444;
32
36
  }
33
37
 
34
38
  .dropdown-select {
35
- width: 100%;
36
- padding-left: 8px;
37
- padding-top: 8px;
38
- padding-bottom: 8px;
39
- padding-right: 20px;
40
- box-sizing: border-box;
41
- position: relative;
42
- overflow: hidden;
43
- white-space: nowrap;
44
- text-overflow: ellipsis;
45
- cursor: pointer;
46
- border-style: solid;
47
- border-width: 2px;
48
- background-color: #eee;
49
- user-select: none;
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
- content: "\25BC";
54
- display: block;
55
- position: absolute;
56
- right: 0px;
57
- top: 50%;
58
- right: 8px;
59
- pointer-events: none;
60
- transition: transform 0.3s ease;
61
- top: 25%;
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
- transform: rotate(-180deg);
66
- transform-origin: center;
67
- padding-right: 0px;
69
+ transform: rotate(-180deg);
70
+ transform-origin: center;
71
+ padding-right: 0px;
68
72
  }
69
73
 
70
74
  .dropdown-wrapper {
71
- width: 100%;
75
+ width: 100%;
72
76
  }
73
77
 
74
78
  .header-dropdown-options {
75
- white-space: normal;
76
- overflow-wrap: break-word;
77
- border-style: solid;
78
- border-top-style: none;
79
- border-bottom-style: none;
80
- border-width: 2px;
81
- background-color: #f6f6f6;
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
- border-top-style: solid;
89
+ border-top-style: solid;
86
90
  }
87
91
 
88
92
  .header-dropdown-select {
89
- width: fit-content;
90
- max-width: 100%;
91
- padding-top: 8px;
92
- padding-bottom: 2px;
93
- padding-right: 25px;
94
- box-sizing: border-box;
95
- position: relative;
96
- overflow: hidden;
97
- white-space: nowrap;
98
- text-overflow: ellipsis;
99
- cursor: pointer;
100
- border-bottom-style: solid;
101
- border-width: 2px;
102
- user-select: none;
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
- border-bottom-style: none;
110
+ border-bottom-style: none;
107
111
  }
108
112
 
109
113
  .header-dropdown-select::after {
110
- content: "\25BE";
111
- display: block;
112
- position: absolute;
113
- right: 0px;
114
- top: 20%;
115
- pointer-events: none;
116
- transition: transform 0.3s ease;
117
- font-size: 1.5rem;
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
- transform: rotate(-180deg);
122
- transform-origin: center;
123
- padding-right: 0px;
124
- top: 16%;
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
- font-weight: bold;
132
+ font-weight: bold;
129
133
  }
130
134
 
131
135
  .header-dropdown-wrapper {
132
- width: 100%;
136
+ width: 100%;
133
137
  }
134
138
 
135
139
  .navbar-container {
136
- background-color: #eee;
137
- position: sticky;
138
- top: 0;
139
- left: 0;
140
- width: 100%;
141
- min-height: 5vh;
142
- height: fit-content;
143
- display: flex;
144
- justify-content: space-between;
145
- align-items: center;
146
- z-index: 10;
140
+ background-color: #eee;
141
+ position: sticky;
142
+ top: 0;
143
+ left: 0;
144
+ width: 100%;
145
+ min-height: 5vh;
146
+ height: fit-content;
147
+ display: flex;
148
+ justify-content: space-between;
149
+ align-items: center;
150
+ z-index: 10;
147
151
  }
148
152
 
149
153
  .navbar-dropdown .header-dropdown-options {
150
- position: absolute;
151
- min-width: 60px !important;
154
+ position: absolute;
155
+ min-width: 60px !important;
152
156
  }
153
157
 
154
158
  .navbar-dropdown .header-dropdown-select {
155
- padding-top: 0px;
156
- border-bottom-style: none;
159
+ padding-top: 0px;
160
+ border-bottom-style: none;
157
161
  }
158
162
 
159
163
  .navbar-dropdown .header-dropdown-select::after {
160
- top: 0;
161
- height: 100%;
162
- display: flex;
163
- align-items: center;
164
- padding-top: 2px;
164
+ top: 0;
165
+ height: 100%;
166
+ display: flex;
167
+ align-items: center;
168
+ padding-top: 2px;
165
169
  }
166
170
 
167
171
  .navbar-dropdown .header-dropdown-selected {
168
- font-weight: normal;
172
+ font-weight: normal;
169
173
  }
170
174
 
171
175
  .navbar-elements {
172
- display: flex;
173
- flex-wrap: wrap;
174
- width: fit-content;
175
- margin-right: 10px;
176
+ display: flex;
177
+ flex-wrap: wrap;
178
+ width: fit-content;
179
+ margin-right: 10px;
176
180
  }
177
181
 
178
182
  .navbar-selection {
179
- margin: 8px;
180
- display: flex;
181
- align-items: center;
183
+ margin: 8px;
184
+ display: flex;
185
+ align-items: center;
182
186
  }
183
187
 
184
188
  .navbar-title {
185
- font-size: clamp(20px, 3vw, 30px);
186
- margin: 0px 8px 0px 8px;
187
- width: fit-content;
188
- white-space: nowrap;
189
- font-weight: bold;
189
+ font-size: clamp(20px, 3vw, 30px);
190
+ margin: 0px 8px 0px 8px;
191
+ width: fit-content;
192
+ white-space: nowrap;
193
+ font-weight: bold;
190
194
  }
191
195
 
192
196
  .navbar-wrapper {
193
- display: flex;
194
- flex-direction: column;
195
- min-height: 100vh;
197
+ display: flex;
198
+ flex-direction: column;
199
+ min-height: 100vh;
196
200
  }
197
201
 
198
202
  .navbar-yield {
199
- flex: 1 1 auto;
200
- padding-top: 8px;
203
+ flex: 1 1 auto;
204
+ padding-top: 8px;
201
205
  }
202
206
 
203
207
  .radio-label {
204
- font-weight: bold;
208
+ font-weight: bold;
205
209
  }
206
210
 
207
211
  .radio-options {
208
- display: flex;
209
- flex-direction: column;
210
- margin: 5px 0px 5px 0px;
211
- }
212
+ display: flex;
213
+ flex-direction: column;
214
+ margin: 5px 0px 5px 0px;
215
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlg-ui",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "The default blueprint for ember-cli addons.",
5
5
  "keywords": [
6
6
  "ember-addon"