@7365admin1/layer-common 3.2.1 → 3.2.2-staging.101
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/.changeset/camera-wall-gated-endpoint.md +47 -0
- package/.changeset/camera-wall-plain-english.md +60 -0
- package/.changeset/camera-wall-selection-and-guidance.md +65 -0
- package/.changeset/dark-primary-contrast.md +39 -0
- package/.changeset/dashboard-dark-theme-contrast.md +15 -0
- package/.changeset/notification-preferences.md +17 -0
- package/.changeset/pm-sidebar-grouping-and-list-scaffold.md +27 -0
- package/.changeset/service-provider-invitation-actions.md +28 -0
- package/assets/css/primitives.css +680 -0
- package/assets/css/screens.css +541 -0
- package/assets/css/shell.css +258 -0
- package/assets/css/tokens.css +220 -0
- package/components/AccessCardQrTagging.vue +1 -1
- package/components/AccessManagement.vue +53 -72
- package/components/AppButton.vue +52 -0
- package/components/AppCard.vue +20 -0
- package/components/AppDateField.vue +35 -0
- package/components/AppField.vue +51 -0
- package/components/AppKpiTile.vue +65 -0
- package/components/AppSegmented.vue +38 -0
- package/components/AppSelect.vue +203 -0
- package/components/AreaChecklistHistoryLogs.vue +51 -44
- package/components/AreaChecklistHistoryMain.vue +6 -2
- package/components/AreaMain.vue +9 -17
- package/components/AttendanceMain.vue +4 -3
- package/components/Avatar/Main.vue +54 -2
- package/components/BillingMain.vue +26 -30
- package/components/BuildingManagement/buildings.vue +27 -38
- package/components/BuildingManagement/units.vue +26 -42
- package/components/BulletinBoardManagement.vue +23 -10
- package/components/CameraWall.vue +1034 -0
- package/components/CameraWallTile.vue +818 -0
- package/components/CardToolbar.vue +37 -0
- package/components/CleaningScheduleMain.vue +29 -46
- package/components/ClientMain.vue +90 -78
- package/components/DashboardEmptyState.vue +11 -1
- package/components/DashboardMain.vue +349 -275
- package/components/DashboardPanel.vue +1 -1
- package/components/DocumentManagement.vue +129 -93
- package/components/EntryPassInformation.vue +4 -4
- package/components/EntryPassMain.vue +49 -27
- package/components/EquipmentItemMain.vue +4 -6
- package/components/EquipmentManagementMain.vue +9 -7
- package/components/FeedbackMain.vue +42 -56
- package/components/FormDialog.vue +60 -21
- package/components/HidAccessLogDashboard.vue +119 -44
- package/components/HidCameraCaptureDialog.vue +199 -0
- package/components/HidIntercomManagement.vue +825 -202
- package/components/HidQrCodeConfiguration.vue +927 -93
- package/components/HidServiceSettingsPanel.vue +20 -1
- package/components/HidUserEnrollment.vue +454 -106
- package/components/InvitationMain.vue +46 -61
- package/components/Layout/Header.vue +289 -37
- package/components/Layout/NavigationDrawer.vue +340 -30
- package/components/ManageChecklistMain.vue +17 -17
- package/components/MemberMain.vue +79 -60
- package/components/MyAttendanceMain.vue +3 -5
- package/components/NavigationItem.vue +9 -0
- package/components/Nfc/NFCPatrolRouteMain.vue +116 -103
- package/components/NotificationSettings.vue +361 -0
- package/components/OnlineFormConfigurationForm.vue +620 -224
- package/components/OnlineFormFill.vue +36 -8
- package/components/OnlineFormsConfiguration.vue +7 -3
- package/components/PageHeader.vue +43 -0
- package/components/PassInformation.vue +104 -45
- package/components/QrTemplate/CreditCardLandscape.vue +19 -12
- package/components/QrTemplate/PrintDialog.vue +209 -196
- package/components/RolePermissionMain.vue +184 -91
- package/components/ScanVisitorQRCode.vue +35 -7
- package/components/ScheduleAreaMain.vue +15 -49
- package/components/ScheduleTaskMain.vue +23 -26
- package/components/ScheduleTastTicketMain.vue +18 -43
- package/components/ServiceProviderInvitationPrompt.vue +150 -0
- package/components/ServiceProviderMain.vue +346 -157
- package/components/SiteSettings.vue +25 -10
- package/components/SiteSettingsWorkOrder.vue +61 -30
- package/components/SpecificAttr.vue +10 -2
- package/components/StatusChip.vue +93 -0
- package/components/StockCard.vue +17 -12
- package/components/SwitchContext.vue +33 -1
- package/components/TableHygiene.vue +29 -46
- package/components/TableList.vue +1 -1
- package/components/TableListSecondary.vue +1 -1
- package/components/TableMain.vue +161 -77
- package/components/TableV3.vue +61 -66
- package/components/UnitMain.vue +9 -17
- package/components/VehicleManagement.vue +20 -9
- package/components/VisitorForm.vue +294 -78
- package/components/VisitorManagement.vue +221 -71
- package/components/VisitorSocketPopUp.vue +56 -2
- package/components/WorkOrder/Main.vue +42 -51
- package/composables/useComment.ts +3 -3
- package/composables/useHidAmico.ts +151 -0
- package/composables/useHidNavigation.ts +0 -7
- package/composables/useLocalAuth.ts +9 -36
- package/composables/useNotificationPreference.ts +87 -0
- package/composables/useOnlineFormPages.ts +2 -0
- package/composables/useOrg.ts +1 -1
- package/composables/useRole.ts +22 -0
- package/composables/useServiceProviderInvitation.ts +145 -0
- package/composables/useSipWebPhone.ts +336 -0
- package/composables/useSiteSettings.ts +50 -0
- package/composables/useThemePreference.ts +63 -0
- package/composables/useVisitor.ts +6 -1
- package/composables/useVisitorSocket.ts +26 -0
- package/composables/useWebUsb.ts +127 -37
- package/nuxt.config.ts +31 -0
- package/package.json +4 -1
- package/pages/[org]/[site]/access-mgmt/intercom/index.vue +1 -1
- package/pages/notification-settings.vue +19 -0
- package/plugins/secure-member.client.ts +21 -56
- package/plugins/vuetify.ts +68 -9
- package/test/visitor-socket.test.mjs +36 -0
- package/types/org.d.ts +2 -0
- package/types/site.d.ts +71 -0
- package/utils/camera-wall.test.ts +571 -0
- package/utils/camera-wall.ts +926 -0
- package/utils/nav-sections.test.ts +190 -0
- package/utils/nav-sections.ts +151 -0
- package/utils/status.test.ts +77 -0
- package/utils/status.ts +90 -0
- package/utils/theme.test.ts +534 -0
- package/utils/theme.ts +294 -0
- package/components/HidIdentityMapping.vue +0 -975
- package/middleware/member.ts +0 -4
- package/pages/[org]/[site]/access-mgmt/identity-mapping/index.vue +0 -23
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-dialog
|
|
3
|
+
:model-value="modelValue"
|
|
4
|
+
max-width="520"
|
|
5
|
+
persistent
|
|
6
|
+
@update:model-value="emit('update:modelValue', $event)"
|
|
7
|
+
>
|
|
8
|
+
<v-card class="camera-dialog" rounded="lg">
|
|
9
|
+
<v-card-title class="d-flex align-center justify-space-between pa-4">
|
|
10
|
+
<span class="text-subtitle-1 font-weight-bold">Take Facial Photo</span>
|
|
11
|
+
<v-btn
|
|
12
|
+
icon="mdi-close"
|
|
13
|
+
variant="text"
|
|
14
|
+
size="small"
|
|
15
|
+
aria-label="Close camera"
|
|
16
|
+
@click="close"
|
|
17
|
+
/>
|
|
18
|
+
</v-card-title>
|
|
19
|
+
|
|
20
|
+
<v-divider />
|
|
21
|
+
|
|
22
|
+
<v-card-text class="pa-4">
|
|
23
|
+
<div class="camera-viewport">
|
|
24
|
+
<video
|
|
25
|
+
ref="videoElement"
|
|
26
|
+
class="camera-preview"
|
|
27
|
+
autoplay
|
|
28
|
+
muted
|
|
29
|
+
playsinline
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<div v-if="starting" class="camera-state">
|
|
33
|
+
<v-progress-circular indeterminate color="primary" />
|
|
34
|
+
<span class="mt-3">Starting camera...</span>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div v-else-if="cameraError" class="camera-state px-6 text-center">
|
|
38
|
+
<v-icon icon="mdi-camera-off-outline" size="42" color="error" />
|
|
39
|
+
<span class="mt-3 text-error">{{ cameraError }}</span>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<canvas ref="canvasElement" class="d-none" />
|
|
44
|
+
|
|
45
|
+
<div class="text-caption text-medium-emphasis mt-3 text-center">
|
|
46
|
+
Keep your face centered and make sure the area is well lit.
|
|
47
|
+
</div>
|
|
48
|
+
</v-card-text>
|
|
49
|
+
|
|
50
|
+
<v-divider />
|
|
51
|
+
|
|
52
|
+
<v-card-actions class="pa-4">
|
|
53
|
+
<v-btn variant="text" @click="close">Cancel</v-btn>
|
|
54
|
+
<v-spacer />
|
|
55
|
+
<v-btn
|
|
56
|
+
color="primary"
|
|
57
|
+
variant="flat"
|
|
58
|
+
prepend-icon="mdi-camera"
|
|
59
|
+
:disabled="starting || !!cameraError || !stream"
|
|
60
|
+
@click="capture"
|
|
61
|
+
>
|
|
62
|
+
Take Photo
|
|
63
|
+
</v-btn>
|
|
64
|
+
</v-card-actions>
|
|
65
|
+
</v-card>
|
|
66
|
+
</v-dialog>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script setup lang="ts">
|
|
70
|
+
const props = defineProps<{ modelValue: boolean }>();
|
|
71
|
+
const emit = defineEmits<{
|
|
72
|
+
"update:modelValue": [value: boolean];
|
|
73
|
+
capture: [dataUrl: string];
|
|
74
|
+
}>();
|
|
75
|
+
|
|
76
|
+
const videoElement = ref<HTMLVideoElement | null>(null);
|
|
77
|
+
const canvasElement = ref<HTMLCanvasElement | null>(null);
|
|
78
|
+
const stream = shallowRef<MediaStream | null>(null);
|
|
79
|
+
const starting = ref(false);
|
|
80
|
+
const cameraError = ref("");
|
|
81
|
+
|
|
82
|
+
function stopCamera() {
|
|
83
|
+
stream.value?.getTracks().forEach((track) => track.stop());
|
|
84
|
+
stream.value = null;
|
|
85
|
+
if (videoElement.value) videoElement.value.srcObject = null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function getCameraErrorMessage(caught: unknown) {
|
|
89
|
+
if (caught instanceof DOMException) {
|
|
90
|
+
if (caught.name === "NotAllowedError") {
|
|
91
|
+
return "Camera permission was denied. Allow camera access and try again.";
|
|
92
|
+
}
|
|
93
|
+
if (caught.name === "NotFoundError") {
|
|
94
|
+
return "No camera was found on this device.";
|
|
95
|
+
}
|
|
96
|
+
if (caught.name === "NotReadableError") {
|
|
97
|
+
return "The camera is currently being used by another application.";
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return "Unable to open the camera. Use HTTPS or check the browser camera permission.";
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async function startCamera() {
|
|
104
|
+
stopCamera();
|
|
105
|
+
cameraError.value = "";
|
|
106
|
+
starting.value = true;
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
if (!navigator.mediaDevices?.getUserMedia) {
|
|
110
|
+
throw new Error("Camera API is unavailable");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
stream.value = await navigator.mediaDevices.getUserMedia({
|
|
114
|
+
audio: false,
|
|
115
|
+
video: {
|
|
116
|
+
facingMode: "user",
|
|
117
|
+
width: { ideal: 1280 },
|
|
118
|
+
height: { ideal: 960 },
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
await nextTick();
|
|
123
|
+
if (!videoElement.value) throw new Error("Camera preview is unavailable");
|
|
124
|
+
videoElement.value.srcObject = stream.value;
|
|
125
|
+
await videoElement.value.play();
|
|
126
|
+
} catch (caught: unknown) {
|
|
127
|
+
stopCamera();
|
|
128
|
+
cameraError.value = getCameraErrorMessage(caught);
|
|
129
|
+
} finally {
|
|
130
|
+
starting.value = false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function capture() {
|
|
135
|
+
const video = videoElement.value;
|
|
136
|
+
const canvas = canvasElement.value;
|
|
137
|
+
if (!video || !canvas || !video.videoWidth || !video.videoHeight) return;
|
|
138
|
+
|
|
139
|
+
canvas.width = video.videoWidth;
|
|
140
|
+
canvas.height = video.videoHeight;
|
|
141
|
+
const context = canvas.getContext("2d");
|
|
142
|
+
if (!context) return;
|
|
143
|
+
|
|
144
|
+
context.translate(canvas.width, 0);
|
|
145
|
+
context.scale(-1, 1);
|
|
146
|
+
context.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
147
|
+
|
|
148
|
+
emit("capture", canvas.toDataURL("image/jpeg", 0.9));
|
|
149
|
+
close();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function close() {
|
|
153
|
+
stopCamera();
|
|
154
|
+
emit("update:modelValue", false);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
watch(
|
|
158
|
+
() => props.modelValue,
|
|
159
|
+
(isOpen) => {
|
|
160
|
+
if (isOpen) void startCamera();
|
|
161
|
+
else stopCamera();
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
onBeforeUnmount(stopCamera);
|
|
166
|
+
</script>
|
|
167
|
+
|
|
168
|
+
<style scoped>
|
|
169
|
+
.camera-dialog {
|
|
170
|
+
overflow: hidden;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.camera-viewport {
|
|
174
|
+
position: relative;
|
|
175
|
+
width: 100%;
|
|
176
|
+
overflow: hidden;
|
|
177
|
+
aspect-ratio: 3 / 4;
|
|
178
|
+
border-radius: 8px;
|
|
179
|
+
background: #111722;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.camera-preview {
|
|
183
|
+
width: 100%;
|
|
184
|
+
height: 100%;
|
|
185
|
+
object-fit: cover;
|
|
186
|
+
transform: scaleX(-1);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.camera-state {
|
|
190
|
+
position: absolute;
|
|
191
|
+
inset: 0;
|
|
192
|
+
display: flex;
|
|
193
|
+
flex-direction: column;
|
|
194
|
+
align-items: center;
|
|
195
|
+
justify-content: center;
|
|
196
|
+
background: #111722;
|
|
197
|
+
color: #ffffff;
|
|
198
|
+
}
|
|
199
|
+
</style>
|