@devalok/shilp-sutra-karm 0.8.2 → 0.10.0
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/_chunks/chat-panel.js +376 -0
- package/dist/_chunks/daily-brief.js +177 -0
- package/dist/_chunks/kanban-board.js +1984 -0
- package/dist/_chunks/project-card.js +121 -0
- package/dist/_chunks/render-adjustment-type.js +3596 -0
- package/dist/_chunks/task-detail-panel.js +1319 -0
- package/dist/_chunks/use-composed-ref.js +12 -0
- package/dist/_chunks/vendor.js +11491 -0
- package/dist/admin/index.js +37 -60
- package/dist/board/board-column.d.ts +2 -13
- package/dist/board/board-column.d.ts.map +1 -1
- package/dist/board/board-constants.d.ts +17 -0
- package/dist/board/board-constants.d.ts.map +1 -0
- package/dist/board/board-context.d.ts +65 -0
- package/dist/board/board-context.d.ts.map +1 -0
- package/dist/board/board-toolbar.d.ts +5 -0
- package/dist/board/board-toolbar.d.ts.map +1 -0
- package/dist/board/board-types.d.ts +48 -0
- package/dist/board/board-types.d.ts.map +1 -0
- package/dist/board/bulk-action-bar.d.ts +5 -0
- package/dist/board/bulk-action-bar.d.ts.map +1 -0
- package/dist/board/column-empty.d.ts +14 -0
- package/dist/board/column-empty.d.ts.map +1 -0
- package/dist/board/column-header.d.ts +10 -0
- package/dist/board/column-header.d.ts.map +1 -0
- package/dist/board/index.d.ts +13 -3
- package/dist/board/index.d.ts.map +1 -1
- package/dist/board/index.js +20 -7
- package/dist/board/kanban-board.d.ts +4 -13
- package/dist/board/kanban-board.d.ts.map +1 -1
- package/dist/board/task-card.d.ts +11 -16
- package/dist/board/task-card.d.ts.map +1 -1
- package/dist/board/task-context-menu.d.ts +10 -0
- package/dist/board/task-context-menu.d.ts.map +1 -0
- package/dist/board/use-board-filters.d.ts +3 -0
- package/dist/board/use-board-filters.d.ts.map +1 -0
- package/dist/board/use-board-keyboard.d.ts +14 -0
- package/dist/board/use-board-keyboard.d.ts.map +1 -0
- package/dist/chat/index.js +6 -10
- package/dist/client/index.js +4 -6
- package/dist/dashboard/index.js +3 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +200 -104
- package/dist/tasks/index.js +8 -14
- package/package.json +78 -80
- package/dist/admin/adjustments/approved-adjustments.js +0 -43
- package/dist/admin/break/break-admin-skeleton.js +0 -59
- package/dist/admin/break/break-admin.js +0 -373
- package/dist/admin/break/break-balance.js +0 -42
- package/dist/admin/break/breaks.js +0 -91
- package/dist/admin/break/delete-break.js +0 -55
- package/dist/admin/break/edit-break-balance.js +0 -113
- package/dist/admin/break/edit-break.js +0 -453
- package/dist/admin/break/header.js +0 -231
- package/dist/admin/break/leave-request.js +0 -162
- package/dist/admin/break/use-break-date-picker.js +0 -43
- package/dist/admin/dashboard/admin-dashboard.js +0 -337
- package/dist/admin/dashboard/associate-detail.js +0 -259
- package/dist/admin/dashboard/attendance-overview.js +0 -136
- package/dist/admin/dashboard/break-request.js +0 -176
- package/dist/admin/dashboard/calendar.js +0 -141
- package/dist/admin/dashboard/correction-list.js +0 -102
- package/dist/admin/dashboard/dashboard-header.js +0 -155
- package/dist/admin/dashboard/dashboard-skeleton.js +0 -109
- package/dist/admin/dashboard/leave-requests.js +0 -201
- package/dist/admin/dashboard/render-date.js +0 -144
- package/dist/admin/dashboard/use-calendar-navigation.js +0 -169
- package/dist/admin/dashboard/use-leave-request-interaction.js +0 -34
- package/dist/admin/utils/date-range-utils.js +0 -37
- package/dist/admin/utils/date-utils.js +0 -119
- package/dist/admin/utils/emoji-utils.js +0 -17
- package/dist/admin/utils/render-adjustment-type.js +0 -20
- package/dist/admin/utils/render-status.js +0 -22
- package/dist/board/board-column.js +0 -236
- package/dist/board/kanban-board.js +0 -218
- package/dist/board/task-card.js +0 -168
- package/dist/chat/chat-input.js +0 -54
- package/dist/chat/chat-panel.js +0 -151
- package/dist/chat/conversation-list.js +0 -99
- package/dist/chat/markdown-components.js +0 -35
- package/dist/chat/message-list.js +0 -59
- package/dist/chat/streaming-text.js +0 -17
- package/dist/client/accent-provider.js +0 -22
- package/dist/client/client-portal-header.js +0 -48
- package/dist/client/project-card.js +0 -60
- package/dist/dashboard/attendance-cta.js +0 -115
- package/dist/dashboard/daily-brief.js +0 -68
- package/dist/page-skeletons.js +0 -130
- package/dist/tasks/activity-tab.js +0 -185
- package/dist/tasks/conversation-tab.js +0 -138
- package/dist/tasks/files-tab.js +0 -186
- package/dist/tasks/review-tab.js +0 -170
- package/dist/tasks/subtasks-tab.js +0 -154
- package/dist/tasks/task-constants.js +0 -22
- package/dist/tasks/task-detail-panel.js +0 -210
- package/dist/tasks/task-properties.js +0 -324
- package/dist/utils/use-composed-ref.js +0 -12
|
@@ -1,373 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as d, Fragment as q, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as B from "react";
|
|
4
|
-
import { useState as N, useMemo as re, useCallback as F, createContext as ie, useContext as ce } from "react";
|
|
5
|
-
import { cn as p } from "@devalok/shilp-sutra/ui/lib/utils";
|
|
6
|
-
import { useToast as le } from "@devalok/shilp-sutra/hooks/use-toast";
|
|
7
|
-
import { BreakBalance as de } from "./break-balance.js";
|
|
8
|
-
import { LeaveRequest as me } from "./leave-request.js";
|
|
9
|
-
import { Breaks as ue } from "./breaks.js";
|
|
10
|
-
import { BreakAdminHeader as fe } from "./header.js";
|
|
11
|
-
import { BreakAdminSkeleton as pe } from "./break-admin-skeleton.js";
|
|
12
|
-
const te = ie(null);
|
|
13
|
-
function w() {
|
|
14
|
-
const m = ce(te);
|
|
15
|
-
if (!m)
|
|
16
|
-
throw new Error(
|
|
17
|
-
"BreakAdmin compound components must be used within <BreakAdmin>"
|
|
18
|
-
);
|
|
19
|
-
return m;
|
|
20
|
-
}
|
|
21
|
-
const L = B.forwardRef(
|
|
22
|
-
function({
|
|
23
|
-
currentUser: n,
|
|
24
|
-
breaks: i,
|
|
25
|
-
pendingRequests: t,
|
|
26
|
-
cashoutRequests: o = [],
|
|
27
|
-
breakBalanceData: s,
|
|
28
|
-
breakBalance: c,
|
|
29
|
-
userImages: l,
|
|
30
|
-
users: u,
|
|
31
|
-
isLoading: k = !1,
|
|
32
|
-
isLoadingBreaks: g = !1,
|
|
33
|
-
isLoadingRequests: y = !1,
|
|
34
|
-
isLoadingBalance: O = !1,
|
|
35
|
-
existingBreaks: C,
|
|
36
|
-
filters: f,
|
|
37
|
-
onFilterChange: R,
|
|
38
|
-
onApproveRequest: P,
|
|
39
|
-
onRejectRequest: j,
|
|
40
|
-
onApproveCashout: xe,
|
|
41
|
-
onRejectCashout: be,
|
|
42
|
-
onRefresh: Y,
|
|
43
|
-
onSaveBreak: $,
|
|
44
|
-
onDeleteBreak: z,
|
|
45
|
-
onSaveBalance: I,
|
|
46
|
-
onFetchMonthBreaks: Q,
|
|
47
|
-
realtimeCallbacks: he,
|
|
48
|
-
children: ae
|
|
49
|
-
}, oe) {
|
|
50
|
-
const [U, V] = N("breaks"), [b, v] = N(!1), [G, E] = N(
|
|
51
|
-
null
|
|
52
|
-
), [J, T] = N(null), { toast: h } = le(), se = re(
|
|
53
|
-
() => ({
|
|
54
|
-
selectedAssociate: null,
|
|
55
|
-
dateFilterStart: null,
|
|
56
|
-
dateFilterEnd: null,
|
|
57
|
-
currMonth: (/* @__PURE__ */ new Date()).getMonth(),
|
|
58
|
-
currYear: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
59
|
-
isOpen: !1
|
|
60
|
-
}),
|
|
61
|
-
[]
|
|
62
|
-
), W = f || se, X = F(
|
|
63
|
-
(a) => {
|
|
64
|
-
R && R(a);
|
|
65
|
-
},
|
|
66
|
-
[R]
|
|
67
|
-
), Z = F(
|
|
68
|
-
async (a, x, A) => {
|
|
69
|
-
if (!b) {
|
|
70
|
-
if (!A && ((a == null ? void 0 : a.metaKey) || (a == null ? void 0 : a.ctrlKey))) {
|
|
71
|
-
E(x);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
try {
|
|
75
|
-
v(!0);
|
|
76
|
-
const r = t.find((K) => K.id === x);
|
|
77
|
-
if (!r)
|
|
78
|
-
throw new Error("Request not found");
|
|
79
|
-
P && P(x, A, r.correction, r), h({
|
|
80
|
-
description: /* @__PURE__ */ d(q, { children: [
|
|
81
|
-
/* @__PURE__ */ d("span", { children: [
|
|
82
|
-
r.correction ? "Attendance correction" : "Break request",
|
|
83
|
-
" "
|
|
84
|
-
] }),
|
|
85
|
-
/* @__PURE__ */ e("span", { className: "text-success-text", children: "approved successfully" })
|
|
86
|
-
] }),
|
|
87
|
-
color: "neutral",
|
|
88
|
-
style: { marginBottom: "var(--spacing-04)", border: "none" }
|
|
89
|
-
});
|
|
90
|
-
} catch (r) {
|
|
91
|
-
console.error("Error approving request:", r), h({
|
|
92
|
-
title: "Error",
|
|
93
|
-
description: r instanceof Error ? r.message : "Failed to approve request",
|
|
94
|
-
color: "error"
|
|
95
|
-
});
|
|
96
|
-
} finally {
|
|
97
|
-
v(!1);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
[b, t, P, h]
|
|
102
|
-
), ee = F(
|
|
103
|
-
async (a, x, A) => {
|
|
104
|
-
if (!b) {
|
|
105
|
-
if (!A && ((a == null ? void 0 : a.metaKey) || (a == null ? void 0 : a.ctrlKey))) {
|
|
106
|
-
T(x);
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
try {
|
|
110
|
-
v(!0);
|
|
111
|
-
const r = t.find((K) => K.id === x);
|
|
112
|
-
if (!r)
|
|
113
|
-
throw new Error("Request not found");
|
|
114
|
-
j && j(x, A, r.correction, r), h({
|
|
115
|
-
description: /* @__PURE__ */ d(q, { children: [
|
|
116
|
-
/* @__PURE__ */ d("span", { children: [
|
|
117
|
-
r.correction ? "Attendance correction" : "Break request",
|
|
118
|
-
" "
|
|
119
|
-
] }),
|
|
120
|
-
/* @__PURE__ */ e("span", { className: "text-error-text", children: "rejected" })
|
|
121
|
-
] }),
|
|
122
|
-
color: "neutral",
|
|
123
|
-
style: { marginBottom: "var(--spacing-04)", border: "none" }
|
|
124
|
-
});
|
|
125
|
-
} catch (r) {
|
|
126
|
-
console.error("Error rejecting request:", r), h({
|
|
127
|
-
title: "Error",
|
|
128
|
-
description: r instanceof Error ? r.message : "Failed to reject request",
|
|
129
|
-
color: "error"
|
|
130
|
-
});
|
|
131
|
-
} finally {
|
|
132
|
-
v(!1);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
[b, t, j, h]
|
|
137
|
-
), ne = re(
|
|
138
|
-
() => ({
|
|
139
|
-
currentUser: n,
|
|
140
|
-
activeTab: U,
|
|
141
|
-
setActiveTab: V,
|
|
142
|
-
isProcessing: b,
|
|
143
|
-
breaks: i,
|
|
144
|
-
pendingRequests: t,
|
|
145
|
-
cashoutRequests: o,
|
|
146
|
-
breakBalanceData: s,
|
|
147
|
-
breakBalance: c,
|
|
148
|
-
userImages: l,
|
|
149
|
-
users: u,
|
|
150
|
-
existingBreaks: C,
|
|
151
|
-
filters: W,
|
|
152
|
-
handleFilterChange: X,
|
|
153
|
-
handleApproveRequest: Z,
|
|
154
|
-
handleRejectRequest: ee,
|
|
155
|
-
acceptedCommentBox: G,
|
|
156
|
-
rejectedCommentBox: J,
|
|
157
|
-
setAcceptedCommentBox: E,
|
|
158
|
-
setRejectedCommentBox: T,
|
|
159
|
-
onRefresh: Y,
|
|
160
|
-
onSaveBreak: $,
|
|
161
|
-
onDeleteBreak: z,
|
|
162
|
-
onSaveBalance: I,
|
|
163
|
-
onFetchMonthBreaks: Q
|
|
164
|
-
}),
|
|
165
|
-
[
|
|
166
|
-
n,
|
|
167
|
-
U,
|
|
168
|
-
V,
|
|
169
|
-
b,
|
|
170
|
-
i,
|
|
171
|
-
t,
|
|
172
|
-
o,
|
|
173
|
-
s,
|
|
174
|
-
c,
|
|
175
|
-
l,
|
|
176
|
-
u,
|
|
177
|
-
C,
|
|
178
|
-
W,
|
|
179
|
-
X,
|
|
180
|
-
Z,
|
|
181
|
-
ee,
|
|
182
|
-
G,
|
|
183
|
-
J,
|
|
184
|
-
E,
|
|
185
|
-
T,
|
|
186
|
-
Y,
|
|
187
|
-
$,
|
|
188
|
-
z,
|
|
189
|
-
I,
|
|
190
|
-
Q
|
|
191
|
-
]
|
|
192
|
-
);
|
|
193
|
-
return k ? /* @__PURE__ */ e(pe, {}) : /* @__PURE__ */ e(te.Provider, { value: ne, children: /* @__PURE__ */ e(
|
|
194
|
-
"div",
|
|
195
|
-
{
|
|
196
|
-
ref: oe,
|
|
197
|
-
className: "z-base flex w-full max-w-layout flex-col items-center justify-center md:pt-0",
|
|
198
|
-
children: /* @__PURE__ */ e("div", { className: "no-scrollbar w-full overflow-auto border border-border-subtle sm:rounded-ds-lg max-md:rounded-ds-none max-md:border-0", children: ae ?? /* @__PURE__ */ d(q, { children: [
|
|
199
|
-
/* @__PURE__ */ e(S, {}),
|
|
200
|
-
/* @__PURE__ */ d("div", { className: "no-scrollbar flex h-fit min-w-[800px] flex-col border-t-[1px] border-border-subtle bg-layer-02 shadow-transparent max-lg:min-w-[100%] max-lg:overflow-x-auto", children: [
|
|
201
|
-
/* @__PURE__ */ e(M, {}),
|
|
202
|
-
/* @__PURE__ */ d("div", { className: "w-full border-0 max-lg:min-w-[800px]", children: [
|
|
203
|
-
/* @__PURE__ */ e(_, {}),
|
|
204
|
-
/* @__PURE__ */ e(D, {}),
|
|
205
|
-
/* @__PURE__ */ e(H, {})
|
|
206
|
-
] })
|
|
207
|
-
] })
|
|
208
|
-
] }) })
|
|
209
|
-
}
|
|
210
|
-
) });
|
|
211
|
-
}
|
|
212
|
-
);
|
|
213
|
-
L.displayName = "BreakAdmin";
|
|
214
|
-
const S = B.forwardRef(function({ className: n, ...i }, t) {
|
|
215
|
-
const {
|
|
216
|
-
filters: o,
|
|
217
|
-
handleFilterChange: s,
|
|
218
|
-
breakBalance: c,
|
|
219
|
-
userImages: l,
|
|
220
|
-
users: u
|
|
221
|
-
} = w();
|
|
222
|
-
return /* @__PURE__ */ e("div", { ref: t, className: p(n), ...i, children: /* @__PURE__ */ e(
|
|
223
|
-
fe,
|
|
224
|
-
{
|
|
225
|
-
filters: o,
|
|
226
|
-
onFilterChange: s,
|
|
227
|
-
breakBalance: c,
|
|
228
|
-
userImages: l,
|
|
229
|
-
users: u
|
|
230
|
-
}
|
|
231
|
-
) });
|
|
232
|
-
});
|
|
233
|
-
S.displayName = "BreakAdmin.Header";
|
|
234
|
-
const M = B.forwardRef(function({ className: n, ...i }, t) {
|
|
235
|
-
const { activeTab: o, setActiveTab: s, pendingRequests: c, breakBalanceData: l } = w();
|
|
236
|
-
return /* @__PURE__ */ d(
|
|
237
|
-
"div",
|
|
238
|
-
{
|
|
239
|
-
ref: t,
|
|
240
|
-
className: p(
|
|
241
|
-
"flex w-full gap-ds-03 border-b-[1px] border-border px-ds-06 pt-ds-03 max-lg:min-w-[800px]",
|
|
242
|
-
n
|
|
243
|
-
),
|
|
244
|
-
...i,
|
|
245
|
-
children: [
|
|
246
|
-
/* @__PURE__ */ e(
|
|
247
|
-
"button",
|
|
248
|
-
{
|
|
249
|
-
className: p("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] px-ds-03 py-ds-04", o === "breaks" ? "text-text-primary border-b-[1px] border-interactive-hover" : "text-text-tertiary"),
|
|
250
|
-
onClick: () => s("breaks"),
|
|
251
|
-
children: "BREAKS"
|
|
252
|
-
}
|
|
253
|
-
),
|
|
254
|
-
/* @__PURE__ */ d(
|
|
255
|
-
"button",
|
|
256
|
-
{
|
|
257
|
-
className: p("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] flex items-center gap-ds-02 px-ds-03 py-ds-04", o === "requests" ? "border-b-[1px] border-interactive-hover text-text-primary" : "text-text-tertiary"),
|
|
258
|
-
onClick: () => s("requests"),
|
|
259
|
-
children: [
|
|
260
|
-
"REQUESTS",
|
|
261
|
-
" ",
|
|
262
|
-
/* @__PURE__ */ e("span", { className: "text-interactive-hover", children: `(${c.length})` })
|
|
263
|
-
]
|
|
264
|
-
}
|
|
265
|
-
),
|
|
266
|
-
/* @__PURE__ */ d(
|
|
267
|
-
"button",
|
|
268
|
-
{
|
|
269
|
-
className: p("text-ds-sm font-semibold uppercase tracking-wider mb-[-1px] flex items-center gap-ds-02 px-ds-03 py-ds-04", o === "balance" ? "border-b-[1px] border-interactive-hover text-text-primary" : "text-text-tertiary"),
|
|
270
|
-
onClick: () => s("balance"),
|
|
271
|
-
children: [
|
|
272
|
-
"BALANCE",
|
|
273
|
-
" ",
|
|
274
|
-
/* @__PURE__ */ e("span", { className: "text-interactive-hover", children: `(${l.length})` })
|
|
275
|
-
]
|
|
276
|
-
}
|
|
277
|
-
)
|
|
278
|
-
]
|
|
279
|
-
}
|
|
280
|
-
);
|
|
281
|
-
});
|
|
282
|
-
M.displayName = "BreakAdmin.TabBar";
|
|
283
|
-
const _ = B.forwardRef(function({ className: n, ...i }, t) {
|
|
284
|
-
const {
|
|
285
|
-
activeTab: o,
|
|
286
|
-
breaks: s,
|
|
287
|
-
userImages: c,
|
|
288
|
-
existingBreaks: l,
|
|
289
|
-
onFetchMonthBreaks: u,
|
|
290
|
-
onSaveBreak: k,
|
|
291
|
-
onDeleteBreak: g,
|
|
292
|
-
onRefresh: y
|
|
293
|
-
} = w();
|
|
294
|
-
return o !== "breaks" ? null : /* @__PURE__ */ e("div", { ref: t, className: p(n), ...i, children: /* @__PURE__ */ e(
|
|
295
|
-
ue,
|
|
296
|
-
{
|
|
297
|
-
breaks: s,
|
|
298
|
-
userImages: c,
|
|
299
|
-
existingBreaks: l,
|
|
300
|
-
onFetchMonthBreaks: u,
|
|
301
|
-
onSave: k,
|
|
302
|
-
onDelete: g,
|
|
303
|
-
onRefresh: y
|
|
304
|
-
}
|
|
305
|
-
) });
|
|
306
|
-
});
|
|
307
|
-
_.displayName = "BreakAdmin.BreaksPanel";
|
|
308
|
-
const D = B.forwardRef(function({ className: n, ...i }, t) {
|
|
309
|
-
const {
|
|
310
|
-
activeTab: o,
|
|
311
|
-
currentUser: s,
|
|
312
|
-
pendingRequests: c,
|
|
313
|
-
userImages: l,
|
|
314
|
-
handleApproveRequest: u,
|
|
315
|
-
handleRejectRequest: k,
|
|
316
|
-
acceptedCommentBox: g,
|
|
317
|
-
rejectedCommentBox: y,
|
|
318
|
-
setAcceptedCommentBox: O,
|
|
319
|
-
setRejectedCommentBox: C
|
|
320
|
-
} = w();
|
|
321
|
-
return o !== "requests" ? null : /* @__PURE__ */ e(
|
|
322
|
-
"div",
|
|
323
|
-
{
|
|
324
|
-
ref: t,
|
|
325
|
-
className: p(
|
|
326
|
-
/* intentional: h-[400px] is the fixed panel height for break tab content areas; mobile uses dvh for browser chrome */
|
|
327
|
-
"no-scrollbar flex h-[400px] flex-col gap-ds-02 overflow-y-auto border-t border-t-border px-ds-06 pb-ds-02 pt-ds-02 max-md:h-[calc(100dvh-317px)] max-md:border-0",
|
|
328
|
-
n
|
|
329
|
-
),
|
|
330
|
-
...i,
|
|
331
|
-
children: c.map((f) => /* @__PURE__ */ e(
|
|
332
|
-
me,
|
|
333
|
-
{
|
|
334
|
-
request: f,
|
|
335
|
-
userImages: l,
|
|
336
|
-
handleRejectRequest: k,
|
|
337
|
-
handleApproveRequest: u,
|
|
338
|
-
commentBoxOpen: g === f.id || y === f.id,
|
|
339
|
-
onCommentBoxClose: () => {
|
|
340
|
-
O(null), C(null);
|
|
341
|
-
},
|
|
342
|
-
clickedAction: g === f.id ? "approve" : y === f.id ? "reject" : null,
|
|
343
|
-
userId: s.id
|
|
344
|
-
},
|
|
345
|
-
f.id
|
|
346
|
-
))
|
|
347
|
-
}
|
|
348
|
-
);
|
|
349
|
-
});
|
|
350
|
-
D.displayName = "BreakAdmin.RequestsPanel";
|
|
351
|
-
const H = B.forwardRef(function({ className: n, ...i }, t) {
|
|
352
|
-
const { activeTab: o, breakBalanceData: s, userImages: c, onSaveBalance: l } = w();
|
|
353
|
-
return o !== "balance" ? null : /* @__PURE__ */ e("div", { ref: t, className: p(n), ...i, children: /* @__PURE__ */ e(
|
|
354
|
-
de,
|
|
355
|
-
{
|
|
356
|
-
breakBalanceData: s,
|
|
357
|
-
userImages: c,
|
|
358
|
-
onSaveBalance: l
|
|
359
|
-
}
|
|
360
|
-
) });
|
|
361
|
-
});
|
|
362
|
-
H.displayName = "BreakAdmin.BalancePanel";
|
|
363
|
-
const Re = Object.assign(L, {
|
|
364
|
-
Root: L,
|
|
365
|
-
Header: S,
|
|
366
|
-
TabBar: M,
|
|
367
|
-
BreaksPanel: _,
|
|
368
|
-
RequestsPanel: D,
|
|
369
|
-
BalancePanel: H
|
|
370
|
-
});
|
|
371
|
-
export {
|
|
372
|
-
Re as BreakAdmin
|
|
373
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import * as p from "react";
|
|
4
|
-
import { Avatar as o, AvatarImage as f, AvatarFallback as u } from "@devalok/shilp-sutra/ui/avatar";
|
|
5
|
-
const h = p.forwardRef(
|
|
6
|
-
function({
|
|
7
|
-
breakBalanceData: m,
|
|
8
|
-
userImages: n,
|
|
9
|
-
onSaveBalance: w
|
|
10
|
-
}, x) {
|
|
11
|
-
return /* @__PURE__ */ s("div", { ref: x, className: "m-0 flex h-[400px] flex-col items-start justify-start p-0 max-md:h-auto", children: [
|
|
12
|
-
/* @__PURE__ */ s("div", { className: "m-0 mx-[4%] mb-ds-05 mt-ds-04 flex w-[92%] items-start justify-start gap-ds-03 p-0 text-text-placeholder", children: [
|
|
13
|
-
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider w-[16.4%] min-w-[120px] px-ds-04 py-ds-03 text-text-tertiary", children: "NAME" }),
|
|
14
|
-
/* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider w-[16.4%] px-ds-04 py-ds-03 text-text-tertiary", children: "Total Balance" })
|
|
15
|
-
] }),
|
|
16
|
-
/* @__PURE__ */ e("div", { className: "no-scrollbar mx-[4%] flex w-[92%] flex-col gap-ds-05 overflow-y-auto max-md:h-[calc(100dvh-373px)]", children: m.map((a) => {
|
|
17
|
-
var t, l, r, d, c, i;
|
|
18
|
-
return /* @__PURE__ */ s(
|
|
19
|
-
"div",
|
|
20
|
-
{
|
|
21
|
-
className: "flex w-full flex-row items-center justify-start gap-ds-03 !border-0 text-left hover:bg-field",
|
|
22
|
-
children: [
|
|
23
|
-
/* @__PURE__ */ s("div", { className: "flex w-1/6 min-w-[120px] items-center gap-ds-03 p-ds-04", children: [
|
|
24
|
-
/* @__PURE__ */ s(o, { className: "h-ds-xs-plus w-ds-xs-plus", children: [
|
|
25
|
-
/* @__PURE__ */ e(f, { src: n[a.userId], alt: ((t = a.user) == null ? void 0 : t.name) || "" }),
|
|
26
|
-
/* @__PURE__ */ e(u, { children: ((r = (l = a.user) == null ? void 0 : l.name) == null ? void 0 : r[0]) || "U" })
|
|
27
|
-
] }),
|
|
28
|
-
/* @__PURE__ */ e("div", { className: "w-[calc(100%-36px)]", children: /* @__PURE__ */ e("span", { className: "text-ds-md block w-full cursor-default truncate text-text-primary", children: ((d = a.user) == null ? void 0 : d.firstName) ?? ((i = (c = a.user) == null ? void 0 : c.name) == null ? void 0 : i.split(" ")[0]) }) })
|
|
29
|
-
] }),
|
|
30
|
-
/* @__PURE__ */ e("div", { className: "text-ds-md w-[16.4%] p-ds-04 px-ds-04 text-interactive", children: a.totalDays })
|
|
31
|
-
]
|
|
32
|
-
},
|
|
33
|
-
a.id
|
|
34
|
-
);
|
|
35
|
-
}) })
|
|
36
|
-
] });
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
h.displayName = "BreakBalance";
|
|
40
|
-
export {
|
|
41
|
-
h as BreakBalance
|
|
42
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as t, jsx as e, Fragment as N } from "react/jsx-runtime";
|
|
3
|
-
import * as g from "react";
|
|
4
|
-
import { Popover as D, PopoverTrigger as j, PopoverContent as T } from "@devalok/shilp-sutra/ui/popover";
|
|
5
|
-
import { Tooltip as S, TooltipTrigger as A, TooltipContent as B } from "@devalok/shilp-sutra/ui";
|
|
6
|
-
import { EditBreak as C } from "./edit-break.js";
|
|
7
|
-
import { formatOptionalDate as p } from "../utils/date-utils.js";
|
|
8
|
-
import { renderStatus as E } from "../utils/render-status.js";
|
|
9
|
-
import { IconButton as R } from "@devalok/shilp-sutra/ui/icon-button";
|
|
10
|
-
import { isSameDay as M } from "date-fns";
|
|
11
|
-
import { IconDotsVertical as O } from "@tabler/icons-react";
|
|
12
|
-
const P = g.forwardRef(
|
|
13
|
-
function({
|
|
14
|
-
breaks: x,
|
|
15
|
-
userImages: d,
|
|
16
|
-
existingBreaks: f,
|
|
17
|
-
onFetchMonthBreaks: h,
|
|
18
|
-
onSave: w,
|
|
19
|
-
onDelete: v,
|
|
20
|
-
onRefresh: _
|
|
21
|
-
}, u) {
|
|
22
|
-
return /* @__PURE__ */ t("div", { ref: u, className: "m-0 flex h-[400px] w-full flex-col items-start justify-start p-0 max-md:h-auto", children: [
|
|
23
|
-
/* @__PURE__ */ t("div", { className: "mx-auto mb-ds-05 mt-ds-04 flex w-[92%] items-center", children: [
|
|
24
|
-
/* @__PURE__ */ e("div", { className: "w-[16%] min-w-[120px] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "NAME" }) }),
|
|
25
|
-
/* @__PURE__ */ e("div", { className: "w-[19%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "DATE" }) }),
|
|
26
|
-
/* @__PURE__ */ e("div", { className: "w-[8%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider w-full text-center text-text-tertiary", children: "DAYS" }) }),
|
|
27
|
-
/* @__PURE__ */ e("div", { className: "w-[22%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "REASON" }) }),
|
|
28
|
-
/* @__PURE__ */ e("div", { className: "flex w-[14%] items-center justify-start overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "STATUS" }) }),
|
|
29
|
-
/* @__PURE__ */ e("div", { className: "w-[24%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-tertiary", children: "COMMENT" }) }),
|
|
30
|
-
/* @__PURE__ */ e("div", { className: "w-ds-lg overflow-hidden px-ds-04 py-ds-03" })
|
|
31
|
-
] }),
|
|
32
|
-
/* @__PURE__ */ e("div", { className: "no-scrollbar mx-auto flex w-[92%] flex-col gap-ds-05 overflow-y-auto max-md:h-[calc(100dvh-373px)]", children: x.map((s) => {
|
|
33
|
-
var l, a, n, c, o, m;
|
|
34
|
-
const r = new Date(s.startDate), i = new Date(s.endDate), y = M(r, i);
|
|
35
|
-
return /* @__PURE__ */ t(
|
|
36
|
-
"div",
|
|
37
|
-
{
|
|
38
|
-
className: "flex w-full items-center hover:bg-field",
|
|
39
|
-
children: [
|
|
40
|
-
/* @__PURE__ */ t("div", { className: "flex w-[16%] min-w-[120px] items-center gap-ds-03 overflow-hidden px-ds-04 py-ds-03", children: [
|
|
41
|
-
d[s.userId] ? /* @__PURE__ */ e(
|
|
42
|
-
"img",
|
|
43
|
-
{
|
|
44
|
-
src: d[s.userId],
|
|
45
|
-
alt: "",
|
|
46
|
-
className: "h-ds-xs-plus w-full max-w-7 flex-shrink-0 rounded-ds-full object-cover"
|
|
47
|
-
}
|
|
48
|
-
) : /* @__PURE__ */ e("span", { className: "flex h-ds-xs-plus w-full max-w-7 items-center justify-center rounded-ds-full bg-layer-02 text-ds-sm font-medium uppercase text-text-primary", children: ((a = (l = s.user) == null ? void 0 : l.name) == null ? void 0 : a[0]) || "U" }),
|
|
49
|
-
/* @__PURE__ */ t(S, { children: [
|
|
50
|
-
/* @__PURE__ */ e(A, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "text-ds-md truncate text-text-primary", children: ((n = s.user) == null ? void 0 : n.name) || ((o = (c = s.user) == null ? void 0 : c.name) == null ? void 0 : o.split(" ")[0]) }) }),
|
|
51
|
-
/* @__PURE__ */ e(B, { children: (m = s.user) == null ? void 0 : m.name })
|
|
52
|
-
] })
|
|
53
|
-
] }),
|
|
54
|
-
/* @__PURE__ */ e("div", { className: "w-[19%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ t("span", { className: "text-ds-md whitespace-nowrap text-text-secondary", children: [
|
|
55
|
-
p(r),
|
|
56
|
-
" ",
|
|
57
|
-
!y && /* @__PURE__ */ t(N, { children: [
|
|
58
|
-
/* @__PURE__ */ e("span", { children: "-" }),
|
|
59
|
-
" ",
|
|
60
|
-
p(i)
|
|
61
|
-
] })
|
|
62
|
-
] }) }),
|
|
63
|
-
/* @__PURE__ */ e("div", { className: "flex w-[8%] items-center justify-center overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-center text-text-secondary", children: s.numberOfDays }) }),
|
|
64
|
-
/* @__PURE__ */ e("div", { className: "w-[22%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-text-tertiary", children: s.reason }) }),
|
|
65
|
-
/* @__PURE__ */ e("div", { className: "flex w-[14%] items-center justify-start overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-text-tertiary", children: E(s == null ? void 0 : s.status, s == null ? void 0 : s.correction) }) }),
|
|
66
|
-
/* @__PURE__ */ e("div", { className: "w-[24%] overflow-hidden px-ds-04 py-ds-03", children: /* @__PURE__ */ e("span", { className: "text-ds-md text-text-tertiary", children: s.adminComment || " " }) }),
|
|
67
|
-
/* @__PURE__ */ e("div", { className: "flex w-ds-lg justify-center px-ds-04 py-ds-03", children: /* @__PURE__ */ t(D, { children: [
|
|
68
|
-
/* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(R, { icon: /* @__PURE__ */ e(O, {}), size: "md", "aria-label": "More options" }) }),
|
|
69
|
-
/* @__PURE__ */ e(T, { className: "w-auto p-0", children: /* @__PURE__ */ e(
|
|
70
|
-
C,
|
|
71
|
-
{
|
|
72
|
-
selectedLeave: s,
|
|
73
|
-
existingBreaks: f,
|
|
74
|
-
onFetchMonthBreaks: h,
|
|
75
|
-
onSave: w,
|
|
76
|
-
onDelete: v
|
|
77
|
-
}
|
|
78
|
-
) })
|
|
79
|
-
] }) })
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
s.id
|
|
83
|
-
);
|
|
84
|
-
}) })
|
|
85
|
-
] });
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
P.displayName = "Breaks";
|
|
89
|
-
export {
|
|
90
|
-
P as Breaks
|
|
91
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import * as u from "react";
|
|
4
|
-
import { useState as c, useRef as p } from "react";
|
|
5
|
-
import { useToast as x } from "@devalok/shilp-sutra/hooks/use-toast";
|
|
6
|
-
import { Dialog as h, DialogTrigger as g, DialogContent as b } from "@devalok/shilp-sutra/ui/dialog";
|
|
7
|
-
import { Button as D } from "@devalok/shilp-sutra/ui/button";
|
|
8
|
-
import { IconButton as k } from "@devalok/shilp-sutra/ui/icon-button";
|
|
9
|
-
import { IconTrash as w } from "@tabler/icons-react";
|
|
10
|
-
const y = u.forwardRef(function({ id: B, userId: v, onDelete: l }, I) {
|
|
11
|
-
const [d, s] = c(!1), { toast: a } = x(), [m, o] = c(!1), i = p(null);
|
|
12
|
-
return /* @__PURE__ */ r(h, { open: m, onOpenChange: o, children: [
|
|
13
|
-
/* @__PURE__ */ t(g, { asChild: !0, children: /* @__PURE__ */ t(k, { icon: /* @__PURE__ */ t(w, {}), size: "md", "aria-label": "Delete break" }) }),
|
|
14
|
-
/* @__PURE__ */ r(b, { className: "flex w-[335px] flex-col items-center gap-ds-06 p-ds-06 max-md:w-[90%] max-md:rounded-ds-lg", children: [
|
|
15
|
-
/* @__PURE__ */ r("div", { className: "flex w-full max-w-[240px] flex-col items-center gap-ds-04 text-center", children: [
|
|
16
|
-
/* @__PURE__ */ t("p", { className: "text-ds-lg font-semibold text-center text-text-primary", children: "Delete this break?" }),
|
|
17
|
-
/* @__PURE__ */ t("p", { className: "text-ds-base text-text-tertiary", children: "This will be permanently deleted and can not undo" })
|
|
18
|
-
] }),
|
|
19
|
-
/* @__PURE__ */ t("form", { ref: i, onSubmit: async (e) => {
|
|
20
|
-
var n;
|
|
21
|
-
e.preventDefault(), (n = e.stopPropagation) == null || n.call(e), s(!0);
|
|
22
|
-
try {
|
|
23
|
-
l && l(), a({
|
|
24
|
-
description: "Break request deleted successfully",
|
|
25
|
-
color: "neutral"
|
|
26
|
-
}), o(!1);
|
|
27
|
-
} catch (f) {
|
|
28
|
-
console.error("Error deleting break request:", f), a({
|
|
29
|
-
title: "Error",
|
|
30
|
-
description: "Failed to delete break request",
|
|
31
|
-
color: "error"
|
|
32
|
-
});
|
|
33
|
-
} finally {
|
|
34
|
-
s(!1);
|
|
35
|
-
}
|
|
36
|
-
}, className: "w-full", children: /* @__PURE__ */ t(
|
|
37
|
-
D,
|
|
38
|
-
{
|
|
39
|
-
className: "w-full",
|
|
40
|
-
variant: "solid",
|
|
41
|
-
onClick: () => {
|
|
42
|
-
var e;
|
|
43
|
-
return (e = i.current) == null ? void 0 : e.requestSubmit();
|
|
44
|
-
},
|
|
45
|
-
disabled: d,
|
|
46
|
-
children: "Yes, Delete"
|
|
47
|
-
}
|
|
48
|
-
) })
|
|
49
|
-
] })
|
|
50
|
-
] });
|
|
51
|
-
});
|
|
52
|
-
y.displayName = "DeleteBreak";
|
|
53
|
-
export {
|
|
54
|
-
y as DeleteBreak
|
|
55
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import * as y from "react";
|
|
4
|
-
import { useState as o, useRef as w, useEffect as g } from "react";
|
|
5
|
-
import { useToast as N } from "@devalok/shilp-sutra/hooks/use-toast";
|
|
6
|
-
import { Dialog as k, DialogTrigger as D, DialogContent as B, DialogHeader as C, DialogDescription as E } from "@devalok/shilp-sutra/ui/dialog";
|
|
7
|
-
import { Button as p } from "@devalok/shilp-sutra/ui/button";
|
|
8
|
-
import { NumberInput as j } from "@devalok/shilp-sutra/ui/number-input";
|
|
9
|
-
import { IconPencil as F } from "@tabler/icons-react";
|
|
10
|
-
const I = y.forwardRef(function({
|
|
11
|
-
selectedLeave: r,
|
|
12
|
-
onSave: n
|
|
13
|
-
}, R) {
|
|
14
|
-
var e;
|
|
15
|
-
const [s, l] = o(!1), [c, u] = o(
|
|
16
|
-
typeof (r == null ? void 0 : r.cashout) == "number" ? r.cashout : 0
|
|
17
|
-
), [m, h] = o(
|
|
18
|
-
(r == null ? void 0 : r.carryForward) || 0
|
|
19
|
-
), d = w(null), { toast: f } = N();
|
|
20
|
-
g(() => {
|
|
21
|
-
u(
|
|
22
|
-
typeof (r == null ? void 0 : r.cashout) == "number" ? r.cashout : 0
|
|
23
|
-
), h((r == null ? void 0 : r.carryForward) || 0);
|
|
24
|
-
}, [r]);
|
|
25
|
-
const b = async (i) => {
|
|
26
|
-
i.preventDefault(), l(!0);
|
|
27
|
-
try {
|
|
28
|
-
n && n({
|
|
29
|
-
userId: r.userId,
|
|
30
|
-
cashOutDays: c,
|
|
31
|
-
carryForward: m,
|
|
32
|
-
year: (/* @__PURE__ */ new Date()).getFullYear()
|
|
33
|
-
}), f({
|
|
34
|
-
description: "Break balance updated successfully",
|
|
35
|
-
color: "neutral"
|
|
36
|
-
});
|
|
37
|
-
} catch (x) {
|
|
38
|
-
console.error("Error updating break balance:", x), f({
|
|
39
|
-
title: "Error",
|
|
40
|
-
description: "Failed to update break balance",
|
|
41
|
-
color: "error"
|
|
42
|
-
});
|
|
43
|
-
} finally {
|
|
44
|
-
l(!1);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
return /* @__PURE__ */ a(k, { children: [
|
|
48
|
-
/* @__PURE__ */ t(D, { asChild: !0, children: /* @__PURE__ */ a(
|
|
49
|
-
p,
|
|
50
|
-
{
|
|
51
|
-
variant: "outline",
|
|
52
|
-
className: "text-ds-base border-border bg-layer-01 px-ds-05 py-ds-04 pr-ds-06 text-text-secondary shadow-02",
|
|
53
|
-
children: [
|
|
54
|
-
/* @__PURE__ */ t(F, {}),
|
|
55
|
-
/* @__PURE__ */ t("span", { children: "Edit" })
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
) }),
|
|
59
|
-
/* @__PURE__ */ t(B, { className: "w-[308px] p-ds-06", children: /* @__PURE__ */ t(C, { children: /* @__PURE__ */ t(E, { children: /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-start gap-ds-05", children: [
|
|
60
|
-
/* @__PURE__ */ a("p", { className: "text-ds-md w-full text-left text-text-tertiary", children: [
|
|
61
|
-
"Edit break balance conversion of ",
|
|
62
|
-
/* @__PURE__ */ t("br", { className: "mb-ds-02" }),
|
|
63
|
-
/* @__PURE__ */ t("span", { className: "font-semibold text-interactive", children: (e = r == null ? void 0 : r.user) == null ? void 0 : e.name })
|
|
64
|
-
] }),
|
|
65
|
-
/* @__PURE__ */ a(
|
|
66
|
-
"form",
|
|
67
|
-
{
|
|
68
|
-
ref: d,
|
|
69
|
-
onSubmit: b,
|
|
70
|
-
id: "updatebreakbalanceform",
|
|
71
|
-
className: "flex w-full flex-col gap-ds-05",
|
|
72
|
-
children: [
|
|
73
|
-
/* @__PURE__ */ a("div", { className: "flex w-full items-center justify-between", children: [
|
|
74
|
-
/* @__PURE__ */ t("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-placeholder", children: "Cash out" }),
|
|
75
|
-
/* @__PURE__ */ t(
|
|
76
|
-
j,
|
|
77
|
-
{
|
|
78
|
-
value: c,
|
|
79
|
-
onValueChange: u,
|
|
80
|
-
min: 0,
|
|
81
|
-
max: 100,
|
|
82
|
-
step: 1,
|
|
83
|
-
disabled: s
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
] }),
|
|
87
|
-
/* @__PURE__ */ a("div", { className: "flex w-full items-center justify-between", children: [
|
|
88
|
-
/* @__PURE__ */ t("div", { className: "text-ds-sm font-semibold uppercase tracking-wider text-text-placeholder", children: "Carry forward" }),
|
|
89
|
-
/* @__PURE__ */ t("div", { className: "flex w-[100px] items-center justify-center", children: /* @__PURE__ */ t("div", { className: "text-ds-base font-semibold text-text-secondary", children: m }) })
|
|
90
|
-
] }),
|
|
91
|
-
/* @__PURE__ */ t(
|
|
92
|
-
p,
|
|
93
|
-
{
|
|
94
|
-
variant: "outline",
|
|
95
|
-
fullWidth: !0,
|
|
96
|
-
onClick: () => {
|
|
97
|
-
var i;
|
|
98
|
-
return (i = d.current) == null ? void 0 : i.requestSubmit();
|
|
99
|
-
},
|
|
100
|
-
disabled: s,
|
|
101
|
-
children: "Update"
|
|
102
|
-
}
|
|
103
|
-
)
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
)
|
|
107
|
-
] }) }) }) })
|
|
108
|
-
] });
|
|
109
|
-
});
|
|
110
|
-
I.displayName = "EditBreakBalance";
|
|
111
|
-
export {
|
|
112
|
-
I as EditBreakBalance
|
|
113
|
-
};
|