@nixweb/nixloc-ui 0.0.291 → 0.0.292

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nixweb/nixloc-ui",
3
- "version": "0.0.291",
3
+ "version": "0.0.292",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -0,0 +1,136 @@
1
+ <template>
2
+ <div>
3
+ <div class="icon-logout" @click="execute">
4
+ <i class="fa-solid fa-right-from-bracket"></i>
5
+ </div>
6
+ <div class="profile-container" v-if="hideShow">
7
+ <div class="item-header text-center">
8
+ <span>Conta</span>
9
+ </div>
10
+ <div class="profile-content" v-for="item in items" :key="item.title">
11
+ <div class="item-content" @click="navegateTo(item.routeName)">
12
+ <div class="title-container">
13
+ <span>
14
+ <i :class="item.classIcon"></i>
15
+ <span class="title-profile title-input">{{ item.title }}</span>
16
+ </span>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ <div class="profile-content" @click="execute">
21
+ <div class="item-content">
22
+ <div class="title-container">
23
+ <span>
24
+ <i class="fas fa-sign-in"></i>
25
+ <span class="title-profile title-input">Sair</span>
26
+ </span>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </template>
33
+ <script>
34
+ export default {
35
+ name: "Account",
36
+ props: {
37
+ items: [],
38
+ exited: Function,
39
+ },
40
+ data() {
41
+ return {
42
+ hideShow: false,
43
+ };
44
+ },
45
+ methods: {
46
+ navegateTo(routeName) {
47
+ this.$router.push({ name: routeName });
48
+ this.hideShow = false;
49
+ },
50
+ execute() {
51
+ if (this.exited) this.exited();
52
+ },
53
+ },
54
+ };
55
+ </script>
56
+ <style scoped>
57
+ .icon-logout {
58
+ padding-left: 12px;
59
+ padding-top: 2px;
60
+ margin-top: -43px;
61
+ margin-right: 28px;
62
+ cursor: pointer;
63
+ position: fixed;
64
+ float: right;
65
+ left: auto;
66
+ right: 0;
67
+ width: 40px;
68
+ height: 40px;
69
+ border-radius: 12px;
70
+ color: #3D4EAE;
71
+ font-size: 22px;
72
+ }
73
+
74
+ img {
75
+ border-radius: 50%;
76
+ height: 40px;
77
+ width: 40px;
78
+ }
79
+
80
+ .profile-container {
81
+ position: fixed;
82
+ float: right;
83
+ left: auto;
84
+ right: 0;
85
+ margin-right: 20px;
86
+ height: 100%;
87
+ z-index: 1000;
88
+ width: 190px;
89
+ margin-top: 26px;
90
+ background-color: white;
91
+ height: auto;
92
+ border-bottom: 1px solid #e9ebec;
93
+ }
94
+
95
+ .profile-content {
96
+ right: 0;
97
+ height: 100%;
98
+ z-index: 101;
99
+ width: 190px;
100
+ height: auto;
101
+ }
102
+
103
+ .item-header {
104
+ padding: 8px 20px;
105
+ background: #f8f8f8;
106
+ border-left: 1px solid #e9ebec;
107
+ border-right: 1px solid #e9ebec;
108
+ border-top: 1px solid #e9ebec;
109
+ }
110
+
111
+ .item-content {
112
+ padding-left: 15px;
113
+ height: 45px;
114
+ background: white;
115
+ border: 1px solid #e9ebec;
116
+ border-bottom: 0px solid #e9ebec;
117
+ cursor: pointer;
118
+ }
119
+
120
+ .item-content:hover {
121
+ background: #f8f8f8;
122
+ }
123
+
124
+ .title-container {
125
+ padding-top: 10px;
126
+ }
127
+
128
+ .title-container:hover {
129
+ padding-top: 10px;
130
+ color: #37597c;
131
+ }
132
+
133
+ .title-profile {
134
+ padding-left: 10px;
135
+ }
136
+ </style>
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <div>
3
+ <div :class="['top', { collapsed: isSidebarCollapsed }]" :style="'background-color:' + backgroundColor">
4
+ <div class="side-by-side top-space">
5
+ <slot></slot>
6
+ </div>
7
+ </div>
8
+ <br />
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+
14
+ import { mapGetters } from "vuex";
15
+
16
+ export default {
17
+ name: "Top",
18
+ props: {
19
+ backgroundColor: {
20
+ type: String,
21
+ default: "#4680A5",
22
+ },
23
+ },
24
+ data() {
25
+ return {
26
+ isSidebarCollapsed: false
27
+ }
28
+ },
29
+ computed: {
30
+ ...mapGetters("generic", ["event"]),
31
+ },
32
+ watch: {
33
+ event: {
34
+ handler(event) {
35
+ if (event.name == "isSidebarCollapsed") {
36
+ this.isSidebarCollapsed = event.data;
37
+ }
38
+ },
39
+ deep: true,
40
+ },
41
+ },
42
+ };
43
+ </script>
44
+
45
+ <style scoped>
46
+ .top {
47
+ padding-top: 4px;
48
+ left: 298px;
49
+ right: 10px;
50
+ height: 55px;
51
+ top: 5px;
52
+ border-radius: 18px;
53
+ border-bottom: 0px solid #eff0f1;
54
+ box-shadow: 0px 10px 30px -6px rgb(0 0 0 / 10%);
55
+ position: fixed;
56
+ transition: all 0.3s ease;
57
+ z-index: 100;
58
+ }
59
+
60
+ .top.collapsed {
61
+ left: 110px;
62
+ }
63
+ </style>
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <div>
3
+ <div v-for="icon in icons" class="molded-icon side-by-side" @click="executeEvent(icon.eventName)" v-b-tooltip.hover
4
+ :title="icon.tooltip">
5
+ <div class="icon-molded-icon" :class="{
6
+ 'icon-active-top': menuActive == icon.module,
7
+ 'icon-normal-top': menuActive != icon.module,
8
+ }">
9
+ <i :class="icon.icon"></i>
10
+ </div>
11
+ </div>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+ import { mapMutations } from "vuex";
17
+
18
+ export default {
19
+ name: "IconMolded",
20
+ props: {
21
+ icons: Array,
22
+ },
23
+ data() {
24
+ return { menuActive: "" };
25
+ },
26
+ methods: {
27
+ ...mapMutations("generic", ["addEvent"]),
28
+ executeEvent(eventName) {
29
+ this.addEvent({
30
+ name: eventName,
31
+ });
32
+ },
33
+ },
34
+ watch: {
35
+ $route: {
36
+ handler: function (router) {
37
+ this.menuActive = router.matched[0].props.default.module;
38
+ },
39
+ deep: true,
40
+ },
41
+ },
42
+ };
43
+ </script>
44
+
45
+ <style scoped>
46
+ .molded-icon {
47
+ height: 38px;
48
+ width: 38px;
49
+ margin-left: 10px;
50
+ margin-top: 4px;
51
+ cursor: pointer;
52
+
53
+ }
54
+
55
+ .icon-molded-icon {
56
+ font-size: 20px;
57
+ margin-left: 10px;
58
+ color: #2c3453 !important;
59
+ }
60
+ </style>
@@ -0,0 +1,419 @@
1
+ <template>
2
+ <div>
3
+ <div :class="['sidebar', { collapsed: isSidebarCollapsed }]">
4
+ <div class="sidebar-header">
5
+ <span class="header-logo">
6
+ <img src="https://espaco.blob.core.windows.net/nixloc-photo-user/E29W4HNYQG_10.png"
7
+ alt="CodingNepal" />
8
+ </span>
9
+ <button class="sidebar-toggler" @click="toggleSidebar">
10
+ <span class="material-symbols-rounded icon-menu-arrow">
11
+ <i class="fa-solid fa-angle-left"></i>
12
+ </span>
13
+ </button>
14
+ </div>
15
+
16
+ <div :class="{ sub: isSidebarCollapsed }">
17
+ <div v-for="(item, index) in menuFilter(true)">
18
+ <div>
19
+ <div v-if="isSidebarCollapsed" class="molded-icon text-center"
20
+ @mouseover="handleMouseOver(item.title, item.module)">
21
+ <i :class="item.icon"></i>
22
+ </div>
23
+ <div class="molded-icon-open" v-else @click="toggleSubMenu(item.title, item.module)">
24
+ <b-row>
25
+ <b-col sm="1">
26
+ <i :class="item.icon"></i>
27
+ </b-col>
28
+ <b-col sm="8">
29
+ <span class="title-menu">{{ item.title }} </span>
30
+ </b-col>
31
+ <b-col sm="1">
32
+ <div>
33
+ <i v-if="titleSubMenu == item.title" class="fa-sharp fa-solid fa-angle-down"
34
+ :class="{ 'rotate': titleSubMenu == item.title }"></i>
35
+
36
+ <i v-else class="fa-sharp fa-solid fa-angle-down"
37
+ :class="{ 'rotate-down': titleSubMenu != item.title }"></i>
38
+ </div>
39
+ </b-col>
40
+ </b-row>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ <transition name="slide-fade">
46
+ <div class="sub-menu" v-if="!isSidebarCollapsed && titleSubMenu == item.title">
47
+ <div v-for="(item, index) in subMenuFilter(false)" :key="index">
48
+ <div v-if="item.title" class="sub-menu-title" @click.prevent="navegateTo(item)">
49
+ <b-row>
50
+ <b-col sm="3"> <i :class="item.icon"></i></b-col>
51
+ <span> {{ item.title }}</span>
52
+ </b-row>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </transition>
57
+
58
+ <transition name="slide-fade">
59
+ <div class="sub-menu-collapsed sub-menu" @mouseleave="handleMouseLeave"
60
+ v-if="isSidebarCollapsed && titleSubMenuCollapsed == item.title">
61
+ <div v-for="(item, index) in subMenuFilter(false)" :key="index">
62
+ <div v-if="item.title" class="sub-menu-title-collapsed"
63
+ @click.prevent="navegateTo(item)">
64
+ <b-row>
65
+ <b-col sm="3"> <i :class="item.icon"></i></b-col>
66
+ <span> {{ item.title }}</span>
67
+ </b-row>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </transition>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </template>
77
+
78
+ <script>
79
+
80
+ import { mapState, mapMutations, mapGetters } from "vuex";
81
+
82
+ export default {
83
+ data() {
84
+ return {
85
+ module: "",
86
+ isSidebarCollapsed: false,
87
+ openDropdowns: {},
88
+ titleSubMenu: "",
89
+ titleSubMenuCollapsed: "",
90
+ };
91
+ },
92
+ computed: {
93
+ ...mapState("user", ["menu", "userLogged"]),
94
+ ...mapGetters("generic", ["event"]),
95
+ },
96
+ methods: {
97
+ ...mapMutations("generic", ["addEvent"]),
98
+ toggleSidebar() {
99
+ this.isSidebarCollapsed = !this.isSidebarCollapsed;
100
+ this.addEvent({ name: "isSidebarCollapsed", data: this.isSidebarCollapsed });
101
+ this.titleSubMenu = "";
102
+ this.titleSubMenuCollapsed = "";
103
+ },
104
+ toggleSubMenu(title, module) {
105
+ this.module = module;
106
+ if (this.titleSubMenu === title) {
107
+ this.titleSubMenu = "";
108
+ } else {
109
+ this.titleSubMenu = title;
110
+ }
111
+ },
112
+ handleMouseOver(title, module) {
113
+ this.module = module;
114
+ this.titleSubMenuCollapsed = title;
115
+ },
116
+ handleMouseLeave() {
117
+ this.titleSubMenuCollapsed = "";
118
+ },
119
+ menuFilter(isModule) {
120
+ let filter = [];
121
+ this.menu.items.forEach(function (obj) {
122
+ if (obj.isModule == isModule) filter.push(obj);
123
+ });
124
+ return filter.sort((a, b) => a.order - b.order);
125
+ },
126
+ subMenuFilter(isModule) {
127
+ let filter = [];
128
+ let self = this;
129
+ let userLogged = this.userLogged.user.userName;
130
+ this.menu.items.forEach(function (obj) {
131
+ if (obj.isModule == isModule && obj.module === self.module) {
132
+ if (obj.isVisible == "all") filter.push(obj);
133
+
134
+ if (obj.isVisible == "support" && userLogged == "UserTemp")
135
+ filter.push(obj);
136
+ }
137
+ });
138
+ return filter;
139
+ },
140
+ navegateTo(item) {
141
+ this.$router.push({
142
+ name: item.routeName,
143
+ });
144
+ this.titleSubMenu = "";
145
+ this.titleSubMenuCollapsed = "";
146
+ },
147
+ },
148
+ };
149
+ </script>
150
+
151
+ <style scoped>
152
+ .sidebar {
153
+ position: fixed;
154
+ top: 0;
155
+ left: 0;
156
+ z-index: 10;
157
+ width: 270px;
158
+ height: 100vh;
159
+ background: #577696;
160
+ transition: all 0.4s ease;
161
+ }
162
+
163
+ .sidebar.collapsed {
164
+ width: 85px;
165
+ }
166
+
167
+ .sidebar .sidebar-header {
168
+ display: flex;
169
+ position: relative;
170
+ padding: 10px 20px;
171
+ align-items: center;
172
+ justify-content: space-between;
173
+ }
174
+
175
+ .sidebar-header .header-logo img {
176
+ width: 46px;
177
+ height: 46px;
178
+ display: block;
179
+ object-fit: contain;
180
+ border-radius: 50%;
181
+ }
182
+
183
+ .sidebar-header .sidebar-toggler,
184
+ .sidebar-menu-button {
185
+ position: absolute;
186
+ right: 20px;
187
+ height: 35px;
188
+ width: 35px;
189
+ color: #151A2D;
190
+ border: none;
191
+ cursor: pointer;
192
+ display: flex;
193
+ background: #EEF2FF;
194
+ align-items: center;
195
+ justify-content: center;
196
+ border-radius: 8px;
197
+ transition: 0.4s ease;
198
+ }
199
+
200
+ .sidebar.collapsed .sidebar-header .sidebar-toggler {
201
+ transform: translate(-4px, 65px);
202
+ }
203
+
204
+ .sidebar-header .sidebar-toggler span,
205
+ .sidebar-menu-button span {
206
+ font-size: 1.75rem;
207
+ transition: 0.4s ease;
208
+ }
209
+
210
+ .sidebar.collapsed .sidebar-header .sidebar-toggler span {
211
+ transform: rotate(180deg);
212
+ }
213
+
214
+ .sidebar-header .sidebar-toggler:hover {
215
+ background: #d9e1fd;
216
+ }
217
+
218
+ .sidebar-nav .nav-list {
219
+ list-style: none;
220
+ display: flex;
221
+ gap: 4px;
222
+ padding: 0 15px;
223
+ flex-direction: column;
224
+ transform: translateY(15px);
225
+ transition: 0.4s ease;
226
+ }
227
+
228
+ .sidebar .sidebar-nav .primary-nav {
229
+ overflow-y: auto;
230
+ scrollbar-width: thin;
231
+ padding-bottom: 20px;
232
+ height: calc(100vh - 227px);
233
+ scrollbar-color: transparent transparent;
234
+ }
235
+
236
+ .sidebar .sidebar-nav .primary-nav:hover {
237
+ scrollbar-color: #EEF2FF transparent;
238
+ }
239
+
240
+ .sidebar.collapsed .sidebar-nav .primary-nav {
241
+ overflow: unset;
242
+ transform: translateY(65px);
243
+ }
244
+
245
+ .sidebar-nav .nav-item .nav-link {
246
+ color: #fff;
247
+ display: flex;
248
+ gap: 12px;
249
+ white-space: nowrap;
250
+ border-radius: 8px;
251
+ padding: 11px 15px;
252
+ align-items: center;
253
+ text-decoration: none;
254
+ border: 1px solid #151A2D;
255
+ transition: 0.4s ease;
256
+ }
257
+
258
+ .sidebar-nav .nav-item:is(:hover, .open)>.nav-link:not(.dropdown-title) {
259
+ color: #151A2D;
260
+ background: #EEF2FF;
261
+ }
262
+
263
+ .sidebar .nav-link .nav-label {
264
+ transition: opacity 0.3s ease;
265
+ color: white;
266
+ }
267
+
268
+ .sidebar.collapsed .nav-link :where(.nav-label, .dropdown-icon) {
269
+ opacity: 0;
270
+ pointer-events: none;
271
+ }
272
+
273
+ .sidebar.collapsed .nav-link .dropdown-icon {
274
+ transition: opacity 0.3s 0s ease;
275
+ }
276
+
277
+ .sidebar-nav .secondary-nav {
278
+ position: absolute;
279
+ bottom: 35px;
280
+ width: 100%;
281
+ background: #151A2D;
282
+ }
283
+
284
+ .sidebar-nav .nav-item {
285
+ position: relative;
286
+ }
287
+
288
+
289
+ .icon-menu-arrow {
290
+ font-size: 18px !important;
291
+ margin-top: 1px !important;
292
+ }
293
+
294
+ .molded-icon-open {
295
+ padding-left: 10px;
296
+ cursor: pointer;
297
+ margin-top: 10px;
298
+ color: white;
299
+ font-size: 17px;
300
+ margin: 15px;
301
+ border-radius: 10px;
302
+ transition: all 0.3s ease;
303
+ }
304
+
305
+ .molded-icon-open:hover {
306
+ color: #2C3453;
307
+ background-color: white;
308
+ }
309
+
310
+ .molded-icon {
311
+ cursor: pointer;
312
+ margin-top: 10px;
313
+ color: white;
314
+ font-size: 18px;
315
+ margin: 15px;
316
+ border-radius: 10px;
317
+ transition: all 0.3s ease;
318
+ }
319
+
320
+ .molded-icon:hover {
321
+ background-color: white;
322
+ color: #2C3453;
323
+ margin: 15px;
324
+ border-radius: 8px;
325
+ transition: all 0.8s ease;
326
+ }
327
+
328
+ .sub {
329
+ margin-top: 70px;
330
+ cursor: pointer;
331
+ transition: all 0.3s ease;
332
+ }
333
+
334
+ .sub-menu {
335
+ margin: 15px;
336
+ padding: 10px;
337
+ border-radius: 15px;
338
+ color: white;
339
+ font-size: 14px;
340
+ background-color: #2C3453;
341
+ transition: all 0.5s ease;
342
+ }
343
+
344
+ .sub-menu-title {
345
+ cursor: pointer;
346
+ border-radius: 8px;
347
+ padding: 5px;
348
+ transition: all 1s ease;
349
+ }
350
+
351
+ .sub-menu-title:hover {
352
+ padding: 5px;
353
+ color: #2C3453;
354
+ background-color: white;
355
+ font-weight: bold;
356
+ transition: all 0.8s ease;
357
+ }
358
+
359
+ .sub-menu-collapsed {
360
+ width: 260px;
361
+ margin-top: -50px;
362
+ margin-left: 85px;
363
+ position: fixed;
364
+ border-radius: 0px 15px 15px 0px;
365
+ background-color: #2C3453;
366
+ }
367
+
368
+ .sub-menu-title-collapsed {
369
+ padding: 10px;
370
+ border-radius: 8px;
371
+ }
372
+
373
+ .sub-menu-title-collapsed:hover {
374
+ background-color: white;
375
+ color: #2C3453;
376
+ transition: all 0.8s ease;
377
+ }
378
+
379
+ .rotate {
380
+ transform: rotate(180deg);
381
+ transition: transform 0.5s ease;
382
+ }
383
+
384
+ .rotate-down {
385
+ transform: rotate(360deg);
386
+ transition: transform 0.5s ease;
387
+ }
388
+
389
+ .title-menu {
390
+ font-size: 14px;
391
+ padding: 20px;
392
+ }
393
+
394
+ .div-arrow {
395
+ margin-left: 50px;
396
+ }
397
+
398
+ .div-menu-bottom {
399
+ position: absolute;
400
+ bottom: 0;
401
+ left: 0;
402
+ width: 100%;
403
+ padding: 10px;
404
+ }
405
+
406
+ .div-icon-bottom {
407
+ cursor: pointer;
408
+ font-size: 17px;
409
+ color: white;
410
+ border-radius: 10px;
411
+ background-color: #2C3453;
412
+ }
413
+
414
+ .title-logout {
415
+ font-size: 16px;
416
+ margin-left: 10px;
417
+ }
418
+
419
+ </style>