@vc-shell/framework 1.0.43 → 1.0.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,6 +1,6 @@
1
1
  {
2
2
  "name": "@vc-shell/framework",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "main": "./dist/framework.js",
5
5
  "module": "./dist/framework.js",
6
6
  "types": "./dist/index.d.ts",
@@ -28,7 +28,8 @@
28
28
  "scripts": {
29
29
  "build": "vite build",
30
30
  "development": "vite build --watch -m development",
31
- "watch": "vite build --watch"
31
+ "watch": "vite build --watch",
32
+ "type-check": "vue-tsc --noEmit"
32
33
  },
33
34
  "dependencies": {
34
35
  "@popperjs/core": "^2.11.0",
@@ -50,8 +51,8 @@
50
51
  "devDependencies": {
51
52
  "@originjs/vite-plugin-commonjs": "^1.0.3",
52
53
  "@rollup/plugin-commonjs": "^21.0.2",
53
- "@vc-shell/api-client-generator": "^1.0.43",
54
- "@vc-shell/config-generator": "^1.0.43",
54
+ "@vc-shell/api-client-generator": "^1.0.45",
55
+ "@vc-shell/config-generator": "^1.0.45",
55
56
  "@vue-macros/volar": "^0.5.7",
56
57
  "sass": "^1.49.0",
57
58
  "typescript": "^4.6.2",
@@ -67,5 +68,5 @@
67
68
  "access": "public",
68
69
  "registry": "https://registry.npmjs.org/"
69
70
  },
70
- "gitHead": "18cd3e491a2ea3fc5ecdd4d434fe6f1601f0f2ca"
71
+ "gitHead": "f62c07e94d9486d3228c70855385cc7fad68274d"
71
72
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div
3
- class="tw-relative tw-h-full tw-flex tw-items-center tw-justify-center tw-ml-2 tw-mr-[15px] tw-shrink-0"
3
+ class="tw-relative tw-h-full tw-flex tw-items-center tw-justify-center tw-mx-2 tw-shrink-0"
4
4
  v-click-outside="onClose"
5
5
  >
6
6
  <button
@@ -3,56 +3,41 @@
3
3
  class="tw-relative tw-flex tw-items-center tw-content-between tw-h-[var(--app-bar-height)] tw-bg-[color:var(--app-bar-background-color)] tw-pl-4"
4
4
  >
5
5
  <slot name="appSwitcher"></slot>
6
- <!-- Logo container for mobile devices -->
7
- <template v-if="$isMobile.value">
8
- <!-- Show logo on mobile dashboard -->
6
+
7
+ <template v-if="!$isMobile.value || blades.length === 0">
8
+ <!-- Logo -->
9
9
  <img
10
- v-if="blades.length === 0"
11
- class="h-3/6 tw-cursor-pointer"
10
+ class="tw-h-1/2 tw-cursor-pointer tw-mx-3"
12
11
  alt="logo"
13
12
  :src="logo"
14
13
  @click="$emit('logo:click')"
15
14
  />
16
15
 
16
+ <!-- Title -->
17
+ <div
18
+ class="tw-text-[color:var(--app-bar-product-name-color)] tw-text-[length:var(--app-bar-product-name-size)] tw-font-medium"
19
+ v-if="title"
20
+ >
21
+ {{ title }}
22
+ </div>
23
+ </template>
24
+
25
+ <template v-if="$isMobile.value">
17
26
  <!-- Show blades name when at least one blade is opened -->
18
27
  <div
19
- v-else-if="blades.length === 1"
28
+ v-if="blades.length === 1"
20
29
  class="tw-overflow-ellipsis tw-overflow-hidden tw-whitespace-nowrap tw-text-2xl tw-leading-header"
21
30
  >
22
31
  {{ blades[0].title }}
23
32
  </div>
24
33
 
25
34
  <!-- Show back link when more than one blade is opened -->
26
- <VcLink v-else @click="$emit('backlink:click')">
35
+ <VcLink v-else-if="blades.length > 1" @click="$emit('backlink:click')">
27
36
  <VcIcon icon="fas fa-chevron-left" size="s"></VcIcon>
28
37
  <span class="tw-ml-2 tw-text-lg">{{ $t("Back") }}</span>
29
38
  </VcLink>
30
39
  </template>
31
40
 
32
- <!-- Logo container for desktop devices -->
33
- <template v-else>
34
- <img
35
- class="tw-h-3/6 tw-cursor-pointer"
36
- :src="logo"
37
- alt="logo"
38
- @click="$emit('logo:click')"
39
- />
40
- <div
41
- class="tw-text-[color:var(--app-bar-version-color)] tw-text-xs tw-ml-[30px]"
42
- @click="$emit('version:click')"
43
- >
44
- {{ version }}
45
- </div>
46
- </template>
47
-
48
- <!-- Product name slot -->
49
- <div
50
- class="tw-text-[color:var(--app-bar-product-name-color)] tw-text-[length:var(--app-bar-product-name-size)] tw-font-medium tw-ml-[30px]"
51
- v-if="title"
52
- >
53
- {{ title }}
54
- </div>
55
-
56
41
  <!-- Additional spacer -->
57
42
  <div class="tw-grow tw-basis-0 tw-basis-0"></div>
58
43
 
@@ -103,7 +88,6 @@ import { IBladeElement } from "@/shared";
103
88
 
104
89
  export interface Props {
105
90
  logo: string;
106
- version: string;
107
91
  blades: IBladeElement[];
108
92
  buttons: IBladeToolbar[];
109
93
  title?: string;
@@ -111,7 +95,6 @@ export interface Props {
111
95
 
112
96
  withDefaults(defineProps<Props>(), {
113
97
  logo: "",
114
- version: "",
115
98
  blades: () => [],
116
99
  buttons: () => [],
117
100
  });
@@ -119,7 +102,6 @@ withDefaults(defineProps<Props>(), {
119
102
  defineEmits([
120
103
  "logo:click",
121
104
  "backlink:click",
122
- "version:click",
123
105
  "toolbarbutton:click",
124
106
  "menubutton:click",
125
107
  ]);
@@ -135,7 +117,6 @@ defineEmits([
135
117
  --app-bar-button-background-color: var(--app-bar-background-color);
136
118
  --app-bar-button-color-hover: #34414f;
137
119
  --app-bar-button-background-color-hover: var(--app-bar-background-color);
138
- --app-bar-version-color: #838d9a;
139
120
  --app-bar-product-name-color: #34414f;
140
121
  --app-bar-product-name-size: 20px;
141
122
  }
@@ -28,7 +28,7 @@
28
28
 
29
29
  <!-- Show scrollable area with menu items -->
30
30
  <VcContainer :noPadding="true" class="tw-grow tw-basis-0">
31
- <div class="tw-gap-[5px] tw-flex tw-flex-col tw-px-4">
31
+ <div class="tw-gap-[5px] tw-flex tw-flex-col tw-px-4 tw-h-full">
32
32
  <template
33
33
  v-for="(item, index) in mobileMenuItems"
34
34
  :key="`info_item_${index}`"
@@ -38,7 +38,7 @@
38
38
  v-if="item.component"
39
39
  :is="item.component"
40
40
  v-bind="item.bladeOptions"
41
- class="tw-p-0 tw-mb-2 tw-w-full"
41
+ class="tw-p-0 tw-mb-2 tw-w-full tw-h-auto"
42
42
  ></component>
43
43
  </template>
44
44
  </template>
@@ -60,6 +60,12 @@
60
60
  "
61
61
  />
62
62
  </template>
63
+ <div
64
+ class="tw-text-[color:var(--app-menu-version-color)] tw-text-xs tw-mt-auto tw-self-center tw-p-1"
65
+ @click="$emit('version:click')"
66
+ >
67
+ {{ version }}
68
+ </div>
63
69
  </div>
64
70
  </VcContainer>
65
71
  </div>
@@ -76,15 +82,18 @@ import { IMenuClickEvent } from "@/shared";
76
82
  export interface Props {
77
83
  items?: IMenuItems[];
78
84
  mobileMenuItems?: IMenuItems[];
85
+ version: string;
79
86
  }
80
87
 
81
88
  export interface Emits {
82
89
  (event: "item:click", { item, navigationCb }: IMenuClickEvent): void;
90
+ (event: "version:click"): void;
83
91
  }
84
92
 
85
93
  withDefaults(defineProps<Props>(), {
86
94
  items: () => [],
87
95
  mobileMenuItems: () => [],
96
+ version: "",
88
97
  });
89
98
 
90
99
  defineEmits<Emits>();
@@ -100,6 +109,7 @@ defineExpose({
100
109
  :root {
101
110
  --app-menu-width: 230px;
102
111
  --app-menu-background-color: #ffffff;
112
+ --app-menu-version-color: #838d9a;
103
113
  }
104
114
 
105
115
  .vc-app-menu {
@@ -15,7 +15,6 @@
15
15
  class="tw-shrink-0"
16
16
  :logo="logo"
17
17
  :blades="bladesRefs"
18
- :version="version"
19
18
  :buttons="toolbarItems"
20
19
  @toolbarbutton:click="onToolbarButtonClick"
21
20
  @menubutton:click="$refs.menu.isMobileVisible = true"
@@ -34,6 +33,7 @@
34
33
  ref="menu"
35
34
  class="tw-shrink-0"
36
35
  :items="menuItems"
36
+ :version="version"
37
37
  :mobileMenuItems="mobileMenuItems"
38
38
  @item:click="onMenuItemClick"
39
39
  ></VcAppMenu>
@@ -65,7 +65,10 @@
65
65
  </template>
66
66
 
67
67
  <!-- Status icon cell -->
68
- <div v-else-if="cell.type === 'status-icon'" class= "tw-flex tw-justify-center">
68
+ <div
69
+ v-else-if="cell.type === 'status-icon'"
70
+ class="tw-flex tw-justify-center"
71
+ >
69
72
  <VcStatusIcon :status="value"></VcStatusIcon>
70
73
  </div>
71
74
 
@@ -102,12 +105,14 @@ const props = withDefaults(defineProps<Props>(), {
102
105
  });
103
106
 
104
107
  const locale = window.navigator.language;
105
- const value = computed(() =>
106
- (props.cell.field || props.cell.id)
108
+ const value = computed(() => {
109
+ return (props.cell.field || props.cell.id)
107
110
  .split(".")
108
- .reduce(
109
- (p: { [x: string]: unknown }, c: string) => (p && p[c]) || null,
110
- props.item
111
- )
112
- );
111
+ .reduce((p: { [x: string]: unknown }, c: string) => {
112
+ if (p && Array.isArray(p) && p.length) {
113
+ return (p && p[0][c]) || null;
114
+ }
115
+ return (p && p[c]) || null;
116
+ }, props.item);
117
+ });
113
118
  </script>