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