@iservice365/layer-common 1.5.2 → 1.5.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.
@@ -3,7 +3,7 @@
3
3
  <v-toolbar>
4
4
  <v-row no-gutters class="fill-height px-6" align="center">
5
5
  <span class="font-weight-bold text-h5 text-capitalize">
6
- {{ prop.mode }} {{ prop.type === 'visitor' ? 'Guest' : prop.type }}
6
+ {{ prop.mode }} {{ prop.type }}
7
7
  </span>
8
8
  </v-row>
9
9
  </v-toolbar>
@@ -0,0 +1,292 @@
1
+ <template>
2
+ <v-row no-gutters>
3
+ <v-col cols="12" lg="12">
4
+ <TableMain
5
+ :title="`Units`"
6
+ :items="items"
7
+ :headers="headers"
8
+ :loading="loading"
9
+ :show-header="true"
10
+ v-model:page="page"
11
+ :pages="pages"
12
+ :pageRange="pageRange"
13
+ :no-data-text="`No supplies found.`"
14
+ @refresh="updatePage"
15
+ :canCreate="true"
16
+ createLabel="Add Supply"
17
+ @row-click="tableRowClickHandler"
18
+ >
19
+ <template #actions>
20
+ <v-row no-gutters align="center" class="w-100">
21
+ <v-col cols="auto">
22
+ <v-btn
23
+ class="text-none"
24
+ rounded="pill"
25
+ variant="tonal"
26
+ size="large"
27
+ >
28
+ Add Supply
29
+ </v-btn>
30
+ </v-col>
31
+
32
+ <v-spacer />
33
+
34
+ <v-col cols="auto">
35
+ <v-text-field
36
+ v-model="searchText"
37
+ density="compact"
38
+ placeholder="Search"
39
+ clearable
40
+ width="300"
41
+ append-inner-icon="mdi-magnify"
42
+ hide-details
43
+ />
44
+ </v-col>
45
+ </v-row>
46
+ </template>
47
+
48
+ <template #item.block="{ value }">
49
+ {{ value ? `blk ${value}` : "" }}
50
+ </template>
51
+ </TableMain>
52
+ </v-col>
53
+ </v-row>
54
+ </template>
55
+ <script setup lang="ts">
56
+ const searchText = ref("");
57
+ const loading = ref(false);
58
+
59
+ const page = ref(1);
60
+ const pages = ref(0);
61
+ const pageRange = ref("-- - -- of --");
62
+ const items = ref<Array<Record<string, any>>>([]);
63
+
64
+ const headers: Array<Record<string, any>> = [
65
+ { title: "Item", value: "item", align: "start" },
66
+ // { title: "Type", value: "type", align: "start" },
67
+ // { title: "Created By", value: "createdByName", align: "start" },
68
+ // { title: "Last Updated", value: "lastUpdated", align: "start" },
69
+ // { title: "Available Qty", value: "availableQty", align: "start" },
70
+ { title: "Stock Qty", value: "stockQty", align: "start" },
71
+ { title: "", value: "action-table", align: "end" },
72
+ ];
73
+
74
+ watchEffect(() => {
75
+ items.value = [
76
+ {
77
+ item: "Multi-Surface Cleaner",
78
+ type: "Consumable",
79
+ createdByName: "John Reyes",
80
+ lastUpdated: "2025-11-20",
81
+ availableQty: 45,
82
+ stockQty: 100,
83
+ },
84
+ {
85
+ item: "Disinfectant Spray",
86
+ type: "Consumable",
87
+ createdByName: "Marianne Santos",
88
+ lastUpdated: "2025-11-18",
89
+ availableQty: 30,
90
+ stockQty: 80,
91
+ },
92
+ {
93
+ item: "Glass Cleaner",
94
+ type: "Consumable",
95
+ createdByName: "Evan Lim",
96
+ lastUpdated: "2025-11-22",
97
+ availableQty: 60,
98
+ stockQty: 120,
99
+ },
100
+ {
101
+ item: "Floor Degreaser",
102
+ type: "Consumable",
103
+ createdByName: "Kristine Tan",
104
+ lastUpdated: "2025-11-21",
105
+ availableQty: 20,
106
+ stockQty: 50,
107
+ },
108
+ {
109
+ item: "Microfiber Cloth",
110
+ type: "Equipment",
111
+ createdByName: "Angela Chua",
112
+ lastUpdated: "2025-11-22",
113
+ availableQty: 120,
114
+ stockQty: 200,
115
+ },
116
+ {
117
+ item: "Toilet Brush",
118
+ type: "Equipment",
119
+ createdByName: "Miguel Perez",
120
+ lastUpdated: "2025-11-19",
121
+ availableQty: 15,
122
+ stockQty: 40,
123
+ },
124
+ {
125
+ item: "Mop Head Refill",
126
+ type: "Consumable",
127
+ createdByName: "Sarah Ong",
128
+ lastUpdated: "2025-11-23",
129
+ availableQty: 50,
130
+ stockQty: 100,
131
+ },
132
+ {
133
+ item: "Cleaning Mop Set",
134
+ type: "Equipment",
135
+ createdByName: "Jenny Ramos",
136
+ lastUpdated: "2025-11-21",
137
+ availableQty: 10,
138
+ stockQty: 25,
139
+ },
140
+ {
141
+ item: "Trash Bags (Large)",
142
+ type: "Consumable",
143
+ createdByName: "Philip Cruz",
144
+ lastUpdated: "2025-11-18",
145
+ availableQty: 90,
146
+ stockQty: 150,
147
+ },
148
+ {
149
+ item: "Air Freshener Spray",
150
+ type: "Consumable",
151
+ createdByName: "Leo Dizon",
152
+ lastUpdated: "2025-11-20",
153
+ availableQty: 75,
154
+ stockQty: 150,
155
+ },
156
+ ];
157
+ pages.value = 2;
158
+ });
159
+
160
+ async function updatePage(pageVal: any) {
161
+ if (pageVal == 2) {
162
+ items.value = [
163
+ {
164
+ item: "Vacuum Cleaner",
165
+ type: "Equipment",
166
+ createdByName: "Robert Sy",
167
+ lastUpdated: "2025-11-22",
168
+ availableQty: 4,
169
+ stockQty: 10,
170
+ },
171
+ {
172
+ item: "Dishwashing Liquid",
173
+ type: "Consumable",
174
+ createdByName: "Kristine Tan",
175
+ lastUpdated: "2025-11-19",
176
+ availableQty: 55,
177
+ stockQty: 110,
178
+ },
179
+ {
180
+ item: "Pressure Washer",
181
+ type: "Equipment",
182
+ createdByName: "Marcel Tan",
183
+ lastUpdated: "2025-11-24",
184
+ availableQty: 2,
185
+ stockQty: 5,
186
+ },
187
+ {
188
+ item: "Scrubbing Pads",
189
+ type: "Consumable",
190
+ createdByName: "Hannah Cruz",
191
+ lastUpdated: "2025-11-23",
192
+ availableQty: 80,
193
+ stockQty: 150,
194
+ },
195
+ {
196
+ item: "Squeegee Set",
197
+ type: "Equipment",
198
+ createdByName: "Darryl Go",
199
+ lastUpdated: "2025-11-22",
200
+ availableQty: 12,
201
+ stockQty: 30,
202
+ },
203
+ ];
204
+ } else {
205
+ items.value = [
206
+ {
207
+ item: "Multi-Surface Cleaner",
208
+ type: "Consumable",
209
+ createdByName: "John Reyes",
210
+ lastUpdated: "2025-11-20",
211
+ availableQty: 45,
212
+ stockQty: 100,
213
+ },
214
+ {
215
+ item: "Disinfectant Spray",
216
+ type: "Consumable",
217
+ createdByName: "Marianne Santos",
218
+ lastUpdated: "2025-11-18",
219
+ availableQty: 30,
220
+ stockQty: 80,
221
+ },
222
+ {
223
+ item: "Glass Cleaner",
224
+ type: "Consumable",
225
+ createdByName: "Evan Lim",
226
+ lastUpdated: "2025-11-22",
227
+ availableQty: 60,
228
+ stockQty: 120,
229
+ },
230
+ {
231
+ item: "Floor Degreaser",
232
+ type: "Consumable",
233
+ createdByName: "Kristine Tan",
234
+ lastUpdated: "2025-11-21",
235
+ availableQty: 20,
236
+ stockQty: 50,
237
+ },
238
+ {
239
+ item: "Microfiber Cloth",
240
+ type: "Equipment",
241
+ createdByName: "Angela Chua",
242
+ lastUpdated: "2025-11-22",
243
+ availableQty: 120,
244
+ stockQty: 200,
245
+ },
246
+ {
247
+ item: "Toilet Brush",
248
+ type: "Equipment",
249
+ createdByName: "Miguel Perez",
250
+ lastUpdated: "2025-11-19",
251
+ availableQty: 15,
252
+ stockQty: 40,
253
+ },
254
+ {
255
+ item: "Mop Head Refill",
256
+ type: "Consumable",
257
+ createdByName: "Sarah Ong",
258
+ lastUpdated: "2025-11-23",
259
+ availableQty: 50,
260
+ stockQty: 100,
261
+ },
262
+ {
263
+ item: "Cleaning Mop Set",
264
+ type: "Equipment",
265
+ createdByName: "Jenny Ramos",
266
+ lastUpdated: "2025-11-21",
267
+ availableQty: 10,
268
+ stockQty: 25,
269
+ },
270
+ {
271
+ item: "Trash Bags (Large)",
272
+ type: "Consumable",
273
+ createdByName: "Philip Cruz",
274
+ lastUpdated: "2025-11-18",
275
+ availableQty: 90,
276
+ stockQty: 150,
277
+ },
278
+ {
279
+ item: "Air Freshener Spray",
280
+ type: "Consumable",
281
+ createdByName: "Leo Dizon",
282
+ lastUpdated: "2025-11-20",
283
+ availableQty: 75,
284
+ stockQty: 150,
285
+ },
286
+ ];
287
+ }
288
+ page.value = pageVal;
289
+ }
290
+
291
+ function tableRowClickHandler(_: any, data: any) {}
292
+ </script>
@@ -289,7 +289,7 @@ const {
289
289
  refresh: getVisitorRefresh,
290
290
  pending: getVisitorPending,
291
291
  } = await useLazyAsyncData(
292
- `get-all-visitors-${activeTab.value}-${page.value}`
292
+ `get-all-visitors-${activeTab.value}-${page.value}-${siteId}`
293
293
  ,
294
294
  () =>
295
295
  getVisitors({
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@iservice365/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.5.2",
5
+ "version": "1.5.4",
6
6
  "main": "./nuxt.config.ts",
7
7
  "scripts": {
8
8
  "dev": "nuxi dev .playground",
package/types/people.d.ts CHANGED
@@ -20,4 +20,4 @@ declare type TPeople = {
20
20
 
21
21
  declare type TPeoplePayload = Pick<TGuest, "name" | "block" | "level" | "unit" | "unitName" | "contact" | "plateNumber" | "nric" | "contact" | "remarks" | "org" | "site" | "start" | "end" | "type">
22
22
 
23
- declare type TPeopleType = "visitor" | "resident" | "tenant"
23
+ declare type TPeopleType = "guest" | "resident" | "tenant"