@burdenoff/microfe-crewfoundry 2026.1029.2 → 2026.1030.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/crewfoundry/components/EmployeeSkillsPanel.d.ts +12 -0
- package/dist/crewfoundry/components/EmployeeSkillsPanel.d.ts.map +1 -0
- package/dist/crewfoundry/components/EmployeeSkillsPanel.js +168 -0
- package/dist/crewfoundry/components/EmployeeSkillsPanel.js.map +1 -0
- package/dist/crewfoundry/lib/useFocusedRecordParam.d.ts +51 -0
- package/dist/crewfoundry/lib/useFocusedRecordParam.d.ts.map +1 -0
- package/dist/crewfoundry/lib/useFocusedRecordParam.js +38 -0
- package/dist/crewfoundry/lib/useFocusedRecordParam.js.map +1 -0
- package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.d.ts.map +1 -1
- package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.js +119 -112
- package/dist/crewfoundry/pages/CommunicationsAnnouncementsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/CompanyClientManagementPagePage.d.ts.map +1 -1
- package/dist/crewfoundry/pages/CompanyClientManagementPagePage.js +78 -71
- package/dist/crewfoundry/pages/CompanyClientManagementPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.d.ts.map +1 -1
- package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.js +88 -81
- package/dist/crewfoundry/pages/CompanyVendorManagementPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HiringCandidatesPagePage.d.ts.map +1 -1
- package/dist/crewfoundry/pages/HiringCandidatesPagePage.js +133 -126
- package/dist/crewfoundry/pages/HiringCandidatesPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HiringInterviewsPagePage.d.ts.map +1 -1
- package/dist/crewfoundry/pages/HiringInterviewsPagePage.js +150 -143
- package/dist/crewfoundry/pages/HiringInterviewsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HrDepartmentsPagePage.d.ts.map +1 -1
- package/dist/crewfoundry/pages/HrDepartmentsPagePage.js +110 -103
- package/dist/crewfoundry/pages/HrDepartmentsPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HrEmployeeProfilePagePage.d.ts.map +1 -1
- package/dist/crewfoundry/pages/HrEmployeeProfilePagePage.js +124 -134
- package/dist/crewfoundry/pages/HrEmployeeProfilePagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HrLeaveManagementPagePage.d.ts.map +1 -1
- package/dist/crewfoundry/pages/HrLeaveManagementPagePage.js +173 -162
- package/dist/crewfoundry/pages/HrLeaveManagementPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HrPayrollPagePage.d.ts.map +1 -1
- package/dist/crewfoundry/pages/HrPayrollPagePage.js +169 -158
- package/dist/crewfoundry/pages/HrPayrollPagePage.js.map +1 -1
- package/dist/crewfoundry/pages/HrTimeTrackingPagePage.d.ts.map +1 -1
- package/dist/crewfoundry/pages/HrTimeTrackingPagePage.js +179 -163
- package/dist/crewfoundry/pages/HrTimeTrackingPagePage.js.map +1 -1
- package/dist/crewfoundry/store/crewfoundryStore.d.ts +22 -0
- package/dist/crewfoundry/store/crewfoundryStore.d.ts.map +1 -1
- package/dist/crewfoundry/store/crewfoundryStore.js +158 -129
- package/dist/crewfoundry/store/crewfoundryStore.js.map +1 -1
- package/dist/utils/pageContext.d.ts +43 -4
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +10 -3
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +3 -2
|
@@ -5,15 +5,16 @@ import { AvatarStack as r } from "../components/viz/AvatarStack.js";
|
|
|
5
5
|
import { SegmentedTabs as i } from "../components/viz/SegmentedTabs.js";
|
|
6
6
|
import "../components/viz/index.js";
|
|
7
7
|
import { FormModal as a, useFormModal as o } from "../components/forms/FormModal.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
8
|
+
import { FOCUSED_CELL_CLASS as s, pageContaining as c, useFocusedRecordParam as l } from "../lib/useFocusedRecordParam.js";
|
|
9
|
+
import { getNumber as u, getText as d, newClientId as ee } from "../components/forms/formValues.js";
|
|
10
|
+
import { useMemo as f, useState as p } from "react";
|
|
11
|
+
import { Calendar as m, CheckCircle as h, ChevronLeft as g, ChevronRight as _, Clock as v, XCircle as te } from "lucide-react";
|
|
12
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
13
|
+
import { Badge as x, Button as S, Card as C, CardContent as w, CardDescription as T, CardHeader as E, CardTitle as D, GradientText as ne, PagePurpose as re, Pagination as ie, ResponsiveTable as ae } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
import { usePagination as oe } from "@burdenoff/fe-libs/shared/hooks";
|
|
15
|
+
import { useAuth as se, useGlobalUi as O } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
15
16
|
//#region src/crewfoundry/pages/HrLeaveManagementPagePage.tsx
|
|
16
|
-
var
|
|
17
|
+
var k = [
|
|
17
18
|
{
|
|
18
19
|
label: "Annual",
|
|
19
20
|
value: "annual"
|
|
@@ -38,7 +39,7 @@ var ne = [
|
|
|
38
39
|
label: "Unpaid",
|
|
39
40
|
value: "unpaid"
|
|
40
41
|
}
|
|
41
|
-
],
|
|
42
|
+
], A = (e) => e.split("_").map((e) => e[0]?.toUpperCase() + e.slice(1)).join(" "), j = {
|
|
42
43
|
annual: {
|
|
43
44
|
label: "Annual",
|
|
44
45
|
dot: "var(--color-status-success-text)",
|
|
@@ -69,11 +70,11 @@ var ne = [
|
|
|
69
70
|
dot: "var(--color-text-muted)",
|
|
70
71
|
cell: "bg-bg-sunken"
|
|
71
72
|
}
|
|
72
|
-
},
|
|
73
|
-
label:
|
|
73
|
+
}, M = (e) => j[e] ?? {
|
|
74
|
+
label: A(e),
|
|
74
75
|
dot: "var(--color-accent-blue)",
|
|
75
76
|
cell: "bg-bg-sunken"
|
|
76
|
-
},
|
|
77
|
+
}, N = [
|
|
77
78
|
"January",
|
|
78
79
|
"February",
|
|
79
80
|
"March",
|
|
@@ -86,7 +87,7 @@ var ne = [
|
|
|
86
87
|
"October",
|
|
87
88
|
"November",
|
|
88
89
|
"December"
|
|
89
|
-
],
|
|
90
|
+
], P = [
|
|
90
91
|
"Su",
|
|
91
92
|
"Mo",
|
|
92
93
|
"Tu",
|
|
@@ -94,111 +95,111 @@ var ne = [
|
|
|
94
95
|
"Th",
|
|
95
96
|
"Fr",
|
|
96
97
|
"Sa"
|
|
97
|
-
],
|
|
98
|
-
function
|
|
99
|
-
let i = t.getFullYear(), a = t.getMonth(), o =
|
|
98
|
+
], F = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, I = (e) => e.slice(0, 10);
|
|
99
|
+
function L({ leaveRequests: e, monthCursor: t, onPrev: n, onNext: r }) {
|
|
100
|
+
let i = t.getFullYear(), a = t.getMonth(), o = F(/* @__PURE__ */ new Date()), s = f(() => e.filter((e) => e.status === "approved" || e.status === "pending"), [e]), c = new Date(i, a, 1);
|
|
100
101
|
c.setDate(1 - c.getDay());
|
|
101
102
|
let l = Array.from({ length: 42 }, (e, t) => {
|
|
102
103
|
let n = new Date(c);
|
|
103
104
|
n.setDate(c.getDate() + t);
|
|
104
|
-
let r =
|
|
105
|
-
for (let e of s)
|
|
105
|
+
let r = F(n), i = /* @__PURE__ */ new Set();
|
|
106
|
+
for (let e of s) I(e.startDate) <= r && r <= I(e.endDate) && i.add(e.type);
|
|
106
107
|
return {
|
|
107
108
|
date: n,
|
|
108
109
|
dayStr: r,
|
|
109
110
|
inMonth: n.getMonth() === a,
|
|
110
111
|
types: [...i]
|
|
111
112
|
};
|
|
112
|
-
}),
|
|
113
|
+
}), u = f(() => {
|
|
113
114
|
let e = /* @__PURE__ */ new Set();
|
|
114
115
|
for (let t of l) t.inMonth && t.types.forEach((t) => e.add(t));
|
|
115
116
|
return [...e];
|
|
116
117
|
}, [l]);
|
|
117
|
-
return /* @__PURE__ */
|
|
118
|
+
return /* @__PURE__ */ b(C, { children: [/* @__PURE__ */ b(E, {
|
|
118
119
|
className: "flex flex-row items-center justify-between space-y-0",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ b(D, {
|
|
120
121
|
className: "text-base",
|
|
121
122
|
children: [
|
|
122
|
-
|
|
123
|
+
N[a],
|
|
123
124
|
" ",
|
|
124
125
|
i
|
|
125
126
|
]
|
|
126
|
-
}), /* @__PURE__ */
|
|
127
|
+
}), /* @__PURE__ */ b("div", {
|
|
127
128
|
className: "flex gap-1",
|
|
128
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ y(S, {
|
|
129
130
|
variant: "outline",
|
|
130
131
|
size: "sm",
|
|
131
132
|
className: "h-8 w-8 p-0",
|
|
132
133
|
"aria-label": "Previous month",
|
|
133
134
|
onClick: n,
|
|
134
|
-
children: /* @__PURE__ */
|
|
135
|
-
}), /* @__PURE__ */
|
|
135
|
+
children: /* @__PURE__ */ y(g, { className: "h-4 w-4" })
|
|
136
|
+
}), /* @__PURE__ */ y(S, {
|
|
136
137
|
variant: "outline",
|
|
137
138
|
size: "sm",
|
|
138
139
|
className: "h-8 w-8 p-0",
|
|
139
140
|
"aria-label": "Next month",
|
|
140
141
|
onClick: r,
|
|
141
|
-
children: /* @__PURE__ */
|
|
142
|
+
children: /* @__PURE__ */ y(_, { className: "h-4 w-4" })
|
|
142
143
|
})]
|
|
143
144
|
})]
|
|
144
|
-
}), /* @__PURE__ */
|
|
145
|
+
}), /* @__PURE__ */ b(w, {
|
|
145
146
|
className: "space-y-3",
|
|
146
147
|
children: [
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ y("div", {
|
|
148
149
|
className: "grid grid-cols-7 gap-1 text-center text-xs font-medium text-text-secondary",
|
|
149
|
-
children:
|
|
150
|
+
children: P.map((e) => /* @__PURE__ */ y("div", { children: e }, e))
|
|
150
151
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ y("div", {
|
|
152
153
|
className: "grid grid-cols-7 gap-1",
|
|
153
154
|
children: l.map((e) => {
|
|
154
|
-
let t = e.types[0], n = e.inMonth && t ?
|
|
155
|
-
return /* @__PURE__ */
|
|
155
|
+
let t = e.types[0], n = e.inMonth && t ? M(t).cell : "", r = e.dayStr === o;
|
|
156
|
+
return /* @__PURE__ */ b("div", {
|
|
156
157
|
className: `relative flex aspect-square flex-col items-center justify-center rounded-md text-xs ${n} ${e.inMonth ? "text-text-primary" : "text-text-muted"} ${r ? "ring-2 ring-action-primary-bg" : ""}`,
|
|
157
|
-
title: e.types.length > 0 ? `${e.dayStr}: ${e.types.map((e) =>
|
|
158
|
-
children: [/* @__PURE__ */
|
|
158
|
+
title: e.types.length > 0 ? `${e.dayStr}: ${e.types.map((e) => M(e).label).join(", ")}` : e.dayStr,
|
|
159
|
+
children: [/* @__PURE__ */ y("span", {
|
|
159
160
|
className: e.types.length > 0 ? "font-semibold" : "",
|
|
160
161
|
children: e.date.getDate()
|
|
161
|
-
}), e.types.length > 0 && /* @__PURE__ */
|
|
162
|
+
}), e.types.length > 0 && /* @__PURE__ */ y("span", {
|
|
162
163
|
className: "mt-0.5 flex gap-0.5",
|
|
163
|
-
children: e.types.slice(0, 3).map((e) => /* @__PURE__ */
|
|
164
|
+
children: e.types.slice(0, 3).map((e) => /* @__PURE__ */ y("span", {
|
|
164
165
|
className: "h-1 w-1 rounded-full",
|
|
165
|
-
style: { backgroundColor:
|
|
166
|
+
style: { backgroundColor: M(e).dot }
|
|
166
167
|
}, e))
|
|
167
168
|
})]
|
|
168
169
|
}, e.dayStr);
|
|
169
170
|
})
|
|
170
171
|
}),
|
|
171
|
-
|
|
172
|
+
u.length > 0 && /* @__PURE__ */ y("div", {
|
|
172
173
|
className: "flex flex-wrap gap-3 pt-1 text-xs text-text-secondary",
|
|
173
|
-
children:
|
|
174
|
+
children: u.map((e) => /* @__PURE__ */ b("span", {
|
|
174
175
|
className: "flex items-center gap-1.5",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
176
|
+
children: [/* @__PURE__ */ y("span", {
|
|
176
177
|
className: "h-2.5 w-2.5 rounded-full",
|
|
177
|
-
style: { backgroundColor:
|
|
178
|
-
}),
|
|
178
|
+
style: { backgroundColor: M(e).dot }
|
|
179
|
+
}), M(e).label]
|
|
179
180
|
}, e))
|
|
180
181
|
})
|
|
181
182
|
]
|
|
182
183
|
})] });
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
-
let { leaveRequests:
|
|
186
|
-
let e =
|
|
185
|
+
function R() {
|
|
186
|
+
let { leaveRequests: g, employees: _, addLeaveRequest: j, updateLeaveRequest: N } = e(), { showToast: P } = O(), { currentUser: F } = se(), R = o(), [z, B] = p("requests"), V = f(() => new Map(_.map((e) => [e.id, e])), [_]), [H, U] = p(() => {
|
|
187
|
+
let e = g.filter((e) => e.status === "approved" || e.status === "pending").map((e) => I(e.startDate)).sort(), t = e[e.length - 1];
|
|
187
188
|
if (t) {
|
|
188
189
|
let [e, n] = t.split("-").map(Number);
|
|
189
190
|
return new Date(e, (n || 1) - 1, 1);
|
|
190
191
|
}
|
|
191
192
|
return /* @__PURE__ */ new Date();
|
|
192
|
-
}),
|
|
193
|
+
}), W = (e) => U((t) => new Date(t.getFullYear(), t.getMonth() + e, 1)), G = F?.name || [F?.firstName, F?.lastName].filter(Boolean).join(" ") || F?.email || "Manager", K = f(() => _.map((e) => ({
|
|
193
194
|
label: `${e.firstName} ${e.lastName}`,
|
|
194
195
|
value: e.id
|
|
195
|
-
})), [
|
|
196
|
+
})), [_]), ce = f(() => [
|
|
196
197
|
{
|
|
197
198
|
name: "employeeId",
|
|
198
199
|
label: "Employee",
|
|
199
200
|
type: "select",
|
|
200
201
|
required: !0,
|
|
201
|
-
options:
|
|
202
|
+
options: K,
|
|
202
203
|
colSpan: 2
|
|
203
204
|
},
|
|
204
205
|
{
|
|
@@ -206,7 +207,7 @@ function B() {
|
|
|
206
207
|
label: "Leave type",
|
|
207
208
|
type: "select",
|
|
208
209
|
required: !0,
|
|
209
|
-
options:
|
|
210
|
+
options: k
|
|
210
211
|
},
|
|
211
212
|
{
|
|
212
213
|
name: "days",
|
|
@@ -233,7 +234,7 @@ function B() {
|
|
|
233
234
|
required: !0,
|
|
234
235
|
colSpan: 2
|
|
235
236
|
}
|
|
236
|
-
], [
|
|
237
|
+
], [K]), le = g.filter((e) => e.status === "pending").length, ue = g.filter((e) => e.status === "approved").length, de = g.filter((e) => e.status === "approved").reduce((e, t) => e + t.days, 0), fe = f(() => {
|
|
237
238
|
let e = {
|
|
238
239
|
annual: 20,
|
|
239
240
|
sick: 12,
|
|
@@ -241,38 +242,47 @@ function B() {
|
|
|
241
242
|
maternity: 90,
|
|
242
243
|
paternity: 30,
|
|
243
244
|
unpaid: 15
|
|
244
|
-
}, t =
|
|
245
|
+
}, t = g.filter((e) => e.status === "approved").reduce((e, t) => (e[t.type] = (e[t.type] || 0) + t.days, e), {});
|
|
245
246
|
return Object.entries(e).map(([e, n]) => {
|
|
246
247
|
let r = t[e] || 0;
|
|
247
248
|
return {
|
|
248
|
-
type:
|
|
249
|
+
type: A(e),
|
|
249
250
|
total: n,
|
|
250
251
|
used: r,
|
|
251
252
|
remaining: Math.max(n - r, 0)
|
|
252
253
|
};
|
|
253
254
|
});
|
|
254
|
-
}, [
|
|
255
|
+
}, [g]), q = f(() => {
|
|
255
256
|
let e = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
256
|
-
return
|
|
257
|
-
}, [
|
|
257
|
+
return g.filter((t) => t.status === "approved" && t.startDate <= e && t.endDate >= e).length;
|
|
258
|
+
}, [g]), J = f(() => [...g].sort((e, t) => t.startDate.localeCompare(e.startDate)), [g]), Y = oe({ initialPageSize: 10 }), pe = J.slice(Y.offset, Y.offset + Y.pageSize), [X, Z] = p(null), Q = X && g.some((e) => e.id === X) ? X : null;
|
|
259
|
+
l({
|
|
260
|
+
records: g,
|
|
261
|
+
activeId: Q,
|
|
262
|
+
onRestore: (e) => {
|
|
263
|
+
Z(e.id), B("requests"), Y.setPage(c(J, e.id, Y.pageSize));
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
let me = [
|
|
258
267
|
{
|
|
259
268
|
key: "employee",
|
|
260
269
|
header: "Employee",
|
|
261
270
|
priority: "primary",
|
|
262
|
-
cell: (e) => /* @__PURE__ */
|
|
263
|
-
|
|
264
|
-
|
|
271
|
+
cell: (e) => /* @__PURE__ */ b("div", {
|
|
272
|
+
"aria-current": e.id === Q ? "true" : void 0,
|
|
273
|
+
className: `flex items-center gap-2.5 ${e.id === Q ? s : ""}`,
|
|
274
|
+
children: [/* @__PURE__ */ y(r, {
|
|
265
275
|
people: [{
|
|
266
276
|
name: e.employeeName,
|
|
267
|
-
avatarUrl:
|
|
277
|
+
avatarUrl: V.get(e.employeeId)?.avatar
|
|
268
278
|
}],
|
|
269
279
|
size: 32
|
|
270
|
-
}), /* @__PURE__ */
|
|
280
|
+
}), /* @__PURE__ */ b("div", {
|
|
271
281
|
className: "min-w-0",
|
|
272
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ y("p", {
|
|
273
283
|
className: "truncate font-medium",
|
|
274
284
|
children: e.employeeName
|
|
275
|
-
}), /* @__PURE__ */
|
|
285
|
+
}), /* @__PURE__ */ y("p", {
|
|
276
286
|
className: "truncate text-xs text-text-secondary",
|
|
277
287
|
children: e.department
|
|
278
288
|
})]
|
|
@@ -282,12 +292,12 @@ function B() {
|
|
|
282
292
|
{
|
|
283
293
|
key: "type",
|
|
284
294
|
header: "Type",
|
|
285
|
-
cell: (e) => /* @__PURE__ */
|
|
295
|
+
cell: (e) => /* @__PURE__ */ b("span", {
|
|
286
296
|
className: "flex items-center gap-1.5",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ y("span", {
|
|
288
298
|
className: "h-2 w-2 rounded-full",
|
|
289
|
-
style: { backgroundColor:
|
|
290
|
-
}), /* @__PURE__ */
|
|
299
|
+
style: { backgroundColor: M(e.type).dot }
|
|
300
|
+
}), /* @__PURE__ */ y("span", {
|
|
291
301
|
className: "text-xs",
|
|
292
302
|
children: t(e.type)
|
|
293
303
|
})]
|
|
@@ -296,7 +306,7 @@ function B() {
|
|
|
296
306
|
{
|
|
297
307
|
key: "period",
|
|
298
308
|
header: "Dates",
|
|
299
|
-
cell: (e) => /* @__PURE__ */
|
|
309
|
+
cell: (e) => /* @__PURE__ */ b("span", {
|
|
300
310
|
className: "text-xs",
|
|
301
311
|
children: [
|
|
302
312
|
e.startDate,
|
|
@@ -310,7 +320,7 @@ function B() {
|
|
|
310
320
|
header: "Days",
|
|
311
321
|
headerClassName: "text-right",
|
|
312
322
|
cellClassName: "md:text-right",
|
|
313
|
-
cell: (e) => /* @__PURE__ */
|
|
323
|
+
cell: (e) => /* @__PURE__ */ y("span", {
|
|
314
324
|
className: "tabular-nums",
|
|
315
325
|
children: e.days
|
|
316
326
|
})
|
|
@@ -318,79 +328,79 @@ function B() {
|
|
|
318
328
|
{
|
|
319
329
|
key: "status",
|
|
320
330
|
header: "Status",
|
|
321
|
-
cell: (e) => e.status === "pending" ? /* @__PURE__ */
|
|
331
|
+
cell: (e) => e.status === "pending" ? /* @__PURE__ */ b("div", {
|
|
322
332
|
className: "flex items-center gap-1.5",
|
|
323
|
-
children: [/* @__PURE__ */
|
|
333
|
+
children: [/* @__PURE__ */ y(S, {
|
|
324
334
|
size: "sm",
|
|
325
335
|
className: "h-7 text-xs",
|
|
326
336
|
onClick: () => $(e, "approved"),
|
|
327
337
|
children: "Approve"
|
|
328
|
-
}), /* @__PURE__ */
|
|
338
|
+
}), /* @__PURE__ */ y(S, {
|
|
329
339
|
size: "sm",
|
|
330
340
|
variant: "outline",
|
|
331
341
|
className: "h-7 text-xs",
|
|
332
342
|
onClick: () => $(e, "rejected"),
|
|
333
343
|
children: "Reject"
|
|
334
344
|
})]
|
|
335
|
-
}) : /* @__PURE__ */
|
|
345
|
+
}) : /* @__PURE__ */ y(x, {
|
|
336
346
|
variant: e.status === "approved" ? "default" : "destructive",
|
|
337
347
|
className: "text-[10px]",
|
|
338
348
|
children: t(e.status)
|
|
339
349
|
})
|
|
340
350
|
}
|
|
341
|
-
],
|
|
342
|
-
let t =
|
|
343
|
-
await
|
|
344
|
-
id:
|
|
351
|
+
], he = async (e) => {
|
|
352
|
+
let t = d(e, "employeeId"), n = _.find((e) => e.id === t);
|
|
353
|
+
await j({
|
|
354
|
+
id: ee(),
|
|
345
355
|
employeeId: t,
|
|
346
356
|
employeeName: n ? `${n.firstName} ${n.lastName}` : "",
|
|
347
357
|
department: n?.department ?? "",
|
|
348
|
-
type:
|
|
349
|
-
startDate:
|
|
350
|
-
endDate:
|
|
351
|
-
days:
|
|
358
|
+
type: d(e, "type"),
|
|
359
|
+
startDate: d(e, "startDate"),
|
|
360
|
+
endDate: d(e, "endDate"),
|
|
361
|
+
days: u(e, "days"),
|
|
352
362
|
status: "pending",
|
|
353
|
-
reason:
|
|
363
|
+
reason: d(e, "reason")
|
|
354
364
|
});
|
|
355
365
|
}, $ = async (e, t) => {
|
|
356
366
|
try {
|
|
357
|
-
await
|
|
367
|
+
await N(e.id, {
|
|
358
368
|
status: t,
|
|
359
|
-
approverName:
|
|
360
|
-
}),
|
|
369
|
+
approverName: G
|
|
370
|
+
}), P(`Leave ${t} for ${e.employeeName}`, "success");
|
|
361
371
|
} catch (e) {
|
|
362
|
-
|
|
372
|
+
P(e instanceof Error ? e.message : "Unable to update leave request", "error");
|
|
363
373
|
}
|
|
364
374
|
};
|
|
365
|
-
return /* @__PURE__ */
|
|
375
|
+
return /* @__PURE__ */ b("div", {
|
|
366
376
|
className: "space-y-6 p-6",
|
|
367
377
|
children: [
|
|
368
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ b("div", {
|
|
369
379
|
className: "flex items-center justify-between",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
380
|
+
children: [/* @__PURE__ */ b("div", { children: [
|
|
381
|
+
/* @__PURE__ */ y("h1", {
|
|
372
382
|
className: "text-2xl font-semibold",
|
|
373
|
-
children: /* @__PURE__ */
|
|
383
|
+
children: /* @__PURE__ */ y(ne, { children: "Leave Management" })
|
|
374
384
|
}),
|
|
375
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ y("p", {
|
|
376
386
|
className: "text-sm text-text-secondary",
|
|
377
387
|
children: "Track and manage employee leave requests"
|
|
378
388
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ y(re, {
|
|
380
390
|
className: "mt-1",
|
|
381
391
|
children: "Handle time-off in one place — review and approve leave requests and keep an eye on team availability and balances."
|
|
382
392
|
})
|
|
383
|
-
] }), /* @__PURE__ */
|
|
393
|
+
] }), /* @__PURE__ */ b(S, {
|
|
384
394
|
size: "sm",
|
|
385
|
-
onClick: () =>
|
|
386
|
-
children: [/* @__PURE__ */
|
|
395
|
+
onClick: () => R.openModal(),
|
|
396
|
+
children: [/* @__PURE__ */ y(m, { className: "mr-1 h-4 w-4" }), "Request Leave"]
|
|
387
397
|
})]
|
|
388
398
|
}),
|
|
389
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ y(i, {
|
|
390
400
|
"aria-label": "Leave views",
|
|
391
401
|
variant: "underline",
|
|
392
|
-
value:
|
|
393
|
-
onChange:
|
|
402
|
+
value: z,
|
|
403
|
+
onChange: B,
|
|
394
404
|
tabs: [
|
|
395
405
|
{
|
|
396
406
|
id: "requests",
|
|
@@ -406,70 +416,71 @@ function B() {
|
|
|
406
416
|
}
|
|
407
417
|
]
|
|
408
418
|
}),
|
|
409
|
-
|
|
419
|
+
z === "requests" && /* @__PURE__ */ b("div", {
|
|
410
420
|
className: "space-y-6",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ b("div", {
|
|
412
422
|
className: "grid gap-4 md:grid-cols-2 lg:grid-cols-4",
|
|
413
423
|
children: [
|
|
414
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ y(n, {
|
|
415
425
|
label: "Pending",
|
|
416
|
-
value:
|
|
417
|
-
icon: /* @__PURE__ */ v
|
|
426
|
+
value: le,
|
|
427
|
+
icon: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
|
|
418
428
|
}),
|
|
419
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ y(n, {
|
|
420
430
|
label: "Approved",
|
|
421
|
-
value:
|
|
422
|
-
icon: /* @__PURE__ */
|
|
431
|
+
value: ue,
|
|
432
|
+
icon: /* @__PURE__ */ y(h, { className: "h-4 w-4" })
|
|
423
433
|
}),
|
|
424
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ y(n, {
|
|
425
435
|
label: "Days Used",
|
|
426
|
-
value:
|
|
427
|
-
icon: /* @__PURE__ */
|
|
436
|
+
value: de,
|
|
437
|
+
icon: /* @__PURE__ */ y(m, { className: "h-4 w-4" })
|
|
428
438
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ y(n, {
|
|
430
440
|
label: "On Leave Today",
|
|
431
|
-
value:
|
|
432
|
-
icon: /* @__PURE__ */
|
|
441
|
+
value: q,
|
|
442
|
+
icon: /* @__PURE__ */ y(te, { className: "h-4 w-4" })
|
|
433
443
|
})
|
|
434
444
|
]
|
|
435
|
-
}), /* @__PURE__ */
|
|
445
|
+
}), /* @__PURE__ */ b("div", {
|
|
436
446
|
className: "grid gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(0,1fr)]",
|
|
437
|
-
children: [/* @__PURE__ */
|
|
447
|
+
children: [/* @__PURE__ */ b(C, { children: [/* @__PURE__ */ b(E, { children: [/* @__PURE__ */ y(D, { children: "Leave Requests" }), /* @__PURE__ */ y(T, { children: "Approve or reject pending requests inline; full request history below." })] }), /* @__PURE__ */ b(w, {
|
|
438
448
|
className: "space-y-4",
|
|
439
|
-
children: [/* @__PURE__ */
|
|
440
|
-
data:
|
|
449
|
+
children: [/* @__PURE__ */ y(ae, {
|
|
450
|
+
data: pe,
|
|
441
451
|
rowKey: (e) => e.id,
|
|
442
|
-
columns:
|
|
443
|
-
|
|
452
|
+
columns: me,
|
|
453
|
+
onRowClick: (e) => Z(e.id),
|
|
454
|
+
emptyState: /* @__PURE__ */ y("p", {
|
|
444
455
|
className: "py-6 text-center text-sm text-text-secondary",
|
|
445
456
|
children: "No leave requests yet."
|
|
446
457
|
})
|
|
447
|
-
}),
|
|
448
|
-
page:
|
|
449
|
-
pageSize:
|
|
450
|
-
totalItems:
|
|
451
|
-
onPageChange:
|
|
458
|
+
}), J.length > Y.pageSize && /* @__PURE__ */ y(ie, {
|
|
459
|
+
page: Y.page,
|
|
460
|
+
pageSize: Y.pageSize,
|
|
461
|
+
totalItems: J.length,
|
|
462
|
+
onPageChange: Y.setPage
|
|
452
463
|
})]
|
|
453
|
-
})] }), /* @__PURE__ */
|
|
454
|
-
leaveRequests:
|
|
455
|
-
monthCursor:
|
|
456
|
-
onPrev: () =>
|
|
457
|
-
onNext: () =>
|
|
464
|
+
})] }), /* @__PURE__ */ y(L, {
|
|
465
|
+
leaveRequests: g,
|
|
466
|
+
monthCursor: H,
|
|
467
|
+
onPrev: () => W(-1),
|
|
468
|
+
onNext: () => W(1)
|
|
458
469
|
})]
|
|
459
470
|
})]
|
|
460
471
|
}),
|
|
461
|
-
|
|
472
|
+
z === "balances" && /* @__PURE__ */ b(C, { children: [/* @__PURE__ */ b(E, { children: [/* @__PURE__ */ y(D, { children: "Leave Balances" }), /* @__PURE__ */ y(T, { children: "Company-wide leave allocation (default policy) vs. approved days used" })] }), /* @__PURE__ */ y(w, {
|
|
462
473
|
className: "grid gap-x-8 gap-y-5 md:grid-cols-2",
|
|
463
|
-
children:
|
|
474
|
+
children: fe.map((e) => {
|
|
464
475
|
let n = Math.round(e.used / Math.max(e.total, 1) * 100);
|
|
465
|
-
return /* @__PURE__ */
|
|
476
|
+
return /* @__PURE__ */ b("div", {
|
|
466
477
|
className: "space-y-1.5",
|
|
467
|
-
children: [/* @__PURE__ */
|
|
478
|
+
children: [/* @__PURE__ */ b("div", {
|
|
468
479
|
className: "flex justify-between text-sm",
|
|
469
|
-
children: [/* @__PURE__ */
|
|
480
|
+
children: [/* @__PURE__ */ y("span", {
|
|
470
481
|
className: "font-medium",
|
|
471
482
|
children: t(e.type)
|
|
472
|
-
}), /* @__PURE__ */
|
|
483
|
+
}), /* @__PURE__ */ b("span", {
|
|
473
484
|
className: "text-text-secondary",
|
|
474
485
|
children: [
|
|
475
486
|
e.used,
|
|
@@ -480,9 +491,9 @@ function B() {
|
|
|
480
491
|
" left"
|
|
481
492
|
]
|
|
482
493
|
})]
|
|
483
|
-
}), /* @__PURE__ */
|
|
494
|
+
}), /* @__PURE__ */ y("div", {
|
|
484
495
|
className: "h-2.5 overflow-hidden rounded-full bg-bg-sunken",
|
|
485
|
-
children: /* @__PURE__ */
|
|
496
|
+
children: /* @__PURE__ */ y("div", {
|
|
486
497
|
className: `h-2.5 rounded-full ${n > 80 ? "bg-status-error-text" : n > 50 ? "bg-status-warning-text" : "bg-status-success-text"}`,
|
|
487
498
|
style: { width: `${n}%` }
|
|
488
499
|
})
|
|
@@ -490,34 +501,34 @@ function B() {
|
|
|
490
501
|
}, e.type);
|
|
491
502
|
})
|
|
492
503
|
})] }),
|
|
493
|
-
|
|
504
|
+
z === "calendar" && /* @__PURE__ */ b("div", {
|
|
494
505
|
className: "grid gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)]",
|
|
495
|
-
children: [/* @__PURE__ */
|
|
496
|
-
leaveRequests:
|
|
497
|
-
monthCursor:
|
|
498
|
-
onPrev: () =>
|
|
499
|
-
onNext: () =>
|
|
500
|
-
}), /* @__PURE__ */
|
|
506
|
+
children: [/* @__PURE__ */ y(L, {
|
|
507
|
+
leaveRequests: g,
|
|
508
|
+
monthCursor: H,
|
|
509
|
+
onPrev: () => W(-1),
|
|
510
|
+
onNext: () => W(1)
|
|
511
|
+
}), /* @__PURE__ */ b(C, { children: [/* @__PURE__ */ b(E, { children: [/* @__PURE__ */ y(D, { children: "Scheduled & requested leave" }), /* @__PURE__ */ y(T, { children: "Everyone who is out, most recent first" })] }), /* @__PURE__ */ b(w, {
|
|
501
512
|
className: "space-y-3",
|
|
502
|
-
children: [
|
|
513
|
+
children: [J.filter((e) => e.status === "approved" || e.status === "pending").slice(0, 8).map((e) => /* @__PURE__ */ b("div", {
|
|
503
514
|
className: "flex items-center justify-between gap-3 rounded-lg border border-border-subtle p-3",
|
|
504
|
-
children: [/* @__PURE__ */
|
|
515
|
+
children: [/* @__PURE__ */ b("div", {
|
|
505
516
|
className: "flex items-center gap-2.5",
|
|
506
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ y(r, {
|
|
507
518
|
people: [{
|
|
508
519
|
name: e.employeeName,
|
|
509
|
-
avatarUrl:
|
|
520
|
+
avatarUrl: V.get(e.employeeId)?.avatar
|
|
510
521
|
}],
|
|
511
522
|
size: 32
|
|
512
|
-
}), /* @__PURE__ */
|
|
523
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
513
524
|
className: "text-sm font-medium",
|
|
514
525
|
children: e.employeeName
|
|
515
|
-
}), /* @__PURE__ */
|
|
526
|
+
}), /* @__PURE__ */ b("p", {
|
|
516
527
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
517
528
|
children: [
|
|
518
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ y("span", {
|
|
519
530
|
className: "h-2 w-2 rounded-full",
|
|
520
|
-
style: { backgroundColor:
|
|
531
|
+
style: { backgroundColor: M(e.type).dot }
|
|
521
532
|
}),
|
|
522
533
|
t(e.type),
|
|
523
534
|
" · ",
|
|
@@ -525,37 +536,37 @@ function B() {
|
|
|
525
536
|
" days"
|
|
526
537
|
]
|
|
527
538
|
})] })]
|
|
528
|
-
}), /* @__PURE__ */
|
|
539
|
+
}), /* @__PURE__ */ b("div", {
|
|
529
540
|
className: "text-right text-xs text-text-secondary",
|
|
530
|
-
children: [/* @__PURE__ */
|
|
541
|
+
children: [/* @__PURE__ */ b("p", { children: [
|
|
531
542
|
e.startDate,
|
|
532
543
|
" — ",
|
|
533
544
|
e.endDate
|
|
534
|
-
] }), /* @__PURE__ */
|
|
545
|
+
] }), /* @__PURE__ */ y(x, {
|
|
535
546
|
variant: e.status === "approved" ? "default" : "secondary",
|
|
536
547
|
className: "mt-1 text-[10px]",
|
|
537
548
|
children: t(e.status)
|
|
538
549
|
})]
|
|
539
550
|
})]
|
|
540
|
-
}, e.id)),
|
|
551
|
+
}, e.id)), J.filter((e) => e.status === "approved" || e.status === "pending").length === 0 && /* @__PURE__ */ y("p", {
|
|
541
552
|
className: "py-6 text-center text-sm text-text-secondary",
|
|
542
553
|
children: "No scheduled or requested leave."
|
|
543
554
|
})]
|
|
544
555
|
})] })]
|
|
545
556
|
}),
|
|
546
|
-
/* @__PURE__ */
|
|
547
|
-
open:
|
|
548
|
-
onOpenChange:
|
|
557
|
+
/* @__PURE__ */ y(a, {
|
|
558
|
+
open: R.open,
|
|
559
|
+
onOpenChange: R.onOpenChange,
|
|
549
560
|
title: "Request leave",
|
|
550
561
|
description: "Submit a new time-off request for review.",
|
|
551
|
-
fields:
|
|
562
|
+
fields: ce,
|
|
552
563
|
submitLabel: "Submit request",
|
|
553
|
-
onSubmit:
|
|
564
|
+
onSubmit: he
|
|
554
565
|
})
|
|
555
566
|
]
|
|
556
567
|
});
|
|
557
568
|
}
|
|
558
569
|
//#endregion
|
|
559
|
-
export {
|
|
570
|
+
export { R as HrLeaveManagementPagePage };
|
|
560
571
|
|
|
561
572
|
//# sourceMappingURL=HrLeaveManagementPagePage.js.map
|