shared-ritm 1.2.43 → 1.2.45
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,146 +1,148 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<q-expansion-item
|
|
3
|
-
v-if="item.items"
|
|
4
|
-
:model-value="isRouteActive(item) && expand"
|
|
5
|
-
header-class="text-purple"
|
|
6
|
-
:class="[$style['menu-item'], { 'expansion-item-active': isRouteActive(item) && minify }]"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
transition-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
:
|
|
32
|
-
:
|
|
33
|
-
:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
v-
|
|
39
|
-
|
|
40
|
-
:
|
|
41
|
-
active
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
font-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<q-expansion-item
|
|
3
|
+
v-if="item.items"
|
|
4
|
+
:model-value="isRouteActive(item) && expand"
|
|
5
|
+
header-class="text-purple"
|
|
6
|
+
:class="[$style['menu-item'], { 'expansion-item-active': isRouteActive(item) && minify }]"
|
|
7
|
+
:data-test="`sidebar-expansion-item-${(item.name || 'unnamed').toLowerCase().replace(/\s+/g, '-')}`"
|
|
8
|
+
@update:model-value="expand = $event"
|
|
9
|
+
>
|
|
10
|
+
<template #header>
|
|
11
|
+
<q-tooltip
|
|
12
|
+
v-if="minify"
|
|
13
|
+
:delay="100"
|
|
14
|
+
transition-show="jump-right"
|
|
15
|
+
transition-hide="jump-left"
|
|
16
|
+
anchor="center right"
|
|
17
|
+
self="center left"
|
|
18
|
+
>
|
|
19
|
+
{{ item.label }}
|
|
20
|
+
</q-tooltip>
|
|
21
|
+
|
|
22
|
+
<q-item-section v-if="item.icon" avatar>
|
|
23
|
+
<app-icon :name="item.icon" color="white" size="24px" />
|
|
24
|
+
</q-item-section>
|
|
25
|
+
|
|
26
|
+
<q-item-section :class="$style['menu-item__label']">{{ item.label }}</q-item-section>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<sidebar-menu-item
|
|
30
|
+
v-for="(subItem, index) in item.items"
|
|
31
|
+
:key="index"
|
|
32
|
+
:item="subItem"
|
|
33
|
+
:main="main"
|
|
34
|
+
:is-route-active="isRouteActive"
|
|
35
|
+
/>
|
|
36
|
+
</q-expansion-item>
|
|
37
|
+
<q-item
|
|
38
|
+
v-else-if="item.name !== 'sign-out'"
|
|
39
|
+
v-ripple
|
|
40
|
+
:class="$style['menu-item']"
|
|
41
|
+
:active="isRouteActive(item)"
|
|
42
|
+
active-class="menu-active"
|
|
43
|
+
clickable
|
|
44
|
+
:to="main ? item.to : ''"
|
|
45
|
+
:data-test="`sidebar-item-${item.name.toLowerCase().replace(/\s+/g, '-')}`"
|
|
46
|
+
@click="goToRoute(item.to)"
|
|
47
|
+
>
|
|
48
|
+
<q-item-section v-if="item.icon" avatar>
|
|
49
|
+
<app-icon :name="item.icon" color="white" size="24px" />
|
|
50
|
+
</q-item-section>
|
|
51
|
+
|
|
52
|
+
<q-item-section :class="$style['menu-item__label']">
|
|
53
|
+
<p>{{ item.label }}</p>
|
|
54
|
+
</q-item-section>
|
|
55
|
+
<q-tooltip
|
|
56
|
+
:delay="100"
|
|
57
|
+
transition-show="jump-right"
|
|
58
|
+
transition-hide="jump-left"
|
|
59
|
+
anchor="center right"
|
|
60
|
+
self="center left"
|
|
61
|
+
>
|
|
62
|
+
{{ item.label }}
|
|
63
|
+
</q-tooltip>
|
|
64
|
+
</q-item>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script lang="ts" setup>
|
|
68
|
+
import { defineProps, ref } from 'vue'
|
|
69
|
+
import AppIcon from '@/common/app-icon/AppIcon.vue'
|
|
70
|
+
|
|
71
|
+
interface Props {
|
|
72
|
+
minify?: boolean
|
|
73
|
+
main: boolean
|
|
74
|
+
isRouteActive: (item: any) => boolean
|
|
75
|
+
item: {
|
|
76
|
+
name: string
|
|
77
|
+
label: string
|
|
78
|
+
icon: string
|
|
79
|
+
href: string
|
|
80
|
+
to: string
|
|
81
|
+
items: any[]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const emits = defineEmits(['goToRoute'])
|
|
86
|
+
const props = defineProps<Props>()
|
|
87
|
+
|
|
88
|
+
const expand = ref(true)
|
|
89
|
+
|
|
90
|
+
const goToRoute = (to: string) => {
|
|
91
|
+
if (!props.main) window.location.href = to
|
|
92
|
+
}
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<style lang="scss" scoped>
|
|
96
|
+
.expansion-item-active {
|
|
97
|
+
background: rgba(243, 249, 253, 0.1);
|
|
98
|
+
border-radius: 10px;
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
101
|
+
|
|
102
|
+
<style lang="scss" module>
|
|
103
|
+
.menu-item {
|
|
104
|
+
margin: 0 8px;
|
|
105
|
+
&:global(.menu-active) {
|
|
106
|
+
border-radius: 10px;
|
|
107
|
+
background: rgba(243, 249, 253, 0.1);
|
|
108
|
+
}
|
|
109
|
+
:global(.q-item__section--avatar) {
|
|
110
|
+
min-width: 24px;
|
|
111
|
+
padding-right: 14px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:global(.q-expansion-item__content .q-item) {
|
|
115
|
+
padding-left: 20px;
|
|
116
|
+
}
|
|
117
|
+
:global(.q-item__section--main ~ .q-item__section--side) {
|
|
118
|
+
color: white;
|
|
119
|
+
}
|
|
120
|
+
&__label {
|
|
121
|
+
color: #fff;
|
|
122
|
+
font-family: 'Nunito Sans', sans-serif;
|
|
123
|
+
font-size: 16px;
|
|
124
|
+
font-weight: 300;
|
|
125
|
+
p {
|
|
126
|
+
display: inline-block;
|
|
127
|
+
max-width: 160px;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
overflow: hidden;
|
|
130
|
+
text-overflow: ellipsis;
|
|
131
|
+
margin: 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@media (max-width: 1440px) {
|
|
137
|
+
.menu-item {
|
|
138
|
+
margin: 0 4px;
|
|
139
|
+
:global(.q-item__section--avatar) {
|
|
140
|
+
min-width: 24px;
|
|
141
|
+
padding-right: 10px;
|
|
142
|
+
}
|
|
143
|
+
&__label {
|
|
144
|
+
font-size: 14px;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
</style>
|