@mptw/skylens-ui 1.4.39 → 1.4.41

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.
@@ -25,6 +25,7 @@
25
25
  SLSidebarNavGroupItem(
26
26
  v-else-if='item.navType === "group"'
27
27
  :nav-collapsed='closured'
28
+ :nav-dark='dark'
28
29
  :item-config='item'
29
30
  @click:item='onClickedItem'
30
31
  )
@@ -114,7 +115,7 @@ export default defineComponent({
114
115
  @apply relative flex flex-col s('w-[188px]') h-full bg-white rounded-r-lg shadow transition-all
115
116
 
116
117
  &.dark
117
- @apply bg-primary
118
+ @apply bg-primary-800
118
119
 
119
120
  &.closure
120
121
  .sidebar-logo
@@ -129,8 +130,10 @@ export default defineComponent({
129
130
  @apply s('lg:block')
130
131
 
131
132
  .sidebar-toggle
133
+ @apply bg-primary-900
134
+
132
135
  &:hover
133
- @apply bg-primary-300 text-white
136
+ @apply bg-primary-600
134
137
 
135
138
  .sidebar-logo
136
139
  .logo
@@ -162,10 +165,10 @@ export default defineComponent({
162
165
  @apply border-2 border-primary-600 bg-primary-300
163
166
 
164
167
  .sidebar-toggle
165
- @apply bg-primary-300 text-white
168
+ @apply bg-primary-900 text-white
166
169
 
167
170
  &:hover
168
- @apply bg-primary-25 text-primary
171
+ @apply bg-primary-600
169
172
 
170
173
  &.closure
171
174
  @apply s('-ml-[188px]')
@@ -184,12 +187,10 @@ export default defineComponent({
184
187
  @apply s('lg:block')
185
188
 
186
189
  .sidebar-toggle
187
- @apply bg-primary-600 text-white
188
- margin-right -20px
189
- border-radius 0px 12px 12px 0px
190
+ @apply s('-mr-5') bg-primary-300 rounded-l-none rounded-r-xl text-white
190
191
 
191
192
  &:hover
192
- @apply bg-primary-300 text-white
193
+ @apply bg-primary-400 text-white
193
194
 
194
195
  .icon-chevron-left
195
196
  @apply hidden
@@ -248,11 +249,7 @@ export default defineComponent({
248
249
  @apply border-2 border-primary-100
249
250
 
250
251
  &-toggle
251
- @apply absolute top-0 right-0 flex justify-center items-center bg-primary-50 text-sm text-primary-600 leading-none transition-all
252
- width 20px
253
- height 40px
254
- margin-top 10px
255
- border-radius 12px 0px 0px 12px
252
+ @apply absolute top-0 right-0 flex justify-center items-center w-5 h-10 s('mt-2.5') bg-primary-50 rounded-l-xl text-sm text-primary-500 leading-none transition-all
256
253
 
257
254
  &:hover
258
255
  @apply bg-primary-300 text-white
@@ -3,6 +3,7 @@
3
3
  SLSidebarNavGroupItemSection(
4
4
  v-for='(groupSection, i) in itemConfig.sections'
5
5
  :nav-collapsed='navCollapsed'
6
+ :nav-dark='navDark'
6
7
  :item-config='groupSection'
7
8
  :key='`${groupSection.code}-${i}`'
8
9
  )
@@ -19,6 +20,10 @@ export default defineComponent({
19
20
  type: Boolean,
20
21
  default: false,
21
22
  },
23
+ navDark: {
24
+ type: Boolean,
25
+ default: false,
26
+ },
22
27
  itemConfig: {
23
28
  type: Object as PropType<NavItemGroup>,
24
29
  required: true,
@@ -32,6 +37,10 @@ export default defineComponent({
32
37
  </script>
33
38
 
34
39
  <style lang="stylus">
40
+ .sidebar.dark
41
+ .sidebar-nav-group-item
42
+ @apply bg-primary-900
43
+
35
44
  .sidebar-nav-group-item
36
45
  @apply w-full mt-1 p-2 space-y-1 bg-primary-50 rounded-lg overflow-hidden
37
46
  </style>
@@ -43,7 +43,7 @@
43
43
  ClientOnly
44
44
  Teleport(to='#nav')
45
45
  .sidebar-nav-group-item-section-popup(
46
- :class='{ single: itemConfig.links.length === 0 }'
46
+ :class='{ single: itemConfig.links.length === 0, dark: navDark}'
47
47
  ref='popupEl'
48
48
  @mouseenter='onPopupMouseEnter'
49
49
  @mouseleave='onIconMouseLeave'
@@ -56,6 +56,8 @@
56
56
  .sidebar-nav-group-item-section-popup-link-title {{ itemConfig.title }}
57
57
  .sidebar-nav-group-item-section-popup-link-icon(v-if='itemConfig.status === "plus"')
58
58
  SLIcon(icon='add')
59
+ .sidebar-nav-group-item-section-popup-link-icon(v-else)
60
+ SLIcon(icon='sort-down')
59
61
  .sidebar-nav-group-item-section-popup-divide(v-if='itemConfig.links.length > 0')
60
62
  NuxtLink.sidebar-nav-group-item-section-popup-link(
61
63
  v-for='(link, i) in itemConfig.links'
@@ -81,6 +83,10 @@ export default defineComponent({
81
83
  type: Boolean,
82
84
  default: false,
83
85
  },
86
+ navDark: {
87
+ type: Boolean,
88
+ default: false,
89
+ },
84
90
  itemConfig: {
85
91
  type: Object as PropType<NavItemSection>,
86
92
  required: true,
@@ -362,6 +368,25 @@ export default defineComponent({
362
368
  &-right
363
369
  @apply s('lg:hidden')
364
370
 
371
+ .sidebar.dark
372
+ .sidebar-nav-group-item-section
373
+ &-header
374
+ @apply bg-primary-900 text-white
375
+ @apply s('hover:bg-primary')
376
+
377
+ &.active, &.router-link-exact-active
378
+ @apply bg-primary-600
379
+ @apply s('hover:bg-primary-600')
380
+
381
+ &-body
382
+ &-wrapper
383
+ .sidebar-nav-group-item-section-link
384
+ @apply bg-primary-900 text-white
385
+ @apply s('hover:bg-primary-800') s('active:bg-primary-600')
386
+
387
+ &.router-link-exact-active
388
+ @apply bg-primary-600
389
+ @apply s('hover:bg-primary-600')
365
390
 
366
391
  .sidebar-nav-group-item-section
367
392
  @apply flex flex-col
@@ -411,7 +436,32 @@ export default defineComponent({
411
436
  @apply s('hover:bg-primary-600') s('hover:text-white') s('hover:font-bold')
412
437
 
413
438
  .sidebar-nav-group-item-section-popup
414
- @apply flex-col p-2 space-y-1 bg-white rounded-lg overflow-hidden shadow-md hidden
439
+ @apply flex-col s('min-w-[142px]') p-2 space-y-1 bg-white rounded-lg overflow-hidden shadow-md hidden
440
+
441
+ &.dark
442
+ @apply bg-primary-900
443
+
444
+ &.single
445
+ .sidebar-nav-group-item-section-popup-link
446
+ &:hover
447
+ .sidebar-nav-group-item-section-popup-link-icon
448
+ @apply text-primary-500
449
+
450
+ &.router-link-exact-active, &:active
451
+ .sidebar-nav-group-item-section-popup-link-icon
452
+ @apply text-primary
453
+
454
+ &-icon
455
+ @apply text-primary-500
456
+
457
+ .sidebar-nav-group-item-section-popup-link
458
+ @apply bg-primary-900 text-white
459
+ @apply s('hover:bg-primary') s('active:bg-primary-600')
460
+
461
+ &.router-link-exact-active
462
+ @apply bg-primary-600
463
+ @apply s('hover:bg-primary-600')
464
+
415
465
 
416
466
  &[data-show]
417
467
  @apply flex
@@ -419,6 +469,9 @@ export default defineComponent({
419
469
  &.single
420
470
  @apply p-0
421
471
 
472
+ .sidebar-nav-group-item-section-popup-link
473
+ @apply py-2 pr-1 pl-2
474
+
422
475
  &-link
423
476
  @apply flex items-center justify-between flex-nowrap py-1 px-2 space-x-4 bg-white rounded-lg text-sm text-primary
424
477
  @apply s('hover:bg-primary-200') s('hover:font-bold') s('active:bg-primary-600') s('active:text-white') s('active:font-bold')
@@ -428,7 +481,7 @@ export default defineComponent({
428
481
  @apply s('hover:bg-primary-600') s('hover:text-white') s('hover:font-bold')
429
482
 
430
483
  &-icon
431
- @apply inline-flex
484
+ @apply inline-flex origin-center rotate-180
432
485
 
433
486
  &-divide
434
487
  @apply h-px bg-primary-200
@@ -2,7 +2,7 @@
2
2
  NuxtLink.sidebar-nav-link-item(
3
3
  :to='itemConfig.to ? itemConfig.to : "javascript:;"',
4
4
  :external='!itemConfig.to',
5
- :class='{ "sidebar-nav-link-item--home": itemConfig.to === "/application" }'
5
+ :class='{ "sidebar-nav-link-item--home": itemConfig.to === "/application", "router-link-active": linkActive }'
6
6
  ref='linkComp'
7
7
  @click='onClickedItem'
8
8
  )
@@ -75,6 +75,8 @@ export default defineComponent({
75
75
  },
76
76
  emits: ['click:item'],
77
77
  setup(props, { emit }) {
78
+ const route = useRoute();
79
+
78
80
  const { navCollapsed, itemConfig } = toRefs(props);
79
81
 
80
82
  const linkComp = shallowRef<NuxtLinkType | null>(null);
@@ -83,6 +85,19 @@ export default defineComponent({
83
85
  let popperInstance: PopperInstance | null = null;
84
86
  let popupHideTimeoutId: any = null;
85
87
 
88
+ const linkActive = computed(() => {
89
+ let linkActive = false;
90
+
91
+ itemConfig.value.include?.forEach((i) => {
92
+ const regexp = new RegExp(i);
93
+ if (regexp.test(route.path)) {
94
+ linkActive = true;
95
+ }
96
+ });
97
+
98
+ return linkActive;
99
+ });
100
+
86
101
  function showPopup() {
87
102
  if (
88
103
  !linkComp.value ||
@@ -191,6 +206,7 @@ export default defineComponent({
191
206
  return {
192
207
  linkComp,
193
208
  popupEl,
209
+ linkActive,
194
210
  onIconMouseEnter,
195
211
  onIconMouseLeave,
196
212
  onPopupMouseEnter,
@@ -211,6 +227,23 @@ export default defineComponent({
211
227
  &-right
212
228
  @apply s('lg:hidden')
213
229
 
230
+ .sidebar.dark
231
+ .sidebar-nav-link-item
232
+ @apply bg-primary-800 text-white
233
+ @apply s('hover:bg-primary') s('active:bg-primary-600')
234
+
235
+ &.router-link-exact-active, &.router-link-active
236
+ @apply bg-primary-600
237
+ @apply s('hover:bg-primary-600') s('active:bg-primary-600')
238
+
239
+ &.sidebar-nav-link-item--home.router-link-active
240
+ @apply bg-primary-800 text-white
241
+ @apply s('hover:bg-primary') s('active:bg-primary-600')
242
+
243
+ &.sidebar-nav-link-item--home.router-link-exact-active.router-link-active
244
+ @apply bg-primary-600
245
+ @apply s('hover:bg-primary-600') s('active:bg-primary-600')
246
+
214
247
  .sidebar-nav-link-item
215
248
  @apply flex items-center justify-start py-2 pr-3 pl-2 bg-white rounded-lg text-base text-primary
216
249
  @apply s('hover:bg-primary-200') s('hover:font-bold') s('active:bg-primary-600') s('active:text-white') s('active:font-bold')
@@ -46,6 +46,11 @@ export default defineComponent({
46
46
  .sidebar-nav-section-item
47
47
  @apply s('lg:items-center')
48
48
 
49
+ .sidebar.dark
50
+ .sidebar-nav-section-item
51
+ &-header
52
+ @apply text-secondary-200
53
+
49
54
  .sidebar-nav-section-item
50
55
  @apply flex flex-col space-y-1
51
56
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mptw/skylens-ui",
3
3
  "type": "module",
4
- "version": "1.4.39",
4
+ "version": "1.4.41",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",