@weni/unnnic-system 1.26.0 → 1.26.2

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": "@weni/unnnic-system",
3
- "version": "1.26.0",
3
+ "version": "1.26.2",
4
4
  "main": "./dist/unnnic.common.js",
5
5
  "files": [
6
6
  "dist/*",
@@ -11,7 +11,7 @@
11
11
  size="ant"
12
12
  :scheme="active.item ? 'weni-600' : 'neutral-cloudy'"
13
13
  />
14
- <p :class="{ 'unnnic-sidebar-item__label': true, active: active.item }">
14
+ <p :class="{ 'unnnic-sidebar-item__label': true, active: active.item }" :title="item.label">
15
15
  {{ item.label }}
16
16
  </p>
17
17
  <Icon
@@ -48,6 +48,7 @@
48
48
  'unnnic-sidebar-item-child__label': true,
49
49
  active: isActive(childIndex),
50
50
  }"
51
+ :title="child.label"
51
52
  >
52
53
  {{ child.label }}
53
54
  </p>
@@ -74,6 +75,10 @@ export default {
74
75
  type: Object,
75
76
  default: () => ({ item: false, childIndex: null }),
76
77
  },
78
+ autoNavigateFirstChild: {
79
+ type: Boolean,
80
+ default: false,
81
+ },
77
82
  },
78
83
  data() {
79
84
  return {
@@ -94,6 +99,10 @@ export default {
94
99
  methods: {
95
100
  handleShowChildrenList() {
96
101
  this.showChildrenList = !this.showChildrenList;
102
+ const isOpening = this.showChildrenList;
103
+ if (isOpening && this.autoNavigateFirstChild) {
104
+ this.$emit('navigate', { item: this.item, child: this.item.children[0] });
105
+ }
97
106
  },
98
107
  isActive(paramChildIndex = null) {
99
108
  const { item, childIndex } = this.active;
@@ -155,6 +164,7 @@ export default {
155
164
  &__label {
156
165
  overflow: hidden;
157
166
  text-overflow: ellipsis;
167
+ white-space: nowrap;
158
168
 
159
169
  font-family: $unnnic-font-family-secondary;
160
170
  font-size: $unnnic-font-size-body-gt;
@@ -188,6 +198,7 @@ export default {
188
198
  &__label {
189
199
  overflow: hidden;
190
200
  text-overflow: ellipsis;
201
+ white-space: nowrap;
191
202
 
192
203
  font-family: $unnnic-font-family-secondary;
193
204
  font-size: $unnnic-font-size-body-gt;
@@ -16,6 +16,7 @@
16
16
  childIndex: active.childIndex,
17
17
  }"
18
18
  @navigate="handleNavigate($event)"
19
+ :autoNavigateFirstChild="autoNavigateFirstChild"
19
20
  />
20
21
  </li>
21
22
  </ul>
@@ -61,6 +62,10 @@ export default {
61
62
  type: Object,
62
63
  default: () => ({ itemIndex: null, childIndex: null }),
63
64
  },
65
+ autoNavigateFirstChild: {
66
+ type: Boolean,
67
+ default: false,
68
+ },
64
69
  },
65
70
  methods: {
66
71
  handleNavigate({ item, child }) {
@@ -82,8 +87,7 @@ export default {
82
87
  position: fixed;
83
88
 
84
89
  width: v-bind('width');
85
- height: 100vh;
86
- padding: $unnnic-spacing-sm;
90
+ height: 100%;
87
91
 
88
92
  &--left {
89
93
  border-top-left-radius: $unnnic-border-radius-md;
@@ -98,6 +102,23 @@ export default {
98
102
  flex-direction: column;
99
103
  list-style: none;
100
104
  gap: $unnnic-spacing-xs;
105
+ overflow-y: auto;
106
+ height: 100%;
107
+
108
+ &::-webkit-scrollbar {
109
+ width: $unnnic-spacing-inline-nano;
110
+ }
111
+
112
+ &::-webkit-scrollbar-thumb {
113
+ background: $unnnic-color-neutral-cleanest;
114
+ border-radius: $unnnic-border-radius-pill;
115
+ }
116
+
117
+ &::-webkit-scrollbar-track {
118
+ background: $unnnic-color-neutral-soft;
119
+ border-radius: $unnnic-border-radius-pill;
120
+
121
+ }
101
122
  }
102
123
  }
103
124
  </style>
@@ -8,14 +8,19 @@ const items = [
8
8
  {
9
9
  label: 'Item 2 Grouped',
10
10
  icon: 'forum',
11
+ children: [{ label: 'Child 1' }],
12
+ },
13
+ {
14
+ label: 'Item 3 Grouped',
15
+ icon: 'forum',
11
16
  children: [{ label: 'Child 1' }, { label: 'Child 2' }],
12
17
  },
13
18
  {
14
- label: 'Item 3',
19
+ label: 'Item 4',
15
20
  icon: 'tune',
16
21
  },
17
22
  {
18
- label: 'Item 4 Grouped icons',
23
+ label: 'Item 5 Grouped icons',
19
24
  icon: 'tune',
20
25
  children: [
21
26
  { label: 'Child 1', icon: 'abc' },
@@ -33,6 +38,7 @@ export default {
33
38
  },
34
39
  items: { control: { type: 'object' } },
35
40
  width: { control: { type: 'text' } },
41
+ autoNavigateFirstChild: { control: { type: 'boolean' } },
36
42
  },
37
43
  };
38
44
 
@@ -73,4 +79,5 @@ Default.args = {
73
79
  width: '300px',
74
80
  position: 'left',
75
81
  active: { itemIndex: 1, childIndex: 0 },
82
+ autoNavigateFirstChild: true,
76
83
  };