aloha-vue 1.0.148 → 1.0.150

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.
@@ -47,6 +47,16 @@ export default {
47
47
  },
48
48
  icon: "EyeOpen",
49
49
  },
50
+ {
51
+ group: "Hola",
52
+ id: "cloak2",
53
+ label: "Cloak disabled",
54
+ to: {
55
+ name: "PageCloak",
56
+ },
57
+ icon: "EyeOpen",
58
+ disabled: true,
59
+ },
50
60
  {
51
61
  group: "Hola",
52
62
  id: "loading",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aloha-vue",
3
3
  "description": "Project aloha",
4
- "version": "1.0.148",
4
+ "version": "1.0.150",
5
5
  "author": "Ilia Brykin",
6
6
  "scripts": {
7
7
  "build-icons": "node scriptsNode/iconsSvgToJs.js bootstrap3 && node scriptsNode/iconsSvgToJs.js bootstrap-1-9-1"
@@ -76,6 +76,10 @@ export default {
76
76
  return undefined;
77
77
  });
78
78
 
79
+ const isLinkDisabled = computed(() => {
80
+ return !!item.value.disabled;
81
+ });
82
+
79
83
  const isLinkVisible = computed(() => {
80
84
  if (isLinkInSearchPanel.value) {
81
85
  return !!idsSearchVisible.value.rest[item.value[AKeyId]];
@@ -117,6 +121,17 @@ export default {
117
121
  return dataProParentChildren.value[id.value] && dataProParentChildren.value[id.value].length;
118
122
  });
119
123
 
124
+ const title = computed(() => {
125
+ return item.value.title || labelWithoutFilter.value;
126
+ });
127
+
128
+ const toLocal = computed(() => {
129
+ if (isLinkDisabled.value) {
130
+ return "#";
131
+ }
132
+ return item.value.to;
133
+ });
134
+
120
135
  const openSubMenu = () => {
121
136
  togglePanel({ parentId: id.value, isLinkInSearchPanel: isLinkInSearchPanel.value });
122
137
  setFocusToFirstLinkInPanel(id.value);
@@ -144,12 +159,15 @@ export default {
144
159
  countChildren,
145
160
  currentSlot,
146
161
  icon,
162
+ isLinkDisabled,
147
163
  isLinkTruncated,
148
164
  isLinkVisible,
149
165
  label,
150
166
  labelWithoutFilter,
151
167
  onKeydown,
152
168
  openSubMenu,
169
+ title,
170
+ toLocal,
153
171
  };
154
172
  },
155
173
  render() {
@@ -158,7 +176,7 @@ export default {
158
176
  }
159
177
  const ICON_AND_TEXT = [
160
178
  this.icon && h(AIcon, {
161
- class: "a_menu__link__icon",
179
+ class: ["a_menu__link__icon", this.item.iconClass],
162
180
  icon: this.icon,
163
181
  }),
164
182
  h("span", {
@@ -166,7 +184,7 @@ export default {
166
184
  }, [
167
185
  h("span", {
168
186
  class: "a_position_absolute_all",
169
- title: this.labelWithoutFilter,
187
+ title: this.title,
170
188
  ariaHidden: true,
171
189
  }),
172
190
  h("span", {
@@ -191,8 +209,10 @@ export default {
191
209
  }) :
192
210
  this.item.to ?
193
211
  h(resolveComponent("RouterLink"), {
194
- class: "a_menu__link a_menu__link__text_truncated",
195
- to: this.item.to,
212
+ class: ["a_menu__link a_menu__link__text_truncated", {
213
+ a_menu__link_disabled: this.isLinkDisabled,
214
+ }],
215
+ to: this.toLocal,
196
216
  tabindex: this.isPanelOpen ? 0 : -1,
197
217
  onClick: this.clickLink,
198
218
  }, () => ICON_AND_TEXT) :
@@ -193,6 +193,10 @@ $a_menu_breakpoint_mobile: 991px;
193
193
  box-shadow: inset 0 0 1px 4px var(--a_menu_icon_focus_shadow_color);
194
194
  }
195
195
  }
196
+ .a_menu__link_disabled {
197
+ opacity: .8;
198
+ cursor: not-allowed;
199
+ }
196
200
  .a_menu__link__text_truncated {
197
201
  text-overflow: ellipsis;
198
202
  white-space: nowrap;