@webitel/ui-sdk 3.1.54 → 3.1.55

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": "@webitel/ui-sdk",
3
- "version": "3.1.54",
3
+ "version": "3.1.55",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -34,6 +34,7 @@ import WtButtonSelect from './molecules/wt-button-select/wt-button-select.vue';
34
34
  import WtHint from './molecules/wt-hint/wt-hint.vue';
35
35
  import WtCopyAction from './molecules/wt-copy-action/wt-copy-action.vue';
36
36
  import WtLoadBar from './molecules/wt-load-bar/wt-load-bar.vue';
37
+ import WtItemLink from './molecules/wt-item-link/wt-item-link.vue';
37
38
 
38
39
  import WtAppHeader from './organisms/wt-app-header/wt-app-header.vue';
39
40
  import WtAppNavigator from './organisms/wt-app-header/wt-app-navigator.vue';
@@ -107,6 +108,7 @@ const Components = {
107
108
  WtLoadBar,
108
109
  WtIconAction,
109
110
  WtPageHeader,
111
+ WtItemLink,
110
112
  };
111
113
 
112
114
  export default Components;
@@ -0,0 +1,9 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import WtItemLink from '../wt-item-link.vue';
3
+
4
+ describe('WtItemLink', () => {
5
+ it('renders a component', () => {
6
+ const wrapper = shallowMount(WtItemLink);
7
+ expect(wrapper.exists()).toBe(true);
8
+ });
9
+ });
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <router-link
3
+ :target="target"
4
+ :to="to"
5
+ class="wt-item-link"
6
+ >
7
+ <slot></slot>
8
+ </router-link>
9
+ </template>
10
+
11
+ <script setup>
12
+ import { computed } from 'vue';
13
+
14
+ const props = defineProps({
15
+ link: {
16
+ type: [String, Object],
17
+ default: '',
18
+ },
19
+ target: {
20
+ type: String,
21
+ default: '_self',
22
+ },
23
+ routeName: {
24
+ type: String,
25
+ },
26
+ id: {
27
+ type: [String, Number],
28
+ },
29
+ });
30
+
31
+ const to = computed(() => props.link || {
32
+ name: `${props.routeName}-edit`,
33
+ params: { id: props.id },
34
+ });
35
+ </script>
36
+
37
+ <style lang="scss" scoped>
38
+ .wt-item-link {
39
+ display: flex;
40
+ align-items: center;
41
+ cursor: pointer;
42
+ transition: var(--transition);
43
+
44
+ &:hover {
45
+ text-decoration: underline;
46
+ }
47
+ }
48
+ </style>