@iservice365/layer-common 0.0.2 → 0.0.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 0.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - e317a6b: replace icons
8
+
9
+ ## 0.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - ef16085: adjust services to navigation drawer
14
+
3
15
  ## 0.0.2
4
16
 
5
17
  ### Patch Changes
@@ -1,12 +1,7 @@
1
1
  <template>
2
2
  <v-app-bar scroll-behavior="elevate" scroll-threshold="200">
3
3
  <div style="width: 264px" class="ml-2">
4
- <nuxt-link
5
- class="text-h6 font-weight-medium text-decoration-none APP_NAME"
6
- :to="{ name: APP_NAME_ROUTE }"
7
- >
8
- {{ APP_NAME }}
9
- </nuxt-link>
4
+ <v-app-bar-nav-icon @click="drawer = !drawer"></v-app-bar-nav-icon>
10
5
  </div>
11
6
 
12
7
  <v-row no-gutters>
@@ -32,86 +27,6 @@
32
27
  @click="toggleTheme"
33
28
  />
34
29
 
35
- <v-menu offset="10px" :close-on-content-click="false">
36
- <template #activator="{ props }">
37
- <v-btn icon="mdi-dots-grid" variant="text" v-bind="props" />
38
- </template>
39
-
40
- <v-card
41
- width="380"
42
- max-height="400px"
43
- elevation="2"
44
- rounded="xl"
45
- class="pa-4"
46
- >
47
- <v-row no-gutters>
48
- <v-col cols="12">
49
- <v-card width="100%" variant="tonal" rounded="t-xl b-0">
50
- <v-row class="pa-4">
51
- <v-col cols="4">
52
- <v-btn
53
- prepend-icon="mdi-account"
54
- stacked
55
- rounded="xl"
56
- variant="text"
57
- class="text-capitalize text-subtitle-2"
58
- @click="redirect(APP_ACCOUNT, 'home')"
59
- >
60
- Account
61
- </v-btn>
62
- </v-col>
63
-
64
- <v-col cols="4">
65
- <v-btn
66
- prepend-icon="mdi-security"
67
- stacked
68
- rounded="xl"
69
- variant="text"
70
- class="text-capitalize text-subtitle-2"
71
- @click="redirect(APP_ADMIN, 'home')"
72
- >
73
- Admin
74
- </v-btn>
75
- </v-col>
76
- </v-row>
77
- </v-card>
78
- </v-col>
79
-
80
- <v-col cols=" 12" class="mt-2">
81
- <v-card
82
- width="100%"
83
- min-height="50px"
84
- variant="tonal"
85
- rounded="b-xl"
86
- >
87
- <v-card-title class="text-center pb-0"> Apps </v-card-title>
88
-
89
- <v-row no-gutters class="px-2 pb-2">
90
- <v-col
91
- v-for="item in apps"
92
- :key="item.title"
93
- cols="4"
94
- class="pa-2"
95
- >
96
- <v-btn
97
- stacked
98
- width="100%"
99
- :prepend-icon="item.icon"
100
- rounded="xl"
101
- variant="text"
102
- class="text-center text-capitalize text-caption"
103
- @click="redirect(item.link, item.landingPage)"
104
- >
105
- {{ item.title }}
106
- </v-btn>
107
- </v-col>
108
- </v-row>
109
- </v-card>
110
- </v-col>
111
- </v-row>
112
- </v-card>
113
- </v-menu>
114
-
115
30
  <v-menu offset="10px" :close-on-content-click="false">
116
31
  <template #activator="{ props }">
117
32
  <v-btn fab variant="text" icon v-bind="props" class="mx-2">
@@ -181,10 +96,11 @@ import { useTheme } from "vuetify";
181
96
 
182
97
  const search = defineModel("search", { type: String });
183
98
 
184
- const { redirect, apps } = useLocal();
99
+ const { drawer } = useLocal();
100
+
101
+ const { redirect } = useUtils();
185
102
 
186
- const { APP_ACCOUNT, APP_ADMIN, APP_NAME, APP_NAME_ROUTE } =
187
- useRuntimeConfig().public;
103
+ const { APP_ACCOUNT, APP_NAME, APP_NAME_ROUTE } = useRuntimeConfig().public;
188
104
 
189
105
  const theme = useTheme();
190
106
 
@@ -1,7 +1,19 @@
1
1
  <template>
2
- <v-navigation-drawer permanent floating class="pr-2">
2
+ <v-navigation-drawer
3
+ v-model="drawer"
4
+ permanent
5
+ floating
6
+ class="pr-2 bg-primary"
7
+ >
3
8
  <v-list>
4
- <slot name="action"/>
9
+ <v-list-item>
10
+ <v-list-item-content>
11
+ <v-list-item-title class="text-h6 text-white">
12
+ {{ APP_NAME }}
13
+ </v-list-item-title>
14
+ </v-list-item-content>
15
+ </v-list-item>
16
+ <slot name="action" />
5
17
  <template
6
18
  v-for="(navigationItem, navigationIndex) in props.navigationItems"
7
19
  :key="`${navigationItem.route.name}-${navigationIndex}`"
@@ -13,6 +25,21 @@
13
25
  :children="navigationItem.children"
14
26
  />
15
27
  </template>
28
+
29
+ <v-list-subheader>
30
+ <span class="font-weight-bold text-white">iService365 Services</span>
31
+ </v-list-subheader>
32
+ <template
33
+ v-for="(service, serviceIndex) in services"
34
+ :key="`${service.id}-${serviceIndex}`"
35
+ >
36
+ <NavigationItem
37
+ :name="`${service.id}-${serviceIndex}`"
38
+ :title="service.title"
39
+ :icon="service.icon"
40
+ :link="service.link"
41
+ />
42
+ </template>
16
43
  </v-list>
17
44
  </v-navigation-drawer>
18
45
  </template>
@@ -21,4 +48,43 @@
21
48
  const props = defineProps({
22
49
  navigationItems: { type: Array<TNavigationItem>, required: true },
23
50
  });
51
+
52
+ const { drawer } = useLocal();
53
+
54
+ const {
55
+ APP_NAME,
56
+ APP_SECURITY,
57
+ APP_HYGIENE,
58
+ APP_PROPERTY_MANAGEMENT,
59
+ APP_MECHANICAL_ELECTRICAL,
60
+ } = useRuntimeConfig().public;
61
+
62
+ const services = computed(() => {
63
+ return [
64
+ {
65
+ id: "security",
66
+ title: "Security",
67
+ icon: "mdi-shield",
68
+ link: APP_SECURITY,
69
+ },
70
+ {
71
+ id: "hygiene",
72
+ title: "Hygiene",
73
+ icon: "mdi-spray-bottle",
74
+ link: APP_HYGIENE,
75
+ },
76
+ {
77
+ id: "property-management",
78
+ title: "Property Management",
79
+ icon: "mdi-home-city-outline",
80
+ link: APP_PROPERTY_MANAGEMENT,
81
+ },
82
+ {
83
+ id: "mechanical-electrical",
84
+ title: "Mechanical & Electrical",
85
+ icon: "mdi-tools",
86
+ link: APP_MECHANICAL_ELECTRICAL,
87
+ },
88
+ ];
89
+ });
24
90
  </script>
@@ -22,7 +22,8 @@
22
22
  </v-list-group>
23
23
 
24
24
  <v-list-item
25
- v-else
25
+ v-if="props.route.name"
26
+ :key="props.name"
26
27
  :prepend-icon="icon"
27
28
  :to="props.route"
28
29
  rounded="e-pill"
@@ -30,6 +31,17 @@
30
31
  >
31
32
  {{ title }}
32
33
  </v-list-item>
34
+
35
+ <v-list-item
36
+ v-if="props.link"
37
+ :key="props.name"
38
+ :prepend-icon="icon"
39
+ :href="props.link"
40
+ rounded="e-pill"
41
+ class="text-subtitle-2"
42
+ >
43
+ {{ title }}
44
+ </v-list-item>
33
45
  </template>
34
46
 
35
47
  <script setup lang="ts">
@@ -50,10 +62,20 @@ const props = defineProps({
50
62
  return { name: "", params: {} };
51
63
  },
52
64
  },
65
+ link: {
66
+ type: String,
67
+ required: false,
68
+ default: "",
69
+ },
53
70
  children: {
54
71
  type: Array<TNavigationItem>,
55
72
  required: false,
56
73
  default: () => [],
57
74
  },
75
+ name: {
76
+ type: String,
77
+ required: false,
78
+ default: "",
79
+ },
58
80
  });
59
81
  </script>
package/nuxt.config.ts CHANGED
@@ -21,6 +21,12 @@ export default defineNuxtConfig({
21
21
  APP_ACCOUNT: (process.env.APP_ACCOUNT as string) ?? "",
22
22
  APP_ADMIN: (process.env.APP_ADMIN as string) ?? "",
23
23
  APP_ORG: (process.env.APP_ORG as string) ?? "",
24
+ APP_HYGIENE: (process.env.APP_HYGIENE as string) ?? "",
25
+ APP_SECURITY: (process.env.APP_SECURITY as string) ?? "",
26
+ APP_PROPERTY_MANAGEMENT:
27
+ (process.env.APP_PROPERTY_MANAGEMENT as string) ?? "",
28
+ APP_MECHANICAL_ELECTRICAL:
29
+ (process.env.APP_MECHANICAL_ELECTRICAL as string) ?? "",
24
30
  },
25
31
  },
26
32
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@iservice365/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "0.0.2",
5
+ "version": "0.0.4",
6
6
  "main": "./nuxt.config.ts",
7
7
  "publishConfig": {
8
8
  "access": "public"