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