@ttianqii/takaui 0.1.5 → 0.1.6
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/README.md +98 -320
- package/dist/index.d.ts +0 -36
- package/dist/takaui.cjs +1 -1
- package/dist/takaui.cjs.map +1 -1
- package/dist/takaui.js +1108 -1255
- package/dist/takaui.js.map +1 -1
- package/package.json +1 -1
package/dist/takaui.js
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { clsx as
|
|
2
|
-
import { twMerge as
|
|
3
|
-
import { jsx as e, jsxs as
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import { Slot as
|
|
7
|
-
import * as
|
|
8
|
-
import { Check as
|
|
1
|
+
import { clsx as Pt } from "clsx";
|
|
2
|
+
import { twMerge as $t } from "tailwind-merge";
|
|
3
|
+
import { jsx as e, jsxs as r, Fragment as ze } from "react/jsx-runtime";
|
|
4
|
+
import * as S from "react";
|
|
5
|
+
import Ht, { useState as J, useMemo as Ie, createContext as At, useContext as Et, useRef as xe, useEffect as Ue } from "react";
|
|
6
|
+
import { Slot as Ft } from "@radix-ui/react-slot";
|
|
7
|
+
import * as _e from "@radix-ui/react-checkbox";
|
|
8
|
+
import { Check as ot, CheckIcon as Yt, CircleIcon as Ot, ChevronRightIcon as jt, Search as _t, ChevronDown as Ae, ChevronUp as Le, ChevronsUpDown as lt, ChevronLeft as ie, ChevronRight as ne, Calendar as Ve, Clock as Lt, X as Vt, Plus as Ke, Trash2 as Wt } from "lucide-react";
|
|
9
9
|
import * as U from "@radix-ui/react-dropdown-menu";
|
|
10
10
|
import * as B from "@radix-ui/react-select";
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import * as
|
|
14
|
-
import * as
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return Et(At(t));
|
|
11
|
+
import { startOfMonth as qe, endOfMonth as Xe, eachDayOfInterval as Qe, addMonths as Ze, format as ke, isSameMonth as et, subMonths as Bt, isSameDay as $e, isToday as Gt } from "date-fns";
|
|
12
|
+
import * as Se from "@radix-ui/react-popover";
|
|
13
|
+
import * as it from "@radix-ui/react-label";
|
|
14
|
+
import * as te from "@radix-ui/react-dialog";
|
|
15
|
+
function u(...t) {
|
|
16
|
+
return $t(Pt(t));
|
|
18
17
|
}
|
|
19
|
-
const b =
|
|
20
|
-
({ className: t, variant: a = "default", size:
|
|
21
|
-
|
|
18
|
+
const b = S.forwardRef(
|
|
19
|
+
({ className: t, variant: a = "default", size: n = "default", asChild: m = !1, ...f }, M) => /* @__PURE__ */ e(
|
|
20
|
+
m ? Ft : "button",
|
|
22
21
|
{
|
|
23
|
-
className:
|
|
22
|
+
className: u(
|
|
24
23
|
// Base styles
|
|
25
24
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all",
|
|
26
25
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
@@ -33,80 +32,80 @@ const b = w.forwardRef(
|
|
|
33
32
|
a === "ghost" && "bg-transparent text-gray-900 hover:bg-gray-100 active:bg-gray-200 active:scale-95",
|
|
34
33
|
a === "link" && "bg-transparent text-blue-600 underline-offset-4 hover:text-blue-700 hover:underline active:text-blue-800",
|
|
35
34
|
// Size styles
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
n === "default" && "h-9 px-4 py-2",
|
|
36
|
+
n === "sm" && "h-8 px-3 text-xs gap-1.5",
|
|
37
|
+
n === "lg" && "h-10 px-6",
|
|
38
|
+
n === "icon" && "h-9 w-9 p-0",
|
|
39
|
+
n === "icon-sm" && "h-8 w-8 p-0",
|
|
40
|
+
n === "icon-lg" && "h-10 w-10 p-0",
|
|
42
41
|
t
|
|
43
42
|
),
|
|
44
|
-
ref:
|
|
45
|
-
...
|
|
43
|
+
ref: M,
|
|
44
|
+
...f
|
|
46
45
|
}
|
|
47
46
|
)
|
|
48
47
|
);
|
|
49
48
|
b.displayName = "Button";
|
|
50
|
-
const
|
|
51
|
-
|
|
49
|
+
const We = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
50
|
+
_e.Root,
|
|
52
51
|
{
|
|
53
|
-
ref:
|
|
54
|
-
className:
|
|
52
|
+
ref: n,
|
|
53
|
+
className: u(
|
|
55
54
|
"peer h-4 w-4 shrink-0 rounded border border-gray-200 bg-white ring-offset-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-gray-900 data-[state=checked]:border-gray-900 data-[state=checked]:text-white transition-colors",
|
|
56
55
|
t
|
|
57
56
|
),
|
|
58
57
|
...a,
|
|
59
58
|
children: /* @__PURE__ */ e(
|
|
60
|
-
|
|
59
|
+
_e.Indicator,
|
|
61
60
|
{
|
|
62
|
-
className:
|
|
63
|
-
children: /* @__PURE__ */ e(
|
|
61
|
+
className: u("flex items-center justify-center text-current"),
|
|
62
|
+
children: /* @__PURE__ */ e(ot, { className: "h-3.5 w-3.5 stroke-[2.5]" })
|
|
64
63
|
}
|
|
65
64
|
)
|
|
66
65
|
}
|
|
67
66
|
));
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
({ className: t, type: a, ...
|
|
67
|
+
We.displayName = _e.Root.displayName;
|
|
68
|
+
const me = S.forwardRef(
|
|
69
|
+
({ className: t, type: a, ...n }, m) => /* @__PURE__ */ e(
|
|
71
70
|
"input",
|
|
72
71
|
{
|
|
73
72
|
type: a,
|
|
74
|
-
className:
|
|
73
|
+
className: u(
|
|
75
74
|
"flex h-10 w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-400 focus:outline-none focus:border-gray-500 hover:border-gray-400 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",
|
|
76
75
|
t
|
|
77
76
|
),
|
|
78
|
-
ref:
|
|
79
|
-
...
|
|
77
|
+
ref: m,
|
|
78
|
+
...n
|
|
80
79
|
}
|
|
81
80
|
)
|
|
82
81
|
);
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
({ className: t, orientation: a = "horizontal", decorative:
|
|
82
|
+
me.displayName = "Input";
|
|
83
|
+
const Jt = S.forwardRef(
|
|
84
|
+
({ className: t, orientation: a = "horizontal", decorative: n = !0, ...m }, f) => /* @__PURE__ */ e(
|
|
86
85
|
"div",
|
|
87
86
|
{
|
|
88
|
-
ref:
|
|
89
|
-
role:
|
|
87
|
+
ref: f,
|
|
88
|
+
role: n ? "none" : "separator",
|
|
90
89
|
"aria-orientation": a,
|
|
91
|
-
className:
|
|
90
|
+
className: u(
|
|
92
91
|
"shrink-0 bg-gray-200",
|
|
93
92
|
a === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
|
|
94
93
|
t
|
|
95
94
|
),
|
|
96
|
-
...
|
|
95
|
+
...m
|
|
97
96
|
}
|
|
98
97
|
)
|
|
99
98
|
);
|
|
100
|
-
|
|
101
|
-
const
|
|
99
|
+
Jt.displayName = "Separator";
|
|
100
|
+
const ct = S.createContext({
|
|
102
101
|
variant: "default"
|
|
103
102
|
});
|
|
104
|
-
function
|
|
103
|
+
function dt({
|
|
105
104
|
className: t,
|
|
106
105
|
variant: a = "default",
|
|
107
|
-
...
|
|
106
|
+
...n
|
|
108
107
|
}) {
|
|
109
|
-
return /* @__PURE__ */ e(
|
|
108
|
+
return /* @__PURE__ */ e(ct.Provider, { value: { variant: a }, children: /* @__PURE__ */ e(
|
|
110
109
|
"div",
|
|
111
110
|
{
|
|
112
111
|
"data-slot": "table-container",
|
|
@@ -115,39 +114,39 @@ function Ge({
|
|
|
115
114
|
"table",
|
|
116
115
|
{
|
|
117
116
|
"data-slot": "table",
|
|
118
|
-
className:
|
|
119
|
-
...
|
|
117
|
+
className: u("w-full caption-bottom text-sm", t),
|
|
118
|
+
...n
|
|
120
119
|
}
|
|
121
120
|
)
|
|
122
121
|
}
|
|
123
122
|
) });
|
|
124
123
|
}
|
|
125
|
-
function
|
|
124
|
+
function ut({ className: t, ...a }) {
|
|
126
125
|
return /* @__PURE__ */ e(
|
|
127
126
|
"thead",
|
|
128
127
|
{
|
|
129
128
|
"data-slot": "table-header",
|
|
130
|
-
className:
|
|
129
|
+
className: u("bg-gray-50 [&_tr]:border-b [&_tr]:border-gray-200", t),
|
|
131
130
|
...a
|
|
132
131
|
}
|
|
133
132
|
);
|
|
134
133
|
}
|
|
135
|
-
function
|
|
134
|
+
function mt({ className: t, ...a }) {
|
|
136
135
|
return /* @__PURE__ */ e(
|
|
137
136
|
"tbody",
|
|
138
137
|
{
|
|
139
138
|
"data-slot": "table-body",
|
|
140
|
-
className:
|
|
139
|
+
className: u("[&_tr:last-child]:border-b-0", t),
|
|
141
140
|
...a
|
|
142
141
|
}
|
|
143
142
|
);
|
|
144
143
|
}
|
|
145
|
-
function
|
|
144
|
+
function fa({ className: t, ...a }) {
|
|
146
145
|
return /* @__PURE__ */ e(
|
|
147
146
|
"tfoot",
|
|
148
147
|
{
|
|
149
148
|
"data-slot": "table-footer",
|
|
150
|
-
className:
|
|
149
|
+
className: u(
|
|
151
150
|
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
|
|
152
151
|
t
|
|
153
152
|
),
|
|
@@ -155,27 +154,27 @@ function wa({ className: t, ...a }) {
|
|
|
155
154
|
}
|
|
156
155
|
);
|
|
157
156
|
}
|
|
158
|
-
function
|
|
159
|
-
const { variant:
|
|
157
|
+
function Ne({ className: t, ...a }) {
|
|
158
|
+
const { variant: n } = S.useContext(ct);
|
|
160
159
|
return /* @__PURE__ */ e(
|
|
161
160
|
"tr",
|
|
162
161
|
{
|
|
163
162
|
"data-slot": "table-row",
|
|
164
|
-
className:
|
|
163
|
+
className: u(
|
|
165
164
|
"hover:bg-gray-50 data-[state=selected]:bg-gray-50 transition-colors border-b border-gray-200",
|
|
166
|
-
|
|
165
|
+
n === "clean" && "border-b-0",
|
|
167
166
|
t
|
|
168
167
|
),
|
|
169
168
|
...a
|
|
170
169
|
}
|
|
171
170
|
);
|
|
172
171
|
}
|
|
173
|
-
function
|
|
172
|
+
function ht({ className: t, ...a }) {
|
|
174
173
|
return /* @__PURE__ */ e(
|
|
175
174
|
"th",
|
|
176
175
|
{
|
|
177
176
|
"data-slot": "table-head",
|
|
178
|
-
className:
|
|
177
|
+
className: u(
|
|
179
178
|
"text-foreground h-auto px-3 py-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
180
179
|
t
|
|
181
180
|
),
|
|
@@ -183,12 +182,12 @@ function Ke({ className: t, ...a }) {
|
|
|
183
182
|
}
|
|
184
183
|
);
|
|
185
184
|
}
|
|
186
|
-
function
|
|
185
|
+
function He({ className: t, ...a }) {
|
|
187
186
|
return /* @__PURE__ */ e(
|
|
188
187
|
"td",
|
|
189
188
|
{
|
|
190
189
|
"data-slot": "table-cell",
|
|
191
|
-
className:
|
|
190
|
+
className: u(
|
|
192
191
|
"px-3 py-2 text-left align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
193
192
|
t
|
|
194
193
|
),
|
|
@@ -196,7 +195,7 @@ function ke({ className: t, ...a }) {
|
|
|
196
195
|
}
|
|
197
196
|
);
|
|
198
197
|
}
|
|
199
|
-
function
|
|
198
|
+
function ya({
|
|
200
199
|
className: t,
|
|
201
200
|
...a
|
|
202
201
|
}) {
|
|
@@ -204,22 +203,22 @@ function Sa({
|
|
|
204
203
|
"caption",
|
|
205
204
|
{
|
|
206
205
|
"data-slot": "table-caption",
|
|
207
|
-
className:
|
|
206
|
+
className: u("text-muted-foreground mt-4 text-sm", t),
|
|
208
207
|
...a
|
|
209
208
|
}
|
|
210
209
|
);
|
|
211
210
|
}
|
|
212
|
-
function
|
|
211
|
+
function xa({
|
|
213
212
|
...t
|
|
214
213
|
}) {
|
|
215
214
|
return /* @__PURE__ */ e(U.Root, { "data-slot": "dropdown-menu", ...t });
|
|
216
215
|
}
|
|
217
|
-
function
|
|
216
|
+
function ba({
|
|
218
217
|
...t
|
|
219
218
|
}) {
|
|
220
219
|
return /* @__PURE__ */ e(U.Portal, { "data-slot": "dropdown-menu-portal", ...t });
|
|
221
220
|
}
|
|
222
|
-
function
|
|
221
|
+
function va({
|
|
223
222
|
...t
|
|
224
223
|
}) {
|
|
225
224
|
return /* @__PURE__ */ e(
|
|
@@ -231,73 +230,73 @@ function ka({
|
|
|
231
230
|
}
|
|
232
231
|
);
|
|
233
232
|
}
|
|
234
|
-
function
|
|
233
|
+
function wa({
|
|
235
234
|
className: t,
|
|
236
235
|
sideOffset: a = 4,
|
|
237
|
-
...
|
|
236
|
+
...n
|
|
238
237
|
}) {
|
|
239
238
|
return /* @__PURE__ */ e(U.Portal, { children: /* @__PURE__ */ e(
|
|
240
239
|
U.Content,
|
|
241
240
|
{
|
|
242
241
|
"data-slot": "dropdown-menu-content",
|
|
243
242
|
sideOffset: a,
|
|
244
|
-
className:
|
|
243
|
+
className: u(
|
|
245
244
|
"bg-white text-gray-900 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border border-gray-200 p-2 shadow-lg",
|
|
246
245
|
t
|
|
247
246
|
),
|
|
248
|
-
...
|
|
247
|
+
...n
|
|
249
248
|
}
|
|
250
249
|
) });
|
|
251
250
|
}
|
|
252
|
-
function
|
|
251
|
+
function Na({
|
|
253
252
|
...t
|
|
254
253
|
}) {
|
|
255
254
|
return /* @__PURE__ */ e(U.Group, { "data-slot": "dropdown-menu-group", ...t });
|
|
256
255
|
}
|
|
257
|
-
function
|
|
256
|
+
function Sa({
|
|
258
257
|
className: t,
|
|
259
258
|
inset: a,
|
|
260
|
-
variant:
|
|
261
|
-
...
|
|
259
|
+
variant: n = "default",
|
|
260
|
+
...m
|
|
262
261
|
}) {
|
|
263
262
|
return /* @__PURE__ */ e(
|
|
264
263
|
U.Item,
|
|
265
264
|
{
|
|
266
265
|
"data-slot": "dropdown-menu-item",
|
|
267
266
|
"data-inset": a,
|
|
268
|
-
"data-variant":
|
|
269
|
-
className:
|
|
267
|
+
"data-variant": n,
|
|
268
|
+
className: u(
|
|
270
269
|
"focus:bg-gray-100 focus:text-gray-900 data-[variant=destructive]:text-red-600 data-[variant=destructive]:focus:bg-red-50 data-[variant=destructive]:focus:text-red-700 [&_svg:not([class*='text-'])]:text-gray-500 relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
271
270
|
t
|
|
272
271
|
),
|
|
273
|
-
...
|
|
272
|
+
...m
|
|
274
273
|
}
|
|
275
274
|
);
|
|
276
275
|
}
|
|
277
|
-
function
|
|
276
|
+
function Ma({
|
|
278
277
|
className: t,
|
|
279
278
|
children: a,
|
|
280
|
-
checked:
|
|
281
|
-
...
|
|
279
|
+
checked: n,
|
|
280
|
+
...m
|
|
282
281
|
}) {
|
|
283
|
-
return /* @__PURE__ */
|
|
282
|
+
return /* @__PURE__ */ r(
|
|
284
283
|
U.CheckboxItem,
|
|
285
284
|
{
|
|
286
285
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
287
|
-
className:
|
|
286
|
+
className: u(
|
|
288
287
|
"focus:bg-gray-100 focus:text-gray-900 relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
289
288
|
t
|
|
290
289
|
),
|
|
291
|
-
checked:
|
|
292
|
-
...
|
|
290
|
+
checked: n,
|
|
291
|
+
...m,
|
|
293
292
|
children: [
|
|
294
|
-
/* @__PURE__ */ e("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ e(U.ItemIndicator, { children: /* @__PURE__ */ e(
|
|
293
|
+
/* @__PURE__ */ e("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ e(U.ItemIndicator, { children: /* @__PURE__ */ e(Yt, { className: "size-4 text-blue-600" }) }) }),
|
|
295
294
|
a
|
|
296
295
|
]
|
|
297
296
|
}
|
|
298
297
|
);
|
|
299
298
|
}
|
|
300
|
-
function
|
|
299
|
+
function Da({
|
|
301
300
|
...t
|
|
302
301
|
}) {
|
|
303
302
|
return /* @__PURE__ */ e(
|
|
@@ -308,46 +307,46 @@ function Pa({
|
|
|
308
307
|
}
|
|
309
308
|
);
|
|
310
309
|
}
|
|
311
|
-
function
|
|
310
|
+
function ka({
|
|
312
311
|
className: t,
|
|
313
312
|
children: a,
|
|
314
|
-
...
|
|
313
|
+
...n
|
|
315
314
|
}) {
|
|
316
|
-
return /* @__PURE__ */
|
|
315
|
+
return /* @__PURE__ */ r(
|
|
317
316
|
U.RadioItem,
|
|
318
317
|
{
|
|
319
318
|
"data-slot": "dropdown-menu-radio-item",
|
|
320
|
-
className:
|
|
319
|
+
className: u(
|
|
321
320
|
"focus:bg-gray-100 focus:text-gray-900 relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
322
321
|
t
|
|
323
322
|
),
|
|
324
|
-
...
|
|
323
|
+
...n,
|
|
325
324
|
children: [
|
|
326
|
-
/* @__PURE__ */ e("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ e(U.ItemIndicator, { children: /* @__PURE__ */ e(
|
|
325
|
+
/* @__PURE__ */ e("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ e(U.ItemIndicator, { children: /* @__PURE__ */ e(Ot, { className: "size-2 fill-blue-600" }) }) }),
|
|
327
326
|
a
|
|
328
327
|
]
|
|
329
328
|
}
|
|
330
329
|
);
|
|
331
330
|
}
|
|
332
|
-
function
|
|
331
|
+
function Ca({
|
|
333
332
|
className: t,
|
|
334
333
|
inset: a,
|
|
335
|
-
...
|
|
334
|
+
...n
|
|
336
335
|
}) {
|
|
337
336
|
return /* @__PURE__ */ e(
|
|
338
337
|
U.Label,
|
|
339
338
|
{
|
|
340
339
|
"data-slot": "dropdown-menu-label",
|
|
341
340
|
"data-inset": a,
|
|
342
|
-
className:
|
|
341
|
+
className: u(
|
|
343
342
|
"px-2 py-1.5 text-sm font-semibold text-gray-900 data-[inset]:pl-8",
|
|
344
343
|
t
|
|
345
344
|
),
|
|
346
|
-
...
|
|
345
|
+
...n
|
|
347
346
|
}
|
|
348
347
|
);
|
|
349
348
|
}
|
|
350
|
-
function
|
|
349
|
+
function Ta({
|
|
351
350
|
className: t,
|
|
352
351
|
...a
|
|
353
352
|
}) {
|
|
@@ -355,12 +354,12 @@ function Ha({
|
|
|
355
354
|
U.Separator,
|
|
356
355
|
{
|
|
357
356
|
"data-slot": "dropdown-menu-separator",
|
|
358
|
-
className:
|
|
357
|
+
className: u("bg-gray-100 my-1 h-px", t),
|
|
359
358
|
...a
|
|
360
359
|
}
|
|
361
360
|
);
|
|
362
361
|
}
|
|
363
|
-
function
|
|
362
|
+
function Ia({
|
|
364
363
|
className: t,
|
|
365
364
|
...a
|
|
366
365
|
}) {
|
|
@@ -368,7 +367,7 @@ function Aa({
|
|
|
368
367
|
"span",
|
|
369
368
|
{
|
|
370
369
|
"data-slot": "dropdown-menu-shortcut",
|
|
371
|
-
className:
|
|
370
|
+
className: u(
|
|
372
371
|
"text-gray-500 ml-auto text-xs tracking-widest",
|
|
373
372
|
t
|
|
374
373
|
),
|
|
@@ -376,35 +375,35 @@ function Aa({
|
|
|
376
375
|
}
|
|
377
376
|
);
|
|
378
377
|
}
|
|
379
|
-
function
|
|
378
|
+
function za({
|
|
380
379
|
...t
|
|
381
380
|
}) {
|
|
382
381
|
return /* @__PURE__ */ e(U.Sub, { "data-slot": "dropdown-menu-sub", ...t });
|
|
383
382
|
}
|
|
384
|
-
function
|
|
383
|
+
function Ra({
|
|
385
384
|
className: t,
|
|
386
385
|
inset: a,
|
|
387
|
-
children:
|
|
388
|
-
...
|
|
386
|
+
children: n,
|
|
387
|
+
...m
|
|
389
388
|
}) {
|
|
390
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ r(
|
|
391
390
|
U.SubTrigger,
|
|
392
391
|
{
|
|
393
392
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
394
393
|
"data-inset": a,
|
|
395
|
-
className:
|
|
394
|
+
className: u(
|
|
396
395
|
"focus:bg-gray-100 focus:text-gray-900 data-[state=open]:bg-gray-100 data-[state=open]:text-gray-900 [&_svg:not([class*='text-'])]:text-gray-500 flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none transition-colors data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
397
396
|
t
|
|
398
397
|
),
|
|
399
|
-
...
|
|
398
|
+
...m,
|
|
400
399
|
children: [
|
|
401
|
-
|
|
402
|
-
/* @__PURE__ */ e(
|
|
400
|
+
n,
|
|
401
|
+
/* @__PURE__ */ e(jt, { className: "ml-auto size-4" })
|
|
403
402
|
]
|
|
404
403
|
}
|
|
405
404
|
);
|
|
406
405
|
}
|
|
407
|
-
function
|
|
406
|
+
function Pa({
|
|
408
407
|
className: t,
|
|
409
408
|
...a
|
|
410
409
|
}) {
|
|
@@ -412,7 +411,7 @@ function Ya({
|
|
|
412
411
|
U.SubContent,
|
|
413
412
|
{
|
|
414
413
|
"data-slot": "dropdown-menu-sub-content",
|
|
415
|
-
className:
|
|
414
|
+
className: u(
|
|
416
415
|
"bg-white text-gray-900 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border border-gray-200 p-2 shadow-lg",
|
|
417
416
|
t
|
|
418
417
|
),
|
|
@@ -420,133 +419,133 @@ function Ya({
|
|
|
420
419
|
}
|
|
421
420
|
);
|
|
422
421
|
}
|
|
423
|
-
function
|
|
422
|
+
function $a({
|
|
424
423
|
data: t = [],
|
|
425
424
|
columns: a,
|
|
426
|
-
searchPlaceholder:
|
|
427
|
-
onRowClick:
|
|
428
|
-
className:
|
|
429
|
-
showPagination:
|
|
430
|
-
showSearch:
|
|
431
|
-
pageSize:
|
|
432
|
-
renderToolbar:
|
|
433
|
-
variant:
|
|
425
|
+
searchPlaceholder: n = "Search...",
|
|
426
|
+
onRowClick: m,
|
|
427
|
+
className: f = "",
|
|
428
|
+
showPagination: M = !0,
|
|
429
|
+
showSearch: h = !0,
|
|
430
|
+
pageSize: z = 10,
|
|
431
|
+
renderToolbar: R,
|
|
432
|
+
variant: F = "default"
|
|
434
433
|
}) {
|
|
435
|
-
const [
|
|
436
|
-
if (!
|
|
437
|
-
const
|
|
438
|
-
return t.filter((
|
|
439
|
-
}, [t,
|
|
440
|
-
const l = a.find((o) => o.key ===
|
|
434
|
+
const [O, x] = J(1), [w] = J(z), [T, P] = J(""), [H, V] = J(null), [j, $] = J("asc"), G = Ie(() => {
|
|
435
|
+
if (!h || !T.trim()) return t;
|
|
436
|
+
const p = T.toLowerCase();
|
|
437
|
+
return t.filter((d) => a.some((l) => (l.accessor ? l.accessor(d) : d[l.key])?.toString().toLowerCase().includes(p)));
|
|
438
|
+
}, [t, T, h, a]), y = Ie(() => H ? [...G].sort((p, d) => {
|
|
439
|
+
const l = a.find((o) => o.key === H);
|
|
441
440
|
if (!l) return 0;
|
|
442
|
-
const c = l.accessor ? l.accessor(
|
|
441
|
+
const c = l.accessor ? l.accessor(p) : p[l.key], i = l.accessor ? l.accessor(d) : d[l.key];
|
|
443
442
|
if (c === i) return 0;
|
|
444
443
|
if (c == null) return 1;
|
|
445
444
|
if (i == null) return -1;
|
|
446
|
-
const
|
|
447
|
-
return
|
|
448
|
-
}) : G, [G,
|
|
449
|
-
if (!
|
|
450
|
-
const
|
|
451
|
-
return y.slice(
|
|
452
|
-
}, [y,
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
},
|
|
457
|
-
const c =
|
|
458
|
-
return
|
|
445
|
+
const C = c < i ? -1 : 1;
|
|
446
|
+
return j === "asc" ? C : -C;
|
|
447
|
+
}) : G, [G, H, j, a]), A = Ie(() => {
|
|
448
|
+
if (!M) return y;
|
|
449
|
+
const p = (O - 1) * w;
|
|
450
|
+
return y.slice(p, p + w);
|
|
451
|
+
}, [y, O, w, M]);
|
|
452
|
+
Ht.useEffect(() => x(1), [T]);
|
|
453
|
+
const W = (p) => {
|
|
454
|
+
H === p ? $(j === "asc" ? "desc" : "asc") : (V(p), $("asc"));
|
|
455
|
+
}, _ = (p, d, l) => {
|
|
456
|
+
const c = d.accessor ? d.accessor(p) : p[d.key];
|
|
457
|
+
return d.cell ? d.cell(c, p, l) : c;
|
|
459
458
|
};
|
|
460
|
-
return /* @__PURE__ */
|
|
461
|
-
(
|
|
462
|
-
|
|
459
|
+
return /* @__PURE__ */ r("div", { className: u("w-full space-y-4", f), children: [
|
|
460
|
+
(h || R) && /* @__PURE__ */ r("div", { className: "flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4", children: [
|
|
461
|
+
h && /* @__PURE__ */ r("div", { className: "relative w-full sm:w-auto", children: [
|
|
463
462
|
/* @__PURE__ */ e(_t, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400" }),
|
|
464
463
|
/* @__PURE__ */ e(
|
|
465
|
-
|
|
464
|
+
me,
|
|
466
465
|
{
|
|
467
|
-
placeholder:
|
|
468
|
-
value:
|
|
469
|
-
onChange: (
|
|
466
|
+
placeholder: n,
|
|
467
|
+
value: T,
|
|
468
|
+
onChange: (p) => P(p.target.value),
|
|
470
469
|
className: "pl-10 w-full sm:w-[300px] bg-gray-50 border-gray-300"
|
|
471
470
|
}
|
|
472
471
|
)
|
|
473
472
|
] }),
|
|
474
|
-
|
|
473
|
+
R && /* @__PURE__ */ e("div", { className: "w-full sm:w-auto", children: R() })
|
|
475
474
|
] }),
|
|
476
|
-
/* @__PURE__ */ e("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */ e(
|
|
478
|
-
|
|
475
|
+
/* @__PURE__ */ e("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ r(dt, { variant: F, children: [
|
|
476
|
+
/* @__PURE__ */ e(ut, { children: /* @__PURE__ */ e(Ne, { children: a.map((p) => /* @__PURE__ */ e(
|
|
477
|
+
ht,
|
|
479
478
|
{
|
|
480
479
|
className: "h-10 px-0 py-0",
|
|
481
|
-
style: { width:
|
|
482
|
-
children:
|
|
480
|
+
style: { width: p.width },
|
|
481
|
+
children: p.align === "center" || !p.align && typeof p.header != "string" ? /* @__PURE__ */ e("div", { className: "h-10 flex items-center justify-center", children: typeof p.header != "string" ? p.header : /* @__PURE__ */ e("span", { className: "text-xs font-normal text-gray-500 uppercase tracking-widest", children: p.header }) }) : /* @__PURE__ */ e("div", { className: "h-10 flex items-center text-xs font-normal text-gray-500 uppercase tracking-widest", children: typeof p.header != "string" ? /* @__PURE__ */ e("div", { children: p.header }) : p.sortable !== !1 ? /* @__PURE__ */ r(
|
|
483
482
|
b,
|
|
484
483
|
{
|
|
485
484
|
variant: "ghost",
|
|
486
485
|
className: "h-auto px-3 py-1.5 font-normal hover:bg-transparent hover:text-gray-900",
|
|
487
|
-
onClick: () =>
|
|
486
|
+
onClick: () => W(p.key),
|
|
488
487
|
children: [
|
|
489
|
-
|
|
490
|
-
|
|
488
|
+
p.header,
|
|
489
|
+
H === p.key && j === "desc" ? /* @__PURE__ */ e(Ae, { className: "h-4 w-4" }) : H === p.key && j === "asc" ? /* @__PURE__ */ e(Le, { className: "h-4 w-4" }) : /* @__PURE__ */ e(lt, { className: "h-4 w-4" })
|
|
491
490
|
]
|
|
492
491
|
}
|
|
493
|
-
) : /* @__PURE__ */ e("span", { className: "px-3", children:
|
|
492
|
+
) : /* @__PURE__ */ e("span", { className: "px-3", children: p.header }) })
|
|
494
493
|
},
|
|
495
|
-
|
|
494
|
+
p.key
|
|
496
495
|
)) }) }),
|
|
497
|
-
/* @__PURE__ */ e(
|
|
498
|
-
|
|
496
|
+
/* @__PURE__ */ e(mt, { children: A.length === 0 ? /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(
|
|
497
|
+
He,
|
|
499
498
|
{
|
|
500
499
|
colSpan: a.length,
|
|
501
500
|
className: "text-center py-8 text-gray-500",
|
|
502
501
|
children: "No results found."
|
|
503
502
|
}
|
|
504
|
-
) }) :
|
|
505
|
-
|
|
503
|
+
) }) : A.map((p, d) => /* @__PURE__ */ e(
|
|
504
|
+
Ne,
|
|
506
505
|
{
|
|
507
506
|
className: "hover:bg-gray-50 cursor-pointer",
|
|
508
|
-
onClick: () =>
|
|
507
|
+
onClick: () => m?.(p),
|
|
509
508
|
children: a.map((l) => {
|
|
510
509
|
const c = l.align === "center" || !l.align && typeof l.header != "string";
|
|
511
510
|
return /* @__PURE__ */ e(
|
|
512
|
-
|
|
511
|
+
He,
|
|
513
512
|
{
|
|
514
513
|
className: c ? "px-0 py-4" : "px-3 py-4",
|
|
515
514
|
style: { width: l.width },
|
|
516
|
-
children: c ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-full", children:
|
|
515
|
+
children: c ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-full", children: _(p, l, d) }) : _(p, l, d)
|
|
517
516
|
},
|
|
518
517
|
l.key
|
|
519
518
|
);
|
|
520
519
|
})
|
|
521
520
|
},
|
|
522
|
-
|
|
521
|
+
d
|
|
523
522
|
)) })
|
|
524
523
|
] }) }) }),
|
|
525
|
-
|
|
526
|
-
/* @__PURE__ */
|
|
524
|
+
M && /* @__PURE__ */ r("div", { className: "flex items-center justify-between px-2 py-4", children: [
|
|
525
|
+
/* @__PURE__ */ r("div", { className: "text-sm text-gray-600", children: [
|
|
527
526
|
"Showing ",
|
|
528
|
-
|
|
527
|
+
A.length,
|
|
529
528
|
" of ",
|
|
530
529
|
y.length,
|
|
531
530
|
" row(s)"
|
|
532
531
|
] }),
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
533
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700", children: [
|
|
535
534
|
"Page ",
|
|
536
|
-
|
|
535
|
+
O,
|
|
537
536
|
" of ",
|
|
538
|
-
Math.ceil(y.length /
|
|
537
|
+
Math.ceil(y.length / w)
|
|
539
538
|
] }),
|
|
540
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ r("div", { className: "flex gap-1", children: [
|
|
541
540
|
/* @__PURE__ */ e(
|
|
542
541
|
b,
|
|
543
542
|
{
|
|
544
543
|
variant: "outline",
|
|
545
544
|
size: "sm",
|
|
546
|
-
onClick: () => x((
|
|
547
|
-
disabled:
|
|
545
|
+
onClick: () => x((p) => Math.max(1, p - 1)),
|
|
546
|
+
disabled: O === 1,
|
|
548
547
|
className: "h-8 w-8 p-0",
|
|
549
|
-
children: /* @__PURE__ */ e(
|
|
548
|
+
children: /* @__PURE__ */ e(ie, { className: "h-4 w-4" })
|
|
550
549
|
}
|
|
551
550
|
),
|
|
552
551
|
/* @__PURE__ */ e(
|
|
@@ -554,10 +553,10 @@ function ja({
|
|
|
554
553
|
{
|
|
555
554
|
variant: "outline",
|
|
556
555
|
size: "sm",
|
|
557
|
-
onClick: () => x((
|
|
558
|
-
disabled:
|
|
556
|
+
onClick: () => x((p) => Math.min(Math.ceil(y.length / w), p + 1)),
|
|
557
|
+
disabled: O === Math.ceil(y.length / w),
|
|
559
558
|
className: "h-8 w-8 p-0",
|
|
560
|
-
children: /* @__PURE__ */ e(
|
|
559
|
+
children: /* @__PURE__ */ e(ne, { className: "h-4 w-4" })
|
|
561
560
|
}
|
|
562
561
|
)
|
|
563
562
|
] })
|
|
@@ -565,268 +564,268 @@ function ja({
|
|
|
565
564
|
] })
|
|
566
565
|
] });
|
|
567
566
|
}
|
|
568
|
-
const
|
|
569
|
-
function
|
|
570
|
-
const t =
|
|
567
|
+
const gt = At(null);
|
|
568
|
+
function Re() {
|
|
569
|
+
const t = Et(gt);
|
|
571
570
|
if (!t)
|
|
572
571
|
throw new Error("useDataGrid must be used within DataGrid");
|
|
573
572
|
return t;
|
|
574
573
|
}
|
|
575
|
-
function
|
|
574
|
+
function Ha({
|
|
576
575
|
columns: t,
|
|
577
576
|
data: a,
|
|
578
|
-
getRowId:
|
|
579
|
-
onRowClick:
|
|
580
|
-
children:
|
|
581
|
-
recordCount:
|
|
577
|
+
getRowId: n = (h) => h.id || String(Math.random()),
|
|
578
|
+
onRowClick: m,
|
|
579
|
+
children: f,
|
|
580
|
+
recordCount: M
|
|
582
581
|
}) {
|
|
583
|
-
const [
|
|
584
|
-
for (const
|
|
585
|
-
const o = t.find((
|
|
582
|
+
const [h, z] = J({ pageIndex: 0, pageSize: 5 }), [R, F] = J([]), [O, x] = J(/* @__PURE__ */ new Set()), w = Ie(() => R.length === 0 ? a : [...a].sort((c, i) => {
|
|
583
|
+
for (const C of R) {
|
|
584
|
+
const o = t.find((Y) => Y.id === C.id);
|
|
586
585
|
if (!o?.accessorKey) continue;
|
|
587
|
-
const
|
|
588
|
-
if (
|
|
589
|
-
const
|
|
590
|
-
return
|
|
586
|
+
const k = c[o.accessorKey], N = i[o.accessorKey];
|
|
587
|
+
if (k === N) continue;
|
|
588
|
+
const I = k < N ? -1 : 1;
|
|
589
|
+
return C.desc ? -I : I;
|
|
591
590
|
}
|
|
592
591
|
return 0;
|
|
593
|
-
}), [a,
|
|
594
|
-
const l =
|
|
595
|
-
return
|
|
596
|
-
}, [
|
|
597
|
-
|
|
592
|
+
}), [a, R, t]), T = Ie(() => {
|
|
593
|
+
const l = h.pageIndex * h.pageSize, c = l + h.pageSize;
|
|
594
|
+
return w.slice(l, c);
|
|
595
|
+
}, [w, h]), P = Math.ceil(w.length / h.pageSize), H = P, V = h.pageIndex > 0, j = h.pageIndex < P - 1, $ = () => z((l) => ({ ...l, pageIndex: l.pageIndex - 1 })), G = () => {
|
|
596
|
+
z((l) => ({
|
|
598
597
|
...l,
|
|
599
|
-
pageIndex: Math.min(l.pageIndex + 1,
|
|
598
|
+
pageIndex: Math.min(l.pageIndex + 1, H - 1)
|
|
600
599
|
}));
|
|
601
600
|
}, y = (l) => {
|
|
602
|
-
|
|
601
|
+
z(() => ({
|
|
603
602
|
pageIndex: 0,
|
|
604
603
|
pageSize: l
|
|
605
604
|
}));
|
|
606
|
-
},
|
|
607
|
-
|
|
605
|
+
}, A = (l) => {
|
|
606
|
+
z((c) => ({
|
|
608
607
|
...c,
|
|
609
|
-
pageIndex: Math.max(0, Math.min(l,
|
|
608
|
+
pageIndex: Math.max(0, Math.min(l, H - 1))
|
|
610
609
|
}));
|
|
611
|
-
},
|
|
610
|
+
}, W = (l) => {
|
|
612
611
|
x((c) => {
|
|
613
612
|
const i = new Set(c);
|
|
614
613
|
return i.has(l) ? i.delete(l) : i.add(l), i;
|
|
615
614
|
});
|
|
616
|
-
},
|
|
617
|
-
|
|
618
|
-
},
|
|
615
|
+
}, _ = () => {
|
|
616
|
+
O.size === T.length ? x(/* @__PURE__ */ new Set()) : x(new Set(T.map((l) => n(l))));
|
|
617
|
+
}, p = T.length > 0 && O.size === T.length, d = {
|
|
619
618
|
columns: t,
|
|
620
619
|
data: a,
|
|
621
|
-
getRowId:
|
|
622
|
-
onRowClick:
|
|
623
|
-
pagination:
|
|
624
|
-
setPagination:
|
|
625
|
-
canPreviousPage:
|
|
626
|
-
canNextPage:
|
|
620
|
+
getRowId: n,
|
|
621
|
+
onRowClick: m,
|
|
622
|
+
pagination: h,
|
|
623
|
+
setPagination: z,
|
|
624
|
+
canPreviousPage: V,
|
|
625
|
+
canNextPage: j,
|
|
627
626
|
previousPage: $,
|
|
628
627
|
nextPage: G,
|
|
629
628
|
setPageSize: y,
|
|
630
|
-
goToPage:
|
|
631
|
-
pageCount:
|
|
632
|
-
sorting:
|
|
633
|
-
setSorting:
|
|
634
|
-
selectedRows:
|
|
635
|
-
toggleRow:
|
|
636
|
-
toggleAllRows:
|
|
637
|
-
isAllRowsSelected:
|
|
638
|
-
paginatedData:
|
|
639
|
-
sortedData:
|
|
640
|
-
totalPages:
|
|
641
|
-
recordCount:
|
|
629
|
+
goToPage: A,
|
|
630
|
+
pageCount: H,
|
|
631
|
+
sorting: R,
|
|
632
|
+
setSorting: F,
|
|
633
|
+
selectedRows: O,
|
|
634
|
+
toggleRow: W,
|
|
635
|
+
toggleAllRows: _,
|
|
636
|
+
isAllRowsSelected: p,
|
|
637
|
+
paginatedData: T,
|
|
638
|
+
sortedData: w,
|
|
639
|
+
totalPages: P,
|
|
640
|
+
recordCount: M ?? a.length
|
|
642
641
|
};
|
|
643
|
-
return /* @__PURE__ */ e(
|
|
642
|
+
return /* @__PURE__ */ e(gt.Provider, { value: d, children: f });
|
|
644
643
|
}
|
|
645
|
-
function
|
|
646
|
-
const { columns: t, paginatedData: a, getRowId:
|
|
647
|
-
return /* @__PURE__ */ e("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */
|
|
648
|
-
/* @__PURE__ */ e(
|
|
649
|
-
|
|
644
|
+
function Aa() {
|
|
645
|
+
const { columns: t, paginatedData: a, getRowId: n, onRowClick: m } = Re();
|
|
646
|
+
return /* @__PURE__ */ e("div", { className: "border border-gray-200 rounded-lg overflow-hidden", children: /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ r(dt, { children: [
|
|
647
|
+
/* @__PURE__ */ e(ut, { children: /* @__PURE__ */ e(Ne, { children: t.map((f) => /* @__PURE__ */ e(
|
|
648
|
+
ht,
|
|
650
649
|
{
|
|
651
650
|
className: "h-10 px-0 py-0",
|
|
652
|
-
style: { width:
|
|
653
|
-
children:
|
|
651
|
+
style: { width: f.size ? `${f.size}px` : void 0 },
|
|
652
|
+
children: f.align === "center" ? /* @__PURE__ */ e("div", { className: "h-10 flex items-center justify-center", children: typeof f.header != "string" ? f.header : /* @__PURE__ */ e("span", { className: "text-xs font-normal text-gray-500 uppercase tracking-widest", children: f.header }) }) : /* @__PURE__ */ e("div", { className: "h-10 flex items-center text-xs font-normal text-gray-500 uppercase tracking-widest", children: typeof f.header != "string" ? /* @__PURE__ */ e("div", { children: f.header }) : /* @__PURE__ */ e("span", { className: "px-3", children: f.header }) })
|
|
654
653
|
},
|
|
655
|
-
|
|
654
|
+
f.id
|
|
656
655
|
)) }) }),
|
|
657
|
-
/* @__PURE__ */ e(
|
|
658
|
-
|
|
656
|
+
/* @__PURE__ */ e(mt, { children: a.length === 0 ? /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ e(He, { colSpan: t.length, className: "text-center py-8 text-gray-500", children: "No results found." }) }) : a.map((f, M) => /* @__PURE__ */ e(
|
|
657
|
+
Ne,
|
|
659
658
|
{
|
|
660
659
|
className: "hover:bg-gray-50 cursor-pointer",
|
|
661
|
-
onClick: () =>
|
|
662
|
-
children: t.map((
|
|
663
|
-
const
|
|
660
|
+
onClick: () => m?.(f),
|
|
661
|
+
children: t.map((h) => {
|
|
662
|
+
const z = h.align === "center", R = h.cell ? h.cell(f, M) : h.accessorKey ? f[h.accessorKey] : null;
|
|
664
663
|
return /* @__PURE__ */ e(
|
|
665
|
-
|
|
664
|
+
He,
|
|
666
665
|
{
|
|
667
|
-
className:
|
|
668
|
-
style: { width:
|
|
669
|
-
children:
|
|
666
|
+
className: z ? "px-0 py-4" : "px-3 py-4",
|
|
667
|
+
style: { width: h.size ? `${h.size}px` : void 0 },
|
|
668
|
+
children: z ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-full", children: R }) : R
|
|
670
669
|
},
|
|
671
|
-
|
|
670
|
+
h.id
|
|
672
671
|
);
|
|
673
672
|
})
|
|
674
673
|
},
|
|
675
|
-
|
|
674
|
+
n(f)
|
|
676
675
|
)) })
|
|
677
676
|
] }) }) });
|
|
678
677
|
}
|
|
679
|
-
const
|
|
678
|
+
const Ce = B.Root, Ea = B.Group, Te = B.Value, be = S.forwardRef(({ className: t, children: a, ...n }, m) => /* @__PURE__ */ r(
|
|
680
679
|
B.Trigger,
|
|
681
680
|
{
|
|
682
|
-
ref:
|
|
683
|
-
className:
|
|
681
|
+
ref: m,
|
|
682
|
+
className: u(
|
|
684
683
|
"flex h-10 w-full items-center justify-between rounded-md border border-gray-300 bg-white px-3 py-2 text-sm ring-offset-white placeholder:text-gray-400 focus:outline-none focus:border-gray-500 hover:border-gray-400 disabled:cursor-not-allowed disabled:opacity-50 transition-colors",
|
|
685
684
|
t
|
|
686
685
|
),
|
|
687
|
-
...
|
|
686
|
+
...n,
|
|
688
687
|
children: [
|
|
689
688
|
a,
|
|
690
|
-
/* @__PURE__ */ e(B.Icon, { asChild: !0, children: /* @__PURE__ */ e(
|
|
689
|
+
/* @__PURE__ */ e(B.Icon, { asChild: !0, children: /* @__PURE__ */ e(Ae, { className: "h-4 w-4 opacity-50" }) })
|
|
691
690
|
]
|
|
692
691
|
}
|
|
693
692
|
));
|
|
694
693
|
be.displayName = B.Trigger.displayName;
|
|
695
|
-
const
|
|
694
|
+
const pt = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
696
695
|
B.ScrollUpButton,
|
|
697
696
|
{
|
|
698
|
-
ref:
|
|
699
|
-
className:
|
|
697
|
+
ref: n,
|
|
698
|
+
className: u(
|
|
700
699
|
"flex cursor-default items-center justify-center py-1",
|
|
701
700
|
t
|
|
702
701
|
),
|
|
703
702
|
...a,
|
|
704
|
-
children: /* @__PURE__ */ e(
|
|
703
|
+
children: /* @__PURE__ */ e(Le, { className: "h-4 w-4" })
|
|
705
704
|
}
|
|
706
705
|
));
|
|
707
|
-
|
|
708
|
-
const
|
|
706
|
+
pt.displayName = B.ScrollUpButton.displayName;
|
|
707
|
+
const ft = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
709
708
|
B.ScrollDownButton,
|
|
710
709
|
{
|
|
711
|
-
ref:
|
|
712
|
-
className:
|
|
710
|
+
ref: n,
|
|
711
|
+
className: u(
|
|
713
712
|
"flex cursor-default items-center justify-center py-1",
|
|
714
713
|
t
|
|
715
714
|
),
|
|
716
715
|
...a,
|
|
717
|
-
children: /* @__PURE__ */ e(
|
|
716
|
+
children: /* @__PURE__ */ e(Ae, { className: "h-4 w-4" })
|
|
718
717
|
}
|
|
719
718
|
));
|
|
720
|
-
|
|
721
|
-
const ve =
|
|
719
|
+
ft.displayName = B.ScrollDownButton.displayName;
|
|
720
|
+
const ve = S.forwardRef(({ className: t, children: a, position: n = "popper", ...m }, f) => /* @__PURE__ */ e(B.Portal, { children: /* @__PURE__ */ r(
|
|
722
721
|
B.Content,
|
|
723
722
|
{
|
|
724
|
-
ref:
|
|
725
|
-
className:
|
|
723
|
+
ref: f,
|
|
724
|
+
className: u(
|
|
726
725
|
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-gray-200 bg-white text-gray-950 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
727
|
-
|
|
726
|
+
n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
728
727
|
t
|
|
729
728
|
),
|
|
730
|
-
position:
|
|
731
|
-
...
|
|
729
|
+
position: n,
|
|
730
|
+
...m,
|
|
732
731
|
children: [
|
|
733
|
-
/* @__PURE__ */ e(
|
|
732
|
+
/* @__PURE__ */ e(pt, {}),
|
|
734
733
|
/* @__PURE__ */ e(
|
|
735
734
|
B.Viewport,
|
|
736
735
|
{
|
|
737
|
-
className:
|
|
736
|
+
className: u(
|
|
738
737
|
"p-1",
|
|
739
|
-
|
|
738
|
+
n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
740
739
|
),
|
|
741
740
|
children: a
|
|
742
741
|
}
|
|
743
742
|
),
|
|
744
|
-
/* @__PURE__ */ e(
|
|
743
|
+
/* @__PURE__ */ e(ft, {})
|
|
745
744
|
]
|
|
746
745
|
}
|
|
747
746
|
) }));
|
|
748
747
|
ve.displayName = B.Content.displayName;
|
|
749
|
-
const
|
|
748
|
+
const Ut = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
750
749
|
B.Label,
|
|
751
750
|
{
|
|
752
|
-
ref:
|
|
753
|
-
className:
|
|
751
|
+
ref: n,
|
|
752
|
+
className: u("py-1.5 pl-8 pr-2 text-sm font-semibold", t),
|
|
754
753
|
...a
|
|
755
754
|
}
|
|
756
755
|
));
|
|
757
|
-
|
|
758
|
-
const
|
|
756
|
+
Ut.displayName = B.Label.displayName;
|
|
757
|
+
const ye = S.forwardRef(({ className: t, children: a, ...n }, m) => /* @__PURE__ */ r(
|
|
759
758
|
B.Item,
|
|
760
759
|
{
|
|
761
|
-
ref:
|
|
762
|
-
className:
|
|
760
|
+
ref: m,
|
|
761
|
+
className: u(
|
|
763
762
|
"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-gray-100 focus:text-gray-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
764
763
|
t
|
|
765
764
|
),
|
|
766
|
-
...
|
|
765
|
+
...n,
|
|
767
766
|
children: [
|
|
768
|
-
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(B.ItemIndicator, { children: /* @__PURE__ */ e(
|
|
767
|
+
/* @__PURE__ */ e("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ e(B.ItemIndicator, { children: /* @__PURE__ */ e(ot, { className: "h-4 w-4" }) }) }),
|
|
769
768
|
/* @__PURE__ */ e(B.ItemText, { children: a })
|
|
770
769
|
]
|
|
771
770
|
}
|
|
772
771
|
));
|
|
773
|
-
|
|
774
|
-
const
|
|
772
|
+
ye.displayName = B.Item.displayName;
|
|
773
|
+
const Kt = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
775
774
|
B.Separator,
|
|
776
775
|
{
|
|
777
|
-
ref:
|
|
778
|
-
className:
|
|
776
|
+
ref: n,
|
|
777
|
+
className: u("-mx-1 my-1 h-px bg-gray-100", t),
|
|
779
778
|
...a
|
|
780
779
|
}
|
|
781
780
|
));
|
|
782
|
-
|
|
783
|
-
function
|
|
781
|
+
Kt.displayName = B.Separator.displayName;
|
|
782
|
+
function Fa({
|
|
784
783
|
mode: t = "simple",
|
|
785
784
|
pageSizeOptions: a = [5, 10, 15, 20]
|
|
786
785
|
}) {
|
|
787
786
|
const {
|
|
788
|
-
canPreviousPage:
|
|
789
|
-
canNextPage:
|
|
790
|
-
previousPage:
|
|
791
|
-
nextPage:
|
|
792
|
-
pageCount:
|
|
793
|
-
pagination:
|
|
794
|
-
setPageSize:
|
|
795
|
-
goToPage:
|
|
796
|
-
} =
|
|
797
|
-
const x =
|
|
798
|
-
if (
|
|
799
|
-
for (let
|
|
800
|
-
|
|
787
|
+
canPreviousPage: n,
|
|
788
|
+
canNextPage: m,
|
|
789
|
+
previousPage: f,
|
|
790
|
+
nextPage: M,
|
|
791
|
+
pageCount: h,
|
|
792
|
+
pagination: z,
|
|
793
|
+
setPageSize: R,
|
|
794
|
+
goToPage: F
|
|
795
|
+
} = Re(), O = () => {
|
|
796
|
+
const x = z.pageIndex, w = h, T = [];
|
|
797
|
+
if (w <= 7)
|
|
798
|
+
for (let P = 0; P < w; P++)
|
|
799
|
+
T.push(P);
|
|
801
800
|
else if (x <= 3) {
|
|
802
|
-
for (let
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
} else if (x >=
|
|
806
|
-
|
|
807
|
-
for (let
|
|
808
|
-
|
|
801
|
+
for (let P = 0; P <= 4; P++)
|
|
802
|
+
T.push(P);
|
|
803
|
+
T.push("..."), T.push(w - 1);
|
|
804
|
+
} else if (x >= w - 4) {
|
|
805
|
+
T.push(0), T.push("...");
|
|
806
|
+
for (let P = w - 5; P < w; P++)
|
|
807
|
+
T.push(P);
|
|
809
808
|
} else
|
|
810
|
-
|
|
811
|
-
return
|
|
809
|
+
T.push(0), T.push("..."), T.push(x - 1), T.push(x), T.push(x + 1), T.push("..."), T.push(w - 1);
|
|
810
|
+
return T;
|
|
812
811
|
};
|
|
813
|
-
return t === "simple" ? /* @__PURE__ */ e("div", { className: "flex items-center justify-end px-2 py-4", children: /* @__PURE__ */
|
|
814
|
-
/* @__PURE__ */
|
|
812
|
+
return t === "simple" ? /* @__PURE__ */ e("div", { className: "flex items-center justify-end px-2 py-4", children: /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
|
|
813
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 hidden sm:block", children: [
|
|
815
814
|
"Page ",
|
|
816
|
-
|
|
815
|
+
z.pageIndex + 1,
|
|
817
816
|
" of ",
|
|
818
|
-
|
|
817
|
+
h
|
|
819
818
|
] }),
|
|
820
|
-
/* @__PURE__ */
|
|
819
|
+
/* @__PURE__ */ r("div", { className: "flex gap-1", children: [
|
|
821
820
|
/* @__PURE__ */ e(
|
|
822
821
|
b,
|
|
823
822
|
{
|
|
824
823
|
variant: "outline",
|
|
825
824
|
size: "sm",
|
|
826
|
-
onClick:
|
|
827
|
-
disabled: !
|
|
825
|
+
onClick: f,
|
|
826
|
+
disabled: !n,
|
|
828
827
|
className: "h-8 w-8 p-0",
|
|
829
|
-
children: /* @__PURE__ */ e(
|
|
828
|
+
children: /* @__PURE__ */ e(ie, { className: "h-4 w-4" })
|
|
830
829
|
}
|
|
831
830
|
),
|
|
832
831
|
/* @__PURE__ */ e(
|
|
@@ -834,254 +833,113 @@ function Wa({
|
|
|
834
833
|
{
|
|
835
834
|
variant: "outline",
|
|
836
835
|
size: "sm",
|
|
837
|
-
onClick:
|
|
838
|
-
disabled: !
|
|
836
|
+
onClick: M,
|
|
837
|
+
disabled: !m,
|
|
839
838
|
className: "h-8 w-8 p-0",
|
|
840
|
-
children: /* @__PURE__ */ e(
|
|
839
|
+
children: /* @__PURE__ */ e(ne, { className: "h-4 w-4" })
|
|
841
840
|
}
|
|
842
841
|
)
|
|
843
842
|
] })
|
|
844
|
-
] }) }) : /* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
843
|
+
] }) }) : /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 px-2 py-4", children: [
|
|
844
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
846
845
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-600 hidden sm:inline", children: "Rows per page:" }),
|
|
847
|
-
/* @__PURE__ */
|
|
848
|
-
|
|
846
|
+
/* @__PURE__ */ r(
|
|
847
|
+
Ce,
|
|
849
848
|
{
|
|
850
|
-
value: String(
|
|
851
|
-
onValueChange: (x) =>
|
|
849
|
+
value: String(z.pageSize),
|
|
850
|
+
onValueChange: (x) => R(Number(x)),
|
|
852
851
|
children: [
|
|
853
|
-
/* @__PURE__ */ e(be, { className: "h-8 w-16", children: /* @__PURE__ */ e(
|
|
854
|
-
/* @__PURE__ */ e(ve, { children: a.map((x) => /* @__PURE__ */ e(
|
|
852
|
+
/* @__PURE__ */ e(be, { className: "h-8 w-16", children: /* @__PURE__ */ e(Te, {}) }),
|
|
853
|
+
/* @__PURE__ */ e(ve, { children: a.map((x) => /* @__PURE__ */ e(ye, { value: String(x), children: x }, x)) })
|
|
855
854
|
]
|
|
856
855
|
}
|
|
857
856
|
)
|
|
858
857
|
] }),
|
|
859
|
-
/* @__PURE__ */
|
|
858
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
860
859
|
/* @__PURE__ */ e(
|
|
861
860
|
b,
|
|
862
861
|
{
|
|
863
862
|
variant: "outline",
|
|
864
863
|
size: "sm",
|
|
865
|
-
onClick:
|
|
866
|
-
disabled: !
|
|
864
|
+
onClick: f,
|
|
865
|
+
disabled: !n,
|
|
867
866
|
className: "h-8 w-8 p-0",
|
|
868
|
-
children: /* @__PURE__ */ e(
|
|
867
|
+
children: /* @__PURE__ */ e(ie, { className: "h-4 w-4" })
|
|
869
868
|
}
|
|
870
869
|
),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
|
|
870
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 sm:hidden px-2", children: [
|
|
871
|
+
z.pageIndex + 1,
|
|
873
872
|
" / ",
|
|
874
|
-
|
|
873
|
+
h
|
|
875
874
|
] }),
|
|
876
|
-
/* @__PURE__ */ e("div", { className: "hidden sm:flex gap-1", children:
|
|
875
|
+
/* @__PURE__ */ e("div", { className: "hidden sm:flex gap-1", children: O().map((x, w) => typeof x == "number" ? /* @__PURE__ */ e(
|
|
877
876
|
b,
|
|
878
877
|
{
|
|
879
|
-
variant:
|
|
878
|
+
variant: z.pageIndex === x ? "default" : "outline",
|
|
880
879
|
size: "sm",
|
|
881
|
-
onClick: () =>
|
|
880
|
+
onClick: () => F(x),
|
|
882
881
|
className: "h-8 w-8 p-0",
|
|
883
882
|
children: x + 1
|
|
884
883
|
},
|
|
885
|
-
|
|
886
|
-
) : /* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center text-gray-400", children: x },
|
|
884
|
+
w
|
|
885
|
+
) : /* @__PURE__ */ e("span", { className: "flex h-8 w-8 items-center justify-center text-gray-400", children: x }, w)) }),
|
|
887
886
|
/* @__PURE__ */ e(
|
|
888
887
|
b,
|
|
889
888
|
{
|
|
890
889
|
variant: "outline",
|
|
891
890
|
size: "sm",
|
|
892
|
-
onClick:
|
|
893
|
-
disabled: !
|
|
891
|
+
onClick: M,
|
|
892
|
+
disabled: !m,
|
|
894
893
|
className: "h-8 w-8 p-0",
|
|
895
|
-
children: /* @__PURE__ */ e(
|
|
894
|
+
children: /* @__PURE__ */ e(ne, { className: "h-4 w-4" })
|
|
896
895
|
}
|
|
897
896
|
)
|
|
898
897
|
] })
|
|
899
898
|
] });
|
|
900
899
|
}
|
|
901
|
-
function
|
|
902
|
-
const { sorting:
|
|
903
|
-
return /* @__PURE__ */
|
|
900
|
+
function Ya({ id: t, title: a }) {
|
|
901
|
+
const { sorting: n, setSorting: m } = Re(), f = n.find((R) => R.id === t), M = !!f, h = f?.desc ?? !1;
|
|
902
|
+
return /* @__PURE__ */ r(
|
|
904
903
|
b,
|
|
905
904
|
{
|
|
906
905
|
variant: "ghost",
|
|
907
906
|
className: "h-auto px-3 py-1.5 font-normal hover:bg-transparent hover:text-gray-900",
|
|
908
907
|
onClick: () => {
|
|
909
|
-
|
|
910
|
-
const
|
|
911
|
-
return
|
|
908
|
+
m((R) => {
|
|
909
|
+
const F = R.find((O) => O.id === t);
|
|
910
|
+
return F ? F.desc ? [] : [{ id: t, desc: !0 }] : [{ id: t, desc: !1 }];
|
|
912
911
|
});
|
|
913
912
|
},
|
|
914
913
|
children: [
|
|
915
914
|
a,
|
|
916
|
-
|
|
915
|
+
M && h ? /* @__PURE__ */ e(Ae, { className: "h-4 w-4" }) : M ? /* @__PURE__ */ e(Le, { className: "h-4 w-4" }) : /* @__PURE__ */ e(lt, { className: "h-4 w-4" })
|
|
917
916
|
]
|
|
918
917
|
}
|
|
919
918
|
);
|
|
920
919
|
}
|
|
921
|
-
function
|
|
922
|
-
const { toggleAllRows: t, isAllRowsSelected: a } =
|
|
923
|
-
return /* @__PURE__ */ e(
|
|
920
|
+
function Oa() {
|
|
921
|
+
const { toggleAllRows: t, isAllRowsSelected: a } = Re();
|
|
922
|
+
return /* @__PURE__ */ e(We, { checked: a, onCheckedChange: t });
|
|
924
923
|
}
|
|
925
|
-
function
|
|
924
|
+
function ja({
|
|
926
925
|
row: t
|
|
927
926
|
}) {
|
|
928
|
-
const { selectedRows: a, toggleRow:
|
|
929
|
-
return /* @__PURE__ */ e(
|
|
927
|
+
const { selectedRows: a, toggleRow: n, getRowId: m } = Re(), f = m(t);
|
|
928
|
+
return /* @__PURE__ */ e(We, { checked: a.has(f), onCheckedChange: () => n(f) });
|
|
930
929
|
}
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
}
|
|
938
|
-
function Ja({ table: t, totalRecords: a, children: r }) {
|
|
939
|
-
return /* @__PURE__ */ e(xt.Provider, { value: { tableInstance: t, totalRecords: a }, children: r });
|
|
940
|
-
}
|
|
941
|
-
function Ua({ children: t, className: a }) {
|
|
942
|
-
return /* @__PURE__ */ e("div", { className: d("rounded-xl border border-gray-200 bg-white overflow-hidden", a), children: t });
|
|
943
|
-
}
|
|
944
|
-
function Ka() {
|
|
945
|
-
const { tableInstance: t } = bt();
|
|
946
|
-
return /* @__PURE__ */ n(Ge, { children: [
|
|
947
|
-
/* @__PURE__ */ e(Je, { children: t.getHeaderGroups().map((a) => /* @__PURE__ */ e(ce, { children: a.headers.map((r) => /* @__PURE__ */ e(Ke, { children: r.isPlaceholder ? null : tt(r.column.columnDef.header, r.getContext()) }, r.id)) }, a.id)) }),
|
|
948
|
-
/* @__PURE__ */ e(Ue, { children: t.getRowModel().rows?.length ? t.getRowModel().rows.map((a) => /* @__PURE__ */ e(ce, { "data-state": a.getIsSelected() && "selected", children: a.getVisibleCells().map((r) => /* @__PURE__ */ e(ke, { children: tt(r.column.columnDef.cell, r.getContext()) }, r.id)) }, a.id)) : /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ e(ke, { colSpan: t.getAllColumns().length, className: "h-24 text-center", children: "No results." }) }) })
|
|
949
|
-
] });
|
|
950
|
-
}
|
|
951
|
-
function qa({
|
|
952
|
-
rowsPerPageOptions: t = [5, 10, 20, 30, 50],
|
|
953
|
-
showPageSelector: a = !0,
|
|
954
|
-
showRecordInfo: r = !0,
|
|
955
|
-
showControls: u = !0
|
|
956
|
-
} = {}) {
|
|
957
|
-
const { tableInstance: g, totalRecords: v } = bt(), m = g.getState().pagination.pageIndex + 1, k = g.getPageCount(), D = g.getState().pagination.pageSize, H = m === 1 ? 1 : (m - 1) * D + 1, Y = Math.min(m * D, v);
|
|
958
|
-
return /* @__PURE__ */ n("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-4 px-3 py-4", children: [
|
|
959
|
-
a && /* @__PURE__ */ n("div", { className: "flex items-center gap-2.5", children: [
|
|
960
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-700 font-medium", children: "Items per page:" }),
|
|
961
|
-
/* @__PURE__ */ n(
|
|
962
|
-
we,
|
|
963
|
-
{
|
|
964
|
-
value: `${D}`,
|
|
965
|
-
onValueChange: (x) => {
|
|
966
|
-
g.setPageSize(Number(x));
|
|
967
|
-
},
|
|
968
|
-
children: [
|
|
969
|
-
/* @__PURE__ */ e(be, { className: "h-9 w-[75px]", children: /* @__PURE__ */ e(Se, { placeholder: D }) }),
|
|
970
|
-
/* @__PURE__ */ e(ve, { side: "top", children: t.map((x) => /* @__PURE__ */ e(ge, { value: `${x}`, children: x }, x)) })
|
|
971
|
-
]
|
|
972
|
-
}
|
|
973
|
-
)
|
|
974
|
-
] }),
|
|
975
|
-
r && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 text-sm text-gray-700", children: /* @__PURE__ */ n("span", { children: [
|
|
976
|
-
H,
|
|
977
|
-
"–",
|
|
978
|
-
Y,
|
|
979
|
-
" of ",
|
|
980
|
-
v
|
|
981
|
-
] }) }),
|
|
982
|
-
u && /* @__PURE__ */ n("div", { className: "flex items-center gap-1.5", children: [
|
|
983
|
-
/* @__PURE__ */ n(
|
|
984
|
-
b,
|
|
985
|
-
{
|
|
986
|
-
variant: "outline",
|
|
987
|
-
size: "sm",
|
|
988
|
-
onClick: () => g.setPageIndex(0),
|
|
989
|
-
disabled: !g.getCanPreviousPage(),
|
|
990
|
-
className: "h-9 w-9 p-0",
|
|
991
|
-
children: [
|
|
992
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "First page" }),
|
|
993
|
-
/* @__PURE__ */ e(Bt, { className: "h-4 w-4" })
|
|
994
|
-
]
|
|
995
|
-
}
|
|
996
|
-
),
|
|
997
|
-
/* @__PURE__ */ n(
|
|
998
|
-
b,
|
|
999
|
-
{
|
|
1000
|
-
variant: "outline",
|
|
1001
|
-
size: "sm",
|
|
1002
|
-
onClick: () => g.previousPage(),
|
|
1003
|
-
disabled: !g.getCanPreviousPage(),
|
|
1004
|
-
className: "h-9 w-9 p-0",
|
|
1005
|
-
children: [
|
|
1006
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "Previous page" }),
|
|
1007
|
-
/* @__PURE__ */ e(se, { className: "h-4 w-4" })
|
|
1008
|
-
]
|
|
1009
|
-
}
|
|
1010
|
-
),
|
|
1011
|
-
/* @__PURE__ */ n("div", { className: "flex items-center justify-center text-sm font-medium min-w-[110px]", children: [
|
|
1012
|
-
"Page ",
|
|
1013
|
-
m,
|
|
1014
|
-
" of ",
|
|
1015
|
-
k
|
|
1016
|
-
] }),
|
|
1017
|
-
/* @__PURE__ */ n(
|
|
1018
|
-
b,
|
|
1019
|
-
{
|
|
1020
|
-
variant: "outline",
|
|
1021
|
-
size: "sm",
|
|
1022
|
-
onClick: () => g.nextPage(),
|
|
1023
|
-
disabled: !g.getCanNextPage(),
|
|
1024
|
-
className: "h-9 w-9 p-0",
|
|
1025
|
-
children: [
|
|
1026
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "Next page" }),
|
|
1027
|
-
/* @__PURE__ */ e(te, { className: "h-4 w-4" })
|
|
1028
|
-
]
|
|
1029
|
-
}
|
|
1030
|
-
),
|
|
1031
|
-
/* @__PURE__ */ n(
|
|
1032
|
-
b,
|
|
1033
|
-
{
|
|
1034
|
-
variant: "outline",
|
|
1035
|
-
size: "sm",
|
|
1036
|
-
onClick: () => g.setPageIndex(g.getPageCount() - 1),
|
|
1037
|
-
disabled: !g.getCanNextPage(),
|
|
1038
|
-
className: "h-9 w-9 p-0",
|
|
1039
|
-
children: [
|
|
1040
|
-
/* @__PURE__ */ e("span", { className: "sr-only", children: "Last page" }),
|
|
1041
|
-
/* @__PURE__ */ e(Gt, { className: "h-4 w-4" })
|
|
1042
|
-
]
|
|
1043
|
-
}
|
|
1044
|
-
)
|
|
1045
|
-
] })
|
|
1046
|
-
] });
|
|
1047
|
-
}
|
|
1048
|
-
function Xa({
|
|
1049
|
-
column: t,
|
|
1050
|
-
title: a,
|
|
1051
|
-
align: r = "left",
|
|
1052
|
-
className: u
|
|
1053
|
-
}) {
|
|
1054
|
-
const g = t.getCanSort(), v = t.getIsSorted(), m = {
|
|
1055
|
-
left: "",
|
|
1056
|
-
center: "text-center",
|
|
1057
|
-
right: "text-right"
|
|
1058
|
-
}, k = () => v === "asc" ? /* @__PURE__ */ e(Re, { className: "h-4 w-4" }) : v === "desc" ? /* @__PURE__ */ e(Ee, { className: "h-4 w-4" }) : /* @__PURE__ */ e(We, { className: "h-4 w-4" });
|
|
1059
|
-
return g ? /* @__PURE__ */ e("div", { className: d(m[r]), children: /* @__PURE__ */ n(
|
|
1060
|
-
b,
|
|
1061
|
-
{
|
|
1062
|
-
variant: "ghost",
|
|
1063
|
-
className: "h-auto px-2 py-1 font-normal hover:bg-transparent hover:text-gray-900",
|
|
1064
|
-
onClick: () => t.toggleSorting(v === "asc"),
|
|
1065
|
-
children: [
|
|
1066
|
-
a,
|
|
1067
|
-
k()
|
|
1068
|
-
]
|
|
1069
|
-
}
|
|
1070
|
-
) }) : /* @__PURE__ */ e("div", { className: d("px-2 py-1", u), children: a });
|
|
1071
|
-
}
|
|
1072
|
-
const ta = (t) => new Date(t.getFullYear(), t.getMonth(), 1), aa = (t) => new Date(t.getFullYear(), t.getMonth() + 1, 0), ra = (t, a) => {
|
|
1073
|
-
const r = [], u = new Date(t);
|
|
1074
|
-
for (; u <= a; )
|
|
1075
|
-
r.push(new Date(u)), u.setDate(u.getDate() + 1);
|
|
1076
|
-
return r;
|
|
1077
|
-
}, lt = (t, a) => t.getMonth() === a.getMonth() && t.getFullYear() === a.getFullYear(), Me = (t, a) => t.getDate() === a.getDate() && t.getMonth() === a.getMonth() && t.getFullYear() === a.getFullYear(), it = (t) => Me(t, /* @__PURE__ */ new Date()), na = (t) => {
|
|
930
|
+
const qt = (t) => new Date(t.getFullYear(), t.getMonth(), 1), Xt = (t) => new Date(t.getFullYear(), t.getMonth() + 1, 0), Qt = (t, a) => {
|
|
931
|
+
const n = [], m = new Date(t);
|
|
932
|
+
for (; m <= a; )
|
|
933
|
+
n.push(new Date(m)), m.setDate(m.getDate() + 1);
|
|
934
|
+
return n;
|
|
935
|
+
}, tt = (t, a) => t.getMonth() === a.getMonth() && t.getFullYear() === a.getFullYear(), we = (t, a) => t.getDate() === a.getDate() && t.getMonth() === a.getMonth() && t.getFullYear() === a.getFullYear(), at = (t) => we(t, /* @__PURE__ */ new Date()), Zt = (t) => {
|
|
1078
936
|
const a = /* @__PURE__ */ new Date();
|
|
1079
|
-
return a.setDate(a.getDate() + 1),
|
|
1080
|
-
},
|
|
1081
|
-
const
|
|
1082
|
-
return
|
|
937
|
+
return a.setDate(a.getDate() + 1), we(t, a);
|
|
938
|
+
}, rt = (t, a) => {
|
|
939
|
+
const n = new Date(t);
|
|
940
|
+
return n.setMonth(n.getMonth() + a), n;
|
|
1083
941
|
}, Oe = (t, a) => {
|
|
1084
|
-
const
|
|
942
|
+
const n = [
|
|
1085
943
|
"January",
|
|
1086
944
|
"February",
|
|
1087
945
|
"March",
|
|
@@ -1094,7 +952,7 @@ const ta = (t) => new Date(t.getFullYear(), t.getMonth(), 1), aa = (t) => new Da
|
|
|
1094
952
|
"October",
|
|
1095
953
|
"November",
|
|
1096
954
|
"December"
|
|
1097
|
-
],
|
|
955
|
+
], m = [
|
|
1098
956
|
"Jan",
|
|
1099
957
|
"Feb",
|
|
1100
958
|
"Mar",
|
|
@@ -1108,17 +966,17 @@ const ta = (t) => new Date(t.getFullYear(), t.getMonth(), 1), aa = (t) => new Da
|
|
|
1108
966
|
"Nov",
|
|
1109
967
|
"Dec"
|
|
1110
968
|
];
|
|
1111
|
-
return a === "MMMM yyyy" ? `${
|
|
969
|
+
return a === "MMMM yyyy" ? `${n[t.getMonth()]} ${t.getFullYear()}` : a === "MMM d, yyyy" ? `${m[t.getMonth()]} ${t.getDate()}, ${t.getFullYear()}` : a === "d" ? t.getDate().toString() : t.toLocaleDateString();
|
|
1112
970
|
};
|
|
1113
|
-
function
|
|
971
|
+
function _a({
|
|
1114
972
|
selected: t,
|
|
1115
973
|
onSelect: a,
|
|
1116
|
-
events:
|
|
1117
|
-
holidays:
|
|
1118
|
-
className:
|
|
1119
|
-
...
|
|
974
|
+
events: n = [],
|
|
975
|
+
holidays: m = [],
|
|
976
|
+
className: f,
|
|
977
|
+
...M
|
|
1120
978
|
}) {
|
|
1121
|
-
const [
|
|
979
|
+
const [h, z] = S.useState(/* @__PURE__ */ new Date()), [R, F] = S.useState("calendar"), O = qt(h), x = Xt(h), w = Qt(O, x), T = [
|
|
1122
980
|
"January",
|
|
1123
981
|
"February",
|
|
1124
982
|
"March",
|
|
@@ -1131,36 +989,36 @@ function Qa({
|
|
|
1131
989
|
"October",
|
|
1132
990
|
"November",
|
|
1133
991
|
"December"
|
|
1134
|
-
],
|
|
1135
|
-
|
|
992
|
+
], P = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], H = h.getFullYear(), V = Array.from({ length: 20 }, (d, l) => H - 10 + l), j = () => {
|
|
993
|
+
z(rt(h, -1));
|
|
1136
994
|
}, $ = () => {
|
|
1137
|
-
|
|
995
|
+
z(rt(h, 1));
|
|
1138
996
|
}, G = () => {
|
|
1139
|
-
const
|
|
1140
|
-
|
|
997
|
+
const d = new Date(h);
|
|
998
|
+
d.setFullYear(H - 1), z(d);
|
|
1141
999
|
}, y = () => {
|
|
1142
|
-
const
|
|
1143
|
-
|
|
1144
|
-
},
|
|
1145
|
-
const l = new Date(
|
|
1146
|
-
l.setMonth(
|
|
1147
|
-
},
|
|
1148
|
-
const l = new Date(
|
|
1149
|
-
l.setFullYear(
|
|
1150
|
-
},
|
|
1151
|
-
return
|
|
1152
|
-
/* @__PURE__ */ e("div", { className: "px-6 py-4 border-b border-gray-100", children: /* @__PURE__ */
|
|
1000
|
+
const d = new Date(h);
|
|
1001
|
+
d.setFullYear(H + 1), z(d);
|
|
1002
|
+
}, A = (d) => {
|
|
1003
|
+
const l = new Date(h);
|
|
1004
|
+
l.setMonth(d), z(l), F("calendar");
|
|
1005
|
+
}, W = (d) => {
|
|
1006
|
+
const l = new Date(h);
|
|
1007
|
+
l.setFullYear(d), z(l), F("calendar");
|
|
1008
|
+
}, _ = (d) => n.filter((l) => we(l.date, d)), p = (d) => m.some((l) => we(l.date, d));
|
|
1009
|
+
return R === "months" ? /* @__PURE__ */ r("div", { className: u("bg-white rounded-lg border border-gray-200 w-full", f), ...M, children: [
|
|
1010
|
+
/* @__PURE__ */ e("div", { className: "px-6 py-4 border-b border-gray-100", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
1153
1011
|
/* @__PURE__ */ e(
|
|
1154
1012
|
b,
|
|
1155
1013
|
{
|
|
1156
1014
|
variant: "ghost",
|
|
1157
1015
|
size: "sm",
|
|
1158
|
-
onClick: () =>
|
|
1016
|
+
onClick: () => F("calendar"),
|
|
1159
1017
|
className: "h-9 px-3 text-sm font-medium text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded",
|
|
1160
1018
|
children: "← Back"
|
|
1161
1019
|
}
|
|
1162
1020
|
),
|
|
1163
|
-
/* @__PURE__ */
|
|
1021
|
+
/* @__PURE__ */ r("div", { className: "flex items-center space-x-1", children: [
|
|
1164
1022
|
/* @__PURE__ */ e(
|
|
1165
1023
|
b,
|
|
1166
1024
|
{
|
|
@@ -1168,16 +1026,16 @@ function Qa({
|
|
|
1168
1026
|
size: "sm",
|
|
1169
1027
|
onClick: G,
|
|
1170
1028
|
className: "h-9 w-9 p-0 border-gray-200 rounded",
|
|
1171
|
-
children: /* @__PURE__ */ e(
|
|
1029
|
+
children: /* @__PURE__ */ e(ie, { className: "h-4 w-4" })
|
|
1172
1030
|
}
|
|
1173
1031
|
),
|
|
1174
1032
|
/* @__PURE__ */ e(
|
|
1175
1033
|
b,
|
|
1176
1034
|
{
|
|
1177
1035
|
variant: "ghost",
|
|
1178
|
-
onClick: () =>
|
|
1036
|
+
onClick: () => F("years"),
|
|
1179
1037
|
className: "h-9 px-4 text-lg font-semibold text-gray-900 hover:bg-gray-50 rounded",
|
|
1180
|
-
children:
|
|
1038
|
+
children: H
|
|
1181
1039
|
}
|
|
1182
1040
|
),
|
|
1183
1041
|
/* @__PURE__ */ e(
|
|
@@ -1187,70 +1045,70 @@ function Qa({
|
|
|
1187
1045
|
size: "sm",
|
|
1188
1046
|
onClick: y,
|
|
1189
1047
|
className: "h-9 w-9 p-0 border-gray-200 rounded",
|
|
1190
|
-
children: /* @__PURE__ */ e(
|
|
1048
|
+
children: /* @__PURE__ */ e(ne, { className: "h-4 w-4" })
|
|
1191
1049
|
}
|
|
1192
1050
|
)
|
|
1193
1051
|
] })
|
|
1194
1052
|
] }) }),
|
|
1195
|
-
/* @__PURE__ */ e("div", { className: "p-6", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children:
|
|
1053
|
+
/* @__PURE__ */ e("div", { className: "p-6", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: T.map((d, l) => /* @__PURE__ */ e(
|
|
1196
1054
|
b,
|
|
1197
1055
|
{
|
|
1198
1056
|
variant: "ghost",
|
|
1199
|
-
onClick: () =>
|
|
1200
|
-
className:
|
|
1057
|
+
onClick: () => A(l),
|
|
1058
|
+
className: u(
|
|
1201
1059
|
"h-11 w-full text-sm font-medium rounded transition-all duration-200",
|
|
1202
|
-
l ===
|
|
1060
|
+
l === h.getMonth() ? "bg-gray-900 text-white hover:bg-gray-800 shadow-sm" : "text-gray-600 hover:text-gray-900 hover:bg-gray-50"
|
|
1203
1061
|
),
|
|
1204
|
-
children:
|
|
1062
|
+
children: d
|
|
1205
1063
|
},
|
|
1206
|
-
|
|
1064
|
+
d
|
|
1207
1065
|
)) }) })
|
|
1208
|
-
] }) :
|
|
1209
|
-
/* @__PURE__ */ e("div", { className: "px-6 py-4 border-b border-gray-100", children: /* @__PURE__ */
|
|
1066
|
+
] }) : R === "years" ? /* @__PURE__ */ r("div", { className: u("bg-white rounded-lg border border-gray-200 w-full", f), ...M, children: [
|
|
1067
|
+
/* @__PURE__ */ e("div", { className: "px-6 py-4 border-b border-gray-100", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
1210
1068
|
/* @__PURE__ */ e(
|
|
1211
1069
|
b,
|
|
1212
1070
|
{
|
|
1213
1071
|
variant: "ghost",
|
|
1214
1072
|
size: "sm",
|
|
1215
|
-
onClick: () =>
|
|
1073
|
+
onClick: () => F("months"),
|
|
1216
1074
|
className: "h-9 px-3 text-sm font-medium text-gray-600 hover:text-gray-900 hover:bg-gray-50 rounded",
|
|
1217
1075
|
children: "← Back"
|
|
1218
1076
|
}
|
|
1219
1077
|
),
|
|
1220
1078
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900", children: "Select Year" })
|
|
1221
1079
|
] }) }),
|
|
1222
|
-
/* @__PURE__ */ e("div", { className: "p-6", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2 max-h-64 overflow-y-auto", children:
|
|
1080
|
+
/* @__PURE__ */ e("div", { className: "p-6", children: /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2 max-h-64 overflow-y-auto", children: V.map((d) => /* @__PURE__ */ e(
|
|
1223
1081
|
b,
|
|
1224
1082
|
{
|
|
1225
1083
|
variant: "ghost",
|
|
1226
|
-
onClick: () =>
|
|
1227
|
-
className:
|
|
1084
|
+
onClick: () => W(d),
|
|
1085
|
+
className: u(
|
|
1228
1086
|
"h-11 w-full text-sm font-medium rounded transition-all duration-200",
|
|
1229
|
-
|
|
1087
|
+
d === H ? "bg-gray-900 text-white hover:bg-gray-800 shadow-sm" : "text-gray-600 hover:text-gray-900 hover:bg-gray-50"
|
|
1230
1088
|
),
|
|
1231
|
-
children:
|
|
1089
|
+
children: d
|
|
1232
1090
|
},
|
|
1233
|
-
|
|
1091
|
+
d
|
|
1234
1092
|
)) }) })
|
|
1235
|
-
] }) : /* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */ e("div", { className: "px-6 py-4 border-b border-gray-100", children: /* @__PURE__ */
|
|
1093
|
+
] }) : /* @__PURE__ */ r("div", { className: u("bg-white rounded-lg border border-gray-200 w-full", f), ...M, children: [
|
|
1094
|
+
/* @__PURE__ */ e("div", { className: "px-6 py-4 border-b border-gray-100", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
1237
1095
|
/* @__PURE__ */ e(
|
|
1238
1096
|
b,
|
|
1239
1097
|
{
|
|
1240
1098
|
variant: "outline",
|
|
1241
1099
|
size: "sm",
|
|
1242
|
-
onClick:
|
|
1100
|
+
onClick: j,
|
|
1243
1101
|
className: "h-9 w-9 p-0 border-gray-200 rounded",
|
|
1244
|
-
children: /* @__PURE__ */ e(
|
|
1102
|
+
children: /* @__PURE__ */ e(ie, { className: "h-4 w-4" })
|
|
1245
1103
|
}
|
|
1246
1104
|
),
|
|
1247
1105
|
/* @__PURE__ */ e(
|
|
1248
1106
|
b,
|
|
1249
1107
|
{
|
|
1250
1108
|
variant: "ghost",
|
|
1251
|
-
onClick: () =>
|
|
1109
|
+
onClick: () => F("months"),
|
|
1252
1110
|
className: "h-9 px-4 text-lg font-semibold text-gray-900 hover:bg-gray-50 rounded",
|
|
1253
|
-
children: Oe(
|
|
1111
|
+
children: Oe(h, "MMMM yyyy")
|
|
1254
1112
|
}
|
|
1255
1113
|
),
|
|
1256
1114
|
/* @__PURE__ */ e(
|
|
@@ -1260,41 +1118,41 @@ function Qa({
|
|
|
1260
1118
|
size: "sm",
|
|
1261
1119
|
onClick: $,
|
|
1262
1120
|
className: "h-9 w-9 p-0 border-gray-200 rounded",
|
|
1263
|
-
children: /* @__PURE__ */ e(
|
|
1121
|
+
children: /* @__PURE__ */ e(ne, { className: "h-4 w-4" })
|
|
1264
1122
|
}
|
|
1265
1123
|
)
|
|
1266
1124
|
] }) }),
|
|
1267
|
-
/* @__PURE__ */
|
|
1268
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children:
|
|
1269
|
-
/* @__PURE__ */
|
|
1270
|
-
Array.from({ length:
|
|
1271
|
-
|
|
1272
|
-
const l =
|
|
1273
|
-
return /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */
|
|
1125
|
+
/* @__PURE__ */ r("div", { className: "p-6", children: [
|
|
1126
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: P.map((d, l) => /* @__PURE__ */ e("div", { className: "h-10 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-gray-400 uppercase", children: d }) }, l)) }),
|
|
1127
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-7 gap-1", children: [
|
|
1128
|
+
Array.from({ length: O.getDay() }).map((d, l) => /* @__PURE__ */ e("div", { className: "h-12" }, `empty-${l}`)),
|
|
1129
|
+
w.map((d) => {
|
|
1130
|
+
const l = _(d), c = t && we(d, t), i = at(d), C = tt(d, h), o = p(d);
|
|
1131
|
+
return /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ r(
|
|
1274
1132
|
b,
|
|
1275
1133
|
{
|
|
1276
1134
|
variant: "ghost",
|
|
1277
1135
|
size: "sm",
|
|
1278
|
-
className:
|
|
1136
|
+
className: u(
|
|
1279
1137
|
"h-12 w-full p-0 text-sm relative rounded transition-all duration-200",
|
|
1280
|
-
!
|
|
1281
|
-
|
|
1138
|
+
!C && "text-gray-300",
|
|
1139
|
+
C && !c && !i && !o && "text-gray-700 hover:bg-gray-50",
|
|
1282
1140
|
o && !c && "text-red-600 font-medium hover:bg-red-50",
|
|
1283
1141
|
i && !c && "bg-gray-100 text-gray-900 font-medium border border-gray-200",
|
|
1284
1142
|
c && "bg-gray-900 text-white font-medium shadow-sm"
|
|
1285
1143
|
),
|
|
1286
|
-
onClick: () => a?.(
|
|
1144
|
+
onClick: () => a?.(d),
|
|
1287
1145
|
children: [
|
|
1288
|
-
Oe(
|
|
1289
|
-
l.length > 0 && /* @__PURE__ */
|
|
1290
|
-
l.slice(0, 3).map((
|
|
1146
|
+
Oe(d, "d"),
|
|
1147
|
+
l.length > 0 && /* @__PURE__ */ r("div", { className: "absolute bottom-1 left-1/2 transform -translate-x-1/2 flex space-x-0.5", children: [
|
|
1148
|
+
l.slice(0, 3).map((k, N) => /* @__PURE__ */ e(
|
|
1291
1149
|
"div",
|
|
1292
1150
|
{
|
|
1293
|
-
className:
|
|
1151
|
+
className: u(
|
|
1294
1152
|
"w-1 h-1 rounded-full",
|
|
1295
|
-
((
|
|
1153
|
+
((Y) => {
|
|
1296
1154
|
if (c) return "bg-white/80";
|
|
1297
|
-
switch (
|
|
1155
|
+
switch (Y) {
|
|
1298
1156
|
case "class":
|
|
1299
1157
|
return "bg-blue-500";
|
|
1300
1158
|
case "meeting":
|
|
@@ -1306,30 +1164,30 @@ function Qa({
|
|
|
1306
1164
|
default:
|
|
1307
1165
|
return "bg-gray-500";
|
|
1308
1166
|
}
|
|
1309
|
-
})(
|
|
1167
|
+
})(k.type)
|
|
1310
1168
|
)
|
|
1311
1169
|
},
|
|
1312
|
-
|
|
1170
|
+
N
|
|
1313
1171
|
)),
|
|
1314
|
-
l.length > 3 && /* @__PURE__ */ e("div", { className:
|
|
1172
|
+
l.length > 3 && /* @__PURE__ */ e("div", { className: u(
|
|
1315
1173
|
"w-1 h-1 rounded-full",
|
|
1316
1174
|
c ? "bg-white/60" : "bg-gray-400"
|
|
1317
1175
|
) })
|
|
1318
1176
|
] })
|
|
1319
1177
|
]
|
|
1320
1178
|
}
|
|
1321
|
-
) },
|
|
1179
|
+
) }, d.toISOString());
|
|
1322
1180
|
})
|
|
1323
1181
|
] })
|
|
1324
1182
|
] }),
|
|
1325
|
-
t && /* @__PURE__ */ e("div", { className: "border-t border-gray-100", children: /* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */ e("div", { className: "flex items-center justify-between mb-4", children: /* @__PURE__ */ e("h4", { className: "text-sm font-semibold text-gray-900", children:
|
|
1183
|
+
t && /* @__PURE__ */ e("div", { className: "border-t border-gray-100", children: /* @__PURE__ */ r("div", { className: "p-6", children: [
|
|
1184
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between mb-4", children: /* @__PURE__ */ e("h4", { className: "text-sm font-semibold text-gray-900", children: at(t) ? "Today" : Zt(t) ? "Tomorrow" : Oe(t, "MMM d, yyyy") }) }),
|
|
1327
1185
|
(() => {
|
|
1328
|
-
const
|
|
1329
|
-
return /* @__PURE__ */
|
|
1330
|
-
|
|
1331
|
-
const i = ((
|
|
1332
|
-
switch (
|
|
1186
|
+
const d = n.filter((l) => we(l.date, t));
|
|
1187
|
+
return /* @__PURE__ */ r("div", { className: "space-y-3", children: [
|
|
1188
|
+
d.length > 0 && d.map((l) => {
|
|
1189
|
+
const i = ((C) => {
|
|
1190
|
+
switch (C) {
|
|
1333
1191
|
case "class":
|
|
1334
1192
|
return { bg: "bg-blue-50", border: "border-blue-100", dot: "bg-blue-500", text: "text-blue-900", subtext: "text-blue-600" };
|
|
1335
1193
|
case "meeting":
|
|
@@ -1342,11 +1200,11 @@ function Qa({
|
|
|
1342
1200
|
return { bg: "bg-gray-50", border: "border-gray-100", dot: "bg-gray-500", text: "text-gray-900", subtext: "text-gray-600" };
|
|
1343
1201
|
}
|
|
1344
1202
|
})(l.type);
|
|
1345
|
-
return /* @__PURE__ */
|
|
1203
|
+
return /* @__PURE__ */ r("div", { className: `flex items-center space-x-3 p-3 ${i.bg} rounded border ${i.border} hover:shadow-sm transition-shadow cursor-pointer`, children: [
|
|
1346
1204
|
/* @__PURE__ */ e("div", { className: `w-2 h-2 rounded-full ${i.dot} flex-shrink-0` }),
|
|
1347
|
-
/* @__PURE__ */
|
|
1205
|
+
/* @__PURE__ */ r("div", { className: "flex-1 min-w-0", children: [
|
|
1348
1206
|
/* @__PURE__ */ e("p", { className: `text-sm font-medium ${i.text} truncate`, children: l.title }),
|
|
1349
|
-
(l.time || l.location) && /* @__PURE__ */
|
|
1207
|
+
(l.time || l.location) && /* @__PURE__ */ r("p", { className: `text-xs ${i.subtext} truncate`, children: [
|
|
1350
1208
|
l.time,
|
|
1351
1209
|
l.time && l.location && " • ",
|
|
1352
1210
|
l.location
|
|
@@ -1354,21 +1212,21 @@ function Qa({
|
|
|
1354
1212
|
] })
|
|
1355
1213
|
] }, l.id || l.title);
|
|
1356
1214
|
}),
|
|
1357
|
-
|
|
1358
|
-
/* @__PURE__ */ e("div", { className: "w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-3", children: /* @__PURE__ */ e(
|
|
1215
|
+
d.length === 0 && /* @__PURE__ */ r("div", { className: "text-center py-8", children: [
|
|
1216
|
+
/* @__PURE__ */ e("div", { className: "w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-3", children: /* @__PURE__ */ e(Ve, { className: "w-5 h-5 text-gray-400" }) }),
|
|
1359
1217
|
/* @__PURE__ */ e("p", { className: "text-sm text-gray-500", children: "No events scheduled" })
|
|
1360
1218
|
] })
|
|
1361
1219
|
] });
|
|
1362
1220
|
})()
|
|
1363
1221
|
] }) }),
|
|
1364
|
-
!
|
|
1222
|
+
!tt(h, /* @__PURE__ */ new Date()) && /* @__PURE__ */ e("div", { className: "p-6 pt-0", children: /* @__PURE__ */ e(
|
|
1365
1223
|
b,
|
|
1366
1224
|
{
|
|
1367
1225
|
variant: "outline",
|
|
1368
1226
|
size: "sm",
|
|
1369
1227
|
onClick: () => {
|
|
1370
|
-
const
|
|
1371
|
-
|
|
1228
|
+
const d = /* @__PURE__ */ new Date();
|
|
1229
|
+
z(d), a?.(d), F("calendar");
|
|
1372
1230
|
},
|
|
1373
1231
|
className: "w-full h-10 text-sm font-medium border-gray-200 hover:bg-gray-50 rounded",
|
|
1374
1232
|
children: "Today"
|
|
@@ -1376,13 +1234,13 @@ function Qa({
|
|
|
1376
1234
|
) })
|
|
1377
1235
|
] });
|
|
1378
1236
|
}
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1237
|
+
const yt = Se.Root, xt = Se.Trigger, La = Se.Anchor, Be = S.forwardRef(({ className: t, align: a = "center", sideOffset: n = 4, ...m }, f) => /* @__PURE__ */ e(Se.Portal, { children: /* @__PURE__ */ e(
|
|
1238
|
+
Se.Content,
|
|
1381
1239
|
{
|
|
1382
|
-
ref:
|
|
1240
|
+
ref: f,
|
|
1383
1241
|
align: a,
|
|
1384
|
-
sideOffset:
|
|
1385
|
-
className:
|
|
1242
|
+
sideOffset: n,
|
|
1243
|
+
className: u(
|
|
1386
1244
|
"z-50 w-auto rounded-md border border-gray-200 bg-white p-3 text-gray-950 shadow-lg outline-none",
|
|
1387
1245
|
"data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1388
1246
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
@@ -1391,75 +1249,75 @@ const vt = De.Root, Nt = De.Trigger, Za = De.Anchor, qe = w.forwardRef(({ classN
|
|
|
1391
1249
|
"data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
1392
1250
|
t
|
|
1393
1251
|
),
|
|
1394
|
-
...
|
|
1252
|
+
...m
|
|
1395
1253
|
}
|
|
1396
1254
|
) }));
|
|
1397
|
-
|
|
1398
|
-
function
|
|
1255
|
+
Be.displayName = Se.Content.displayName;
|
|
1256
|
+
function Va({
|
|
1399
1257
|
date: t,
|
|
1400
1258
|
onDateChange: a,
|
|
1401
|
-
mode:
|
|
1402
|
-
dateRange:
|
|
1403
|
-
onDateRangeChange:
|
|
1404
|
-
placeholder:
|
|
1405
|
-
dateFormat:
|
|
1406
|
-
disabled:
|
|
1407
|
-
className:
|
|
1408
|
-
variant:
|
|
1409
|
-
size:
|
|
1259
|
+
mode: n = "single",
|
|
1260
|
+
dateRange: m,
|
|
1261
|
+
onDateRangeChange: f,
|
|
1262
|
+
placeholder: M = "Pick a date",
|
|
1263
|
+
dateFormat: h = "PPP",
|
|
1264
|
+
disabled: z = !1,
|
|
1265
|
+
className: R,
|
|
1266
|
+
variant: F = "outline",
|
|
1267
|
+
size: O = "default",
|
|
1410
1268
|
align: x = "start",
|
|
1411
|
-
showIcon:
|
|
1412
|
-
icon:
|
|
1413
|
-
minDate:
|
|
1414
|
-
maxDate:
|
|
1415
|
-
disabledDates:
|
|
1416
|
-
isDateDisabled:
|
|
1269
|
+
showIcon: w = !0,
|
|
1270
|
+
icon: T,
|
|
1271
|
+
minDate: P,
|
|
1272
|
+
maxDate: H,
|
|
1273
|
+
disabledDates: V,
|
|
1274
|
+
isDateDisabled: j,
|
|
1417
1275
|
fullWidth: $ = !1,
|
|
1418
1276
|
customTrigger: G,
|
|
1419
1277
|
numberOfMonths: y = 1,
|
|
1420
|
-
holidays:
|
|
1278
|
+
holidays: A = []
|
|
1421
1279
|
}) {
|
|
1422
|
-
const [
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
}, [
|
|
1426
|
-
|
|
1427
|
-
}, [
|
|
1428
|
-
const
|
|
1429
|
-
if (
|
|
1280
|
+
const [W, _] = S.useState(!1), [p, d] = S.useState(t || /* @__PURE__ */ new Date()), [l, c] = S.useState("calendar"), [i, C] = S.useState(m?.from), [o, k] = S.useState(m?.to), [N, I] = S.useState();
|
|
1281
|
+
S.useEffect(() => {
|
|
1282
|
+
C(m?.from), k(m?.to);
|
|
1283
|
+
}, [m]), S.useEffect(() => {
|
|
1284
|
+
W && (c("calendar"), n === "single" && t ? d(t) : n === "range" && m?.from && d(m.from));
|
|
1285
|
+
}, [W, t, m, n]);
|
|
1286
|
+
const Y = (g) => {
|
|
1287
|
+
if (n === "range")
|
|
1430
1288
|
if (!i || i && o)
|
|
1431
|
-
|
|
1289
|
+
C(g), k(void 0), f?.({ from: g, to: void 0 });
|
|
1432
1290
|
else {
|
|
1433
|
-
const
|
|
1434
|
-
|
|
1291
|
+
const E = i < g ? i : g, Z = i < g ? g : i;
|
|
1292
|
+
C(E), k(Z), f?.({ from: E, to: Z }), _(!1);
|
|
1435
1293
|
}
|
|
1436
1294
|
else
|
|
1437
|
-
a?.(
|
|
1438
|
-
}, q = (
|
|
1439
|
-
|
|
1440
|
-
},
|
|
1441
|
-
|
|
1442
|
-
},
|
|
1295
|
+
a?.(g), _(!1);
|
|
1296
|
+
}, q = (g) => !!(V?.some((E) => E.toDateString() === g.toDateString()) || P && g < P || H && g > H || j?.(g)), se = (g) => A.some((E) => $e(E.date, g)), ce = qe(p), Q = Xe(p), oe = Qe({ start: ce, end: Q }), le = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], de = Ze(p, 1), Me = qe(de), Pe = Xe(de), De = Qe({ start: Me, end: Pe }), he = () => {
|
|
1297
|
+
d(Bt(p, 1));
|
|
1298
|
+
}, ue = () => {
|
|
1299
|
+
d(Ze(p, 1));
|
|
1300
|
+
}, ae = (g, E) => ke(g, E), s = (g) => {
|
|
1443
1301
|
if (i && o)
|
|
1444
|
-
return
|
|
1445
|
-
if (i && !o &&
|
|
1446
|
-
const
|
|
1447
|
-
return
|
|
1302
|
+
return g >= i && g <= o;
|
|
1303
|
+
if (i && !o && N) {
|
|
1304
|
+
const E = i < N ? i : N, Z = i < N ? N : i;
|
|
1305
|
+
return g >= E && g <= Z;
|
|
1448
1306
|
}
|
|
1449
1307
|
return !1;
|
|
1450
|
-
},
|
|
1451
|
-
const
|
|
1452
|
-
|
|
1453
|
-
},
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1456
|
-
}, X = (
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1459
|
-
}, K = (
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1462
|
-
},
|
|
1308
|
+
}, v = (g) => i && $e(g, i), L = (g) => o && $e(g, o), D = () => {
|
|
1309
|
+
const g = new Date(p);
|
|
1310
|
+
g.setFullYear(ge - 1), d(g);
|
|
1311
|
+
}, re = () => {
|
|
1312
|
+
const g = new Date(p);
|
|
1313
|
+
g.setFullYear(ge + 1), d(g);
|
|
1314
|
+
}, X = (g) => {
|
|
1315
|
+
const E = new Date(p.getFullYear(), g, 1);
|
|
1316
|
+
d(E), c("calendar");
|
|
1317
|
+
}, K = (g) => {
|
|
1318
|
+
const E = new Date(g, p.getMonth(), 1);
|
|
1319
|
+
d(E), c("calendar");
|
|
1320
|
+
}, Ee = [
|
|
1463
1321
|
"January",
|
|
1464
1322
|
"February",
|
|
1465
1323
|
"March",
|
|
@@ -1472,74 +1330,74 @@ function er({
|
|
|
1472
1330
|
"October",
|
|
1473
1331
|
"November",
|
|
1474
1332
|
"December"
|
|
1475
|
-
],
|
|
1333
|
+
], ge = p.getFullYear(), Fe = Array.from({ length: 20 }, (g, E) => ge - 10 + E), Ge = G || /* @__PURE__ */ r(
|
|
1476
1334
|
b,
|
|
1477
1335
|
{
|
|
1478
|
-
variant:
|
|
1479
|
-
size:
|
|
1480
|
-
className:
|
|
1336
|
+
variant: F,
|
|
1337
|
+
size: O,
|
|
1338
|
+
className: u(
|
|
1481
1339
|
"justify-start text-left font-normal",
|
|
1482
1340
|
!t && !i && "text-gray-500",
|
|
1483
1341
|
$ && "w-full",
|
|
1484
|
-
|
|
1342
|
+
R
|
|
1485
1343
|
),
|
|
1486
|
-
disabled:
|
|
1344
|
+
disabled: z,
|
|
1487
1345
|
children: [
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1346
|
+
w && (T || /* @__PURE__ */ e(Ve, { className: "mr-2 h-4 w-4" })),
|
|
1347
|
+
n === "range" ? i && o ? /* @__PURE__ */ r("span", { children: [
|
|
1348
|
+
ke(i, h),
|
|
1491
1349
|
" - ",
|
|
1492
|
-
|
|
1493
|
-
] }) : i ? /* @__PURE__ */
|
|
1494
|
-
|
|
1350
|
+
ke(o, h)
|
|
1351
|
+
] }) : i ? /* @__PURE__ */ r("span", { children: [
|
|
1352
|
+
ke(i, h),
|
|
1495
1353
|
" - ..."
|
|
1496
|
-
] }) : /* @__PURE__ */ e("span", { children:
|
|
1354
|
+
] }) : /* @__PURE__ */ e("span", { children: M }) : t ? ke(t, h) : /* @__PURE__ */ e("span", { children: M })
|
|
1497
1355
|
]
|
|
1498
1356
|
}
|
|
1499
|
-
),
|
|
1500
|
-
const Z =
|
|
1357
|
+
), pe = (g, E) => {
|
|
1358
|
+
const Z = n === "single" ? t && $e(g, t) : v(g) || L(g), Tt = Gt(g), Ye = q(g), fe = n === "range" && s(g), It = se(g), Je = g.getDay(), zt = v(g), Rt = L(g);
|
|
1501
1359
|
return /* @__PURE__ */ e(
|
|
1502
1360
|
"div",
|
|
1503
1361
|
{
|
|
1504
|
-
className:
|
|
1362
|
+
className: u(
|
|
1505
1363
|
"relative p-0.5",
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1364
|
+
fe && "bg-gray-100",
|
|
1365
|
+
fe && Je === 0 && "rounded-l-md",
|
|
1366
|
+
fe && Je === 6 && "rounded-r-md",
|
|
1367
|
+
fe && zt && "rounded-l-md",
|
|
1368
|
+
fe && Rt && "rounded-r-md"
|
|
1511
1369
|
),
|
|
1512
|
-
onMouseEnter: () =>
|
|
1513
|
-
onMouseLeave: () =>
|
|
1370
|
+
onMouseEnter: () => n === "range" && i && !o && I(g),
|
|
1371
|
+
onMouseLeave: () => I(void 0),
|
|
1514
1372
|
children: /* @__PURE__ */ e(
|
|
1515
1373
|
b,
|
|
1516
1374
|
{
|
|
1517
1375
|
variant: "ghost",
|
|
1518
1376
|
size: "sm",
|
|
1519
|
-
disabled:
|
|
1520
|
-
className:
|
|
1377
|
+
disabled: Ye || z,
|
|
1378
|
+
className: u(
|
|
1521
1379
|
"h-10 w-full p-0 text-sm relative transition-all duration-200 rounded-md text-gray-900",
|
|
1522
|
-
!
|
|
1523
|
-
|
|
1524
|
-
|
|
1380
|
+
!E && "text-gray-300",
|
|
1381
|
+
It && !Z && "text-red-600 font-medium",
|
|
1382
|
+
Tt && !Z && !fe && "bg-gray-50 text-gray-900 font-medium border border-gray-200",
|
|
1525
1383
|
Z && "bg-gray-900 text-white font-medium shadow-sm z-10 hover:bg-gray-800",
|
|
1526
|
-
|
|
1527
|
-
|
|
1384
|
+
fe && !Z && "text-gray-900 bg-gray-100",
|
|
1385
|
+
Ye && "opacity-40 cursor-not-allowed"
|
|
1528
1386
|
),
|
|
1529
|
-
onClick: () => !
|
|
1530
|
-
children:
|
|
1387
|
+
onClick: () => !Ye && Y(g),
|
|
1388
|
+
children: ae(g, "d")
|
|
1531
1389
|
}
|
|
1532
1390
|
)
|
|
1533
1391
|
},
|
|
1534
|
-
|
|
1392
|
+
g.toISOString()
|
|
1535
1393
|
);
|
|
1536
1394
|
};
|
|
1537
|
-
return /* @__PURE__ */
|
|
1538
|
-
/* @__PURE__ */ e(
|
|
1395
|
+
return /* @__PURE__ */ r(yt, { open: W, onOpenChange: _, children: [
|
|
1396
|
+
/* @__PURE__ */ e(xt, { asChild: !0, children: Ge }),
|
|
1539
1397
|
/* @__PURE__ */ e(
|
|
1540
|
-
|
|
1398
|
+
Be,
|
|
1541
1399
|
{
|
|
1542
|
-
className:
|
|
1400
|
+
className: u(
|
|
1543
1401
|
"p-0 border-gray-200",
|
|
1544
1402
|
y === 2 ? "w-[640px]" : "w-80"
|
|
1545
1403
|
),
|
|
@@ -1547,19 +1405,19 @@ function er({
|
|
|
1547
1405
|
side: "bottom",
|
|
1548
1406
|
sideOffset: 4,
|
|
1549
1407
|
collisionPadding: 8,
|
|
1550
|
-
children: /* @__PURE__ */
|
|
1551
|
-
/* @__PURE__ */ e("div", { className: "border-b border-gray-100 px-6 py-4", children: /* @__PURE__ */
|
|
1408
|
+
children: /* @__PURE__ */ r("div", { className: "bg-white rounded-lg", "data-takaui": "datepicker", children: [
|
|
1409
|
+
/* @__PURE__ */ e("div", { className: "border-b border-gray-100 px-6 py-4", children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
1552
1410
|
/* @__PURE__ */ e(
|
|
1553
1411
|
b,
|
|
1554
1412
|
{
|
|
1555
1413
|
variant: "outline",
|
|
1556
1414
|
size: "sm",
|
|
1557
|
-
onClick:
|
|
1415
|
+
onClick: he,
|
|
1558
1416
|
className: "h-9 w-9 p-0",
|
|
1559
|
-
children: /* @__PURE__ */ e(
|
|
1417
|
+
children: /* @__PURE__ */ e(ie, { className: "h-4 w-4" })
|
|
1560
1418
|
}
|
|
1561
1419
|
),
|
|
1562
|
-
y === 2 ? /* @__PURE__ */
|
|
1420
|
+
y === 2 ? /* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
1563
1421
|
/* @__PURE__ */ e(
|
|
1564
1422
|
b,
|
|
1565
1423
|
{
|
|
@@ -1567,7 +1425,7 @@ function er({
|
|
|
1567
1425
|
size: "sm",
|
|
1568
1426
|
onClick: () => c("months"),
|
|
1569
1427
|
className: "h-9 px-3 font-semibold text-base",
|
|
1570
|
-
children:
|
|
1428
|
+
children: ae(p, "MMMM")
|
|
1571
1429
|
}
|
|
1572
1430
|
),
|
|
1573
1431
|
/* @__PURE__ */ e("span", { className: "text-gray-400 text-sm", children: "-" }),
|
|
@@ -1578,7 +1436,7 @@ function er({
|
|
|
1578
1436
|
size: "sm",
|
|
1579
1437
|
onClick: () => c("months"),
|
|
1580
1438
|
className: "h-9 px-3 font-semibold text-base",
|
|
1581
|
-
children:
|
|
1439
|
+
children: ae(de, "MMMM yyyy")
|
|
1582
1440
|
}
|
|
1583
1441
|
)
|
|
1584
1442
|
] }) : /* @__PURE__ */ e(
|
|
@@ -1588,7 +1446,7 @@ function er({
|
|
|
1588
1446
|
size: "sm",
|
|
1589
1447
|
onClick: () => c("months"),
|
|
1590
1448
|
className: "h-9 px-4 font-semibold text-lg",
|
|
1591
|
-
children:
|
|
1449
|
+
children: ae(p, "MMMM yyyy")
|
|
1592
1450
|
}
|
|
1593
1451
|
),
|
|
1594
1452
|
/* @__PURE__ */ e(
|
|
@@ -1596,15 +1454,15 @@ function er({
|
|
|
1596
1454
|
{
|
|
1597
1455
|
variant: "outline",
|
|
1598
1456
|
size: "sm",
|
|
1599
|
-
onClick:
|
|
1457
|
+
onClick: ue,
|
|
1600
1458
|
className: "h-9 w-9 p-0",
|
|
1601
|
-
children: /* @__PURE__ */ e(
|
|
1459
|
+
children: /* @__PURE__ */ e(ne, { className: "h-4 w-4" })
|
|
1602
1460
|
}
|
|
1603
1461
|
)
|
|
1604
1462
|
] }) }),
|
|
1605
|
-
/* @__PURE__ */
|
|
1606
|
-
l === "years" && /* @__PURE__ */
|
|
1607
|
-
/* @__PURE__ */
|
|
1463
|
+
/* @__PURE__ */ r("div", { className: "p-6", children: [
|
|
1464
|
+
l === "years" && /* @__PURE__ */ r(ze, { children: [
|
|
1465
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
1608
1466
|
/* @__PURE__ */ e(
|
|
1609
1467
|
b,
|
|
1610
1468
|
{
|
|
@@ -1617,23 +1475,23 @@ function er({
|
|
|
1617
1475
|
),
|
|
1618
1476
|
/* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900", children: "Select Year" })
|
|
1619
1477
|
] }),
|
|
1620
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2 max-h-64 overflow-y-auto", children:
|
|
1478
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2 max-h-64 overflow-y-auto", children: Fe.map((g) => /* @__PURE__ */ e(
|
|
1621
1479
|
b,
|
|
1622
1480
|
{
|
|
1623
1481
|
variant: "ghost",
|
|
1624
1482
|
size: "sm",
|
|
1625
|
-
onClick: () => K(
|
|
1626
|
-
className:
|
|
1483
|
+
onClick: () => K(g),
|
|
1484
|
+
className: u(
|
|
1627
1485
|
"h-11 w-full text-sm font-medium rounded-md transition-all duration-200",
|
|
1628
|
-
|
|
1486
|
+
g === ge ? "bg-gray-900 text-white shadow-sm hover:bg-gray-800" : "text-gray-900 bg-transparent"
|
|
1629
1487
|
),
|
|
1630
|
-
children:
|
|
1488
|
+
children: g
|
|
1631
1489
|
},
|
|
1632
|
-
|
|
1490
|
+
g
|
|
1633
1491
|
)) })
|
|
1634
1492
|
] }),
|
|
1635
|
-
l === "months" && /* @__PURE__ */
|
|
1636
|
-
/* @__PURE__ */
|
|
1493
|
+
l === "months" && /* @__PURE__ */ r(ze, { children: [
|
|
1494
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
1637
1495
|
/* @__PURE__ */ e(
|
|
1638
1496
|
b,
|
|
1639
1497
|
{
|
|
@@ -1644,15 +1502,15 @@ function er({
|
|
|
1644
1502
|
children: "← Back"
|
|
1645
1503
|
}
|
|
1646
1504
|
),
|
|
1647
|
-
/* @__PURE__ */
|
|
1505
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
1648
1506
|
/* @__PURE__ */ e(
|
|
1649
1507
|
b,
|
|
1650
1508
|
{
|
|
1651
1509
|
variant: "outline",
|
|
1652
1510
|
size: "sm",
|
|
1653
|
-
onClick:
|
|
1511
|
+
onClick: D,
|
|
1654
1512
|
className: "h-9 w-9 p-0",
|
|
1655
|
-
children: /* @__PURE__ */ e(
|
|
1513
|
+
children: /* @__PURE__ */ e(ie, { className: "h-4 w-4" })
|
|
1656
1514
|
}
|
|
1657
1515
|
),
|
|
1658
1516
|
/* @__PURE__ */ e(
|
|
@@ -1661,7 +1519,7 @@ function er({
|
|
|
1661
1519
|
variant: "ghost",
|
|
1662
1520
|
onClick: () => c("years"),
|
|
1663
1521
|
className: "h-9 px-4 text-lg font-semibold text-gray-900",
|
|
1664
|
-
children:
|
|
1522
|
+
children: ge
|
|
1665
1523
|
}
|
|
1666
1524
|
),
|
|
1667
1525
|
/* @__PURE__ */ e(
|
|
@@ -1669,41 +1527,41 @@ function er({
|
|
|
1669
1527
|
{
|
|
1670
1528
|
variant: "outline",
|
|
1671
1529
|
size: "sm",
|
|
1672
|
-
onClick:
|
|
1530
|
+
onClick: re,
|
|
1673
1531
|
className: "h-9 w-9 p-0",
|
|
1674
|
-
children: /* @__PURE__ */ e(
|
|
1532
|
+
children: /* @__PURE__ */ e(ne, { className: "h-4 w-4" })
|
|
1675
1533
|
}
|
|
1676
1534
|
)
|
|
1677
1535
|
] })
|
|
1678
1536
|
] }),
|
|
1679
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children:
|
|
1537
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: Ee.map((g, E) => /* @__PURE__ */ e(
|
|
1680
1538
|
b,
|
|
1681
1539
|
{
|
|
1682
1540
|
variant: "ghost",
|
|
1683
1541
|
size: "sm",
|
|
1684
|
-
onClick: () => X(
|
|
1685
|
-
className:
|
|
1542
|
+
onClick: () => X(E),
|
|
1543
|
+
className: u(
|
|
1686
1544
|
"h-11 w-full text-sm font-medium rounded-md transition-all duration-200",
|
|
1687
|
-
|
|
1545
|
+
E === p.getMonth() ? "bg-gray-900 text-white shadow-sm hover:bg-gray-800" : "text-gray-900 bg-transparent"
|
|
1688
1546
|
),
|
|
1689
|
-
children:
|
|
1547
|
+
children: g
|
|
1690
1548
|
},
|
|
1691
|
-
|
|
1549
|
+
g
|
|
1692
1550
|
)) })
|
|
1693
1551
|
] }),
|
|
1694
|
-
l === "calendar" && /* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
1696
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children:
|
|
1697
|
-
/* @__PURE__ */
|
|
1698
|
-
Array.from({ length:
|
|
1699
|
-
|
|
1552
|
+
l === "calendar" && /* @__PURE__ */ r("div", { className: u("flex", y === 2 ? "gap-6" : "gap-0"), children: [
|
|
1553
|
+
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
1554
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: le.map((g, E) => /* @__PURE__ */ e("div", { className: "h-8 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-gray-400 uppercase", children: g }) }, E)) }),
|
|
1555
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-7", children: [
|
|
1556
|
+
Array.from({ length: ce.getDay() }).map((g, E) => /* @__PURE__ */ e("div", { className: "h-10" }, `empty-${E}`)),
|
|
1557
|
+
oe.map((g) => pe(g, et(g, p)))
|
|
1700
1558
|
] })
|
|
1701
1559
|
] }),
|
|
1702
|
-
y === 2 && /* @__PURE__ */
|
|
1703
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children:
|
|
1704
|
-
/* @__PURE__ */
|
|
1705
|
-
Array.from({ length:
|
|
1706
|
-
|
|
1560
|
+
y === 2 && /* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
1561
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: le.map((g, E) => /* @__PURE__ */ e("div", { className: "h-8 flex items-center justify-center", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-gray-400 uppercase", children: g }) }, E)) }),
|
|
1562
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-7", children: [
|
|
1563
|
+
Array.from({ length: Me.getDay() }).map((g, E) => /* @__PURE__ */ e("div", { className: "h-10" }, `next-empty-${E}`)),
|
|
1564
|
+
De.map((g) => pe(g, et(g, de)))
|
|
1707
1565
|
] })
|
|
1708
1566
|
] })
|
|
1709
1567
|
] })
|
|
@@ -1713,71 +1571,71 @@ function er({
|
|
|
1713
1571
|
)
|
|
1714
1572
|
] });
|
|
1715
1573
|
}
|
|
1716
|
-
const
|
|
1574
|
+
const Wa = ({
|
|
1717
1575
|
time: t,
|
|
1718
1576
|
onTimeChange: a,
|
|
1719
|
-
timezone:
|
|
1720
|
-
format:
|
|
1721
|
-
showTimezone:
|
|
1722
|
-
minuteStep:
|
|
1723
|
-
showSeconds:
|
|
1724
|
-
placeholder:
|
|
1725
|
-
variant:
|
|
1726
|
-
size:
|
|
1727
|
-
showClockFace:
|
|
1577
|
+
timezone: n = "UTC",
|
|
1578
|
+
format: m = "24h",
|
|
1579
|
+
showTimezone: f = !1,
|
|
1580
|
+
minuteStep: M = 1,
|
|
1581
|
+
showSeconds: h = !1,
|
|
1582
|
+
placeholder: z = "Select time",
|
|
1583
|
+
variant: R = "outline",
|
|
1584
|
+
size: F = "default",
|
|
1585
|
+
showClockFace: O = !1
|
|
1728
1586
|
}) => {
|
|
1729
|
-
const x =
|
|
1730
|
-
|
|
1587
|
+
const x = m === "24h", w = t ? t.getHours() : 0, T = t ? t.getMinutes() : 0, P = t ? t.getSeconds() : 0, H = w >= 12 ? "PM" : "AM", [V, j] = J(w), [$, G] = J(T), [y, A] = J(P), [W, _] = J(H), [p, d] = J(""), [l, c] = J(""), [i, C] = J(""), o = xe(null), k = xe(null), N = xe(null), I = xe(null), Y = xe(null), q = xe(null);
|
|
1588
|
+
Ue(() => {
|
|
1731
1589
|
if (t) {
|
|
1732
|
-
const s = t.getHours(),
|
|
1733
|
-
s !==
|
|
1590
|
+
const s = t.getHours(), v = t.getMinutes(), L = t.getSeconds(), D = s >= 12 ? "PM" : "AM";
|
|
1591
|
+
s !== V && j(s), v !== $ && G(v), L !== y && A(L), D !== W && _(D);
|
|
1734
1592
|
}
|
|
1735
|
-
}, [t]),
|
|
1736
|
-
|
|
1737
|
-
}, [
|
|
1738
|
-
const
|
|
1739
|
-
const
|
|
1740
|
-
|
|
1741
|
-
},
|
|
1742
|
-
let
|
|
1743
|
-
x || (
|
|
1593
|
+
}, [t]), Ue(() => {
|
|
1594
|
+
I.current && I.current.querySelector('[data-selected="true"]')?.scrollIntoView({ block: "center", behavior: "smooth" }), Y.current && Y.current.querySelector('[data-selected="true"]')?.scrollIntoView({ block: "center", behavior: "smooth" }), q.current && q.current.querySelector('[data-selected="true"]')?.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
1595
|
+
}, [V, $, y, x]);
|
|
1596
|
+
const se = (s, v, L) => {
|
|
1597
|
+
const D = /* @__PURE__ */ new Date();
|
|
1598
|
+
D.setHours(s), D.setMinutes(v), D.setSeconds(L), a(D);
|
|
1599
|
+
}, ce = (s) => {
|
|
1600
|
+
let v = s;
|
|
1601
|
+
x || (W === "PM" && s !== 12 ? v = s + 12 : W === "AM" && s === 12 && (v = 0)), j(v), se(v, $, y);
|
|
1744
1602
|
}, Q = (s) => {
|
|
1745
|
-
G(s),
|
|
1603
|
+
G(s), se(V, s, y);
|
|
1604
|
+
}, oe = (s) => {
|
|
1605
|
+
A(s), se(V, $, s);
|
|
1746
1606
|
}, le = (s) => {
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
O(N), oe(N, $, y);
|
|
1753
|
-
}, ue = () => {
|
|
1607
|
+
if (W === s) return;
|
|
1608
|
+
_(s);
|
|
1609
|
+
const v = s === "PM" ? V % 12 + 12 : V % 12;
|
|
1610
|
+
j(v), se(v, $, y);
|
|
1611
|
+
}, de = () => {
|
|
1754
1612
|
const s = /* @__PURE__ */ new Date();
|
|
1755
|
-
|
|
1756
|
-
},
|
|
1757
|
-
if (!t) return
|
|
1758
|
-
const s = x ?
|
|
1759
|
-
let
|
|
1760
|
-
return
|
|
1761
|
-
},
|
|
1762
|
-
const s = x ? 23 : 12,
|
|
1763
|
-
return Array.from({ length: s -
|
|
1764
|
-
},
|
|
1765
|
-
const
|
|
1766
|
-
return /* @__PURE__ */
|
|
1613
|
+
j(s.getHours()), G(s.getMinutes()), A(s.getSeconds()), _(s.getHours() >= 12 ? "PM" : "AM"), a(s);
|
|
1614
|
+
}, Me = () => {
|
|
1615
|
+
if (!t) return z;
|
|
1616
|
+
const s = x ? V : V % 12 || 12, v = $.toString().padStart(2, "0"), L = y.toString().padStart(2, "0");
|
|
1617
|
+
let D = `${s.toString().padStart(2, "0")}:${v}`;
|
|
1618
|
+
return h && (D += `:${L}`), x || (D += ` ${W}`), f && (D += ` ${n}`), D;
|
|
1619
|
+
}, Pe = () => {
|
|
1620
|
+
const s = x ? 23 : 12, v = x ? 0 : 1;
|
|
1621
|
+
return Array.from({ length: s - v + 1 }, (L, D) => v + D);
|
|
1622
|
+
}, De = () => Array.from({ length: Math.floor(60 / M) }, (s, v) => v * M), he = () => Array.from({ length: 60 }, (s, v) => v), ue = x ? V : V % 12 || 12, ae = () => {
|
|
1623
|
+
const re = (ue % 12 * 30 + $ * 0.5) * (Math.PI / 180) - Math.PI / 2, X = $ * 6 * (Math.PI / 180) - Math.PI / 2, K = 100 + 50 * Math.cos(re), Ee = 100 + 50 * Math.sin(re), ge = 100 + 70 * Math.cos(X), Fe = 100 + 70 * Math.sin(X);
|
|
1624
|
+
return /* @__PURE__ */ r("svg", { width: 200, height: 200, className: "mx-auto", children: [
|
|
1767
1625
|
/* @__PURE__ */ e("circle", { cx: 100, cy: 100, r: 95, fill: "white", stroke: "#e5e7eb", strokeWidth: "2" }),
|
|
1768
|
-
Array.from({ length: 12 }, (
|
|
1769
|
-
const
|
|
1626
|
+
Array.from({ length: 12 }, (Ge, pe) => {
|
|
1627
|
+
const g = pe * 30 * (Math.PI / 180) - Math.PI / 2, E = 100 + 80 * Math.cos(g), Z = 100 + 80 * Math.sin(g);
|
|
1770
1628
|
return /* @__PURE__ */ e(
|
|
1771
1629
|
"text",
|
|
1772
1630
|
{
|
|
1773
|
-
x:
|
|
1631
|
+
x: E,
|
|
1774
1632
|
y: Z,
|
|
1775
1633
|
textAnchor: "middle",
|
|
1776
1634
|
dominantBaseline: "middle",
|
|
1777
1635
|
className: "text-sm fill-gray-600",
|
|
1778
|
-
children:
|
|
1636
|
+
children: pe === 0 ? 12 : pe
|
|
1779
1637
|
},
|
|
1780
|
-
|
|
1638
|
+
pe
|
|
1781
1639
|
);
|
|
1782
1640
|
}),
|
|
1783
1641
|
/* @__PURE__ */ e(
|
|
@@ -1786,7 +1644,7 @@ const tr = ({
|
|
|
1786
1644
|
x1: 100,
|
|
1787
1645
|
y1: 100,
|
|
1788
1646
|
x2: K,
|
|
1789
|
-
y2:
|
|
1647
|
+
y2: Ee,
|
|
1790
1648
|
stroke: "#374151",
|
|
1791
1649
|
strokeWidth: "6",
|
|
1792
1650
|
strokeLinecap: "round"
|
|
@@ -1797,8 +1655,8 @@ const tr = ({
|
|
|
1797
1655
|
{
|
|
1798
1656
|
x1: 100,
|
|
1799
1657
|
y1: 100,
|
|
1800
|
-
x2:
|
|
1801
|
-
y2:
|
|
1658
|
+
x2: ge,
|
|
1659
|
+
y2: Fe,
|
|
1802
1660
|
stroke: "#ef4444",
|
|
1803
1661
|
strokeWidth: "4",
|
|
1804
1662
|
strokeLinecap: "round"
|
|
@@ -1807,56 +1665,56 @@ const tr = ({
|
|
|
1807
1665
|
/* @__PURE__ */ e("circle", { cx: 100, cy: 100, r: "6", fill: "#ef4444" })
|
|
1808
1666
|
] });
|
|
1809
1667
|
};
|
|
1810
|
-
return /* @__PURE__ */
|
|
1811
|
-
/* @__PURE__ */ e(
|
|
1668
|
+
return /* @__PURE__ */ r(yt, { children: [
|
|
1669
|
+
/* @__PURE__ */ e(xt, { asChild: !0, children: /* @__PURE__ */ r(
|
|
1812
1670
|
b,
|
|
1813
1671
|
{
|
|
1814
|
-
variant:
|
|
1815
|
-
size:
|
|
1816
|
-
className:
|
|
1672
|
+
variant: R,
|
|
1673
|
+
size: F,
|
|
1674
|
+
className: u(
|
|
1817
1675
|
"justify-start text-left font-normal",
|
|
1818
1676
|
!t && "text-muted-foreground"
|
|
1819
1677
|
),
|
|
1820
1678
|
children: [
|
|
1821
|
-
/* @__PURE__ */ e(
|
|
1822
|
-
|
|
1679
|
+
/* @__PURE__ */ e(Lt, { className: "mr-2 h-4 w-4" }),
|
|
1680
|
+
Me()
|
|
1823
1681
|
]
|
|
1824
1682
|
}
|
|
1825
1683
|
) }),
|
|
1826
|
-
/* @__PURE__ */ e(
|
|
1827
|
-
/* @__PURE__ */
|
|
1828
|
-
/* @__PURE__ */
|
|
1829
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ e(Be, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ r("div", { className: "p-6 space-y-4 min-w-[460px]", children: [
|
|
1685
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
1686
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-center gap-6", children: [
|
|
1687
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1", children: [
|
|
1830
1688
|
/* @__PURE__ */ e(
|
|
1831
1689
|
"input",
|
|
1832
1690
|
{
|
|
1833
1691
|
ref: o,
|
|
1834
1692
|
type: "text",
|
|
1835
1693
|
inputMode: "numeric",
|
|
1836
|
-
value:
|
|
1694
|
+
value: p !== "" ? p.padStart(2, "0") : ue.toString().padStart(2, "0"),
|
|
1837
1695
|
onKeyDown: (s) => {
|
|
1838
1696
|
if (s.key >= "0" && s.key <= "9") {
|
|
1839
1697
|
s.preventDefault();
|
|
1840
|
-
const
|
|
1841
|
-
if (
|
|
1842
|
-
|
|
1843
|
-
else if (
|
|
1844
|
-
const
|
|
1845
|
-
let X =
|
|
1846
|
-
|
|
1698
|
+
const v = p + s.key;
|
|
1699
|
+
if (v.length === 1)
|
|
1700
|
+
d(s.key);
|
|
1701
|
+
else if (v.length === 2) {
|
|
1702
|
+
const L = parseInt(v), D = x ? 23 : 12, re = x ? 0 : 1;
|
|
1703
|
+
let X = L;
|
|
1704
|
+
L < re && (X = re), L > D && (X = D), d(""), ce(X), setTimeout(() => k.current?.focus(), 0);
|
|
1847
1705
|
}
|
|
1848
|
-
} else s.key === "Backspace" ? (s.preventDefault(),
|
|
1706
|
+
} else s.key === "Backspace" ? (s.preventDefault(), p.length > 0 && d(p.slice(0, -1))) : s.key === "ArrowRight" || s.key === "Tab" ? (s.key === "ArrowRight" && s.preventDefault(), k.current?.focus()) : s.key === ":" && (s.preventDefault(), k.current?.focus());
|
|
1849
1707
|
},
|
|
1850
1708
|
onBlur: () => {
|
|
1851
|
-
if (
|
|
1852
|
-
const s = parseInt(
|
|
1853
|
-
let
|
|
1854
|
-
s <
|
|
1709
|
+
if (p) {
|
|
1710
|
+
const s = parseInt(p), v = x ? 23 : 12, L = x ? 0 : 1;
|
|
1711
|
+
let D = s;
|
|
1712
|
+
s < L && (D = L), s > v && (D = v), ce(D);
|
|
1855
1713
|
}
|
|
1856
|
-
|
|
1714
|
+
d("");
|
|
1857
1715
|
},
|
|
1858
1716
|
onFocus: () => {
|
|
1859
|
-
|
|
1717
|
+
d("");
|
|
1860
1718
|
},
|
|
1861
1719
|
className: "text-6xl font-medium tabular-nums leading-none w-[85px] text-center bg-transparent outline-none focus:ring-2 focus:ring-primary rounded px-1 cursor-text",
|
|
1862
1720
|
readOnly: !0
|
|
@@ -1866,26 +1724,26 @@ const tr = ({
|
|
|
1866
1724
|
/* @__PURE__ */ e(
|
|
1867
1725
|
"input",
|
|
1868
1726
|
{
|
|
1869
|
-
ref:
|
|
1727
|
+
ref: k,
|
|
1870
1728
|
type: "text",
|
|
1871
1729
|
inputMode: "numeric",
|
|
1872
1730
|
value: l !== "" ? l.padStart(2, "0") : $.toString().padStart(2, "0"),
|
|
1873
1731
|
onKeyDown: (s) => {
|
|
1874
1732
|
if (s.key >= "0" && s.key <= "9") {
|
|
1875
1733
|
s.preventDefault();
|
|
1876
|
-
const
|
|
1877
|
-
if (
|
|
1734
|
+
const v = l + s.key;
|
|
1735
|
+
if (v.length === 1)
|
|
1878
1736
|
c(s.key);
|
|
1879
|
-
else if (
|
|
1880
|
-
const
|
|
1881
|
-
c(""), Q(
|
|
1737
|
+
else if (v.length === 2) {
|
|
1738
|
+
const L = parseInt(v), D = Math.min(59, Math.max(0, L));
|
|
1739
|
+
c(""), Q(D), h && setTimeout(() => N.current?.focus(), 0);
|
|
1882
1740
|
}
|
|
1883
|
-
} else s.key === "Backspace" ? (s.preventDefault(), l.length > 0 ? c(l.slice(0, -1)) : o.current?.focus()) : s.key === "ArrowLeft" ? (s.preventDefault(), o.current?.focus()) : s.key === "ArrowRight" || s.key === "Tab" ? (s.key === "ArrowRight" && s.preventDefault(),
|
|
1741
|
+
} else s.key === "Backspace" ? (s.preventDefault(), l.length > 0 ? c(l.slice(0, -1)) : o.current?.focus()) : s.key === "ArrowLeft" ? (s.preventDefault(), o.current?.focus()) : s.key === "ArrowRight" || s.key === "Tab" ? (s.key === "ArrowRight" && s.preventDefault(), h && N.current?.focus()) : s.key === ":" && (s.preventDefault(), h && N.current?.focus());
|
|
1884
1742
|
},
|
|
1885
1743
|
onBlur: () => {
|
|
1886
1744
|
if (l) {
|
|
1887
|
-
const s = parseInt(l),
|
|
1888
|
-
Q(
|
|
1745
|
+
const s = parseInt(l), v = Math.min(59, Math.max(0, s));
|
|
1746
|
+
Q(v);
|
|
1889
1747
|
}
|
|
1890
1748
|
c("");
|
|
1891
1749
|
},
|
|
@@ -1896,36 +1754,36 @@ const tr = ({
|
|
|
1896
1754
|
readOnly: !0
|
|
1897
1755
|
}
|
|
1898
1756
|
),
|
|
1899
|
-
|
|
1757
|
+
h && /* @__PURE__ */ r(ze, { children: [
|
|
1900
1758
|
/* @__PURE__ */ e("div", { className: "text-6xl font-medium leading-none flex items-center px-1", children: ":" }),
|
|
1901
1759
|
/* @__PURE__ */ e(
|
|
1902
1760
|
"input",
|
|
1903
1761
|
{
|
|
1904
|
-
ref:
|
|
1762
|
+
ref: N,
|
|
1905
1763
|
type: "text",
|
|
1906
1764
|
inputMode: "numeric",
|
|
1907
1765
|
value: i !== "" ? i.padStart(2, "0") : y.toString().padStart(2, "0"),
|
|
1908
1766
|
onKeyDown: (s) => {
|
|
1909
1767
|
if (s.key >= "0" && s.key <= "9") {
|
|
1910
1768
|
s.preventDefault();
|
|
1911
|
-
const
|
|
1912
|
-
if (
|
|
1913
|
-
|
|
1914
|
-
else if (
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1769
|
+
const v = i + s.key;
|
|
1770
|
+
if (v.length === 1)
|
|
1771
|
+
C(s.key);
|
|
1772
|
+
else if (v.length === 2) {
|
|
1773
|
+
const L = parseInt(v), D = Math.min(59, Math.max(0, L));
|
|
1774
|
+
C(""), oe(D);
|
|
1917
1775
|
}
|
|
1918
|
-
} else s.key === "Backspace" ? (s.preventDefault(), i.length > 0 ?
|
|
1776
|
+
} else s.key === "Backspace" ? (s.preventDefault(), i.length > 0 ? C(i.slice(0, -1)) : k.current?.focus()) : s.key === "ArrowLeft" && (s.preventDefault(), k.current?.focus());
|
|
1919
1777
|
},
|
|
1920
1778
|
onBlur: () => {
|
|
1921
1779
|
if (i) {
|
|
1922
|
-
const s = parseInt(i),
|
|
1923
|
-
|
|
1780
|
+
const s = parseInt(i), v = Math.min(59, Math.max(0, s));
|
|
1781
|
+
oe(v);
|
|
1924
1782
|
}
|
|
1925
|
-
|
|
1783
|
+
C("");
|
|
1926
1784
|
},
|
|
1927
1785
|
onFocus: () => {
|
|
1928
|
-
|
|
1786
|
+
C("");
|
|
1929
1787
|
},
|
|
1930
1788
|
className: "text-6xl font-medium tabular-nums leading-none w-[85px] text-center bg-transparent outline-none focus:ring-2 focus:ring-primary rounded px-1 cursor-text",
|
|
1931
1789
|
readOnly: !0
|
|
@@ -1933,13 +1791,13 @@ const tr = ({
|
|
|
1933
1791
|
)
|
|
1934
1792
|
] })
|
|
1935
1793
|
] }),
|
|
1936
|
-
!x && /* @__PURE__ */
|
|
1794
|
+
!x && /* @__PURE__ */ r("div", { className: "flex flex-col gap-1", children: [
|
|
1937
1795
|
/* @__PURE__ */ e(
|
|
1938
1796
|
b,
|
|
1939
1797
|
{
|
|
1940
1798
|
size: "sm",
|
|
1941
|
-
variant:
|
|
1942
|
-
onClick: () =>
|
|
1799
|
+
variant: W === "AM" ? "default" : "outline",
|
|
1800
|
+
onClick: () => le("AM"),
|
|
1943
1801
|
className: "h-8 w-12 text-xs font-medium",
|
|
1944
1802
|
children: "AM"
|
|
1945
1803
|
}
|
|
@@ -1948,37 +1806,37 @@ const tr = ({
|
|
|
1948
1806
|
b,
|
|
1949
1807
|
{
|
|
1950
1808
|
size: "sm",
|
|
1951
|
-
variant:
|
|
1952
|
-
onClick: () =>
|
|
1809
|
+
variant: W === "PM" ? "default" : "outline",
|
|
1810
|
+
onClick: () => le("PM"),
|
|
1953
1811
|
className: "h-8 w-12 text-xs font-medium",
|
|
1954
1812
|
children: "PM"
|
|
1955
1813
|
}
|
|
1956
1814
|
)
|
|
1957
1815
|
] })
|
|
1958
1816
|
] }),
|
|
1959
|
-
|
|
1817
|
+
f && /* @__PURE__ */ e("div", { className: "text-xs text-gray-500 text-center", children: n })
|
|
1960
1818
|
] }),
|
|
1961
|
-
|
|
1819
|
+
O ? (
|
|
1962
1820
|
/* Clock Face View */
|
|
1963
|
-
/* @__PURE__ */ e("div", { className: "space-y-4", children:
|
|
1821
|
+
/* @__PURE__ */ e("div", { className: "space-y-4", children: ae() })
|
|
1964
1822
|
) : (
|
|
1965
1823
|
/* Scrollable Column View */
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
1824
|
+
/* @__PURE__ */ r("div", { className: "flex gap-2 justify-center items-start", children: [
|
|
1825
|
+
/* @__PURE__ */ r("div", { className: "flex-1 max-w-[80px]", children: [
|
|
1968
1826
|
/* @__PURE__ */ e("div", { className: "text-xs text-center text-gray-500 mb-2", children: "Hour" }),
|
|
1969
1827
|
/* @__PURE__ */ e(
|
|
1970
1828
|
"div",
|
|
1971
1829
|
{
|
|
1972
|
-
ref:
|
|
1830
|
+
ref: I,
|
|
1973
1831
|
className: "h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",
|
|
1974
|
-
children:
|
|
1832
|
+
children: Pe().map((s) => /* @__PURE__ */ e(
|
|
1975
1833
|
"button",
|
|
1976
1834
|
{
|
|
1977
|
-
"data-selected":
|
|
1978
|
-
onClick: () =>
|
|
1979
|
-
className:
|
|
1835
|
+
"data-selected": ue === s,
|
|
1836
|
+
onClick: () => ce(s),
|
|
1837
|
+
className: u(
|
|
1980
1838
|
"w-full py-2 text-center transition-colors",
|
|
1981
|
-
|
|
1839
|
+
ue === s ? "bg-blue-500 text-white font-medium" : "hover:bg-gray-100 text-gray-700"
|
|
1982
1840
|
),
|
|
1983
1841
|
children: s.toString().padStart(2, "0")
|
|
1984
1842
|
},
|
|
@@ -1987,19 +1845,19 @@ const tr = ({
|
|
|
1987
1845
|
}
|
|
1988
1846
|
)
|
|
1989
1847
|
] }),
|
|
1990
|
-
/* @__PURE__ */
|
|
1848
|
+
/* @__PURE__ */ r("div", { className: "flex-1 max-w-[80px]", children: [
|
|
1991
1849
|
/* @__PURE__ */ e("div", { className: "text-xs text-center text-gray-500 mb-2", children: "Min" }),
|
|
1992
1850
|
/* @__PURE__ */ e(
|
|
1993
1851
|
"div",
|
|
1994
1852
|
{
|
|
1995
|
-
ref:
|
|
1853
|
+
ref: Y,
|
|
1996
1854
|
className: "h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",
|
|
1997
|
-
children:
|
|
1855
|
+
children: De().map((s) => /* @__PURE__ */ e(
|
|
1998
1856
|
"button",
|
|
1999
1857
|
{
|
|
2000
1858
|
"data-selected": $ === s,
|
|
2001
1859
|
onClick: () => Q(s),
|
|
2002
|
-
className:
|
|
1860
|
+
className: u(
|
|
2003
1861
|
"w-full py-2 text-center transition-colors",
|
|
2004
1862
|
$ === s ? "bg-blue-500 text-white font-medium" : "hover:bg-gray-100 text-gray-700"
|
|
2005
1863
|
),
|
|
@@ -2010,19 +1868,19 @@ const tr = ({
|
|
|
2010
1868
|
}
|
|
2011
1869
|
)
|
|
2012
1870
|
] }),
|
|
2013
|
-
|
|
1871
|
+
h && /* @__PURE__ */ r("div", { className: "flex-1 max-w-[80px]", children: [
|
|
2014
1872
|
/* @__PURE__ */ e("div", { className: "text-xs text-center text-gray-500 mb-2", children: "Sec" }),
|
|
2015
1873
|
/* @__PURE__ */ e(
|
|
2016
1874
|
"div",
|
|
2017
1875
|
{
|
|
2018
1876
|
ref: q,
|
|
2019
1877
|
className: "h-40 overflow-y-scroll border rounded-md scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-gray-100",
|
|
2020
|
-
children:
|
|
1878
|
+
children: he().map((s) => /* @__PURE__ */ e(
|
|
2021
1879
|
"button",
|
|
2022
1880
|
{
|
|
2023
1881
|
"data-selected": y === s,
|
|
2024
|
-
onClick: () =>
|
|
2025
|
-
className:
|
|
1882
|
+
onClick: () => oe(s),
|
|
1883
|
+
className: u(
|
|
2026
1884
|
"w-full py-2 text-center transition-colors",
|
|
2027
1885
|
y === s ? "bg-blue-500 text-white font-medium" : "hover:bg-gray-100 text-gray-700"
|
|
2028
1886
|
),
|
|
@@ -2035,156 +1893,156 @@ const tr = ({
|
|
|
2035
1893
|
] })
|
|
2036
1894
|
] })
|
|
2037
1895
|
),
|
|
2038
|
-
/* @__PURE__ */
|
|
2039
|
-
/* @__PURE__ */ e(b, { size: "sm", variant: "outline", onClick:
|
|
1896
|
+
/* @__PURE__ */ r("div", { className: "flex gap-2 justify-between pt-2 border-t", children: [
|
|
1897
|
+
/* @__PURE__ */ e(b, { size: "sm", variant: "outline", onClick: de, children: "Now" }),
|
|
2040
1898
|
/* @__PURE__ */ e(b, { size: "sm", onClick: () => a(t), children: "Done" })
|
|
2041
1899
|
] })
|
|
2042
1900
|
] }) })
|
|
2043
1901
|
] });
|
|
2044
|
-
},
|
|
1902
|
+
}, bt = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
2045
1903
|
"div",
|
|
2046
1904
|
{
|
|
2047
|
-
ref:
|
|
2048
|
-
className:
|
|
1905
|
+
ref: n,
|
|
1906
|
+
className: u(
|
|
2049
1907
|
"rounded-lg border border-gray-200 bg-white text-gray-950 shadow-sm",
|
|
2050
1908
|
t
|
|
2051
1909
|
),
|
|
2052
1910
|
...a
|
|
2053
1911
|
}
|
|
2054
1912
|
));
|
|
2055
|
-
|
|
2056
|
-
const
|
|
1913
|
+
bt.displayName = "Card";
|
|
1914
|
+
const vt = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
2057
1915
|
"div",
|
|
2058
1916
|
{
|
|
2059
|
-
ref:
|
|
2060
|
-
className:
|
|
1917
|
+
ref: n,
|
|
1918
|
+
className: u("flex flex-col space-y-1.5 p-6", t),
|
|
2061
1919
|
...a
|
|
2062
1920
|
}
|
|
2063
1921
|
));
|
|
2064
|
-
|
|
2065
|
-
const
|
|
1922
|
+
vt.displayName = "CardHeader";
|
|
1923
|
+
const wt = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
2066
1924
|
"h3",
|
|
2067
1925
|
{
|
|
2068
|
-
ref:
|
|
2069
|
-
className:
|
|
1926
|
+
ref: n,
|
|
1927
|
+
className: u(
|
|
2070
1928
|
"text-2xl font-semibold leading-none tracking-tight",
|
|
2071
1929
|
t
|
|
2072
1930
|
),
|
|
2073
1931
|
...a
|
|
2074
1932
|
}
|
|
2075
1933
|
));
|
|
2076
|
-
|
|
2077
|
-
const
|
|
1934
|
+
wt.displayName = "CardTitle";
|
|
1935
|
+
const ea = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
2078
1936
|
"p",
|
|
2079
1937
|
{
|
|
2080
|
-
ref:
|
|
2081
|
-
className:
|
|
1938
|
+
ref: n,
|
|
1939
|
+
className: u("text-sm text-gray-500", t),
|
|
2082
1940
|
...a
|
|
2083
1941
|
}
|
|
2084
1942
|
));
|
|
2085
|
-
|
|
2086
|
-
const
|
|
2087
|
-
|
|
2088
|
-
const
|
|
1943
|
+
ea.displayName = "CardDescription";
|
|
1944
|
+
const Nt = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e("div", { ref: n, className: u("p-6 pt-0", t), ...a }));
|
|
1945
|
+
Nt.displayName = "CardContent";
|
|
1946
|
+
const ta = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
2089
1947
|
"div",
|
|
2090
1948
|
{
|
|
2091
|
-
ref:
|
|
2092
|
-
className:
|
|
1949
|
+
ref: n,
|
|
1950
|
+
className: u("flex items-center p-6 pt-0", t),
|
|
2093
1951
|
...a
|
|
2094
1952
|
}
|
|
2095
1953
|
));
|
|
2096
|
-
|
|
2097
|
-
const ee =
|
|
2098
|
-
|
|
1954
|
+
ta.displayName = "CardFooter";
|
|
1955
|
+
const ee = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
1956
|
+
it.Root,
|
|
2099
1957
|
{
|
|
2100
|
-
ref:
|
|
2101
|
-
className:
|
|
1958
|
+
ref: n,
|
|
1959
|
+
className: u(
|
|
2102
1960
|
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
2103
1961
|
t
|
|
2104
1962
|
),
|
|
2105
1963
|
...a
|
|
2106
1964
|
}
|
|
2107
1965
|
));
|
|
2108
|
-
ee.displayName =
|
|
2109
|
-
const
|
|
2110
|
-
|
|
1966
|
+
ee.displayName = it.Root.displayName;
|
|
1967
|
+
const aa = te.Root, ra = te.Portal, St = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
1968
|
+
te.Overlay,
|
|
2111
1969
|
{
|
|
2112
|
-
ref:
|
|
2113
|
-
className:
|
|
1970
|
+
ref: n,
|
|
1971
|
+
className: u(
|
|
2114
1972
|
"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
2115
1973
|
t
|
|
2116
1974
|
),
|
|
2117
1975
|
...a
|
|
2118
1976
|
}
|
|
2119
1977
|
));
|
|
2120
|
-
|
|
2121
|
-
const
|
|
2122
|
-
/* @__PURE__ */ e(
|
|
2123
|
-
/* @__PURE__ */
|
|
2124
|
-
|
|
1978
|
+
St.displayName = te.Overlay.displayName;
|
|
1979
|
+
const Mt = S.forwardRef(({ className: t, children: a, ...n }, m) => /* @__PURE__ */ r(ra, { children: [
|
|
1980
|
+
/* @__PURE__ */ e(St, {}),
|
|
1981
|
+
/* @__PURE__ */ r(
|
|
1982
|
+
te.Content,
|
|
2125
1983
|
{
|
|
2126
|
-
ref:
|
|
2127
|
-
className:
|
|
1984
|
+
ref: m,
|
|
1985
|
+
className: u(
|
|
2128
1986
|
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",
|
|
2129
1987
|
t
|
|
2130
1988
|
),
|
|
2131
|
-
...
|
|
1989
|
+
...n,
|
|
2132
1990
|
children: [
|
|
2133
1991
|
a,
|
|
2134
|
-
/* @__PURE__ */
|
|
2135
|
-
/* @__PURE__ */ e(
|
|
1992
|
+
/* @__PURE__ */ r(te.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-gray-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-gray-100", children: [
|
|
1993
|
+
/* @__PURE__ */ e(Vt, { className: "h-4 w-4" }),
|
|
2136
1994
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Close" })
|
|
2137
1995
|
] })
|
|
2138
1996
|
]
|
|
2139
1997
|
}
|
|
2140
1998
|
)
|
|
2141
1999
|
] }));
|
|
2142
|
-
|
|
2143
|
-
const
|
|
2000
|
+
Mt.displayName = te.Content.displayName;
|
|
2001
|
+
const Dt = ({
|
|
2144
2002
|
className: t,
|
|
2145
2003
|
...a
|
|
2146
2004
|
}) => /* @__PURE__ */ e(
|
|
2147
2005
|
"div",
|
|
2148
2006
|
{
|
|
2149
|
-
className:
|
|
2007
|
+
className: u(
|
|
2150
2008
|
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
2151
2009
|
t
|
|
2152
2010
|
),
|
|
2153
2011
|
...a
|
|
2154
2012
|
}
|
|
2155
2013
|
);
|
|
2156
|
-
|
|
2157
|
-
const
|
|
2158
|
-
|
|
2014
|
+
Dt.displayName = "ModalHeader";
|
|
2015
|
+
const kt = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
2016
|
+
te.Title,
|
|
2159
2017
|
{
|
|
2160
|
-
ref:
|
|
2161
|
-
className:
|
|
2018
|
+
ref: n,
|
|
2019
|
+
className: u(
|
|
2162
2020
|
"text-lg font-semibold leading-none tracking-tight",
|
|
2163
2021
|
t
|
|
2164
2022
|
),
|
|
2165
2023
|
...a
|
|
2166
2024
|
}
|
|
2167
2025
|
));
|
|
2168
|
-
|
|
2169
|
-
const
|
|
2170
|
-
|
|
2026
|
+
kt.displayName = te.Title.displayName;
|
|
2027
|
+
const Ct = S.forwardRef(({ className: t, ...a }, n) => /* @__PURE__ */ e(
|
|
2028
|
+
te.Description,
|
|
2171
2029
|
{
|
|
2172
|
-
ref:
|
|
2173
|
-
className:
|
|
2030
|
+
ref: n,
|
|
2031
|
+
className: u("text-sm text-gray-500", t),
|
|
2174
2032
|
...a
|
|
2175
2033
|
}
|
|
2176
2034
|
));
|
|
2177
|
-
|
|
2178
|
-
function
|
|
2179
|
-
return /* @__PURE__ */ e(
|
|
2180
|
-
(
|
|
2181
|
-
|
|
2182
|
-
|
|
2035
|
+
Ct.displayName = te.Description.displayName;
|
|
2036
|
+
function na({ isOpen: t, onClose: a, title: n, description: m, children: f, className: M }) {
|
|
2037
|
+
return /* @__PURE__ */ e(aa, { open: t, onOpenChange: a, children: /* @__PURE__ */ r(Mt, { className: M, children: [
|
|
2038
|
+
(n || m) && /* @__PURE__ */ r(Dt, { children: [
|
|
2039
|
+
n && /* @__PURE__ */ e(kt, { children: n }),
|
|
2040
|
+
m && /* @__PURE__ */ e(Ct, { children: m })
|
|
2183
2041
|
] }),
|
|
2184
|
-
|
|
2042
|
+
f
|
|
2185
2043
|
] }) });
|
|
2186
2044
|
}
|
|
2187
|
-
const
|
|
2045
|
+
const je = [
|
|
2188
2046
|
"January",
|
|
2189
2047
|
"February",
|
|
2190
2048
|
"March",
|
|
@@ -2198,115 +2056,115 @@ const Le = [
|
|
|
2198
2056
|
"November",
|
|
2199
2057
|
"December"
|
|
2200
2058
|
];
|
|
2201
|
-
function
|
|
2059
|
+
function sa({
|
|
2202
2060
|
onWeekChange: t,
|
|
2203
2061
|
initialDate: a = /* @__PURE__ */ new Date(),
|
|
2204
|
-
className:
|
|
2205
|
-
compact:
|
|
2062
|
+
className: n,
|
|
2063
|
+
compact: m = !1
|
|
2206
2064
|
}) {
|
|
2207
|
-
const [
|
|
2208
|
-
const i = [],
|
|
2209
|
-
|
|
2210
|
-
for (let
|
|
2211
|
-
const
|
|
2212
|
-
|
|
2065
|
+
const [f, M] = S.useState(a), [h, z] = S.useState(!1), [R, F] = S.useState(!1), [O, x] = S.useState(!1), [w, T] = S.useState(a.getFullYear()), [P, H] = S.useState(a.getMonth()), [V, j] = S.useState(0), $ = S.useRef(null), G = S.useRef(null), y = (c) => {
|
|
2066
|
+
const i = [], C = new Date(c), o = C.getDay(), k = o === 0 ? -6 : 1 - o;
|
|
2067
|
+
C.setDate(C.getDate() + k);
|
|
2068
|
+
for (let N = 0; N < 7; N++) {
|
|
2069
|
+
const I = new Date(C);
|
|
2070
|
+
I.setDate(C.getDate() + N), i.push(I);
|
|
2213
2071
|
}
|
|
2214
2072
|
return i;
|
|
2215
|
-
},
|
|
2216
|
-
const
|
|
2217
|
-
|
|
2218
|
-
const
|
|
2219
|
-
for (;
|
|
2220
|
-
const
|
|
2221
|
-
if (
|
|
2073
|
+
}, A = (c, i) => {
|
|
2074
|
+
const C = new Date(c, i, 1), o = new Date(c, i + 1, 0), k = new Date(C);
|
|
2075
|
+
k.setDate(C.getDate() - (C.getDay() + 6) % 7);
|
|
2076
|
+
const N = [], I = new Date(k);
|
|
2077
|
+
for (; I <= o || I.getMonth() === i; ) {
|
|
2078
|
+
const Y = new Date(I);
|
|
2079
|
+
if (Y.setDate(I.getDate() + 6), N.push({ start: new Date(I), end: new Date(Y) }), I.setDate(I.getDate() + 7), N.length > 6) break;
|
|
2222
2080
|
}
|
|
2223
|
-
return
|
|
2224
|
-
},
|
|
2225
|
-
const
|
|
2226
|
-
return
|
|
2227
|
-
},
|
|
2228
|
-
const i = new Date(
|
|
2229
|
-
i.setDate(
|
|
2081
|
+
return N;
|
|
2082
|
+
}, W = (c, i) => {
|
|
2083
|
+
const C = c.toLocaleDateString("en-US", { month: "short" }), o = i.toLocaleDateString("en-US", { month: "short" });
|
|
2084
|
+
return C === o ? `${C} ${c.getDate()}-${i.getDate()}` : `${C} ${c.getDate()}-${o} ${i.getDate()}`;
|
|
2085
|
+
}, _ = y(f), p = Array.from({ length: 10 }, (c, i) => w - 5 + i), d = (c) => {
|
|
2086
|
+
const i = new Date(f);
|
|
2087
|
+
i.setDate(f.getDate() + (c === "next" ? 7 : -7)), M(i), T(i.getFullYear()), H(i.getMonth()), t?.(i);
|
|
2230
2088
|
}, l = (c, i) => {
|
|
2231
|
-
|
|
2089
|
+
j(i), z(!1), M(c.start), t?.(c.start);
|
|
2232
2090
|
};
|
|
2233
|
-
return
|
|
2091
|
+
return S.useEffect(() => {
|
|
2234
2092
|
const c = (i) => {
|
|
2235
|
-
$.current && !$.current.contains(i.target) && G.current && !G.current.contains(i.target) && (
|
|
2093
|
+
$.current && !$.current.contains(i.target) && G.current && !G.current.contains(i.target) && (z(!1), F(!1), x(!1));
|
|
2236
2094
|
};
|
|
2237
|
-
return
|
|
2095
|
+
return h && document.addEventListener("mousedown", c), () => {
|
|
2238
2096
|
document.removeEventListener("mousedown", c);
|
|
2239
2097
|
};
|
|
2240
|
-
}, [
|
|
2241
|
-
const i =
|
|
2242
|
-
(
|
|
2098
|
+
}, [h]), S.useEffect(() => {
|
|
2099
|
+
const i = A(w, P).findIndex(
|
|
2100
|
+
(C) => f >= C.start && f <= C.end
|
|
2243
2101
|
);
|
|
2244
|
-
i !== -1 &&
|
|
2245
|
-
}, [
|
|
2102
|
+
i !== -1 && j(i);
|
|
2103
|
+
}, [f, w, P]), /* @__PURE__ */ r("div", { className: u("flex items-center gap-3", n), children: [
|
|
2246
2104
|
/* @__PURE__ */ e(
|
|
2247
2105
|
b,
|
|
2248
2106
|
{
|
|
2249
2107
|
variant: "outline",
|
|
2250
2108
|
size: "sm",
|
|
2251
|
-
onClick: () =>
|
|
2252
|
-
className:
|
|
2109
|
+
onClick: () => d("prev"),
|
|
2110
|
+
className: u(
|
|
2253
2111
|
"rounded-lg border-gray-200 hover:border-gray-300 hover:bg-gray-50",
|
|
2254
|
-
|
|
2112
|
+
m ? "h-8 w-8 p-0" : "h-9 w-9 p-0"
|
|
2255
2113
|
),
|
|
2256
|
-
children: /* @__PURE__ */ e(
|
|
2114
|
+
children: /* @__PURE__ */ e(ie, { className: u(m ? "h-3 w-3" : "h-4 w-4", "text-gray-600") })
|
|
2257
2115
|
}
|
|
2258
2116
|
),
|
|
2259
|
-
/* @__PURE__ */
|
|
2260
|
-
/* @__PURE__ */
|
|
2117
|
+
/* @__PURE__ */ r("div", { className: "relative", children: [
|
|
2118
|
+
/* @__PURE__ */ r(
|
|
2261
2119
|
"div",
|
|
2262
2120
|
{
|
|
2263
2121
|
ref: G,
|
|
2264
|
-
className:
|
|
2122
|
+
className: u(
|
|
2265
2123
|
"flex items-center gap-2 bg-white rounded-lg border border-gray-200 shadow-sm cursor-pointer hover:bg-gray-50 transition-colors",
|
|
2266
|
-
|
|
2124
|
+
m ? "px-2 py-1" : "px-3 py-2"
|
|
2267
2125
|
),
|
|
2268
|
-
onClick: () =>
|
|
2126
|
+
onClick: () => z(!h),
|
|
2269
2127
|
children: [
|
|
2270
|
-
/* @__PURE__ */ e(
|
|
2271
|
-
/* @__PURE__ */ e("span", { className:
|
|
2272
|
-
/* @__PURE__ */ e(
|
|
2273
|
-
|
|
2128
|
+
/* @__PURE__ */ e(Ve, { className: u(m ? "h-3 w-3" : "h-4 w-4", "text-gray-500") }),
|
|
2129
|
+
/* @__PURE__ */ e("span", { className: u(m ? "text-xs" : "text-sm", "font-medium text-gray-700"), children: _.length >= 7 && _[0] && _[6] && `${_[0].getDate()}-${_[6].getDate()} ${je[_[0].getMonth()]} ${_[0].getFullYear()}` }),
|
|
2130
|
+
/* @__PURE__ */ e(ne, { className: u(
|
|
2131
|
+
m ? "h-2 w-2" : "h-3 w-3",
|
|
2274
2132
|
"text-gray-400 transition-transform",
|
|
2275
|
-
|
|
2133
|
+
h && "rotate-90"
|
|
2276
2134
|
) })
|
|
2277
2135
|
]
|
|
2278
2136
|
}
|
|
2279
2137
|
),
|
|
2280
|
-
|
|
2281
|
-
!
|
|
2138
|
+
h && /* @__PURE__ */ r("div", { ref: $, className: "absolute top-full right-0 mt-2 bg-white border border-gray-200 rounded-lg shadow-lg p-4 z-50 w-80 sm:w-96", children: [
|
|
2139
|
+
!R && !O && /* @__PURE__ */ r("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2282
2140
|
/* @__PURE__ */ e(
|
|
2283
2141
|
b,
|
|
2284
2142
|
{
|
|
2285
2143
|
variant: "ghost",
|
|
2286
2144
|
size: "sm",
|
|
2287
2145
|
onClick: () => {
|
|
2288
|
-
const c =
|
|
2289
|
-
|
|
2146
|
+
const c = P === 0 ? 11 : P - 1, i = P === 0 ? w - 1 : w;
|
|
2147
|
+
H(c), T(i);
|
|
2290
2148
|
},
|
|
2291
2149
|
className: "h-8 w-8 p-0",
|
|
2292
|
-
children: /* @__PURE__ */ e(
|
|
2150
|
+
children: /* @__PURE__ */ e(ie, { className: "h-4 w-4" })
|
|
2293
2151
|
}
|
|
2294
2152
|
),
|
|
2295
|
-
/* @__PURE__ */
|
|
2153
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2296
2154
|
/* @__PURE__ */ e(
|
|
2297
2155
|
"button",
|
|
2298
2156
|
{
|
|
2299
2157
|
className: "text-lg font-semibold text-gray-800 hover:text-blue-600 transition-colors",
|
|
2300
|
-
onClick: () =>
|
|
2301
|
-
children:
|
|
2158
|
+
onClick: () => F(!R),
|
|
2159
|
+
children: je[P]
|
|
2302
2160
|
}
|
|
2303
2161
|
),
|
|
2304
2162
|
/* @__PURE__ */ e(
|
|
2305
2163
|
"button",
|
|
2306
2164
|
{
|
|
2307
2165
|
className: "text-lg font-semibold text-gray-800 hover:text-blue-600 transition-colors",
|
|
2308
|
-
onClick: () => x(!
|
|
2309
|
-
children:
|
|
2166
|
+
onClick: () => x(!O),
|
|
2167
|
+
children: w
|
|
2310
2168
|
}
|
|
2311
2169
|
)
|
|
2312
2170
|
] }),
|
|
@@ -2316,43 +2174,43 @@ function da({
|
|
|
2316
2174
|
variant: "ghost",
|
|
2317
2175
|
size: "sm",
|
|
2318
2176
|
onClick: () => {
|
|
2319
|
-
const c =
|
|
2320
|
-
|
|
2177
|
+
const c = P === 11 ? 0 : P + 1, i = P === 11 ? w + 1 : w;
|
|
2178
|
+
H(c), T(i);
|
|
2321
2179
|
},
|
|
2322
2180
|
className: "h-8 w-8 p-0",
|
|
2323
|
-
children: /* @__PURE__ */ e(
|
|
2181
|
+
children: /* @__PURE__ */ e(ne, { className: "h-4 w-4" })
|
|
2324
2182
|
}
|
|
2325
2183
|
)
|
|
2326
2184
|
] }),
|
|
2327
|
-
|
|
2328
|
-
/* @__PURE__ */
|
|
2185
|
+
R ? /* @__PURE__ */ r("div", { className: "p-6", children: [
|
|
2186
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2329
2187
|
/* @__PURE__ */ e(
|
|
2330
2188
|
b,
|
|
2331
2189
|
{
|
|
2332
2190
|
variant: "ghost",
|
|
2333
2191
|
size: "sm",
|
|
2334
|
-
onClick: () =>
|
|
2192
|
+
onClick: () => F(!1),
|
|
2335
2193
|
className: "h-9 px-3 text-sm font-medium",
|
|
2336
2194
|
children: "← Back"
|
|
2337
2195
|
}
|
|
2338
2196
|
),
|
|
2339
|
-
/* @__PURE__ */ e("span", { className: "text-lg font-semibold", children:
|
|
2197
|
+
/* @__PURE__ */ e("span", { className: "text-lg font-semibold", children: w })
|
|
2340
2198
|
] }),
|
|
2341
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children:
|
|
2199
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: je.map((c, i) => /* @__PURE__ */ e(
|
|
2342
2200
|
"button",
|
|
2343
2201
|
{
|
|
2344
|
-
className:
|
|
2202
|
+
className: u(
|
|
2345
2203
|
"h-11 w-full text-sm font-medium rounded-xl transition-all",
|
|
2346
|
-
|
|
2204
|
+
P === i ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-50"
|
|
2347
2205
|
),
|
|
2348
2206
|
onClick: () => {
|
|
2349
|
-
|
|
2207
|
+
H(i), F(!1);
|
|
2350
2208
|
},
|
|
2351
2209
|
children: c
|
|
2352
2210
|
},
|
|
2353
2211
|
c
|
|
2354
2212
|
)) })
|
|
2355
|
-
] }) :
|
|
2213
|
+
] }) : O ? /* @__PURE__ */ r("div", { className: "p-6", children: [
|
|
2356
2214
|
/* @__PURE__ */ e("div", { className: "flex items-center justify-start mb-4", children: /* @__PURE__ */ e(
|
|
2357
2215
|
b,
|
|
2358
2216
|
{
|
|
@@ -2363,15 +2221,15 @@ function da({
|
|
|
2363
2221
|
children: "← Back"
|
|
2364
2222
|
}
|
|
2365
2223
|
) }),
|
|
2366
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2 max-h-64 overflow-y-auto", children:
|
|
2224
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-2 max-h-64 overflow-y-auto", children: p.map((c) => /* @__PURE__ */ e(
|
|
2367
2225
|
"button",
|
|
2368
2226
|
{
|
|
2369
|
-
className:
|
|
2227
|
+
className: u(
|
|
2370
2228
|
"h-11 w-full text-sm font-medium rounded-xl transition-all",
|
|
2371
|
-
|
|
2229
|
+
w === c ? "bg-blue-500 text-white" : "text-gray-600 hover:bg-gray-50"
|
|
2372
2230
|
),
|
|
2373
2231
|
onClick: () => {
|
|
2374
|
-
|
|
2232
|
+
T(c), x(!1), F(!0);
|
|
2375
2233
|
},
|
|
2376
2234
|
children: c
|
|
2377
2235
|
},
|
|
@@ -2379,28 +2237,28 @@ function da({
|
|
|
2379
2237
|
)) })
|
|
2380
2238
|
] }) : (
|
|
2381
2239
|
/* Week Selector View */
|
|
2382
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2 max-h-64 overflow-y-auto", children:
|
|
2383
|
-
const
|
|
2240
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-2 max-h-64 overflow-y-auto", children: A(w, P).map((c, i) => {
|
|
2241
|
+
const C = /* @__PURE__ */ new Date() >= c.start && /* @__PURE__ */ new Date() <= c.end, o = V === i;
|
|
2384
2242
|
return /* @__PURE__ */ e(
|
|
2385
2243
|
"button",
|
|
2386
2244
|
{
|
|
2387
|
-
className:
|
|
2245
|
+
className: u(
|
|
2388
2246
|
"w-full p-3 text-left rounded-lg border transition-all",
|
|
2389
|
-
o ? "bg-blue-500 text-white border-blue-500" :
|
|
2247
|
+
o ? "bg-blue-500 text-white border-blue-500" : C ? "bg-white text-blue-600 border-blue-500" : "bg-white border-gray-200 text-gray-700 hover:border-blue-300"
|
|
2390
2248
|
),
|
|
2391
2249
|
onClick: () => l(c, i),
|
|
2392
|
-
children: /* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */
|
|
2250
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
2251
|
+
/* @__PURE__ */ r("div", { className: u(
|
|
2394
2252
|
"font-medium text-sm",
|
|
2395
2253
|
o ? "text-white" : "text-gray-800"
|
|
2396
2254
|
), children: [
|
|
2397
2255
|
"Week ",
|
|
2398
2256
|
i + 1
|
|
2399
2257
|
] }),
|
|
2400
|
-
/* @__PURE__ */ e("div", { className:
|
|
2258
|
+
/* @__PURE__ */ e("div", { className: u(
|
|
2401
2259
|
"text-xs",
|
|
2402
2260
|
o ? "text-blue-100" : "text-gray-500"
|
|
2403
|
-
), children:
|
|
2261
|
+
), children: W(c.start, c.end) })
|
|
2404
2262
|
] })
|
|
2405
2263
|
},
|
|
2406
2264
|
i
|
|
@@ -2415,7 +2273,7 @@ function da({
|
|
|
2415
2273
|
className: "flex-1",
|
|
2416
2274
|
onClick: () => {
|
|
2417
2275
|
const c = /* @__PURE__ */ new Date();
|
|
2418
|
-
|
|
2276
|
+
M(c), z(!1), F(!1), x(!1), t?.(c);
|
|
2419
2277
|
},
|
|
2420
2278
|
children: "This Week"
|
|
2421
2279
|
}
|
|
@@ -2427,23 +2285,23 @@ function da({
|
|
|
2427
2285
|
{
|
|
2428
2286
|
variant: "outline",
|
|
2429
2287
|
size: "sm",
|
|
2430
|
-
onClick: () =>
|
|
2431
|
-
className:
|
|
2288
|
+
onClick: () => d("next"),
|
|
2289
|
+
className: u(
|
|
2432
2290
|
"rounded-lg border-gray-200 hover:border-gray-300 hover:bg-gray-50",
|
|
2433
|
-
|
|
2291
|
+
m ? "h-8 w-8 p-0" : "h-9 w-9 p-0"
|
|
2434
2292
|
),
|
|
2435
|
-
children: /* @__PURE__ */ e(
|
|
2293
|
+
children: /* @__PURE__ */ e(ne, { className: u(m ? "h-3 w-3" : "h-4 w-4", "text-gray-600") })
|
|
2436
2294
|
}
|
|
2437
2295
|
)
|
|
2438
2296
|
] });
|
|
2439
2297
|
}
|
|
2440
|
-
const
|
|
2298
|
+
const nt = {
|
|
2441
2299
|
calculateWeekDates: (t) => {
|
|
2442
|
-
const a = [],
|
|
2443
|
-
|
|
2444
|
-
for (let
|
|
2445
|
-
const
|
|
2446
|
-
|
|
2300
|
+
const a = [], n = new Date(t), m = n.getDay(), f = m === 0 ? -6 : 1 - m;
|
|
2301
|
+
n.setDate(n.getDate() + f);
|
|
2302
|
+
for (let M = 0; M < 7; M++) {
|
|
2303
|
+
const h = new Date(n);
|
|
2304
|
+
h.setDate(n.getDate() + M), a.push(h);
|
|
2447
2305
|
}
|
|
2448
2306
|
return a;
|
|
2449
2307
|
},
|
|
@@ -2452,14 +2310,14 @@ const dt = {
|
|
|
2452
2310
|
day: "numeric"
|
|
2453
2311
|
}),
|
|
2454
2312
|
getWeekNumber: (t) => {
|
|
2455
|
-
const a = new Date(t.getFullYear(), 0, 1),
|
|
2456
|
-
return Math.ceil((
|
|
2313
|
+
const a = new Date(t.getFullYear(), 0, 1), n = (t.getTime() - a.getTime()) / 864e5;
|
|
2314
|
+
return Math.ceil((n + a.getDay() + 1) / 7);
|
|
2457
2315
|
},
|
|
2458
2316
|
getWeekOfMonth: (t) => {
|
|
2459
|
-
const
|
|
2460
|
-
return Math.ceil(
|
|
2317
|
+
const n = new Date(t.getFullYear(), t.getMonth(), 1).getDay(), m = t.getDate() + n - 1;
|
|
2318
|
+
return Math.ceil(m / 7);
|
|
2461
2319
|
}
|
|
2462
|
-
},
|
|
2320
|
+
}, oa = [
|
|
2463
2321
|
"08:00",
|
|
2464
2322
|
"09:00",
|
|
2465
2323
|
"10:00",
|
|
@@ -2469,32 +2327,32 @@ const dt = {
|
|
|
2469
2327
|
"14:00",
|
|
2470
2328
|
"15:00",
|
|
2471
2329
|
"16:00"
|
|
2472
|
-
],
|
|
2330
|
+
], la = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], ia = [
|
|
2473
2331
|
{ name: "Blue", value: "bg-blue-500" },
|
|
2474
2332
|
{ name: "Green", value: "bg-emerald-500" },
|
|
2475
2333
|
{ name: "Purple", value: "bg-purple-500" },
|
|
2476
2334
|
{ name: "Orange", value: "bg-orange-500" },
|
|
2477
2335
|
{ name: "Pink", value: "bg-pink-500" }
|
|
2478
2336
|
];
|
|
2479
|
-
function
|
|
2337
|
+
function Ba({
|
|
2480
2338
|
title: t = "Weekly Schedule",
|
|
2481
2339
|
subtitle: a,
|
|
2482
|
-
events:
|
|
2483
|
-
onEventAdd:
|
|
2484
|
-
onEventUpdate:
|
|
2485
|
-
onEventDelete:
|
|
2486
|
-
className:
|
|
2487
|
-
timeSlots:
|
|
2488
|
-
daysOfWeek:
|
|
2489
|
-
showAddButton:
|
|
2490
|
-
eventColors:
|
|
2340
|
+
events: n,
|
|
2341
|
+
onEventAdd: m,
|
|
2342
|
+
onEventUpdate: f,
|
|
2343
|
+
onEventDelete: M,
|
|
2344
|
+
className: h,
|
|
2345
|
+
timeSlots: z = oa,
|
|
2346
|
+
daysOfWeek: R = la,
|
|
2347
|
+
showAddButton: F = !0,
|
|
2348
|
+
eventColors: O = ia,
|
|
2491
2349
|
customFields: x = [],
|
|
2492
|
-
showWeekNavigation:
|
|
2493
|
-
showHalfHourLines:
|
|
2494
|
-
showCurrentTimeIndicator:
|
|
2495
|
-
slotHeight:
|
|
2350
|
+
showWeekNavigation: w = !1,
|
|
2351
|
+
showHalfHourLines: T = !0,
|
|
2352
|
+
showCurrentTimeIndicator: P = !0,
|
|
2353
|
+
slotHeight: H = 85
|
|
2496
2354
|
}) {
|
|
2497
|
-
const [
|
|
2355
|
+
const [V, j] = J(!1), [$, G] = J(null), [y, A] = J({
|
|
2498
2356
|
title: "",
|
|
2499
2357
|
day: "",
|
|
2500
2358
|
startTime: "",
|
|
@@ -2505,30 +2363,30 @@ function ar({
|
|
|
2505
2363
|
specificDate: "",
|
|
2506
2364
|
scheduleMode: "day"
|
|
2507
2365
|
// "day" or "date"
|
|
2508
|
-
}), [
|
|
2509
|
-
if (
|
|
2510
|
-
G(
|
|
2511
|
-
const
|
|
2512
|
-
title:
|
|
2513
|
-
day:
|
|
2514
|
-
startTime:
|
|
2515
|
-
endTime:
|
|
2516
|
-
color:
|
|
2517
|
-
description:
|
|
2518
|
-
recurrenceType:
|
|
2519
|
-
specificDate:
|
|
2520
|
-
scheduleMode:
|
|
2366
|
+
}), [W, _] = J(/* @__PURE__ */ new Date()), p = w ? nt.calculateWeekDates(W) : [], d = (o, k, N) => {
|
|
2367
|
+
if (N) {
|
|
2368
|
+
G(N);
|
|
2369
|
+
const I = {
|
|
2370
|
+
title: N.title,
|
|
2371
|
+
day: N.day,
|
|
2372
|
+
startTime: N.startTime,
|
|
2373
|
+
endTime: N.endTime,
|
|
2374
|
+
color: N.color,
|
|
2375
|
+
description: N.description || "",
|
|
2376
|
+
recurrenceType: N.recurrenceType || "none",
|
|
2377
|
+
specificDate: N.specificDate || "",
|
|
2378
|
+
scheduleMode: N.specificDate ? "date" : "day"
|
|
2521
2379
|
};
|
|
2522
|
-
x.forEach((
|
|
2523
|
-
const q =
|
|
2524
|
-
|
|
2525
|
-
}),
|
|
2380
|
+
x.forEach((Y) => {
|
|
2381
|
+
const q = N[Y.key];
|
|
2382
|
+
I[Y.key] = q instanceof Date ? q.toISOString() : q || (Y.type === "number" ? 0 : "");
|
|
2383
|
+
}), A(I);
|
|
2526
2384
|
} else {
|
|
2527
2385
|
G(null);
|
|
2528
|
-
const
|
|
2386
|
+
const I = {
|
|
2529
2387
|
title: "",
|
|
2530
2388
|
day: o || "",
|
|
2531
|
-
startTime:
|
|
2389
|
+
startTime: k || "",
|
|
2532
2390
|
endTime: "",
|
|
2533
2391
|
color: "bg-blue-500",
|
|
2534
2392
|
description: "",
|
|
@@ -2536,11 +2394,11 @@ function ar({
|
|
|
2536
2394
|
specificDate: "",
|
|
2537
2395
|
scheduleMode: "day"
|
|
2538
2396
|
};
|
|
2539
|
-
x.forEach((
|
|
2540
|
-
|
|
2541
|
-
}),
|
|
2397
|
+
x.forEach((Y) => {
|
|
2398
|
+
I[Y.key] = Y.type === "number" ? 0 : "";
|
|
2399
|
+
}), A(I);
|
|
2542
2400
|
}
|
|
2543
|
-
|
|
2401
|
+
j(!0);
|
|
2544
2402
|
}, l = () => {
|
|
2545
2403
|
if (!y.title || !y.day || !y.startTime || !y.endTime)
|
|
2546
2404
|
return;
|
|
@@ -2548,122 +2406,122 @@ function ar({
|
|
|
2548
2406
|
...y,
|
|
2549
2407
|
id: $?.id || Date.now().toString()
|
|
2550
2408
|
};
|
|
2551
|
-
$ ?
|
|
2409
|
+
$ ? f?.(o) : m?.(y), j(!1);
|
|
2552
2410
|
}, c = () => {
|
|
2553
|
-
$ && (
|
|
2554
|
-
}, i = (o,
|
|
2555
|
-
if (
|
|
2556
|
-
const
|
|
2557
|
-
return
|
|
2558
|
-
}),
|
|
2559
|
-
const [
|
|
2560
|
-
return Q *
|
|
2411
|
+
$ && (M?.($.id), j(!1));
|
|
2412
|
+
}, i = (o, k) => n.filter((N) => {
|
|
2413
|
+
if (N.day !== o) return !1;
|
|
2414
|
+
const I = parseInt(N.startTime.replace(":", "")), Y = parseInt(k.replace(":", ""));
|
|
2415
|
+
return I === Y;
|
|
2416
|
+
}), C = (o) => {
|
|
2417
|
+
const [k, N] = o.startTime.split(":").map(Number), [I, Y] = o.endTime.split(":").map(Number), q = k * 60 + N, Q = (I * 60 + Y - q) / 60, oe = Math.max(4, H * 0.1);
|
|
2418
|
+
return Q * H - oe;
|
|
2561
2419
|
};
|
|
2562
|
-
return /* @__PURE__ */
|
|
2563
|
-
/* @__PURE__ */
|
|
2564
|
-
/* @__PURE__ */ e(
|
|
2565
|
-
/* @__PURE__ */
|
|
2566
|
-
/* @__PURE__ */ e(
|
|
2420
|
+
return /* @__PURE__ */ r(ze, { children: [
|
|
2421
|
+
/* @__PURE__ */ r(bt, { className: u("w-full", h), children: [
|
|
2422
|
+
/* @__PURE__ */ e(vt, { className: "pb-6 bg-gradient-to-r from-slate-50 to-gray-50 border-b border-gray-100", children: /* @__PURE__ */ r("div", { className: "flex justify-between items-center", children: [
|
|
2423
|
+
/* @__PURE__ */ r("div", { children: [
|
|
2424
|
+
/* @__PURE__ */ e(wt, { className: "text-2xl", children: t }),
|
|
2567
2425
|
a && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 mt-1", children: a })
|
|
2568
2426
|
] }),
|
|
2569
|
-
/* @__PURE__ */
|
|
2570
|
-
|
|
2571
|
-
|
|
2427
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4", children: [
|
|
2428
|
+
w && /* @__PURE__ */ e(
|
|
2429
|
+
sa,
|
|
2572
2430
|
{
|
|
2573
|
-
onWeekChange:
|
|
2574
|
-
initialDate:
|
|
2431
|
+
onWeekChange: _,
|
|
2432
|
+
initialDate: W
|
|
2575
2433
|
}
|
|
2576
2434
|
),
|
|
2577
|
-
|
|
2578
|
-
/* @__PURE__ */ e(
|
|
2435
|
+
F && /* @__PURE__ */ r(b, { onClick: () => d(), className: "gap-2", children: [
|
|
2436
|
+
/* @__PURE__ */ e(Ke, { className: "h-4 w-4" }),
|
|
2579
2437
|
"Add Event"
|
|
2580
2438
|
] })
|
|
2581
2439
|
] })
|
|
2582
2440
|
] }) }),
|
|
2583
|
-
/* @__PURE__ */ e(
|
|
2584
|
-
/* @__PURE__ */
|
|
2441
|
+
/* @__PURE__ */ e(Nt, { className: "p-0", children: /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ r("div", { className: "min-w-[800px]", children: [
|
|
2442
|
+
/* @__PURE__ */ r("div", { className: "grid border-b border-gray-200", style: { gridTemplateColumns: `80px repeat(${R.length}, 1fr)` }, children: [
|
|
2585
2443
|
/* @__PURE__ */ e("div", { className: "p-3 bg-gray-50 border-r border-gray-200", children: /* @__PURE__ */ e("span", { className: "text-xs font-medium text-gray-500", children: "Time" }) }),
|
|
2586
|
-
|
|
2587
|
-
const
|
|
2588
|
-
return /* @__PURE__ */
|
|
2589
|
-
/* @__PURE__ */ e("div", { className: `font-semibold text-sm ${
|
|
2590
|
-
|
|
2444
|
+
R.map((o, k) => {
|
|
2445
|
+
const N = /* @__PURE__ */ new Date(), I = w && p[k], Y = I && I.getDate() === N.getDate() && I.getMonth() === N.getMonth() && I.getFullYear() === N.getFullYear();
|
|
2446
|
+
return /* @__PURE__ */ r("div", { className: "p-4 text-center border-r border-gray-200 last:border-r-0 bg-gray-50 hover:bg-white/50 transition-colors", children: [
|
|
2447
|
+
/* @__PURE__ */ e("div", { className: `font-semibold text-sm ${Y ? "text-blue-600" : "text-gray-800"}`, children: o }),
|
|
2448
|
+
w && I && /* @__PURE__ */ e("div", { className: `text-xs mt-1 font-medium ${Y ? "text-blue-600 font-bold" : "text-gray-500"}`, children: nt.formatDateDisplay(I) })
|
|
2591
2449
|
] }, o);
|
|
2592
2450
|
})
|
|
2593
2451
|
] }),
|
|
2594
|
-
|
|
2595
|
-
const
|
|
2596
|
-
return /* @__PURE__ */
|
|
2452
|
+
z.map((o) => {
|
|
2453
|
+
const k = /* @__PURE__ */ new Date(), N = k.getHours(), I = k.getMinutes(), [Y, q] = o.split(":"), se = parseInt(q || "0"), Q = parseInt(Y || "0") * 60 + se, oe = Q + 60, le = N * 60 + I, de = le >= Q && le < oe, De = (le - Q) / 60 * H;
|
|
2454
|
+
return /* @__PURE__ */ r("div", { className: "grid border-b border-gray-100 last:border-b-0", style: { gridTemplateColumns: `80px repeat(${R.length}, 1fr)` }, children: [
|
|
2597
2455
|
/* @__PURE__ */ e("div", { className: "p-2 bg-gray-50/50 border-r border-gray-200", children: /* @__PURE__ */ e("span", { className: "text-xs text-gray-600", children: o }) }),
|
|
2598
|
-
|
|
2599
|
-
const
|
|
2600
|
-
return /* @__PURE__ */
|
|
2456
|
+
R.map((he, ue) => {
|
|
2457
|
+
const ae = i(he, o), s = /* @__PURE__ */ new Date(), v = w && p[ue], L = v ? v.getDate() === s.getDate() && v.getMonth() === s.getMonth() && v.getFullYear() === s.getFullYear() : !1;
|
|
2458
|
+
return /* @__PURE__ */ r(
|
|
2601
2459
|
"div",
|
|
2602
2460
|
{
|
|
2603
2461
|
className: "relative border-r border-gray-200 last:border-r-0 hover:bg-blue-50/30 cursor-pointer transition-colors",
|
|
2604
|
-
style: { minHeight: `${
|
|
2605
|
-
onClick: () => !
|
|
2462
|
+
style: { minHeight: `${H}px` },
|
|
2463
|
+
onClick: () => !ae.length && d(he, o),
|
|
2606
2464
|
children: [
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
const
|
|
2465
|
+
T && /* @__PURE__ */ e("div", { className: "absolute top-1/2 left-0 right-0 h-px bg-gray-200/60 z-[5]" }),
|
|
2466
|
+
ae.map((D) => {
|
|
2467
|
+
const re = C(D), X = re < 40;
|
|
2610
2468
|
return /* @__PURE__ */ e(
|
|
2611
2469
|
"div",
|
|
2612
2470
|
{
|
|
2613
|
-
className:
|
|
2471
|
+
className: u(
|
|
2614
2472
|
"absolute rounded-md text-white cursor-pointer hover:scale-[1.02] transition-transform overflow-visible",
|
|
2615
|
-
|
|
2473
|
+
D.color,
|
|
2616
2474
|
X ? "inset-x-1 py-0.5 px-1" : "inset-1 p-2"
|
|
2617
2475
|
),
|
|
2618
2476
|
style: {
|
|
2619
|
-
height: `${
|
|
2477
|
+
height: `${re}px`,
|
|
2620
2478
|
zIndex: 10,
|
|
2621
2479
|
minHeight: X ? "auto" : void 0
|
|
2622
2480
|
},
|
|
2623
2481
|
onClick: (K) => {
|
|
2624
|
-
K.stopPropagation(),
|
|
2482
|
+
K.stopPropagation(), d(void 0, void 0, D);
|
|
2625
2483
|
},
|
|
2626
2484
|
children: X ? (
|
|
2627
2485
|
// Short event layout: title and time side by side
|
|
2628
|
-
/* @__PURE__ */
|
|
2629
|
-
/* @__PURE__ */ e("div", { className: "font-semibold truncate text-[10px] leading-tight flex-1", children:
|
|
2630
|
-
/* @__PURE__ */
|
|
2631
|
-
|
|
2486
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-1", children: [
|
|
2487
|
+
/* @__PURE__ */ e("div", { className: "font-semibold truncate text-[10px] leading-tight flex-1", children: D.title }),
|
|
2488
|
+
/* @__PURE__ */ r("div", { className: "text-[9px] opacity-80 whitespace-nowrap", children: [
|
|
2489
|
+
D.startTime,
|
|
2632
2490
|
"-",
|
|
2633
|
-
|
|
2491
|
+
D.endTime
|
|
2634
2492
|
] })
|
|
2635
2493
|
] })
|
|
2636
2494
|
) : (
|
|
2637
2495
|
// Normal event layout
|
|
2638
|
-
/* @__PURE__ */
|
|
2639
|
-
/* @__PURE__ */ e("div", { className: "text-xs font-semibold truncate", children:
|
|
2640
|
-
x.filter((K) => K.showInCard &&
|
|
2496
|
+
/* @__PURE__ */ r(ze, { children: [
|
|
2497
|
+
/* @__PURE__ */ e("div", { className: "text-xs font-semibold truncate", children: D.title }),
|
|
2498
|
+
x.filter((K) => K.showInCard && D[K.key]).map((K) => /* @__PURE__ */ r("div", { className: "text-xs opacity-90 flex items-center gap-1 mt-1", children: [
|
|
2641
2499
|
K.icon,
|
|
2642
|
-
/* @__PURE__ */ e("span", { className: "truncate", children:
|
|
2500
|
+
/* @__PURE__ */ e("span", { className: "truncate", children: D[K.key] instanceof Date ? D[K.key].toLocaleString() : String(D[K.key] || "") })
|
|
2643
2501
|
] }, K.key)),
|
|
2644
|
-
/* @__PURE__ */ e("div", { className: "text-xs opacity-80 mt-1", children: /* @__PURE__ */
|
|
2645
|
-
|
|
2502
|
+
/* @__PURE__ */ e("div", { className: "text-xs opacity-80 mt-1", children: /* @__PURE__ */ r("span", { children: [
|
|
2503
|
+
D.startTime,
|
|
2646
2504
|
"-",
|
|
2647
|
-
|
|
2505
|
+
D.endTime
|
|
2648
2506
|
] }) })
|
|
2649
2507
|
] })
|
|
2650
2508
|
)
|
|
2651
2509
|
},
|
|
2652
|
-
|
|
2510
|
+
D.id
|
|
2653
2511
|
);
|
|
2654
2512
|
}),
|
|
2655
|
-
|
|
2513
|
+
P && L && de && /* @__PURE__ */ r("div", { className: "absolute left-0 right-0 flex items-center z-20", style: { top: `${De - 8}px` }, children: [
|
|
2656
2514
|
/* @__PURE__ */ e("div", { className: "h-[3px] bg-red-500 absolute -left-14 right-0" }),
|
|
2657
|
-
/* @__PURE__ */
|
|
2658
|
-
|
|
2515
|
+
/* @__PURE__ */ r("div", { className: "bg-red-500 text-white text-xs px-2 py-0.5 rounded font-bold whitespace-nowrap relative z-30 -ml-14", children: [
|
|
2516
|
+
k.getHours(),
|
|
2659
2517
|
":",
|
|
2660
|
-
|
|
2518
|
+
k.getMinutes().toString().padStart(2, "0")
|
|
2661
2519
|
] })
|
|
2662
2520
|
] }),
|
|
2663
|
-
!
|
|
2521
|
+
!ae.length && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center opacity-0 hover:opacity-100 transition-opacity", children: /* @__PURE__ */ e(Ke, { className: "h-5 w-5 text-gray-400" }) })
|
|
2664
2522
|
]
|
|
2665
2523
|
},
|
|
2666
|
-
`${
|
|
2524
|
+
`${he}-${o}`
|
|
2667
2525
|
);
|
|
2668
2526
|
})
|
|
2669
2527
|
] }, o);
|
|
@@ -2671,117 +2529,117 @@ function ar({
|
|
|
2671
2529
|
] }) }) })
|
|
2672
2530
|
] }),
|
|
2673
2531
|
/* @__PURE__ */ e(
|
|
2674
|
-
|
|
2532
|
+
na,
|
|
2675
2533
|
{
|
|
2676
|
-
isOpen:
|
|
2677
|
-
onClose: () =>
|
|
2534
|
+
isOpen: V,
|
|
2535
|
+
onClose: () => j(!1),
|
|
2678
2536
|
title: $ ? "Edit Event" : "Add New Event",
|
|
2679
|
-
children: /* @__PURE__ */
|
|
2680
|
-
/* @__PURE__ */
|
|
2537
|
+
children: /* @__PURE__ */ r("div", { className: "space-y-4 p-6", children: [
|
|
2538
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
2681
2539
|
/* @__PURE__ */ e(ee, { className: "text-sm font-medium", children: "Schedule Type" }),
|
|
2682
|
-
/* @__PURE__ */
|
|
2683
|
-
|
|
2540
|
+
/* @__PURE__ */ r(
|
|
2541
|
+
Ce,
|
|
2684
2542
|
{
|
|
2685
2543
|
value: String(y.scheduleMode),
|
|
2686
|
-
onValueChange: (o) =>
|
|
2544
|
+
onValueChange: (o) => A({ ...y, scheduleMode: o }),
|
|
2687
2545
|
children: [
|
|
2688
|
-
/* @__PURE__ */ e(be, { children: /* @__PURE__ */ e(
|
|
2689
|
-
/* @__PURE__ */
|
|
2690
|
-
/* @__PURE__ */ e(
|
|
2691
|
-
/* @__PURE__ */ e(
|
|
2546
|
+
/* @__PURE__ */ e(be, { children: /* @__PURE__ */ e(Te, { placeholder: "Select schedule type" }) }),
|
|
2547
|
+
/* @__PURE__ */ r(ve, { children: [
|
|
2548
|
+
/* @__PURE__ */ e(ye, { value: "day", children: "By Day (Monday, Tuesday, etc.)" }),
|
|
2549
|
+
/* @__PURE__ */ e(ye, { value: "date", children: "By Date (Specific date)" })
|
|
2692
2550
|
] })
|
|
2693
2551
|
]
|
|
2694
2552
|
}
|
|
2695
2553
|
),
|
|
2696
2554
|
/* @__PURE__ */ e("p", { className: "text-xs text-gray-500", children: y.scheduleMode === "day" ? "Schedule by day of the week (e.g., every Monday)" : "Schedule by specific date (e.g., January 15, 2025)" })
|
|
2697
2555
|
] }),
|
|
2698
|
-
/* @__PURE__ */
|
|
2556
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
2699
2557
|
/* @__PURE__ */ e(ee, { htmlFor: "title", children: "Title *" }),
|
|
2700
2558
|
/* @__PURE__ */ e(
|
|
2701
|
-
|
|
2559
|
+
me,
|
|
2702
2560
|
{
|
|
2703
2561
|
id: "title",
|
|
2704
2562
|
value: String(y.title),
|
|
2705
|
-
onChange: (o) =>
|
|
2563
|
+
onChange: (o) => A({ ...y, title: o.target.value }),
|
|
2706
2564
|
placeholder: "Event title"
|
|
2707
2565
|
}
|
|
2708
2566
|
)
|
|
2709
2567
|
] }),
|
|
2710
|
-
/* @__PURE__ */
|
|
2711
|
-
y.scheduleMode === "day" ? /* @__PURE__ */
|
|
2568
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
2569
|
+
y.scheduleMode === "day" ? /* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
2712
2570
|
/* @__PURE__ */ e(ee, { children: "Day *" }),
|
|
2713
|
-
/* @__PURE__ */
|
|
2714
|
-
/* @__PURE__ */ e(be, { children: /* @__PURE__ */ e(
|
|
2715
|
-
/* @__PURE__ */ e(ve, { children:
|
|
2571
|
+
/* @__PURE__ */ r(Ce, { value: String(y.day), onValueChange: (o) => A({ ...y, day: o }), children: [
|
|
2572
|
+
/* @__PURE__ */ e(be, { children: /* @__PURE__ */ e(Te, { placeholder: "Select day" }) }),
|
|
2573
|
+
/* @__PURE__ */ e(ve, { children: R.map((o) => /* @__PURE__ */ e(ye, { value: o, children: o }, o)) })
|
|
2716
2574
|
] })
|
|
2717
|
-
] }) : /* @__PURE__ */
|
|
2575
|
+
] }) : /* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
2718
2576
|
/* @__PURE__ */ e(ee, { htmlFor: "specificDate", children: "Date *" }),
|
|
2719
2577
|
/* @__PURE__ */ e(
|
|
2720
|
-
|
|
2578
|
+
me,
|
|
2721
2579
|
{
|
|
2722
2580
|
id: "specificDate",
|
|
2723
2581
|
type: "date",
|
|
2724
2582
|
value: String(y.specificDate),
|
|
2725
|
-
onChange: (o) =>
|
|
2583
|
+
onChange: (o) => A({ ...y, specificDate: o.target.value })
|
|
2726
2584
|
}
|
|
2727
2585
|
)
|
|
2728
2586
|
] }),
|
|
2729
|
-
/* @__PURE__ */
|
|
2587
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
2730
2588
|
/* @__PURE__ */ e(ee, { htmlFor: "startTime", children: "Start Time *" }),
|
|
2731
2589
|
/* @__PURE__ */ e(
|
|
2732
|
-
|
|
2590
|
+
me,
|
|
2733
2591
|
{
|
|
2734
2592
|
id: "startTime",
|
|
2735
2593
|
type: "time",
|
|
2736
2594
|
value: String(y.startTime),
|
|
2737
|
-
onChange: (o) =>
|
|
2595
|
+
onChange: (o) => A({ ...y, startTime: o.target.value })
|
|
2738
2596
|
}
|
|
2739
2597
|
)
|
|
2740
2598
|
] }),
|
|
2741
|
-
/* @__PURE__ */
|
|
2599
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
2742
2600
|
/* @__PURE__ */ e(ee, { htmlFor: "endTime", children: "End Time *" }),
|
|
2743
2601
|
/* @__PURE__ */ e(
|
|
2744
|
-
|
|
2602
|
+
me,
|
|
2745
2603
|
{
|
|
2746
2604
|
id: "endTime",
|
|
2747
2605
|
type: "time",
|
|
2748
2606
|
value: String(y.endTime),
|
|
2749
|
-
onChange: (o) =>
|
|
2607
|
+
onChange: (o) => A({ ...y, endTime: o.target.value })
|
|
2750
2608
|
}
|
|
2751
2609
|
)
|
|
2752
2610
|
] })
|
|
2753
2611
|
] }),
|
|
2754
|
-
x.length > 0 && /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-4", children: x.map((o) => /* @__PURE__ */
|
|
2755
|
-
/* @__PURE__ */
|
|
2612
|
+
x.length > 0 && /* @__PURE__ */ e("div", { className: "grid grid-cols-2 gap-4", children: x.map((o) => /* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
2613
|
+
/* @__PURE__ */ r(ee, { htmlFor: o.key, children: [
|
|
2756
2614
|
o.label,
|
|
2757
2615
|
" ",
|
|
2758
2616
|
o.required && "*"
|
|
2759
2617
|
] }),
|
|
2760
|
-
o.type === "select" ? /* @__PURE__ */
|
|
2761
|
-
|
|
2618
|
+
o.type === "select" ? /* @__PURE__ */ r(
|
|
2619
|
+
Ce,
|
|
2762
2620
|
{
|
|
2763
2621
|
value: String(y[o.key] || ""),
|
|
2764
|
-
onValueChange: (
|
|
2622
|
+
onValueChange: (k) => A({ ...y, [o.key]: k }),
|
|
2765
2623
|
children: [
|
|
2766
|
-
/* @__PURE__ */ e(be, { children: /* @__PURE__ */ e(
|
|
2767
|
-
/* @__PURE__ */ e(ve, { children: o.options?.map((
|
|
2624
|
+
/* @__PURE__ */ e(be, { children: /* @__PURE__ */ e(Te, { placeholder: o.placeholder || `Select ${o.label}` }) }),
|
|
2625
|
+
/* @__PURE__ */ e(ve, { children: o.options?.map((k) => /* @__PURE__ */ e(ye, { value: k.value, children: k.label }, k.value)) })
|
|
2768
2626
|
]
|
|
2769
2627
|
}
|
|
2770
2628
|
) : /* @__PURE__ */ e(
|
|
2771
|
-
|
|
2629
|
+
me,
|
|
2772
2630
|
{
|
|
2773
2631
|
id: o.key,
|
|
2774
2632
|
type: o.type,
|
|
2775
2633
|
value: o.type === "number" ? Number(y[o.key] || 0) : String(y[o.key] || ""),
|
|
2776
|
-
onChange: (
|
|
2634
|
+
onChange: (k) => A({
|
|
2777
2635
|
...y,
|
|
2778
|
-
[o.key]: o.type === "number" ? parseInt(
|
|
2636
|
+
[o.key]: o.type === "number" ? parseInt(k.target.value) || 0 : k.target.value
|
|
2779
2637
|
}),
|
|
2780
2638
|
placeholder: o.placeholder
|
|
2781
2639
|
}
|
|
2782
2640
|
)
|
|
2783
2641
|
] }, o.key)) }),
|
|
2784
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
|
|
2785
2643
|
/* @__PURE__ */ e(
|
|
2786
2644
|
"input",
|
|
2787
2645
|
{
|
|
@@ -2789,46 +2647,46 @@ function ar({
|
|
|
2789
2647
|
id: "isRecurring",
|
|
2790
2648
|
checked: y.recurrenceType !== "none",
|
|
2791
2649
|
onChange: (o) => {
|
|
2792
|
-
o.target.checked ?
|
|
2650
|
+
o.target.checked ? A({
|
|
2793
2651
|
...y,
|
|
2794
2652
|
recurrenceType: y.scheduleMode === "day" ? "weekly" : "monthly"
|
|
2795
|
-
}) :
|
|
2653
|
+
}) : A({ ...y, recurrenceType: "none" });
|
|
2796
2654
|
},
|
|
2797
2655
|
className: "w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
|
|
2798
2656
|
}
|
|
2799
2657
|
),
|
|
2800
2658
|
/* @__PURE__ */ e(ee, { htmlFor: "isRecurring", className: "text-sm font-medium text-gray-700 cursor-pointer", children: y.scheduleMode === "day" ? "Repeat every week on this day" : "Repeat every month on this date" })
|
|
2801
2659
|
] }),
|
|
2802
|
-
/* @__PURE__ */
|
|
2660
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
2803
2661
|
/* @__PURE__ */ e(ee, { children: "Color" }),
|
|
2804
|
-
/* @__PURE__ */
|
|
2805
|
-
/* @__PURE__ */ e(be, { children: /* @__PURE__ */ e(
|
|
2806
|
-
/* @__PURE__ */ e(ve, { children:
|
|
2807
|
-
/* @__PURE__ */ e("div", { className:
|
|
2662
|
+
/* @__PURE__ */ r(Ce, { value: String(y.color), onValueChange: (o) => A({ ...y, color: o }), children: [
|
|
2663
|
+
/* @__PURE__ */ e(be, { children: /* @__PURE__ */ e(Te, {}) }),
|
|
2664
|
+
/* @__PURE__ */ e(ve, { children: O.map((o) => /* @__PURE__ */ e(ye, { value: o.value, children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
2665
|
+
/* @__PURE__ */ e("div", { className: u("w-4 h-4 rounded", o.value) }),
|
|
2808
2666
|
o.name
|
|
2809
2667
|
] }) }, o.value)) })
|
|
2810
2668
|
] })
|
|
2811
2669
|
] }),
|
|
2812
|
-
/* @__PURE__ */
|
|
2670
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
2813
2671
|
/* @__PURE__ */ e(ee, { htmlFor: "description", children: "Description" }),
|
|
2814
2672
|
/* @__PURE__ */ e(
|
|
2815
|
-
|
|
2673
|
+
me,
|
|
2816
2674
|
{
|
|
2817
2675
|
id: "description",
|
|
2818
2676
|
value: String(y.description || ""),
|
|
2819
|
-
onChange: (o) =>
|
|
2677
|
+
onChange: (o) => A({ ...y, description: o.target.value }),
|
|
2820
2678
|
placeholder: "Optional description"
|
|
2821
2679
|
}
|
|
2822
2680
|
)
|
|
2823
2681
|
] }),
|
|
2824
|
-
/* @__PURE__ */
|
|
2825
|
-
$ && /* @__PURE__ */
|
|
2826
|
-
/* @__PURE__ */ e(
|
|
2682
|
+
/* @__PURE__ */ r("div", { className: "flex gap-2 pt-4", children: [
|
|
2683
|
+
$ && /* @__PURE__ */ r(b, { variant: "destructive", onClick: c, className: "gap-2", children: [
|
|
2684
|
+
/* @__PURE__ */ e(Wt, { className: "h-4 w-4" }),
|
|
2827
2685
|
"Delete"
|
|
2828
2686
|
] }),
|
|
2829
2687
|
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
2830
|
-
/* @__PURE__ */ e(b, { variant: "outline", onClick: () =>
|
|
2831
|
-
/* @__PURE__ */
|
|
2688
|
+
/* @__PURE__ */ e(b, { variant: "outline", onClick: () => j(!1), children: "Cancel" }),
|
|
2689
|
+
/* @__PURE__ */ r(b, { onClick: l, children: [
|
|
2832
2690
|
$ ? "Update" : "Add",
|
|
2833
2691
|
" Event"
|
|
2834
2692
|
] })
|
|
@@ -2838,7 +2696,7 @@ function ar({
|
|
|
2838
2696
|
)
|
|
2839
2697
|
] });
|
|
2840
2698
|
}
|
|
2841
|
-
const
|
|
2699
|
+
const st = [
|
|
2842
2700
|
{ label: "UTC", offset: 0 },
|
|
2843
2701
|
{ label: "EST", offset: -5 },
|
|
2844
2702
|
{ label: "CST", offset: -6 },
|
|
@@ -2855,84 +2713,79 @@ const ut = [
|
|
|
2855
2713
|
{ label: "HST", offset: -10 },
|
|
2856
2714
|
{ label: "AKST", offset: -9 },
|
|
2857
2715
|
{ label: "Asia/Bangkok", offset: 7 }
|
|
2858
|
-
],
|
|
2859
|
-
const
|
|
2860
|
-
return
|
|
2861
|
-
},
|
|
2862
|
-
const
|
|
2863
|
-
let
|
|
2864
|
-
return
|
|
2716
|
+
], Ga = (t, a, n) => {
|
|
2717
|
+
const m = st.find((h) => h.label === a)?.offset || 0, f = st.find((h) => h.label === n)?.offset || 0, M = new Date(t);
|
|
2718
|
+
return M.setHours(M.getHours() + (f - m)), M;
|
|
2719
|
+
}, Ja = (t, a, n = "24h", m = !1) => {
|
|
2720
|
+
const f = n === "12h" ? t.getHours() % 12 || 12 : t.getHours(), M = t.getMinutes().toString().padStart(2, "0"), h = t.getSeconds().toString().padStart(2, "0"), z = t.getHours() >= 12 ? "PM" : "AM";
|
|
2721
|
+
let R = `${f.toString().padStart(2, "0")}:${M}`;
|
|
2722
|
+
return m && (R += `:${h}`), n === "12h" && (R += ` ${z}`), R += ` ${a}`, R;
|
|
2865
2723
|
};
|
|
2866
2724
|
export {
|
|
2867
2725
|
b as Button,
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2726
|
+
_a as Calendar,
|
|
2727
|
+
bt as Card,
|
|
2728
|
+
Nt as CardContent,
|
|
2729
|
+
ea as CardDescription,
|
|
2730
|
+
ta as CardFooter,
|
|
2731
|
+
vt as CardHeader,
|
|
2732
|
+
wt as CardTitle,
|
|
2733
|
+
We as Checkbox,
|
|
2734
|
+
Ha as DataGrid,
|
|
2735
|
+
Ya as DataGridColumnHeader,
|
|
2736
|
+
Fa as DataGridPagination,
|
|
2737
|
+
Aa as DataGridTable,
|
|
2738
|
+
ja as DataGridTableRowSelect,
|
|
2739
|
+
Oa as DataGridTableRowSelectAll,
|
|
2740
|
+
$a as DataTable,
|
|
2741
|
+
Va as DatePicker,
|
|
2742
|
+
xa as DropdownMenu,
|
|
2743
|
+
Ma as DropdownMenuCheckboxItem,
|
|
2744
|
+
wa as DropdownMenuContent,
|
|
2745
|
+
Na as DropdownMenuGroup,
|
|
2746
|
+
Sa as DropdownMenuItem,
|
|
2747
|
+
Ca as DropdownMenuLabel,
|
|
2748
|
+
ba as DropdownMenuPortal,
|
|
2749
|
+
Da as DropdownMenuRadioGroup,
|
|
2750
|
+
ka as DropdownMenuRadioItem,
|
|
2751
|
+
Ta as DropdownMenuSeparator,
|
|
2752
|
+
Ia as DropdownMenuShortcut,
|
|
2753
|
+
za as DropdownMenuSub,
|
|
2754
|
+
Pa as DropdownMenuSubContent,
|
|
2755
|
+
Ra as DropdownMenuSubTrigger,
|
|
2756
|
+
va as DropdownMenuTrigger,
|
|
2757
|
+
me as Input,
|
|
2900
2758
|
ee as Label,
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2759
|
+
aa as Modal,
|
|
2760
|
+
yt as Popover,
|
|
2761
|
+
La as PopoverAnchor,
|
|
2762
|
+
Be as PopoverContent,
|
|
2763
|
+
xt as PopoverTrigger,
|
|
2764
|
+
Ba as Schedule,
|
|
2765
|
+
Ce as Select,
|
|
2908
2766
|
ve as SelectContent,
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2767
|
+
Ea as SelectGroup,
|
|
2768
|
+
ye as SelectItem,
|
|
2769
|
+
Ut as SelectLabel,
|
|
2770
|
+
Kt as SelectSeparator,
|
|
2913
2771
|
be as SelectTrigger,
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
d as cn,
|
|
2933
|
-
rr as convertTimezone,
|
|
2934
|
-
nr as formatTimeWithTimezone,
|
|
2935
|
-
$e as useDataGrid,
|
|
2936
|
-
dt as weekNavigatorUtils
|
|
2772
|
+
Te as SelectValue,
|
|
2773
|
+
Jt as Separator,
|
|
2774
|
+
st as TIMEZONES,
|
|
2775
|
+
dt as Table,
|
|
2776
|
+
mt as TableBody,
|
|
2777
|
+
ya as TableCaption,
|
|
2778
|
+
He as TableCell,
|
|
2779
|
+
fa as TableFooter,
|
|
2780
|
+
ht as TableHead,
|
|
2781
|
+
ut as TableHeader,
|
|
2782
|
+
Ne as TableRow,
|
|
2783
|
+
Wa as TimePicker,
|
|
2784
|
+
sa as WeekNavigator,
|
|
2785
|
+
u as cn,
|
|
2786
|
+
Ga as convertTimezone,
|
|
2787
|
+
Ja as formatTimeWithTimezone,
|
|
2788
|
+
Re as useDataGrid,
|
|
2789
|
+
nt as weekNavigatorUtils
|
|
2937
2790
|
};
|
|
2938
2791
|
//# sourceMappingURL=takaui.js.map
|