@burdenoff/microfe-calendar 2026.830.1 → 2026.830.2
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/dist/CalendarRoot.d.ts.map +1 -1
- package/dist/CalendarRoot.js +35 -38
- package/dist/CalendarRoot.js.map +1 -1
- package/dist/CalendarRoutes.d.ts.map +1 -1
- package/dist/CalendarRoutes.js +35 -34
- package/dist/CalendarRoutes.js.map +1 -1
- package/dist/components/AgendaView.d.ts.map +1 -1
- package/dist/components/AgendaView.js +33 -36
- package/dist/components/AgendaView.js.map +1 -1
- package/dist/components/CalendarErrorState.d.ts.map +1 -1
- package/dist/components/CalendarErrorState.js +4 -7
- package/dist/components/CalendarErrorState.js.map +1 -1
- package/dist/components/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/ConfirmDialog.js +11 -14
- package/dist/components/ConfirmDialog.js.map +1 -1
- package/dist/components/DayView.d.ts.map +1 -1
- package/dist/components/DayView.js +21 -24
- package/dist/components/DayView.js.map +1 -1
- package/dist/components/EventFormModal.d.ts.map +1 -1
- package/dist/components/EventFormModal.js +184 -187
- package/dist/components/EventFormModal.js.map +1 -1
- package/dist/components/MiniCalendar.d.ts.map +1 -1
- package/dist/components/MiniCalendar.js +38 -37
- package/dist/components/MiniCalendar.js.map +1 -1
- package/dist/components/MonthView.d.ts.map +1 -1
- package/dist/components/MonthView.js +28 -31
- package/dist/components/MonthView.js.map +1 -1
- package/dist/components/TaskEventDetail.d.ts.map +1 -1
- package/dist/components/TaskEventDetail.js +28 -31
- package/dist/components/TaskEventDetail.js.map +1 -1
- package/dist/components/TimelineView.d.ts.map +1 -1
- package/dist/components/TimelineView.js +35 -38
- package/dist/components/TimelineView.js.map +1 -1
- package/dist/components/ViewSwitcher.d.ts.map +1 -1
- package/dist/components/ViewSwitcher.js +13 -16
- package/dist/components/ViewSwitcher.js.map +1 -1
- package/dist/components/WeekView.d.ts.map +1 -1
- package/dist/components/WeekView.js +24 -27
- package/dist/components/WeekView.js.map +1 -1
- package/dist/components/YearView.d.ts.map +1 -1
- package/dist/components/YearView.js +30 -33
- package/dist/components/YearView.js.map +1 -1
- package/dist/pages/CalendarPage.d.ts.map +1 -1
- package/dist/pages/CalendarPage.js +173 -176
- package/dist/pages/CalendarPage.js.map +1 -1
- package/dist/pages/EventDetailsPage.d.ts.map +1 -1
- package/dist/pages/EventDetailsPage.js +88 -85
- package/dist/pages/EventDetailsPage.js.map +1 -1
- package/dist/pages/ResourcesPage.d.ts.map +1 -1
- package/dist/pages/ResourcesPage.js +197 -200
- package/dist/pages/ResourcesPage.js.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.js +213 -169
- package/dist/pages/SettingsPage.js.map +1 -1
- package/dist/pages/SubscriptionsPage.d.ts.map +1 -1
- package/dist/pages/SubscriptionsPage.js +37 -40
- package/dist/pages/SubscriptionsPage.js.map +1 -1
- package/dist/shared/hooks/useTr.d.ts +17 -0
- package/dist/shared/hooks/useTr.d.ts.map +1 -0
- package/dist/shared/hooks/useTr.js +14 -0
- package/dist/shared/hooks/useTr.js.map +1 -0
- package/dist/translations/en.d.ts +351 -0
- package/dist/translations/en.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { useTr as e } from "../shared/hooks/useTr.js";
|
|
2
|
+
import { useCreateCalendarResourceMutation as t, useDeleteCalendarResourceMutation as n, useGetCalendarResourcesQuery as r } from "../generated/wspace-operations.js";
|
|
3
|
+
import { useSafePermissions as i } from "../hooks/useSafePermissions.js";
|
|
4
|
+
import { CALENDAR_PERMISSIONS as a } from "../constants/permissions.js";
|
|
5
|
+
import { ConfirmDialog as o } from "../components/ConfirmDialog.js";
|
|
6
|
+
import { nativeConfirm as s, nativeNotify as c } from "../utils/nativeBridge.js";
|
|
7
|
+
import { useMemo as l, useState as u } from "react";
|
|
7
8
|
import { AccessDenied as d } from "@burdenoff/fe-libs/shared/components";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { EmphasisPanel as w, GlassCard as T, GradientText as E, IllustratedEmptyState as D, PagePurpose as O } from "@burdenoff/fe-libs/ui";
|
|
9
|
+
import { Car as f, DoorOpen as p, MapPin as m, Monitor as h, Package as g, Plus as _, Users as v, X as y } from "lucide-react";
|
|
10
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
11
|
+
import { EmphasisPanel as C, GlassCard as w, GradientText as T, IllustratedEmptyState as E, PagePurpose as D } from "@burdenoff/fe-libs/ui";
|
|
12
12
|
//#region src/pages/ResourcesPage.tsx
|
|
13
|
-
var
|
|
14
|
-
ROOM:
|
|
15
|
-
EQUIPMENT:
|
|
16
|
-
VEHICLE:
|
|
17
|
-
DESK:
|
|
18
|
-
PARKING_SPOT:
|
|
19
|
-
OTHER:
|
|
13
|
+
var O = {
|
|
14
|
+
ROOM: p,
|
|
15
|
+
EQUIPMENT: h,
|
|
16
|
+
VEHICLE: f,
|
|
17
|
+
DESK: g,
|
|
18
|
+
PARKING_SPOT: f,
|
|
19
|
+
OTHER: g
|
|
20
20
|
};
|
|
21
|
-
function
|
|
22
|
-
let { hasPermission:
|
|
23
|
-
let n = A(e);
|
|
24
|
-
return n === e ? t : n;
|
|
25
|
-
}, [A]), [M, N] = u(!1), [P, F] = u(null), I = p(i.CALENDAR_RESOURCE_READ), { data: L, loading: R, error: z, refetch: B } = n({
|
|
21
|
+
function k() {
|
|
22
|
+
let { hasPermission: f, isLoading: h } = i(), k = e(), [A, j] = u(!1), [M, N] = u(null), P = f(a.CALENDAR_RESOURCE_READ), { data: F, loading: I, error: L, refetch: R } = r({
|
|
26
23
|
fetchPolicy: "cache-and-network",
|
|
27
|
-
skip:
|
|
28
|
-
}),
|
|
24
|
+
skip: h || !P
|
|
25
|
+
}), z = F?.getCalendarResources ?? [], [B, { loading: V, error: H }] = t(), [U, { loading: W }] = n(), [G, K] = u({
|
|
29
26
|
name: "",
|
|
30
27
|
description: "",
|
|
31
28
|
resourceType: "ROOM",
|
|
@@ -35,154 +32,154 @@ function A() {
|
|
|
35
32
|
floor: "",
|
|
36
33
|
room: "",
|
|
37
34
|
requireApproval: !1
|
|
38
|
-
}),
|
|
39
|
-
ROOM:
|
|
40
|
-
EQUIPMENT:
|
|
41
|
-
VEHICLE:
|
|
42
|
-
DESK:
|
|
43
|
-
PARKING_SPOT:
|
|
44
|
-
OTHER:
|
|
45
|
-
}), [
|
|
46
|
-
|
|
35
|
+
}), q = l(() => ({
|
|
36
|
+
ROOM: k("calendar.room", "Room"),
|
|
37
|
+
EQUIPMENT: k("calendar.equipment", "Equipment"),
|
|
38
|
+
VEHICLE: k("calendar.vehicle", "Vehicle"),
|
|
39
|
+
DESK: k("calendar.desk", "Desk"),
|
|
40
|
+
PARKING_SPOT: k("calendar.parkingSpot", "Parking Spot"),
|
|
41
|
+
OTHER: k("calendar.other", "Other")
|
|
42
|
+
}), [k]), J = (e, t) => {
|
|
43
|
+
K((n) => ({
|
|
47
44
|
...n,
|
|
48
45
|
[e]: t
|
|
49
46
|
}));
|
|
50
47
|
};
|
|
51
|
-
return
|
|
48
|
+
return h || I && !F ? /* @__PURE__ */ x("div", {
|
|
52
49
|
className: "@container min-h-screen bg-bg-canvas flex items-center justify-center",
|
|
53
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ x("p", {
|
|
54
51
|
className: "font-text-md text-text-secondary",
|
|
55
|
-
children:
|
|
52
|
+
children: k("calendar.loading", "Loading...")
|
|
56
53
|
})
|
|
57
|
-
}) :
|
|
54
|
+
}) : P ? /* @__PURE__ */ S("div", {
|
|
58
55
|
className: "@container min-h-screen bg-bg-canvas",
|
|
59
56
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ x("header", {
|
|
61
58
|
className: "border-b border-border-seam bg-bg-surface px-page-padding py-element-padding",
|
|
62
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ S("div", {
|
|
63
60
|
className: "flex flex-col @lg:flex-row @lg:items-center @lg:justify-between gap-stack-gap",
|
|
64
|
-
children: [/* @__PURE__ */
|
|
61
|
+
children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h1", {
|
|
65
62
|
className: "font-heading-lg text-text-primary mb-stack-gap-sm",
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
}), /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ x(T, { children: k("calendar.resources", "Resources") })
|
|
64
|
+
}), /* @__PURE__ */ x(D, {
|
|
68
65
|
className: "max-w-2xl",
|
|
69
|
-
children:
|
|
70
|
-
})] }),
|
|
66
|
+
children: k("calendar.resourcesPagePurpose", "A shared inventory of bookable rooms, equipment, vehicles, and desks. Add a resource here, then attach it to an event so it is reserved for that time — capacity, location, and approval rules keep double-bookings out.")
|
|
67
|
+
})] }), f(a.CALENDAR_RESOURCE_CREATE) ? /* @__PURE__ */ S("button", {
|
|
71
68
|
type: "button",
|
|
72
|
-
onClick: () =>
|
|
69
|
+
onClick: () => j(!0),
|
|
73
70
|
className: "inline-flex items-center gap-inline-gap-sm px-element-padding py-element-padding-sm rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors",
|
|
74
|
-
children: [/* @__PURE__ */
|
|
71
|
+
children: [/* @__PURE__ */ x(_, { className: "size-4" }), k("calendar.addResource", "Add Resource")]
|
|
75
72
|
}) : null]
|
|
76
73
|
})
|
|
77
74
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ S("div", {
|
|
79
76
|
className: "p-page-padding",
|
|
80
77
|
children: [
|
|
81
|
-
|
|
78
|
+
I && z.length === 0 && /* @__PURE__ */ x("div", {
|
|
82
79
|
className: "text-center py-12",
|
|
83
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ x("p", {
|
|
84
81
|
className: "font-text-md text-text-secondary",
|
|
85
|
-
children:
|
|
82
|
+
children: k("calendar.loadingResources", "Loading resources...")
|
|
86
83
|
})
|
|
87
84
|
}),
|
|
88
|
-
|
|
85
|
+
L && /* @__PURE__ */ x("div", {
|
|
89
86
|
className: "text-center py-12",
|
|
90
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ S("p", {
|
|
91
88
|
className: "font-text-md text-red-600 dark:text-red-400",
|
|
92
89
|
children: [
|
|
93
|
-
|
|
90
|
+
k("calendar.failedToLoadResources", "Failed to load resources:"),
|
|
94
91
|
" ",
|
|
95
|
-
|
|
92
|
+
L.message
|
|
96
93
|
]
|
|
97
94
|
})
|
|
98
95
|
}),
|
|
99
|
-
!
|
|
96
|
+
!I && !L && z.length === 0 && /* @__PURE__ */ x(E, {
|
|
100
97
|
illustration: "empty-data",
|
|
101
|
-
title:
|
|
102
|
-
description:
|
|
103
|
-
action:
|
|
98
|
+
title: k("calendar.noResourcesYet", "No resources yet"),
|
|
99
|
+
description: k("calendar.bookConferenceRooms", "Book conference rooms, equipment, and other workspace resources"),
|
|
100
|
+
action: f(a.CALENDAR_RESOURCE_CREATE) ? /* @__PURE__ */ S("button", {
|
|
104
101
|
type: "button",
|
|
105
|
-
onClick: () =>
|
|
102
|
+
onClick: () => j(!0),
|
|
106
103
|
className: "inline-flex min-h-11 items-center gap-inline-gap-sm px-element-padding py-element-padding-sm rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border",
|
|
107
|
-
children: [/* @__PURE__ */
|
|
104
|
+
children: [/* @__PURE__ */ x(_, { className: "size-4" }), k("calendar.addYourFirstResource", "Add your first resource")]
|
|
108
105
|
}) : void 0
|
|
109
106
|
}),
|
|
110
|
-
|
|
107
|
+
z.length > 0 && /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ S(C, {
|
|
111
108
|
className: "mb-section-gap flex flex-wrap items-center justify-between gap-stack-gap",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ S("div", {
|
|
113
110
|
className: "flex items-start gap-3",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ x(p, { className: "size-5 text-action-primary-bg shrink-0 mt-0.5" }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
|
|
115
112
|
className: "font-text-sm font-weight-semibold text-text-primary mb-0.5",
|
|
116
|
-
children:
|
|
117
|
-
}), /* @__PURE__ */
|
|
113
|
+
children: k("calendar.bookableResources", "Bookable resources")
|
|
114
|
+
}), /* @__PURE__ */ x("p", {
|
|
118
115
|
className: "font-text-sm text-text-secondary",
|
|
119
|
-
children:
|
|
116
|
+
children: k("calendar.resourcesSummary", "{{count}} resources ready to attach to your events. Open an event and add a resource to reserve it.", { count: z.length })
|
|
120
117
|
})] })]
|
|
121
|
-
}),
|
|
118
|
+
}), f(a.CALENDAR_RESOURCE_CREATE) ? /* @__PURE__ */ S("button", {
|
|
122
119
|
type: "button",
|
|
123
|
-
onClick: () =>
|
|
120
|
+
onClick: () => j(!0),
|
|
124
121
|
className: "inline-flex items-center gap-inline-gap-sm px-element-padding py-element-padding-sm rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-border",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ x(_, { className: "size-4" }), k("calendar.addResource", "Add Resource")]
|
|
126
123
|
}) : null]
|
|
127
|
-
}), /* @__PURE__ */
|
|
124
|
+
}), /* @__PURE__ */ x("div", {
|
|
128
125
|
className: "grid gap-grid-gap",
|
|
129
126
|
style: { gridTemplateColumns: "repeat(auto-fit, minmax(18rem, 1fr))" },
|
|
130
|
-
children:
|
|
127
|
+
children: z.map((e) => /* @__PURE__ */ x(w, {
|
|
131
128
|
treatment: "metric",
|
|
132
129
|
className: "@container p-card-padding",
|
|
133
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ S("div", {
|
|
134
131
|
className: "flex items-start gap-inline-gap",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ x("div", {
|
|
136
133
|
className: "size-10 inline-flex items-center justify-center rounded-radius-md bg-bg-neutral text-text-secondary shrink-0",
|
|
137
|
-
children: /* @__PURE__ */
|
|
138
|
-
}), /* @__PURE__ */
|
|
134
|
+
children: /* @__PURE__ */ x(O[e.resourceType] ?? g, { className: "size-5" })
|
|
135
|
+
}), /* @__PURE__ */ S("div", {
|
|
139
136
|
className: "min-w-0 flex-1",
|
|
140
137
|
children: [
|
|
141
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ S("div", {
|
|
142
139
|
className: "flex items-start justify-between",
|
|
143
|
-
children: [/* @__PURE__ */
|
|
140
|
+
children: [/* @__PURE__ */ x("h3", {
|
|
144
141
|
className: "font-heading-sm text-text-primary mb-1",
|
|
145
142
|
children: e.name
|
|
146
|
-
}),
|
|
143
|
+
}), f(a.CALENDAR_RESOURCE_DELETE) && /* @__PURE__ */ x("button", {
|
|
147
144
|
type: "button",
|
|
148
|
-
onClick: () =>
|
|
145
|
+
onClick: () => N({
|
|
149
146
|
id: e.id,
|
|
150
147
|
name: e.name
|
|
151
148
|
}),
|
|
152
149
|
className: "size-6 inline-flex items-center justify-center rounded-radius-sm hover:bg-red-50 dark:hover:bg-red-950/20 text-text-tertiary hover:text-red-600 transition-colors shrink-0",
|
|
153
|
-
"aria-label": `${
|
|
154
|
-
children: /* @__PURE__ */
|
|
150
|
+
"aria-label": `${k("calendar.deleteResource", "Delete Resource")} ${e.name}`,
|
|
151
|
+
children: /* @__PURE__ */ x(y, { className: "size-3.5" })
|
|
155
152
|
})]
|
|
156
153
|
}),
|
|
157
|
-
e.description && /* @__PURE__ */
|
|
154
|
+
e.description && /* @__PURE__ */ x("p", {
|
|
158
155
|
className: "font-text-sm text-text-secondary mb-2 line-clamp-2",
|
|
159
156
|
children: e.description
|
|
160
157
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ S("div", {
|
|
162
159
|
className: "flex flex-wrap items-center gap-2",
|
|
163
160
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ x("span", {
|
|
165
162
|
className: "font-text-xs px-2 py-0.5 rounded-radius-sm bg-bg-neutral text-text-secondary",
|
|
166
|
-
children:
|
|
163
|
+
children: q[e.resourceType] ?? e.resourceType
|
|
167
164
|
}),
|
|
168
|
-
e.capacity && /* @__PURE__ */
|
|
165
|
+
e.capacity && /* @__PURE__ */ S("span", {
|
|
169
166
|
className: "inline-flex items-center gap-1 font-text-xs text-text-tertiary",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ x(v, { className: "size-3" }), e.capacity]
|
|
171
168
|
}),
|
|
172
|
-
e.location && /* @__PURE__ */
|
|
169
|
+
e.location && /* @__PURE__ */ S("span", {
|
|
173
170
|
className: "inline-flex items-center gap-1 font-text-xs text-text-tertiary",
|
|
174
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ x(m, { className: "size-3" }), e.location]
|
|
175
172
|
})
|
|
176
173
|
]
|
|
177
174
|
}),
|
|
178
|
-
/* @__PURE__ */
|
|
175
|
+
/* @__PURE__ */ S("div", {
|
|
179
176
|
className: "mt-2 flex items-center gap-2",
|
|
180
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ x("span", {
|
|
181
178
|
className: `font-text-xs px-2 py-0.5 rounded-radius-sm ${e.isActive ? "bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-300" : "bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400"}`,
|
|
182
|
-
children: e.isActive ?
|
|
183
|
-
}), e.requireApproval && /* @__PURE__ */
|
|
179
|
+
children: e.isActive ? k("calendar.active", "Active") : k("calendar.inactive", "Inactive")
|
|
180
|
+
}), e.requireApproval && /* @__PURE__ */ x("span", {
|
|
184
181
|
className: "font-text-xs px-2 py-0.5 rounded-radius-sm bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300",
|
|
185
|
-
children:
|
|
182
|
+
children: k("calendar.requiresApproval", "Requires Approval")
|
|
186
183
|
})]
|
|
187
184
|
})
|
|
188
185
|
]
|
|
@@ -192,28 +189,28 @@ function A() {
|
|
|
192
189
|
})] })
|
|
193
190
|
]
|
|
194
191
|
}),
|
|
195
|
-
|
|
192
|
+
A && /* @__PURE__ */ S("dialog", {
|
|
196
193
|
open: !0,
|
|
197
194
|
className: "fixed inset-0 z-50 m-auto rounded-radius-lg border border-border-default bg-bg-surface shadow-lg backdrop:bg-black/50 max-w-lg w-full p-0",
|
|
198
195
|
style: { position: "fixed" },
|
|
199
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ x("button", {
|
|
200
197
|
type: "button",
|
|
201
|
-
"aria-label":
|
|
198
|
+
"aria-label": k("calendar.closeDialog", "Close dialog"),
|
|
202
199
|
className: "fixed inset-0 bg-black/50",
|
|
203
|
-
onClick: () =>
|
|
204
|
-
}), /* @__PURE__ */
|
|
200
|
+
onClick: () => j(!1)
|
|
201
|
+
}), /* @__PURE__ */ S("form", {
|
|
205
202
|
onSubmit: async (e) => {
|
|
206
|
-
e.preventDefault(),
|
|
207
|
-
name:
|
|
208
|
-
description:
|
|
209
|
-
resourceType:
|
|
210
|
-
capacity:
|
|
211
|
-
location:
|
|
212
|
-
building:
|
|
213
|
-
floor:
|
|
214
|
-
room:
|
|
215
|
-
requireApproval:
|
|
216
|
-
} } }),
|
|
203
|
+
e.preventDefault(), G.name.trim() && (await B({ variables: { input: {
|
|
204
|
+
name: G.name,
|
|
205
|
+
description: G.description || void 0,
|
|
206
|
+
resourceType: G.resourceType,
|
|
207
|
+
capacity: G.capacity ? parseInt(G.capacity, 10) : void 0,
|
|
208
|
+
location: G.location || void 0,
|
|
209
|
+
building: G.building || void 0,
|
|
210
|
+
floor: G.floor || void 0,
|
|
211
|
+
room: G.room || void 0,
|
|
212
|
+
requireApproval: G.requireApproval
|
|
213
|
+
} } }), K({
|
|
217
214
|
name: "",
|
|
218
215
|
description: "",
|
|
219
216
|
resourceType: "ROOM",
|
|
@@ -223,193 +220,193 @@ function A() {
|
|
|
223
220
|
floor: "",
|
|
224
221
|
room: "",
|
|
225
222
|
requireApproval: !1
|
|
226
|
-
}),
|
|
223
|
+
}), j(!1), R());
|
|
227
224
|
},
|
|
228
225
|
className: "relative z-10 bg-bg-surface rounded-radius-lg p-6 max-w-lg w-full mx-auto mt-20 border border-border-default shadow-lg",
|
|
229
226
|
children: [
|
|
230
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ S("div", {
|
|
231
228
|
className: "flex items-center justify-between mb-6",
|
|
232
|
-
children: [/* @__PURE__ */
|
|
229
|
+
children: [/* @__PURE__ */ x("h2", {
|
|
233
230
|
className: "font-heading-md text-text-primary",
|
|
234
|
-
children:
|
|
235
|
-
}), /* @__PURE__ */
|
|
231
|
+
children: k("calendar.addResource", "Add Resource")
|
|
232
|
+
}), /* @__PURE__ */ x("button", {
|
|
236
233
|
type: "button",
|
|
237
|
-
onClick: () =>
|
|
234
|
+
onClick: () => j(!1),
|
|
238
235
|
className: "size-8 inline-flex items-center justify-center rounded-radius-sm hover:bg-bg-elevated text-text-tertiary",
|
|
239
|
-
children: /* @__PURE__ */
|
|
236
|
+
children: /* @__PURE__ */ x(y, { className: "size-5" })
|
|
240
237
|
})]
|
|
241
238
|
}),
|
|
242
|
-
|
|
239
|
+
H && /* @__PURE__ */ x("div", {
|
|
243
240
|
className: "mb-4 p-3 rounded-radius-md bg-red-50 dark:bg-red-950/20 border border-red-200 dark:border-red-800",
|
|
244
|
-
children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ x("p", {
|
|
245
242
|
className: "font-text-sm text-red-700 dark:text-red-300",
|
|
246
|
-
children:
|
|
243
|
+
children: H.message
|
|
247
244
|
})
|
|
248
245
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ S("div", {
|
|
250
247
|
className: "space-y-4",
|
|
251
248
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("label", {
|
|
253
250
|
htmlFor: "resource-name",
|
|
254
251
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
255
252
|
children: [
|
|
256
|
-
|
|
253
|
+
k("calendar.name", "Name"),
|
|
257
254
|
" ",
|
|
258
|
-
/* @__PURE__ */
|
|
255
|
+
/* @__PURE__ */ x("span", {
|
|
259
256
|
className: "text-red-500",
|
|
260
257
|
children: "*"
|
|
261
258
|
})
|
|
262
259
|
]
|
|
263
|
-
}), /* @__PURE__ */
|
|
260
|
+
}), /* @__PURE__ */ x("input", {
|
|
264
261
|
id: "resource-name",
|
|
265
262
|
type: "text",
|
|
266
263
|
required: !0,
|
|
267
|
-
value:
|
|
268
|
-
onChange: (e) =>
|
|
269
|
-
placeholder:
|
|
264
|
+
value: G.name,
|
|
265
|
+
onChange: (e) => J("name", e.target.value),
|
|
266
|
+
placeholder: k("calendar.resourceNameExample", "e.g. Conference Room A"),
|
|
270
267
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
271
|
-
"aria-label":
|
|
268
|
+
"aria-label": k("calendar.name", "Name")
|
|
272
269
|
})] }),
|
|
273
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
274
271
|
htmlFor: "resource-type",
|
|
275
272
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
276
|
-
children:
|
|
277
|
-
}), /* @__PURE__ */
|
|
273
|
+
children: k("calendar.type", "Type")
|
|
274
|
+
}), /* @__PURE__ */ S("select", {
|
|
278
275
|
id: "resource-type",
|
|
279
|
-
value:
|
|
280
|
-
onChange: (e) =>
|
|
276
|
+
value: G.resourceType,
|
|
277
|
+
onChange: (e) => J("resourceType", e.target.value),
|
|
281
278
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface text-text-primary font-text-sm focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
282
279
|
children: [
|
|
283
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ x("option", {
|
|
284
281
|
value: "ROOM",
|
|
285
|
-
children:
|
|
282
|
+
children: k("calendar.room", "Room")
|
|
286
283
|
}),
|
|
287
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ x("option", {
|
|
288
285
|
value: "EQUIPMENT",
|
|
289
|
-
children:
|
|
286
|
+
children: k("calendar.equipment", "Equipment")
|
|
290
287
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ x("option", {
|
|
292
289
|
value: "DESK",
|
|
293
|
-
children:
|
|
290
|
+
children: k("calendar.desk", "Desk")
|
|
294
291
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ x("option", {
|
|
296
293
|
value: "VEHICLE",
|
|
297
|
-
children:
|
|
294
|
+
children: k("calendar.vehicle", "Vehicle")
|
|
298
295
|
}),
|
|
299
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ x("option", {
|
|
300
297
|
value: "PARKING_SPOT",
|
|
301
|
-
children:
|
|
298
|
+
children: k("calendar.parkingSpot", "Parking Spot")
|
|
302
299
|
}),
|
|
303
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ x("option", {
|
|
304
301
|
value: "OTHER",
|
|
305
|
-
children:
|
|
302
|
+
children: k("calendar.other", "Other")
|
|
306
303
|
})
|
|
307
304
|
]
|
|
308
305
|
})] }),
|
|
309
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ S("div", {
|
|
310
307
|
className: "grid grid-cols-2 gap-3",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
312
309
|
htmlFor: "resource-capacity",
|
|
313
310
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
314
|
-
children:
|
|
315
|
-
}), /* @__PURE__ */
|
|
311
|
+
children: k("calendar.capacity", "Capacity")
|
|
312
|
+
}), /* @__PURE__ */ x("input", {
|
|
316
313
|
id: "resource-capacity",
|
|
317
314
|
type: "number",
|
|
318
315
|
min: "1",
|
|
319
|
-
value:
|
|
320
|
-
onChange: (e) =>
|
|
321
|
-
placeholder:
|
|
316
|
+
value: G.capacity,
|
|
317
|
+
onChange: (e) => J("capacity", e.target.value),
|
|
318
|
+
placeholder: k("calendar.resourceCapacityExample", "e.g. 12"),
|
|
322
319
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border",
|
|
323
|
-
"aria-label":
|
|
324
|
-
})] }), /* @__PURE__ */
|
|
320
|
+
"aria-label": k("calendar.capacity", "Capacity")
|
|
321
|
+
})] }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
325
322
|
htmlFor: "resource-location",
|
|
326
323
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
327
|
-
children:
|
|
328
|
-
}), /* @__PURE__ */
|
|
324
|
+
children: k("calendar.location", "Location")
|
|
325
|
+
}), /* @__PURE__ */ x("input", {
|
|
329
326
|
id: "resource-location",
|
|
330
327
|
type: "text",
|
|
331
|
-
value:
|
|
332
|
-
onChange: (e) =>
|
|
333
|
-
placeholder:
|
|
334
|
-
"aria-label":
|
|
328
|
+
value: G.location,
|
|
329
|
+
onChange: (e) => J("location", e.target.value),
|
|
330
|
+
placeholder: k("calendar.resourceLocationExample", "e.g. Building A"),
|
|
331
|
+
"aria-label": k("calendar.location", "Location"),
|
|
335
332
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border"
|
|
336
333
|
})] })]
|
|
337
334
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
|
|
339
336
|
htmlFor: "resource-description",
|
|
340
337
|
className: "block font-text-sm font-weight-medium text-text-primary mb-1",
|
|
341
|
-
children:
|
|
342
|
-
}), /* @__PURE__ */
|
|
338
|
+
children: k("calendar.description", "Description")
|
|
339
|
+
}), /* @__PURE__ */ x("textarea", {
|
|
343
340
|
id: "resource-description",
|
|
344
|
-
value:
|
|
345
|
-
onChange: (e) =>
|
|
346
|
-
placeholder:
|
|
341
|
+
value: G.description,
|
|
342
|
+
onChange: (e) => J("description", e.target.value),
|
|
343
|
+
placeholder: k("calendar.addDescription", "Add a description"),
|
|
347
344
|
rows: 2,
|
|
348
|
-
"aria-label":
|
|
345
|
+
"aria-label": k("calendar.description", "Description"),
|
|
349
346
|
className: "w-full px-3 py-2 rounded-radius-md border border-border-default bg-bg-surface text-text-primary font-text-sm placeholder:text-text-tertiary focus:outline-none focus:ring-2 focus:ring-action-primary-border resize-none"
|
|
350
347
|
})] }),
|
|
351
|
-
/* @__PURE__ */
|
|
348
|
+
/* @__PURE__ */ S("div", {
|
|
352
349
|
className: "flex items-center gap-3",
|
|
353
|
-
children: [/* @__PURE__ */
|
|
350
|
+
children: [/* @__PURE__ */ x("input", {
|
|
354
351
|
id: "resource-approval",
|
|
355
352
|
type: "checkbox",
|
|
356
|
-
checked:
|
|
357
|
-
onChange: (e) =>
|
|
353
|
+
checked: G.requireApproval,
|
|
354
|
+
onChange: (e) => J("requireApproval", e.target.checked),
|
|
358
355
|
className: "size-4 rounded border-border-default",
|
|
359
|
-
"aria-label":
|
|
360
|
-
}), /* @__PURE__ */
|
|
356
|
+
"aria-label": k("calendar.requireApprovalForBookings", "Require approval for bookings")
|
|
357
|
+
}), /* @__PURE__ */ x("label", {
|
|
361
358
|
htmlFor: "resource-approval",
|
|
362
359
|
className: "font-text-sm text-text-primary",
|
|
363
|
-
children:
|
|
360
|
+
children: k("calendar.requireApprovalForBookings", "Require approval for bookings")
|
|
364
361
|
})]
|
|
365
362
|
})
|
|
366
363
|
]
|
|
367
364
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ S("div", {
|
|
369
366
|
className: "mt-6 flex justify-end gap-3",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
367
|
+
children: [/* @__PURE__ */ x("button", {
|
|
371
368
|
type: "button",
|
|
372
|
-
onClick: () =>
|
|
373
|
-
disabled:
|
|
369
|
+
onClick: () => j(!1),
|
|
370
|
+
disabled: V,
|
|
374
371
|
className: "px-4 py-2 rounded-radius-md border border-border-default bg-bg-surface hover:bg-bg-elevated font-text-sm font-weight-medium text-text-primary transition-colors disabled:opacity-50",
|
|
375
|
-
children:
|
|
376
|
-
}), /* @__PURE__ */
|
|
372
|
+
children: k("calendar.cancel", "Cancel")
|
|
373
|
+
}), /* @__PURE__ */ x("button", {
|
|
377
374
|
type: "submit",
|
|
378
|
-
disabled:
|
|
375
|
+
disabled: V || !G.name.trim(),
|
|
379
376
|
className: "px-4 py-2 rounded-radius-md bg-action-primary-bg text-action-primary-fg font-text-sm font-weight-medium hover:bg-action-primary-bg-hover transition-colors disabled:opacity-50",
|
|
380
|
-
children:
|
|
377
|
+
children: V ? k("calendar.creating", "Creating...") : k("calendar.createResource", "Create Resource")
|
|
381
378
|
})]
|
|
382
379
|
})
|
|
383
380
|
]
|
|
384
381
|
})]
|
|
385
382
|
}),
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
open: !!
|
|
388
|
-
title:
|
|
389
|
-
message:
|
|
390
|
-
confirmLabel:
|
|
383
|
+
/* @__PURE__ */ x(o, {
|
|
384
|
+
open: !!M,
|
|
385
|
+
title: k("calendar.deleteResource", "Delete Resource"),
|
|
386
|
+
message: k("calendar.deleteResourceConfirmation", "Are you sure you want to delete \"{{name}}\"? This will also cancel all future bookings.", { name: M?.name ?? "" }),
|
|
387
|
+
confirmLabel: k("calendar.delete", "Delete"),
|
|
391
388
|
variant: "danger",
|
|
392
|
-
loading:
|
|
389
|
+
loading: W,
|
|
393
390
|
onConfirm: async () => {
|
|
394
|
-
if (
|
|
395
|
-
title:
|
|
396
|
-
message:
|
|
397
|
-
okButtonTitle:
|
|
391
|
+
if (M && await s({
|
|
392
|
+
title: k("calendar.deleteResource", "Delete Resource"),
|
|
393
|
+
message: k("calendar.deleteResourceConfirmation", "Are you sure you want to delete \"{{name}}\"? This will also cancel all future bookings.", { name: M.name }),
|
|
394
|
+
okButtonTitle: k("calendar.delete", "Delete")
|
|
398
395
|
}) !== !1) try {
|
|
399
|
-
await
|
|
396
|
+
await U({ variables: { id: M.id } }), c("success"), N(null), R();
|
|
400
397
|
} catch (e) {
|
|
401
|
-
throw
|
|
398
|
+
throw c("error"), e;
|
|
402
399
|
}
|
|
403
400
|
},
|
|
404
|
-
onCancel: () =>
|
|
401
|
+
onCancel: () => N(null)
|
|
405
402
|
})
|
|
406
403
|
]
|
|
407
|
-
}) : /* @__PURE__ */
|
|
408
|
-
title:
|
|
409
|
-
description:
|
|
404
|
+
}) : /* @__PURE__ */ x(d, {
|
|
405
|
+
title: k("calendar.accessDenied", "Access Denied"),
|
|
406
|
+
description: k("calendar.noPermissionViewResources", "You don't have permission to view resources.")
|
|
410
407
|
});
|
|
411
408
|
}
|
|
412
409
|
//#endregion
|
|
413
|
-
export {
|
|
410
|
+
export { k as ResourcesPage };
|
|
414
411
|
|
|
415
412
|
//# sourceMappingURL=ResourcesPage.js.map
|