aloha-vue 1.0.149 → 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.149",
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]];
@@ -121,6 +125,13 @@ export default {
121
125
  return item.value.title || labelWithoutFilter.value;
122
126
  });
123
127
 
128
+ const toLocal = computed(() => {
129
+ if (isLinkDisabled.value) {
130
+ return "#";
131
+ }
132
+ return item.value.to;
133
+ });
134
+
124
135
  const openSubMenu = () => {
125
136
  togglePanel({ parentId: id.value, isLinkInSearchPanel: isLinkInSearchPanel.value });
126
137
  setFocusToFirstLinkInPanel(id.value);
@@ -148,6 +159,7 @@ export default {
148
159
  countChildren,
149
160
  currentSlot,
150
161
  icon,
162
+ isLinkDisabled,
151
163
  isLinkTruncated,
152
164
  isLinkVisible,
153
165
  label,
@@ -155,6 +167,7 @@ export default {
155
167
  onKeydown,
156
168
  openSubMenu,
157
169
  title,
170
+ toLocal,
158
171
  };
159
172
  },
160
173
  render() {
@@ -196,8 +209,10 @@ export default {
196
209
  }) :
197
210
  this.item.to ?
198
211
  h(resolveComponent("RouterLink"), {
199
- class: "a_menu__link a_menu__link__text_truncated",
200
- 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,
201
216
  tabindex: this.isPanelOpen ? 0 : -1,
202
217
  onClick: this.clickLink,
203
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;