@ceed/cds 0.0.32 → 0.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Autocomplete/Autocomplete.d.ts +11 -0
- package/dist/components/Autocomplete/index.d.ts +3 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +21 -0
- package/dist/components/Breadcrumbs/index.d.ts +3 -0
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Calendar/Calendar.d.ts +7 -0
- package/dist/components/Calendar/hooks/use-calendar-props.d.ts +35 -0
- package/dist/components/Calendar/hooks/use-calendar.d.ts +35 -0
- package/dist/components/Calendar/index.d.ts +3 -0
- package/dist/components/Calendar/types.d.ts +24 -0
- package/dist/components/Calendar/utils/index.d.ts +12 -0
- package/dist/components/DataTable/DataTable.d.ts +25 -5
- package/dist/components/DatePicker/DatePicker.d.ts +22 -0
- package/dist/components/DatePicker/index.d.ts +3 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +22 -0
- package/dist/components/DateRangePicker/index.d.ts +3 -0
- package/dist/components/DialogActions/DialogActions.d.ts +2 -2
- package/dist/components/DialogContent/DialogContent.d.ts +2 -2
- package/dist/components/DialogTitle/DialogTitle.d.ts +2 -2
- package/dist/components/FormControl/FormControl.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +21 -3
- package/dist/components/Modal/Modal.d.ts +4 -4
- package/dist/components/MonthRangePicker/MonthRangePicker.d.ts +22 -0
- package/dist/components/MonthRangePicker/index.d.ts +3 -0
- package/dist/components/Radio/Radio.d.ts +2 -2
- package/dist/components/Select/Select.d.ts +11 -13
- package/dist/components/Stack/Stack.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +2 -2
- package/dist/components/Textarea/Textarea.d.ts +19 -1
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +10 -0
- package/dist/components/index.d.ts +8 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2842 -6
- package/framer/index.js +29510 -18631
- package/package.json +17 -8
- package/dist/components/Accordions/Accordions.js +0 -66
- package/dist/components/Accordions/index.js +0 -3
- package/dist/components/Box/Box.js +0 -6
- package/dist/components/Box/index.js +0 -3
- package/dist/components/Button/Button.js +0 -28
- package/dist/components/Button/index.js +0 -3
- package/dist/components/Checkbox/Checkbox.js +0 -28
- package/dist/components/Checkbox/index.js +0 -3
- package/dist/components/Container/Container.js +0 -51
- package/dist/components/Container/index.js +0 -3
- package/dist/components/DataTable/DataTable.js +0 -268
- package/dist/components/DataTable/index.js +0 -3
- package/dist/components/DialogActions/DialogActions.js +0 -6
- package/dist/components/DialogActions/index.js +0 -3
- package/dist/components/DialogContent/DialogContent.js +0 -6
- package/dist/components/DialogContent/index.js +0 -3
- package/dist/components/DialogFrame/DialogFrame.js +0 -44
- package/dist/components/DialogFrame/index.js +0 -3
- package/dist/components/DialogTitle/DialogTitle.js +0 -6
- package/dist/components/DialogTitle/index.js +0 -3
- package/dist/components/Divider/Divider.js +0 -28
- package/dist/components/Divider/index.js +0 -3
- package/dist/components/Dropdown/Dropdown.js +0 -6
- package/dist/components/Dropdown/index.js +0 -3
- package/dist/components/FormControl/FormControl.js +0 -6
- package/dist/components/FormControl/index.js +0 -3
- package/dist/components/FormHelperText/FormHelperText.js +0 -6
- package/dist/components/FormHelperText/index.js +0 -3
- package/dist/components/FormLabel/FormLabel.js +0 -6
- package/dist/components/FormLabel/index.js +0 -3
- package/dist/components/Grid/Grid.js +0 -6
- package/dist/components/Grid/index.js +0 -3
- package/dist/components/IconButton/IconButton.js +0 -28
- package/dist/components/IconButton/index.js +0 -3
- package/dist/components/Input/Input.js +0 -28
- package/dist/components/Input/index.js +0 -3
- package/dist/components/InsetDrawer/InsetDrawer.js +0 -45
- package/dist/components/InsetDrawer/index.js +0 -3
- package/dist/components/Menu/Menu.js +0 -56
- package/dist/components/Menu/index.js +0 -3
- package/dist/components/Modal/Modal.js +0 -60
- package/dist/components/Modal/index.js +0 -3
- package/dist/components/Radio/Radio.js +0 -10
- package/dist/components/Radio/index.js +0 -3
- package/dist/components/RadioList/RadioList.js +0 -38
- package/dist/components/RadioList/index.js +0 -3
- package/dist/components/Select/Select.js +0 -12
- package/dist/components/Select/index.js +0 -3
- package/dist/components/Sheet/Sheet.js +0 -6
- package/dist/components/Sheet/index.js +0 -3
- package/dist/components/Stack/Stack.js +0 -6
- package/dist/components/Stack/index.js +0 -3
- package/dist/components/Switch/Switch.js +0 -54
- package/dist/components/Switch/index.js +0 -3
- package/dist/components/Table/Table.js +0 -89
- package/dist/components/Table/index.js +0 -3
- package/dist/components/Tabs/Tabs.js +0 -18
- package/dist/components/Tabs/index.js +0 -3
- package/dist/components/Textarea/Textarea.js +0 -28
- package/dist/components/Textarea/index.js +0 -3
- package/dist/components/ThemeProvider/ThemeProvider.js +0 -54
- package/dist/components/ThemeProvider/index.js +0 -3
- package/dist/components/Tooltip/Tooltip.js +0 -28
- package/dist/components/Tooltip/index.js +0 -3
- package/dist/components/Typography/Typography.js +0 -28
- package/dist/components/Typography/index.js +0 -3
- package/dist/components/index.js +0 -33
package/dist/index.js
CHANGED
|
@@ -1,6 +1,2842 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
boxClasses,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
boxClasses,
|
|
4
|
+
buttonClasses,
|
|
5
|
+
checkboxClasses as checkboxClasses2,
|
|
6
|
+
dividerClasses,
|
|
7
|
+
iconButtonClasses,
|
|
8
|
+
inputClasses,
|
|
9
|
+
menuClasses,
|
|
10
|
+
menuButtonClasses,
|
|
11
|
+
menuItemClasses,
|
|
12
|
+
optionClasses,
|
|
13
|
+
radioClasses,
|
|
14
|
+
radioGroupClasses,
|
|
15
|
+
selectClasses,
|
|
16
|
+
switchClasses as switchClasses2,
|
|
17
|
+
tableClasses,
|
|
18
|
+
textareaClasses,
|
|
19
|
+
typographyClasses,
|
|
20
|
+
formControlClasses,
|
|
21
|
+
formLabelClasses,
|
|
22
|
+
formHelperTextClasses,
|
|
23
|
+
gridClasses,
|
|
24
|
+
stackClasses,
|
|
25
|
+
sheetClasses,
|
|
26
|
+
modalClasses,
|
|
27
|
+
modalCloseClasses,
|
|
28
|
+
modalDialogClasses,
|
|
29
|
+
modalOverflowClasses,
|
|
30
|
+
dialogTitleClasses,
|
|
31
|
+
dialogContentClasses,
|
|
32
|
+
dialogActionsClasses,
|
|
33
|
+
tooltipClasses,
|
|
34
|
+
tabsClasses,
|
|
35
|
+
tabListClasses,
|
|
36
|
+
tabPanelClasses,
|
|
37
|
+
accordionClasses,
|
|
38
|
+
accordionDetailsClasses,
|
|
39
|
+
accordionGroupClasses,
|
|
40
|
+
accordionSummaryClasses,
|
|
41
|
+
AutocompleteListbox,
|
|
42
|
+
AutocompleteOption,
|
|
43
|
+
autocompleteClasses,
|
|
44
|
+
autocompleteListboxClasses,
|
|
45
|
+
autocompleteOptionClasses,
|
|
46
|
+
Avatar,
|
|
47
|
+
avatarClasses,
|
|
48
|
+
AvatarGroup,
|
|
49
|
+
avatarGroupClasses,
|
|
50
|
+
AspectRatio,
|
|
51
|
+
aspectRatioClasses,
|
|
52
|
+
Badge,
|
|
53
|
+
badgeClasses,
|
|
54
|
+
breadcrumbsClasses,
|
|
55
|
+
Card,
|
|
56
|
+
cardClasses,
|
|
57
|
+
CardActions,
|
|
58
|
+
cardActionsClasses,
|
|
59
|
+
CardContent,
|
|
60
|
+
cardContentClasses,
|
|
61
|
+
CardCover,
|
|
62
|
+
cardCoverClasses,
|
|
63
|
+
CardOverflow,
|
|
64
|
+
cardOverflowClasses,
|
|
65
|
+
Chip,
|
|
66
|
+
chipClasses,
|
|
67
|
+
CircularProgress,
|
|
68
|
+
circularProgressClasses,
|
|
69
|
+
Drawer,
|
|
70
|
+
drawerClasses,
|
|
71
|
+
LinearProgress as LinearProgress2,
|
|
72
|
+
linearProgressClasses,
|
|
73
|
+
List,
|
|
74
|
+
listClasses,
|
|
75
|
+
ListDivider,
|
|
76
|
+
listDividerClasses,
|
|
77
|
+
ListItem,
|
|
78
|
+
listItemClasses,
|
|
79
|
+
ListItemButton,
|
|
80
|
+
listItemButtonClasses,
|
|
81
|
+
ListItemContent,
|
|
82
|
+
listItemContentClasses,
|
|
83
|
+
ListItemDecorator,
|
|
84
|
+
listItemDecoratorClasses,
|
|
85
|
+
ListSubheader,
|
|
86
|
+
listSubheaderClasses,
|
|
87
|
+
Link,
|
|
88
|
+
linkClasses,
|
|
89
|
+
Slider,
|
|
90
|
+
sliderClasses,
|
|
91
|
+
Step,
|
|
92
|
+
stepClasses,
|
|
93
|
+
StepButton,
|
|
94
|
+
stepButtonClasses,
|
|
95
|
+
StepIndicator,
|
|
96
|
+
Stepper,
|
|
97
|
+
stepperClasses,
|
|
98
|
+
Skeleton,
|
|
99
|
+
skeletonClasses
|
|
100
|
+
} from "@mui/joy";
|
|
101
|
+
|
|
102
|
+
// src/components/Accordions/Accordions.tsx
|
|
103
|
+
import React from "react";
|
|
104
|
+
import {
|
|
105
|
+
AccordionGroup as JoyAccordionGroup,
|
|
106
|
+
Accordion as JoyAccordion,
|
|
107
|
+
AccordionSummary as JoyAccordionSummary,
|
|
108
|
+
AccordionDetails as JoyAccordionDetails
|
|
109
|
+
} from "@mui/joy";
|
|
110
|
+
import { motion } from "framer-motion";
|
|
111
|
+
var MotionAccordionSummary = motion(JoyAccordionSummary);
|
|
112
|
+
var AccordionSummary = MotionAccordionSummary;
|
|
113
|
+
AccordionSummary.displayName = "AccordionSummary";
|
|
114
|
+
var MotionAccordionDetails = motion(JoyAccordionDetails);
|
|
115
|
+
var AccordionDetails = MotionAccordionDetails;
|
|
116
|
+
AccordionDetails.displayName = "AccordionDetails";
|
|
117
|
+
var MotionAccordion = motion(JoyAccordion);
|
|
118
|
+
function Accordion(props) {
|
|
119
|
+
const { summary, details, variant, color, ...innerProps } = props;
|
|
120
|
+
const inheritedVariant = variant === "solid" ? "solid" : void 0;
|
|
121
|
+
return /* @__PURE__ */ React.createElement(MotionAccordion, { variant: inheritedVariant, color, ...innerProps }, /* @__PURE__ */ React.createElement(AccordionSummary, { variant: inheritedVariant, color }, summary), /* @__PURE__ */ React.createElement(AccordionDetails, { variant: inheritedVariant, color }, details));
|
|
122
|
+
}
|
|
123
|
+
Accordion.displayName = "Accordion";
|
|
124
|
+
var MotionAccordions = motion(JoyAccordionGroup);
|
|
125
|
+
function Accordions(props) {
|
|
126
|
+
const { variant, color, items, ...innerProps } = props;
|
|
127
|
+
return /* @__PURE__ */ React.createElement(MotionAccordions, { variant, color, ...innerProps }, items.map((item, index) => /* @__PURE__ */ React.createElement(
|
|
128
|
+
Accordion,
|
|
129
|
+
{
|
|
130
|
+
summary: item.summary,
|
|
131
|
+
details: item.details,
|
|
132
|
+
index,
|
|
133
|
+
variant,
|
|
134
|
+
color
|
|
135
|
+
}
|
|
136
|
+
)));
|
|
137
|
+
}
|
|
138
|
+
Accordions.displayName = "Accordions";
|
|
139
|
+
|
|
140
|
+
// src/components/Autocomplete/Autocomplete.tsx
|
|
141
|
+
import React2 from "react";
|
|
142
|
+
import { Autocomplete as JoyAutocomplete } from "@mui/joy";
|
|
143
|
+
|
|
144
|
+
// src/components/FormControl/FormControl.tsx
|
|
145
|
+
import { FormControl as JoyFormControl } from "@mui/joy";
|
|
146
|
+
import { motion as motion2 } from "framer-motion";
|
|
147
|
+
var MotionFormControl = motion2(JoyFormControl);
|
|
148
|
+
var FormControl = MotionFormControl;
|
|
149
|
+
FormControl.displayName = "FormControl";
|
|
150
|
+
|
|
151
|
+
// src/components/FormControl/index.ts
|
|
152
|
+
var FormControl_default = FormControl;
|
|
153
|
+
|
|
154
|
+
// src/components/FormLabel/FormLabel.tsx
|
|
155
|
+
import { FormLabel as JoyFormLabel } from "@mui/joy";
|
|
156
|
+
import { motion as motion3 } from "framer-motion";
|
|
157
|
+
var MotionFormLabel = motion3(JoyFormLabel);
|
|
158
|
+
var FormLabel = MotionFormLabel;
|
|
159
|
+
FormLabel.displayName = "FormLabel";
|
|
160
|
+
|
|
161
|
+
// src/components/FormLabel/index.ts
|
|
162
|
+
var FormLabel_default = FormLabel;
|
|
163
|
+
|
|
164
|
+
// src/components/FormHelperText/FormHelperText.tsx
|
|
165
|
+
import { FormHelperText as JoyFormHelperText } from "@mui/joy";
|
|
166
|
+
import { motion as motion4 } from "framer-motion";
|
|
167
|
+
var MotionFormHelperText = motion4(JoyFormHelperText);
|
|
168
|
+
var FormHelperText = MotionFormHelperText;
|
|
169
|
+
FormHelperText.displayName = "FormHelperText";
|
|
170
|
+
|
|
171
|
+
// src/components/FormHelperText/index.ts
|
|
172
|
+
var FormHelperText_default = FormHelperText;
|
|
173
|
+
|
|
174
|
+
// src/components/Autocomplete/Autocomplete.tsx
|
|
175
|
+
function Autocomplete(props) {
|
|
176
|
+
const {
|
|
177
|
+
label,
|
|
178
|
+
error,
|
|
179
|
+
helperText,
|
|
180
|
+
color,
|
|
181
|
+
size,
|
|
182
|
+
disabled,
|
|
183
|
+
required,
|
|
184
|
+
...innerProps
|
|
185
|
+
} = props;
|
|
186
|
+
if (label) {
|
|
187
|
+
return /* @__PURE__ */ React2.createElement(
|
|
188
|
+
FormControl_default,
|
|
189
|
+
{
|
|
190
|
+
required,
|
|
191
|
+
color,
|
|
192
|
+
size,
|
|
193
|
+
error,
|
|
194
|
+
disabled
|
|
195
|
+
},
|
|
196
|
+
/* @__PURE__ */ React2.createElement(FormLabel_default, null, label),
|
|
197
|
+
/* @__PURE__ */ React2.createElement(JoyAutocomplete, { ...innerProps }),
|
|
198
|
+
helperText && /* @__PURE__ */ React2.createElement(FormHelperText_default, null, helperText)
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
return /* @__PURE__ */ React2.createElement(
|
|
202
|
+
JoyAutocomplete,
|
|
203
|
+
{
|
|
204
|
+
...innerProps,
|
|
205
|
+
required,
|
|
206
|
+
color,
|
|
207
|
+
size,
|
|
208
|
+
disabled
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
Autocomplete.displayName = "Autocomplete";
|
|
213
|
+
|
|
214
|
+
// src/components/Box/Box.tsx
|
|
215
|
+
import { Box as JoyBox } from "@mui/joy";
|
|
216
|
+
import { motion as motion5 } from "framer-motion";
|
|
217
|
+
var MotionBox = motion5(JoyBox);
|
|
218
|
+
var Box = MotionBox;
|
|
219
|
+
Box.displayName = "Box";
|
|
220
|
+
|
|
221
|
+
// src/components/Box/index.ts
|
|
222
|
+
var Box_default = Box;
|
|
223
|
+
|
|
224
|
+
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
225
|
+
import React5 from "react";
|
|
226
|
+
import {
|
|
227
|
+
Breadcrumbs as JoyBreadcrumbs,
|
|
228
|
+
Link as JoyLink
|
|
229
|
+
} from "@mui/joy";
|
|
230
|
+
|
|
231
|
+
// src/components/Menu/Menu.tsx
|
|
232
|
+
import React3 from "react";
|
|
233
|
+
import {
|
|
234
|
+
Menu as JoyMenu,
|
|
235
|
+
MenuButton as JoyMenuButton,
|
|
236
|
+
MenuItem as JoyMenuItem
|
|
237
|
+
} from "@mui/joy";
|
|
238
|
+
import { motion as motion6 } from "framer-motion";
|
|
239
|
+
var MotionMenu = motion6(JoyMenu);
|
|
240
|
+
var Menu = (props) => {
|
|
241
|
+
return /* @__PURE__ */ React3.createElement(MotionMenu, { ...props });
|
|
242
|
+
};
|
|
243
|
+
Menu.displayName = "Menu";
|
|
244
|
+
var MotionMenuButton = motion6(JoyMenuButton);
|
|
245
|
+
var MenuButton = (props) => {
|
|
246
|
+
return /* @__PURE__ */ React3.createElement(MotionMenuButton, { ...props });
|
|
247
|
+
};
|
|
248
|
+
MenuButton.displayName = "MenuButton";
|
|
249
|
+
var MotionMenuItem = motion6(JoyMenuItem);
|
|
250
|
+
var MenuItem = (props) => {
|
|
251
|
+
return /* @__PURE__ */ React3.createElement(MotionMenuItem, { ...props });
|
|
252
|
+
};
|
|
253
|
+
MenuItem.displayName = "MenuItem";
|
|
254
|
+
|
|
255
|
+
// src/components/Menu/index.ts
|
|
256
|
+
var Menu_default = Menu;
|
|
257
|
+
|
|
258
|
+
// src/components/Dropdown/Dropdown.tsx
|
|
259
|
+
import { Dropdown as JoyDropdown } from "@mui/joy";
|
|
260
|
+
import { motion as motion7 } from "framer-motion";
|
|
261
|
+
var MotionDropdown = motion7(JoyDropdown);
|
|
262
|
+
var Dropdown = MotionDropdown;
|
|
263
|
+
Dropdown.displayName = "Dropdown";
|
|
264
|
+
|
|
265
|
+
// src/components/Dropdown/index.ts
|
|
266
|
+
var Dropdown_default = Dropdown;
|
|
267
|
+
|
|
268
|
+
// src/components/Typography/Typography.tsx
|
|
269
|
+
import React4 from "react";
|
|
270
|
+
import { Typography as JoyTypography } from "@mui/joy";
|
|
271
|
+
import { motion as motion8 } from "framer-motion";
|
|
272
|
+
var MotionTypography = motion8(JoyTypography);
|
|
273
|
+
var Typography = (props) => {
|
|
274
|
+
return /* @__PURE__ */ React4.createElement(MotionTypography, { ...props });
|
|
275
|
+
};
|
|
276
|
+
Typography.displayName = "Typography";
|
|
277
|
+
|
|
278
|
+
// src/components/Typography/index.ts
|
|
279
|
+
var Typography_default = Typography;
|
|
280
|
+
|
|
281
|
+
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
282
|
+
function Breadcrumbs(props) {
|
|
283
|
+
const {
|
|
284
|
+
crumbs,
|
|
285
|
+
size,
|
|
286
|
+
frontCrumbCounts = 1,
|
|
287
|
+
backCrumbCounts = 3,
|
|
288
|
+
slots: { link: Link2, ...restSlots } = { link: JoyLink },
|
|
289
|
+
slotProps: { link: linkProps, ...restSlotProps } = {
|
|
290
|
+
link: { color: "neutral" }
|
|
291
|
+
},
|
|
292
|
+
...innerProps
|
|
293
|
+
} = props;
|
|
294
|
+
const _backCrumbCounts = Math.max(1, backCrumbCounts);
|
|
295
|
+
const Crumb = (props2) => {
|
|
296
|
+
if (props2.type === "link" && Link2) {
|
|
297
|
+
return /* @__PURE__ */ React5.createElement(Link2, { to: props2.linkHref, href: props2.linkHref, ...linkProps }, props2.label);
|
|
298
|
+
} else {
|
|
299
|
+
return /* @__PURE__ */ React5.createElement(Typography_default, null, props2.label);
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
const frontCrumbs = crumbs.slice(0, frontCrumbCounts).map((crumb) => /* @__PURE__ */ React5.createElement(Crumb, { ...crumb }));
|
|
303
|
+
const backCrumbs = (frontCrumbCounts + _backCrumbCounts > crumbs.length ? crumbs.slice(frontCrumbCounts) : crumbs.slice(-_backCrumbCounts)).map((crumb) => /* @__PURE__ */ React5.createElement(Crumb, { ...crumb }));
|
|
304
|
+
const collapsedCrumbs = crumbs.slice(frontCrumbCounts, -_backCrumbCounts).map((crumb) => /* @__PURE__ */ React5.createElement(MenuItem, null, /* @__PURE__ */ React5.createElement(Crumb, { ...crumb })));
|
|
305
|
+
console.log(collapsedCrumbs);
|
|
306
|
+
return /* @__PURE__ */ React5.createElement(
|
|
307
|
+
JoyBreadcrumbs,
|
|
308
|
+
{
|
|
309
|
+
size,
|
|
310
|
+
slots: restSlots,
|
|
311
|
+
slotProps: restSlotProps,
|
|
312
|
+
...innerProps
|
|
313
|
+
},
|
|
314
|
+
frontCrumbs,
|
|
315
|
+
collapsedCrumbs.length && /* @__PURE__ */ React5.createElement(Dropdown_default, null, /* @__PURE__ */ React5.createElement(MenuButton, { variant: "plain" }, "..."), /* @__PURE__ */ React5.createElement(Menu_default, null, collapsedCrumbs)),
|
|
316
|
+
backCrumbs
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
320
|
+
|
|
321
|
+
// src/components/Button/Button.tsx
|
|
322
|
+
import React6, { forwardRef } from "react";
|
|
323
|
+
import { Button as JoyButton } from "@mui/joy";
|
|
324
|
+
import { motion as motion9 } from "framer-motion";
|
|
325
|
+
var MotionButton = motion9(JoyButton);
|
|
326
|
+
var Button = forwardRef(
|
|
327
|
+
(props, ref) => {
|
|
328
|
+
return /* @__PURE__ */ React6.createElement(
|
|
329
|
+
MotionButton,
|
|
330
|
+
{
|
|
331
|
+
ref,
|
|
332
|
+
...props
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
);
|
|
337
|
+
Button.displayName = "Button";
|
|
338
|
+
|
|
339
|
+
// src/components/Button/index.ts
|
|
340
|
+
var Button_default = Button;
|
|
341
|
+
|
|
342
|
+
// src/components/Calendar/Calendar.tsx
|
|
343
|
+
import React9, { Fragment, forwardRef as forwardRef2, useMemo as useMemo2 } from "react";
|
|
344
|
+
import { styled } from "@mui/joy";
|
|
345
|
+
import ChevronLeftIcon from "@mui/icons-material/esm/ChevronLeft.js";
|
|
346
|
+
import ChevronRightIcon from "@mui/icons-material/esm/ChevronRight.js";
|
|
347
|
+
import { AnimatePresence, motion as motion11 } from "framer-motion";
|
|
348
|
+
|
|
349
|
+
// src/components/Calendar/utils/index.ts
|
|
350
|
+
var getCalendarDates = (date) => {
|
|
351
|
+
const dates = [];
|
|
352
|
+
const firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
353
|
+
const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
354
|
+
const firstWeekInThisMonth = Math.ceil((firstDay.getDay() + 1) / 7);
|
|
355
|
+
const lastWeekInThisMonth = Math.ceil(
|
|
356
|
+
(lastDay.getDate() + firstDay.getDay()) / 7
|
|
357
|
+
);
|
|
358
|
+
let day = 1;
|
|
359
|
+
for (let i = 1; i <= lastWeekInThisMonth; i++) {
|
|
360
|
+
const week = [];
|
|
361
|
+
for (let j = 1; j <= 7; j++) {
|
|
362
|
+
if (i === firstWeekInThisMonth && j < firstDay.getDay() + 1) {
|
|
363
|
+
week.push(void 0);
|
|
364
|
+
} else if (day > lastDay.getDate()) {
|
|
365
|
+
week.push(void 0);
|
|
366
|
+
} else {
|
|
367
|
+
week.push(day);
|
|
368
|
+
day++;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
dates.push(week);
|
|
372
|
+
}
|
|
373
|
+
return dates;
|
|
374
|
+
};
|
|
375
|
+
var getYearName = (date, locale) => {
|
|
376
|
+
return date.toLocaleString(locale, { year: "numeric" });
|
|
377
|
+
};
|
|
378
|
+
var getMonthName = (date, locale) => {
|
|
379
|
+
return date.toLocaleString(locale, { year: "numeric", month: "long" });
|
|
380
|
+
};
|
|
381
|
+
var getMonthNameFromIndex = (index, locale) => {
|
|
382
|
+
return new Date(0, index).toLocaleString(locale, { month: "short" });
|
|
383
|
+
};
|
|
384
|
+
var getWeekdayNames = (locale) => {
|
|
385
|
+
const currentDay = (/* @__PURE__ */ new Date()).getDay();
|
|
386
|
+
const date = /* @__PURE__ */ new Date();
|
|
387
|
+
date.setDate(date.getDate() - currentDay);
|
|
388
|
+
return Array.from({ length: 7 }).map(() => {
|
|
389
|
+
const day = date.toLocaleString(locale, { weekday: "short" });
|
|
390
|
+
date.setDate(date.getDate() + 1);
|
|
391
|
+
return day;
|
|
392
|
+
});
|
|
393
|
+
};
|
|
394
|
+
var isToday = (date) => {
|
|
395
|
+
const today = /* @__PURE__ */ new Date();
|
|
396
|
+
const d = new Date(date);
|
|
397
|
+
d.setHours(0, 0, 0, 0);
|
|
398
|
+
today.setHours(0, 0, 0, 0);
|
|
399
|
+
return d.getTime() === today.getTime();
|
|
400
|
+
};
|
|
401
|
+
var isSameDay = (date1, date2) => {
|
|
402
|
+
const d1 = new Date(date1);
|
|
403
|
+
const d2 = new Date(date2);
|
|
404
|
+
d1.setHours(0, 0, 0, 0);
|
|
405
|
+
d2.setHours(0, 0, 0, 0);
|
|
406
|
+
return d1.getTime() === d2.getTime();
|
|
407
|
+
};
|
|
408
|
+
var isWithinRange = (d1, d2, date) => {
|
|
409
|
+
const dateToCheck = new Date(date);
|
|
410
|
+
dateToCheck.setHours(0, 0, 0, 0);
|
|
411
|
+
const minDate = new Date(Math.min(d1.getTime(), d2.getTime()));
|
|
412
|
+
const maxDate = new Date(Math.max(d1.getTime(), d2.getTime()));
|
|
413
|
+
return dateToCheck >= minDate && dateToCheck <= maxDate;
|
|
414
|
+
};
|
|
415
|
+
var isSameMonth = (date1, date2) => {
|
|
416
|
+
return date1.getFullYear() === date2.getFullYear() && date1.getMonth() === date2.getMonth();
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
// src/components/IconButton/IconButton.tsx
|
|
420
|
+
import React7 from "react";
|
|
421
|
+
import { IconButton as JoyIconButton } from "@mui/joy";
|
|
422
|
+
import { motion as motion10 } from "framer-motion";
|
|
423
|
+
var MotionIconButton = motion10(JoyIconButton);
|
|
424
|
+
var IconButton = (props) => {
|
|
425
|
+
return /* @__PURE__ */ React7.createElement(MotionIconButton, { ...props });
|
|
426
|
+
};
|
|
427
|
+
IconButton.displayName = "IconButton";
|
|
428
|
+
|
|
429
|
+
// src/components/IconButton/index.ts
|
|
430
|
+
var IconButton_default = IconButton;
|
|
431
|
+
|
|
432
|
+
// src/components/Calendar/hooks/use-calendar-props.ts
|
|
433
|
+
import { useCallback, useMemo, useState } from "react";
|
|
434
|
+
import { useThemeProps } from "@mui/joy";
|
|
435
|
+
var resolveView = (view, views) => {
|
|
436
|
+
return views.includes(view) ? view : views[0];
|
|
437
|
+
};
|
|
438
|
+
var useCalendarProps = (inProps) => {
|
|
439
|
+
const [uncontrolledView, setUncontrolledView] = useState(
|
|
440
|
+
() => resolveView(inProps.view || "day", inProps.views || ["day", "month"])
|
|
441
|
+
);
|
|
442
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(inProps.defaultValue);
|
|
443
|
+
const [viewMonth, setViewMonth] = useState(() => {
|
|
444
|
+
const today = /* @__PURE__ */ new Date();
|
|
445
|
+
today.setDate(1);
|
|
446
|
+
today.setHours(0, 0, 0, 0);
|
|
447
|
+
return inProps.value?.[0] || inProps.defaultValue?.[0] || today;
|
|
448
|
+
});
|
|
449
|
+
const [[page, direction], setPage] = useState([0, 0]);
|
|
450
|
+
const resolvedView = inProps.view ?? uncontrolledView;
|
|
451
|
+
const paginate = (newDirection) => {
|
|
452
|
+
setPage([page + newDirection, newDirection]);
|
|
453
|
+
};
|
|
454
|
+
const handleViewMonthChange = useCallback(
|
|
455
|
+
(newMonth) => {
|
|
456
|
+
setViewMonth(newMonth);
|
|
457
|
+
if (resolvedView === "month") {
|
|
458
|
+
if (viewMonth.getFullYear() !== newMonth.getFullYear()) {
|
|
459
|
+
paginate(newMonth > viewMonth ? 1 : -1);
|
|
460
|
+
}
|
|
461
|
+
} else {
|
|
462
|
+
paginate(newMonth > viewMonth ? 1 : -1);
|
|
463
|
+
}
|
|
464
|
+
inProps.onMonthChange?.(newMonth);
|
|
465
|
+
},
|
|
466
|
+
[inProps.onMonthChange, viewMonth, resolvedView]
|
|
467
|
+
);
|
|
468
|
+
const props = useThemeProps({
|
|
469
|
+
props: {
|
|
470
|
+
locale: "default",
|
|
471
|
+
views: ["day", "month"],
|
|
472
|
+
view: resolvedView,
|
|
473
|
+
value: inProps.value ?? uncontrolledValue,
|
|
474
|
+
...inProps,
|
|
475
|
+
// overrides
|
|
476
|
+
onChange: inProps.value ? (
|
|
477
|
+
// Controlled
|
|
478
|
+
inProps.onChange
|
|
479
|
+
) : (
|
|
480
|
+
// Uncontrolled
|
|
481
|
+
(value) => {
|
|
482
|
+
setUncontrolledValue(value);
|
|
483
|
+
inProps.onChange?.(value);
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
onMonthChange: handleViewMonthChange,
|
|
487
|
+
onViewChange: () => {
|
|
488
|
+
const newView = resolvedView === "month" ? "day" : "month";
|
|
489
|
+
const isAllowedView = !inProps.views ? true : inProps.views.includes(newView);
|
|
490
|
+
if (!isAllowedView || inProps.view === newView)
|
|
491
|
+
return;
|
|
492
|
+
if (inProps.onViewChange) {
|
|
493
|
+
inProps.onViewChange(newView);
|
|
494
|
+
} else {
|
|
495
|
+
setUncontrolledView(newView);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
name: "Calendar"
|
|
500
|
+
});
|
|
501
|
+
const ownerState = useMemo(
|
|
502
|
+
() => ({ ...props, viewMonth, direction }),
|
|
503
|
+
[props, viewMonth, direction]
|
|
504
|
+
);
|
|
505
|
+
return [props, ownerState];
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
// src/components/Calendar/hooks/use-calendar.ts
|
|
509
|
+
import { useCallback as useCallback2, useState as useState2 } from "react";
|
|
510
|
+
var useCalendar = (ownerState) => {
|
|
511
|
+
const [hoverDay, setHoverDay] = useState2(null);
|
|
512
|
+
const [hoverMonth, setHoverMonth] = useState2(null);
|
|
513
|
+
return {
|
|
514
|
+
calendarTitle: ownerState.view === "month" ? getYearName(ownerState.viewMonth, ownerState.locale || "default") : getMonthName(ownerState.viewMonth, ownerState.locale || "default"),
|
|
515
|
+
onPrev: useCallback2(() => {
|
|
516
|
+
if (ownerState.view === "day") {
|
|
517
|
+
const prevMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
518
|
+
prevMonth.setMonth(prevMonth.getMonth() - 1);
|
|
519
|
+
ownerState.onMonthChange?.(prevMonth);
|
|
520
|
+
} else if (ownerState.view === "month") {
|
|
521
|
+
const prevYear = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
522
|
+
prevYear.setFullYear(prevYear.getFullYear() - 1);
|
|
523
|
+
ownerState.onMonthChange?.(prevYear);
|
|
524
|
+
}
|
|
525
|
+
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
526
|
+
onNext: useCallback2(() => {
|
|
527
|
+
if (ownerState.view === "day") {
|
|
528
|
+
const nextMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
529
|
+
nextMonth.setMonth(nextMonth.getMonth() + 1);
|
|
530
|
+
ownerState.onMonthChange?.(nextMonth);
|
|
531
|
+
} else if (ownerState.view === "month") {
|
|
532
|
+
const nextYear = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
533
|
+
nextYear.setFullYear(nextYear.getFullYear() + 1);
|
|
534
|
+
ownerState.onMonthChange?.(nextYear);
|
|
535
|
+
}
|
|
536
|
+
}, [ownerState.onMonthChange, ownerState.viewMonth, ownerState.view]),
|
|
537
|
+
getDayCellProps: useCallback2(
|
|
538
|
+
(day) => {
|
|
539
|
+
const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
540
|
+
thisDay.setHours(0, 0, 0, 0);
|
|
541
|
+
thisDay.setDate(day);
|
|
542
|
+
const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
543
|
+
(hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
|
|
544
|
+
ownerState.value[1] && isWithinRange(
|
|
545
|
+
ownerState.value[0],
|
|
546
|
+
ownerState.value[1],
|
|
547
|
+
thisDay
|
|
548
|
+
));
|
|
549
|
+
return {
|
|
550
|
+
"aria-label": thisDay.toLocaleDateString(),
|
|
551
|
+
"aria-current": inRange ? "date" : void 0
|
|
552
|
+
};
|
|
553
|
+
},
|
|
554
|
+
[
|
|
555
|
+
ownerState.rangeSelection,
|
|
556
|
+
ownerState.value,
|
|
557
|
+
ownerState.viewMonth,
|
|
558
|
+
hoverDay
|
|
559
|
+
]
|
|
560
|
+
),
|
|
561
|
+
getMonthCellProps: useCallback2(
|
|
562
|
+
(monthIndex) => {
|
|
563
|
+
const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
564
|
+
thisMonth.setDate(1);
|
|
565
|
+
thisMonth.setHours(0, 0, 0, 0);
|
|
566
|
+
thisMonth.setMonth(monthIndex);
|
|
567
|
+
const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") && ownerState.rangeSelection;
|
|
568
|
+
const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
569
|
+
(hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
|
|
570
|
+
ownerState.value[1] && isWithinRange(
|
|
571
|
+
ownerState.value[0],
|
|
572
|
+
ownerState.value[1],
|
|
573
|
+
thisMonth
|
|
574
|
+
));
|
|
575
|
+
return {
|
|
576
|
+
"aria-label": thisMonth.toLocaleDateString(),
|
|
577
|
+
"aria-current": inRange ? "date" : void 0
|
|
578
|
+
};
|
|
579
|
+
},
|
|
580
|
+
[
|
|
581
|
+
ownerState.rangeSelection,
|
|
582
|
+
ownerState.value,
|
|
583
|
+
ownerState.viewMonth,
|
|
584
|
+
hoverMonth
|
|
585
|
+
]
|
|
586
|
+
),
|
|
587
|
+
getPickerDayProps: useCallback2(
|
|
588
|
+
(day) => {
|
|
589
|
+
const thisDay = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
590
|
+
thisDay.setHours(0, 0, 0, 0);
|
|
591
|
+
thisDay.setDate(day);
|
|
592
|
+
const isSelected = !!ownerState.value && (isSameDay(thisDay, ownerState.value[0]) || ownerState.value[1] && isSameDay(thisDay, ownerState.value[1]));
|
|
593
|
+
const inRange = ownerState.rangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
594
|
+
(hoverDay && isWithinRange(ownerState.value[0], hoverDay, thisDay) || // NOTE: Selected range is included in the range
|
|
595
|
+
ownerState.value[1] && isWithinRange(
|
|
596
|
+
ownerState.value[0],
|
|
597
|
+
ownerState.value[1],
|
|
598
|
+
thisDay
|
|
599
|
+
));
|
|
600
|
+
const handleDayClick = () => {
|
|
601
|
+
if (ownerState.rangeSelection) {
|
|
602
|
+
if (!ownerState.value) {
|
|
603
|
+
ownerState.onChange?.([thisDay, void 0]);
|
|
604
|
+
} else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
605
|
+
ownerState.onChange?.([
|
|
606
|
+
new Date(
|
|
607
|
+
Math.min(ownerState.value[0].getTime(), thisDay.getTime())
|
|
608
|
+
),
|
|
609
|
+
new Date(
|
|
610
|
+
Math.max(ownerState.value[0].getTime(), thisDay.getTime())
|
|
611
|
+
)
|
|
612
|
+
]);
|
|
613
|
+
} else {
|
|
614
|
+
ownerState.onChange?.([thisDay, void 0]);
|
|
615
|
+
}
|
|
616
|
+
} else {
|
|
617
|
+
ownerState.onChange?.([thisDay, void 0]);
|
|
618
|
+
}
|
|
619
|
+
setHoverDay(null);
|
|
620
|
+
};
|
|
621
|
+
return {
|
|
622
|
+
isToday: isToday(thisDay),
|
|
623
|
+
isSelected,
|
|
624
|
+
onClick: handleDayClick,
|
|
625
|
+
onMouseEnter: ownerState.rangeSelection && ownerState.value?.[0] && !ownerState.value?.[1] ? () => setHoverDay(thisDay) : void 0,
|
|
626
|
+
disabled: ownerState.minDate && thisDay < ownerState.minDate || ownerState.maxDate && thisDay > ownerState.maxDate || ownerState.disableFuture && thisDay > /* @__PURE__ */ new Date() || ownerState.disablePast && thisDay < (() => {
|
|
627
|
+
const today = /* @__PURE__ */ new Date();
|
|
628
|
+
today.setHours(0, 0, 0, 0);
|
|
629
|
+
return today;
|
|
630
|
+
})(),
|
|
631
|
+
tabIndex: -1,
|
|
632
|
+
"aria-label": thisDay.toLocaleDateString(),
|
|
633
|
+
"aria-selected": isSelected ? "true" : void 0,
|
|
634
|
+
"aria-current": inRange ? "date" : void 0
|
|
635
|
+
};
|
|
636
|
+
},
|
|
637
|
+
[
|
|
638
|
+
ownerState.onChange,
|
|
639
|
+
ownerState.value,
|
|
640
|
+
ownerState.viewMonth,
|
|
641
|
+
ownerState.rangeSelection,
|
|
642
|
+
ownerState.minDate,
|
|
643
|
+
ownerState.maxDate,
|
|
644
|
+
ownerState.disableFuture,
|
|
645
|
+
ownerState.disablePast,
|
|
646
|
+
hoverDay
|
|
647
|
+
]
|
|
648
|
+
),
|
|
649
|
+
getPickerMonthProps: useCallback2(
|
|
650
|
+
(monthIndex) => {
|
|
651
|
+
const thisMonth = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
652
|
+
thisMonth.setDate(1);
|
|
653
|
+
thisMonth.setHours(0, 0, 0, 0);
|
|
654
|
+
thisMonth.setMonth(monthIndex);
|
|
655
|
+
const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") && ownerState.rangeSelection;
|
|
656
|
+
const isSelected = !!ownerState.value && (isSameMonth(thisMonth, ownerState.value[0]) || ownerState.value[1] && isSameMonth(thisMonth, ownerState.value[1]));
|
|
657
|
+
const inRange = isMonthRangeSelection && ownerState.value && ownerState.value[0] && // NOTE: hover day is not included in the range
|
|
658
|
+
(hoverMonth && isWithinRange(ownerState.value[0], hoverMonth, thisMonth) || // NOTE: Selected range is included in the range
|
|
659
|
+
ownerState.value[1] && isWithinRange(
|
|
660
|
+
ownerState.value[0],
|
|
661
|
+
ownerState.value[1],
|
|
662
|
+
thisMonth
|
|
663
|
+
));
|
|
664
|
+
const handleMonthClick = () => {
|
|
665
|
+
if (isMonthRangeSelection) {
|
|
666
|
+
if (!ownerState.value) {
|
|
667
|
+
ownerState.onChange?.([thisMonth, void 0]);
|
|
668
|
+
} else if (ownerState.value[0] && !ownerState.value[1]) {
|
|
669
|
+
ownerState.onChange?.([
|
|
670
|
+
new Date(
|
|
671
|
+
Math.min(ownerState.value[0].getTime(), thisMonth.getTime())
|
|
672
|
+
),
|
|
673
|
+
new Date(
|
|
674
|
+
Math.max(ownerState.value[0].getTime(), thisMonth.getTime())
|
|
675
|
+
)
|
|
676
|
+
]);
|
|
677
|
+
} else {
|
|
678
|
+
ownerState.onChange?.([thisMonth, void 0]);
|
|
679
|
+
}
|
|
680
|
+
} else {
|
|
681
|
+
ownerState.onViewChange?.("day");
|
|
682
|
+
ownerState.onMonthChange?.(thisMonth);
|
|
683
|
+
}
|
|
684
|
+
setHoverMonth(null);
|
|
685
|
+
};
|
|
686
|
+
return {
|
|
687
|
+
isSelected,
|
|
688
|
+
onMouseEnter: isMonthRangeSelection && ownerState.value?.[0] && !ownerState.value?.[1] ? () => setHoverMonth(thisMonth) : void 0,
|
|
689
|
+
disabled: ownerState.minDate && (() => {
|
|
690
|
+
const lastDay = new Date(thisMonth);
|
|
691
|
+
lastDay.setMonth(lastDay.getMonth() + 1);
|
|
692
|
+
lastDay.setDate(0);
|
|
693
|
+
return lastDay < ownerState.minDate;
|
|
694
|
+
})() || ownerState.maxDate && (() => {
|
|
695
|
+
const lastDay = new Date(thisMonth);
|
|
696
|
+
lastDay.setDate(0);
|
|
697
|
+
return lastDay > ownerState.maxDate;
|
|
698
|
+
})() || ownerState.disableFuture && thisMonth > /* @__PURE__ */ new Date() || ownerState.disablePast && thisMonth < /* @__PURE__ */ new Date() && !isSameMonth(thisMonth, /* @__PURE__ */ new Date()),
|
|
699
|
+
onClick: handleMonthClick,
|
|
700
|
+
tabIndex: -1,
|
|
701
|
+
"aria-label": getMonthName(thisMonth, ownerState.locale || "default"),
|
|
702
|
+
"aria-selected": isSelected ? "true" : void 0,
|
|
703
|
+
"aria-current": inRange ? "date" : void 0
|
|
704
|
+
};
|
|
705
|
+
},
|
|
706
|
+
[
|
|
707
|
+
ownerState.onMonthChange,
|
|
708
|
+
ownerState.onViewChange,
|
|
709
|
+
ownerState.onChange,
|
|
710
|
+
ownerState.viewMonth,
|
|
711
|
+
ownerState.locale,
|
|
712
|
+
ownerState.value,
|
|
713
|
+
ownerState.minDate,
|
|
714
|
+
ownerState.maxDate,
|
|
715
|
+
ownerState.disableFuture,
|
|
716
|
+
ownerState.disablePast,
|
|
717
|
+
hoverMonth
|
|
718
|
+
]
|
|
719
|
+
)
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
|
|
723
|
+
// src/components/Calendar/Calendar.tsx
|
|
724
|
+
var CalendarRoot = styled("div", {
|
|
725
|
+
name: "Calendar",
|
|
726
|
+
slot: "root"
|
|
727
|
+
})({
|
|
728
|
+
maxWidth: "264px"
|
|
729
|
+
});
|
|
730
|
+
var CalendarHeader = styled("div", {
|
|
731
|
+
name: "Calendar",
|
|
732
|
+
slot: "calendarHeader"
|
|
733
|
+
})(({ theme }) => ({
|
|
734
|
+
display: "flex",
|
|
735
|
+
justifyContent: "space-between",
|
|
736
|
+
alignItems: "center",
|
|
737
|
+
padding: theme.spacing(1)
|
|
738
|
+
}));
|
|
739
|
+
var CalendarViewContainer = styled("div", {
|
|
740
|
+
name: "Calendar",
|
|
741
|
+
slot: "viewContainer"
|
|
742
|
+
})(({ theme, calendarType }) => ({
|
|
743
|
+
paddingLeft: theme.spacing(1),
|
|
744
|
+
paddingRight: theme.spacing(1),
|
|
745
|
+
position: "relative",
|
|
746
|
+
overflow: "hidden",
|
|
747
|
+
minHeight: calendarType === "datePicker" ? "250px" : "unset"
|
|
748
|
+
}));
|
|
749
|
+
var CalendarViewTable = styled(motion11.table, {
|
|
750
|
+
name: "Calendar",
|
|
751
|
+
slot: "viewTable"
|
|
752
|
+
})(({ theme }) => ({
|
|
753
|
+
borderSpacing: 0,
|
|
754
|
+
"& td, & th": {
|
|
755
|
+
padding: 0
|
|
756
|
+
},
|
|
757
|
+
"& th": {
|
|
758
|
+
paddingTop: theme.spacing(1),
|
|
759
|
+
paddingBottom: theme.spacing(1)
|
|
760
|
+
}
|
|
761
|
+
}));
|
|
762
|
+
var CalendarWeekHeaderContainer = styled("thead", {
|
|
763
|
+
name: "Calendar",
|
|
764
|
+
slot: "weekHeaderContainer"
|
|
765
|
+
})({});
|
|
766
|
+
var CalendarDayPickerContainer = styled("tbody", {
|
|
767
|
+
name: "Calendar",
|
|
768
|
+
slot: "dayPickerContainer"
|
|
769
|
+
})({});
|
|
770
|
+
var CalendarSwitchViewButton = styled(Button_default, {
|
|
771
|
+
name: "Calendar",
|
|
772
|
+
slot: "switchViewButton"
|
|
773
|
+
})(({ ownerState }) => [
|
|
774
|
+
ownerState.view === "month" && {
|
|
775
|
+
pointerEvents: "none"
|
|
776
|
+
}
|
|
777
|
+
]);
|
|
778
|
+
var CalendarDayCell = styled("td", {
|
|
779
|
+
name: "Calendar",
|
|
780
|
+
slot: "dayCell"
|
|
781
|
+
})(({ theme }) => ({
|
|
782
|
+
// aria-current=date === range에 포함된 버튼
|
|
783
|
+
"&[aria-current=date]": {
|
|
784
|
+
position: "relative",
|
|
785
|
+
"& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)": {
|
|
786
|
+
backgroundColor: `rgb(${theme.palette.primary.lightChannel})`
|
|
787
|
+
},
|
|
788
|
+
'& + td[aria-hidden] + td[aria-current="date"]::before': {
|
|
789
|
+
content: '""',
|
|
790
|
+
position: "absolute",
|
|
791
|
+
top: 0,
|
|
792
|
+
left: "-10px",
|
|
793
|
+
bottom: 0,
|
|
794
|
+
width: "16px",
|
|
795
|
+
backgroundColor: `rgb(${theme.palette.primary.lightChannel})`,
|
|
796
|
+
zIndex: -1
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}));
|
|
800
|
+
var CalendarMonthCell = styled("td", {
|
|
801
|
+
name: "Calendar",
|
|
802
|
+
slot: "monthCell"
|
|
803
|
+
})(({ theme }) => ({
|
|
804
|
+
// aria-current=date === range에 포함된 버튼
|
|
805
|
+
"&[aria-current=date]": {
|
|
806
|
+
position: "relative",
|
|
807
|
+
"& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)": {
|
|
808
|
+
backgroundColor: `rgb(${theme.palette.primary.lightChannel})`
|
|
809
|
+
},
|
|
810
|
+
'& + td[aria-hidden] + td[aria-current="date"]::before': {
|
|
811
|
+
content: '""',
|
|
812
|
+
position: "absolute",
|
|
813
|
+
top: 0,
|
|
814
|
+
left: "-10px",
|
|
815
|
+
bottom: 0,
|
|
816
|
+
width: "16px",
|
|
817
|
+
backgroundColor: `rgb(${theme.palette.primary.lightChannel})`,
|
|
818
|
+
zIndex: -1
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}));
|
|
822
|
+
var CalendarMonth = styled(Button_default, {
|
|
823
|
+
name: "Calendar",
|
|
824
|
+
slot: "month"
|
|
825
|
+
})(({ theme, isSelected, disabled }) => [
|
|
826
|
+
{
|
|
827
|
+
width: "59px",
|
|
828
|
+
// height: "32px",
|
|
829
|
+
textAlign: "center",
|
|
830
|
+
"&:hover": {
|
|
831
|
+
color: theme.palette.primary.softColor,
|
|
832
|
+
backgroundColor: theme.palette.primary.softHoverBg
|
|
833
|
+
},
|
|
834
|
+
"&:active": {
|
|
835
|
+
color: theme.palette.primary.softColor,
|
|
836
|
+
backgroundColor: theme.palette.primary.softActiveBg
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
isSelected && {
|
|
840
|
+
backgroundColor: theme.palette.primary.solidBg,
|
|
841
|
+
color: theme.palette.primary.solidColor,
|
|
842
|
+
"&:hover": {
|
|
843
|
+
color: theme.palette.primary.solidColor,
|
|
844
|
+
backgroundColor: theme.palette.primary.solidHoverBg
|
|
845
|
+
},
|
|
846
|
+
"&:active": {
|
|
847
|
+
color: theme.palette.primary.solidColor,
|
|
848
|
+
backgroundColor: theme.palette.primary.solidActiveBg
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
disabled && {
|
|
852
|
+
color: theme.palette.neutral.solidDisabledColor,
|
|
853
|
+
backgroundColor: theme.palette.neutral.solidDisabledBg
|
|
854
|
+
}
|
|
855
|
+
]);
|
|
856
|
+
var CalendarDay = styled(Button_default, {
|
|
857
|
+
name: "Calendar",
|
|
858
|
+
slot: "day"
|
|
859
|
+
})(({ theme, isToday: isToday2, isSelected, disabled }) => [
|
|
860
|
+
{
|
|
861
|
+
width: "32px",
|
|
862
|
+
height: "32px",
|
|
863
|
+
textAlign: "center",
|
|
864
|
+
"&:hover": {
|
|
865
|
+
color: theme.palette.primary.softColor,
|
|
866
|
+
backgroundColor: theme.palette.primary.softHoverBg
|
|
867
|
+
},
|
|
868
|
+
"&:active": {
|
|
869
|
+
color: theme.palette.primary.softColor,
|
|
870
|
+
backgroundColor: theme.palette.primary.softActiveBg
|
|
871
|
+
}
|
|
872
|
+
},
|
|
873
|
+
// NOTE: enabled, disabled 일때만 border 적용
|
|
874
|
+
isToday2 && !isSelected && {
|
|
875
|
+
"&:not([aria-current=date]):not(:hover)": {
|
|
876
|
+
border: `1px solid ${theme.palette.neutral.outlinedBorder}`
|
|
877
|
+
}
|
|
878
|
+
},
|
|
879
|
+
isSelected && {
|
|
880
|
+
backgroundColor: theme.palette.primary.solidBg,
|
|
881
|
+
color: theme.palette.primary.solidColor,
|
|
882
|
+
"&:hover": {
|
|
883
|
+
color: theme.palette.primary.solidColor,
|
|
884
|
+
backgroundColor: theme.palette.primary.solidHoverBg
|
|
885
|
+
},
|
|
886
|
+
"&:active": {
|
|
887
|
+
color: theme.palette.primary.solidColor,
|
|
888
|
+
backgroundColor: theme.palette.primary.solidActiveBg
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
disabled && {
|
|
892
|
+
color: theme.palette.neutral.solidDisabledColor,
|
|
893
|
+
backgroundColor: theme.palette.neutral.solidDisabledBg
|
|
894
|
+
}
|
|
895
|
+
]);
|
|
896
|
+
var variants = {
|
|
897
|
+
enter: (direction) => {
|
|
898
|
+
return {
|
|
899
|
+
x: direction > 0 ? 300 : -300,
|
|
900
|
+
opacity: 0
|
|
901
|
+
};
|
|
902
|
+
},
|
|
903
|
+
center: {
|
|
904
|
+
position: "relative",
|
|
905
|
+
zIndex: 1,
|
|
906
|
+
x: 0,
|
|
907
|
+
opacity: 1
|
|
908
|
+
},
|
|
909
|
+
exit: (direction) => {
|
|
910
|
+
return {
|
|
911
|
+
position: "absolute",
|
|
912
|
+
zIndex: 0,
|
|
913
|
+
x: direction < 0 ? 300 : -300,
|
|
914
|
+
opacity: 0
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
};
|
|
918
|
+
var swipeConfidenceThreshold = 1e4;
|
|
919
|
+
var swipePower = (offset, velocity) => {
|
|
920
|
+
return Math.abs(offset) * velocity;
|
|
921
|
+
};
|
|
922
|
+
var PickerDays = (props) => {
|
|
923
|
+
const { ownerState } = props;
|
|
924
|
+
const { getPickerDayProps, getDayCellProps } = useCalendar(ownerState);
|
|
925
|
+
const calendarDates = useMemo2(
|
|
926
|
+
() => getCalendarDates(ownerState.viewMonth),
|
|
927
|
+
[ownerState.viewMonth]
|
|
928
|
+
);
|
|
929
|
+
const weekdayNames = useMemo2(
|
|
930
|
+
() => getWeekdayNames(ownerState.locale || "default"),
|
|
931
|
+
[ownerState.locale]
|
|
932
|
+
);
|
|
933
|
+
return /* @__PURE__ */ React9.createElement(CalendarViewContainer, { calendarType: "datePicker" }, /* @__PURE__ */ React9.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React9.createElement(
|
|
934
|
+
CalendarViewTable,
|
|
935
|
+
{
|
|
936
|
+
key: `${ownerState.viewMonth.toString()}_${ownerState.direction}`,
|
|
937
|
+
custom: ownerState.direction,
|
|
938
|
+
variants,
|
|
939
|
+
initial: "enter",
|
|
940
|
+
animate: "center",
|
|
941
|
+
exit: "exit",
|
|
942
|
+
transition: {
|
|
943
|
+
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
944
|
+
opacity: { duration: 0.2 }
|
|
945
|
+
},
|
|
946
|
+
drag: "x",
|
|
947
|
+
dragConstraints: { left: 0, right: 0 },
|
|
948
|
+
dragElastic: 1,
|
|
949
|
+
onDragEnd: (e, { offset, velocity }) => {
|
|
950
|
+
const swipe = swipePower(offset.x, velocity.x);
|
|
951
|
+
if (swipe < -swipeConfidenceThreshold) {
|
|
952
|
+
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
953
|
+
date.setMonth(date.getMonth() + 1);
|
|
954
|
+
ownerState.onMonthChange?.(date);
|
|
955
|
+
} else if (swipe > swipeConfidenceThreshold) {
|
|
956
|
+
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
957
|
+
date.setMonth(date.getMonth() - 1);
|
|
958
|
+
ownerState.onMonthChange?.(date);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
/* @__PURE__ */ React9.createElement(CalendarWeekHeaderContainer, null, /* @__PURE__ */ React9.createElement("tr", null, weekdayNames.map((name, i) => /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement("th", null, /* @__PURE__ */ React9.createElement(Typography_default, { level: "body-xs", textAlign: "center" }, name)), i < 6 && /* @__PURE__ */ React9.createElement(
|
|
963
|
+
"th",
|
|
964
|
+
{
|
|
965
|
+
style: { width: 4 },
|
|
966
|
+
"aria-hidden": "true",
|
|
967
|
+
"aria-description": "cell-gap"
|
|
968
|
+
}
|
|
969
|
+
))))),
|
|
970
|
+
/* @__PURE__ */ React9.createElement(CalendarDayPickerContainer, null, calendarDates.map((weekDates, rowIndex) => /* @__PURE__ */ React9.createElement(Fragment, { key: `${ownerState.viewMonth}_${rowIndex}` }, /* @__PURE__ */ React9.createElement("tr", null, weekDates.map(
|
|
971
|
+
(date, i) => date ? /* @__PURE__ */ React9.createElement(Fragment, { key: i }, /* @__PURE__ */ React9.createElement(CalendarDayCell, { ...getDayCellProps(date) }, /* @__PURE__ */ React9.createElement(
|
|
972
|
+
CalendarDay,
|
|
973
|
+
{
|
|
974
|
+
size: "sm",
|
|
975
|
+
variant: "plain",
|
|
976
|
+
color: "neutral",
|
|
977
|
+
...getPickerDayProps(date)
|
|
978
|
+
},
|
|
979
|
+
date
|
|
980
|
+
)), i < 6 && /* @__PURE__ */ React9.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" })) : /* @__PURE__ */ React9.createElement(Fragment, { key: i }, /* @__PURE__ */ React9.createElement("td", null), i < 6 && /* @__PURE__ */ React9.createElement("td", { "aria-hidden": "true", "aria-description": "cell-gap" }))
|
|
981
|
+
)), rowIndex < calendarDates.length - 1 && /* @__PURE__ */ React9.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React9.createElement("td", { colSpan: 13, style: { height: 4 } })))))
|
|
982
|
+
)));
|
|
983
|
+
};
|
|
984
|
+
var PickerMonths = (props) => {
|
|
985
|
+
const { ownerState } = props;
|
|
986
|
+
const { getPickerMonthProps, getMonthCellProps } = useCalendar(ownerState);
|
|
987
|
+
const chunkedMonths = Array.from({ length: 12 }, (_, i) => i).reduce(
|
|
988
|
+
(acc, month) => {
|
|
989
|
+
if (acc[acc.length - 1].length === 4) {
|
|
990
|
+
acc.push([]);
|
|
991
|
+
}
|
|
992
|
+
acc[acc.length - 1].push(month);
|
|
993
|
+
return acc;
|
|
994
|
+
},
|
|
995
|
+
[[]]
|
|
996
|
+
);
|
|
997
|
+
const isMonthRangeSelection = !ownerState.views?.find((view) => view === "day") && ownerState.rangeSelection;
|
|
998
|
+
return /* @__PURE__ */ React9.createElement(CalendarViewContainer, { calendarType: isMonthRangeSelection ? "monthPicker" : "datePicker" }, /* @__PURE__ */ React9.createElement(AnimatePresence, { initial: false, custom: ownerState.direction }, /* @__PURE__ */ React9.createElement(
|
|
999
|
+
CalendarViewTable,
|
|
1000
|
+
{
|
|
1001
|
+
key: `${ownerState.viewMonth.getFullYear()}_${ownerState.direction}`,
|
|
1002
|
+
custom: ownerState.direction,
|
|
1003
|
+
variants,
|
|
1004
|
+
initial: "enter",
|
|
1005
|
+
animate: "center",
|
|
1006
|
+
exit: "exit",
|
|
1007
|
+
transition: {
|
|
1008
|
+
x: { type: "spring", stiffness: 300, damping: 30 },
|
|
1009
|
+
opacity: { duration: 0.2 }
|
|
1010
|
+
},
|
|
1011
|
+
drag: "x",
|
|
1012
|
+
dragConstraints: { left: 0, right: 0 },
|
|
1013
|
+
dragElastic: 1,
|
|
1014
|
+
onDragEnd: (e, { offset, velocity }) => {
|
|
1015
|
+
const swipe = swipePower(offset.x, velocity.x);
|
|
1016
|
+
if (swipe < -swipeConfidenceThreshold) {
|
|
1017
|
+
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1018
|
+
date.setMonth(date.getMonth() + 1);
|
|
1019
|
+
ownerState.onMonthChange?.(date);
|
|
1020
|
+
} else if (swipe > swipeConfidenceThreshold) {
|
|
1021
|
+
const date = new Date(ownerState.viewMonth || /* @__PURE__ */ new Date());
|
|
1022
|
+
date.setMonth(date.getMonth() - 1);
|
|
1023
|
+
ownerState.onMonthChange?.(date);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
},
|
|
1027
|
+
/* @__PURE__ */ React9.createElement("tbody", null, chunkedMonths.map((months, i) => /* @__PURE__ */ React9.createElement(Fragment, { key: i }, /* @__PURE__ */ React9.createElement("tr", null, months.map((monthIndex, j) => /* @__PURE__ */ React9.createElement(Fragment, { key: monthIndex }, /* @__PURE__ */ React9.createElement(CalendarMonthCell, { ...getMonthCellProps(monthIndex) }, /* @__PURE__ */ React9.createElement(
|
|
1028
|
+
CalendarMonth,
|
|
1029
|
+
{
|
|
1030
|
+
size: "sm",
|
|
1031
|
+
variant: "plain",
|
|
1032
|
+
color: "neutral",
|
|
1033
|
+
...getPickerMonthProps(monthIndex)
|
|
1034
|
+
},
|
|
1035
|
+
getMonthNameFromIndex(
|
|
1036
|
+
monthIndex,
|
|
1037
|
+
ownerState.locale
|
|
1038
|
+
)
|
|
1039
|
+
)), j < 3 && /* @__PURE__ */ React9.createElement(
|
|
1040
|
+
"td",
|
|
1041
|
+
{
|
|
1042
|
+
style: { width: 4 },
|
|
1043
|
+
"aria-hidden": "true",
|
|
1044
|
+
"aria-description": "cell-gap"
|
|
1045
|
+
}
|
|
1046
|
+
)))), i < chunkedMonths.length - 1 && /* @__PURE__ */ React9.createElement("tr", { "aria-hidden": "true", "aria-description": "row-gap" }, /* @__PURE__ */ React9.createElement("td", { colSpan: 7, style: { height: 4 } })))))
|
|
1047
|
+
)));
|
|
1048
|
+
};
|
|
1049
|
+
var Calendar = forwardRef2((inProps, ref) => {
|
|
1050
|
+
const [props, ownerState] = useCalendarProps(inProps);
|
|
1051
|
+
const {
|
|
1052
|
+
value,
|
|
1053
|
+
defaultValue,
|
|
1054
|
+
onChange,
|
|
1055
|
+
locale,
|
|
1056
|
+
onViewChange,
|
|
1057
|
+
onMonthChange,
|
|
1058
|
+
view,
|
|
1059
|
+
views,
|
|
1060
|
+
rangeSelection,
|
|
1061
|
+
...others
|
|
1062
|
+
} = props;
|
|
1063
|
+
const { calendarTitle, onPrev, onNext } = useCalendar(ownerState);
|
|
1064
|
+
return /* @__PURE__ */ React9.createElement(CalendarRoot, { ref, ...others }, /* @__PURE__ */ React9.createElement(CalendarHeader, null, /* @__PURE__ */ React9.createElement(IconButton_default, { size: "sm", onClick: onPrev }, /* @__PURE__ */ React9.createElement(ChevronLeftIcon, null)), /* @__PURE__ */ React9.createElement(
|
|
1065
|
+
CalendarSwitchViewButton,
|
|
1066
|
+
{
|
|
1067
|
+
ownerState,
|
|
1068
|
+
variant: "plain",
|
|
1069
|
+
color: "neutral",
|
|
1070
|
+
onClick: onViewChange
|
|
1071
|
+
},
|
|
1072
|
+
calendarTitle
|
|
1073
|
+
), /* @__PURE__ */ React9.createElement(IconButton_default, { size: "sm", onClick: onNext }, /* @__PURE__ */ React9.createElement(ChevronRightIcon, null))), view === "day" && /* @__PURE__ */ React9.createElement(PickerDays, { ownerState }), view === "month" && /* @__PURE__ */ React9.createElement(PickerMonths, { ownerState }));
|
|
1074
|
+
});
|
|
1075
|
+
Calendar.displayName = "Calendar";
|
|
1076
|
+
|
|
1077
|
+
// src/components/Calendar/index.ts
|
|
1078
|
+
var Calendar_default = Calendar;
|
|
1079
|
+
|
|
1080
|
+
// src/components/Checkbox/Checkbox.tsx
|
|
1081
|
+
import React10 from "react";
|
|
1082
|
+
import { Checkbox as JoyCheckbox } from "@mui/joy";
|
|
1083
|
+
import { motion as motion12 } from "framer-motion";
|
|
1084
|
+
var MotionCheckbox = motion12(JoyCheckbox);
|
|
1085
|
+
var Checkbox = (props) => {
|
|
1086
|
+
return /* @__PURE__ */ React10.createElement(MotionCheckbox, { ...props });
|
|
1087
|
+
};
|
|
1088
|
+
Checkbox.displayName = "Checkbox";
|
|
1089
|
+
|
|
1090
|
+
// src/components/Checkbox/index.ts
|
|
1091
|
+
var Checkbox_default = Checkbox;
|
|
1092
|
+
|
|
1093
|
+
// src/components/Container/Container.tsx
|
|
1094
|
+
import { styled as styled2 } from "@mui/joy";
|
|
1095
|
+
import React11, { forwardRef as forwardRef3 } from "react";
|
|
1096
|
+
var ContainerRoot = styled2("div", {
|
|
1097
|
+
name: "Container",
|
|
1098
|
+
slot: "root",
|
|
1099
|
+
shouldForwardProp: (prop) => prop !== "maxWidth"
|
|
1100
|
+
})(({ theme, maxWidth = "lg" }) => ({
|
|
1101
|
+
width: "100%",
|
|
1102
|
+
marginLeft: "auto",
|
|
1103
|
+
boxSizing: "border-box",
|
|
1104
|
+
marginRight: "auto",
|
|
1105
|
+
display: "block",
|
|
1106
|
+
// Fix IE11 layout when used with main.
|
|
1107
|
+
paddingLeft: theme.spacing(2),
|
|
1108
|
+
paddingRight: theme.spacing(2),
|
|
1109
|
+
...maxWidth === "sm" && {
|
|
1110
|
+
[theme.breakpoints.up("xs")]: {
|
|
1111
|
+
maxWidth: theme.breakpoints.values.sm
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
1114
|
+
...maxWidth === "md" && {
|
|
1115
|
+
[theme.breakpoints.up("sm")]: {
|
|
1116
|
+
maxWidth: theme.breakpoints.values.md
|
|
1117
|
+
}
|
|
1118
|
+
},
|
|
1119
|
+
...maxWidth === "lg" && {
|
|
1120
|
+
[theme.breakpoints.up("md")]: {
|
|
1121
|
+
maxWidth: theme.breakpoints.values.lg
|
|
1122
|
+
}
|
|
1123
|
+
},
|
|
1124
|
+
...maxWidth === "xl" && {
|
|
1125
|
+
[theme.breakpoints.up("lg")]: {
|
|
1126
|
+
maxWidth: theme.breakpoints.values.xl
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
}));
|
|
1130
|
+
var Container = forwardRef3(function Container2(props, ref) {
|
|
1131
|
+
return /* @__PURE__ */ React11.createElement(ContainerRoot, { ref, ...props });
|
|
1132
|
+
});
|
|
1133
|
+
Container.displayName = "Container";
|
|
1134
|
+
|
|
1135
|
+
// src/components/DataTable/DataTable.tsx
|
|
1136
|
+
import React13, {
|
|
1137
|
+
useCallback as useCallback3,
|
|
1138
|
+
useEffect,
|
|
1139
|
+
useMemo as useMemo3,
|
|
1140
|
+
useRef,
|
|
1141
|
+
useState as useState3
|
|
1142
|
+
} from "react";
|
|
1143
|
+
import { styled as styled3, LinearProgress } from "@mui/joy";
|
|
1144
|
+
import PreviousIcon from "@mui/icons-material/esm/ChevronLeft.js";
|
|
1145
|
+
import NextIcon from "@mui/icons-material/esm/ChevronRight.js";
|
|
1146
|
+
|
|
1147
|
+
// src/components/Sheet/Sheet.tsx
|
|
1148
|
+
import { Sheet as JoySheet } from "@mui/joy";
|
|
1149
|
+
import { motion as motion13 } from "framer-motion";
|
|
1150
|
+
var MotionSheet = motion13(JoySheet);
|
|
1151
|
+
var Sheet = MotionSheet;
|
|
1152
|
+
Sheet.displayName = "Sheet";
|
|
1153
|
+
|
|
1154
|
+
// src/components/Sheet/index.ts
|
|
1155
|
+
var Sheet_default = Sheet;
|
|
1156
|
+
|
|
1157
|
+
// src/components/Table/Table.tsx
|
|
1158
|
+
import React12 from "react";
|
|
1159
|
+
import { Table as JoyTable } from "@mui/joy";
|
|
1160
|
+
var Table = (props) => {
|
|
1161
|
+
const { children, ...inheritProps } = props;
|
|
1162
|
+
return /* @__PURE__ */ React12.createElement(JoyTable, { ...inheritProps }, children);
|
|
1163
|
+
};
|
|
1164
|
+
Table.displayName = "Table";
|
|
1165
|
+
function TableHead(props) {
|
|
1166
|
+
const {
|
|
1167
|
+
headCells,
|
|
1168
|
+
showCheckbox,
|
|
1169
|
+
onCheckboxChange,
|
|
1170
|
+
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
1171
|
+
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
1172
|
+
} = props;
|
|
1173
|
+
return /* @__PURE__ */ React12.createElement("thead", null, /* @__PURE__ */ React12.createElement("tr", null, showCheckbox && /* @__PURE__ */ React12.createElement(
|
|
1174
|
+
"th",
|
|
1175
|
+
{
|
|
1176
|
+
style: {
|
|
1177
|
+
width: "40px",
|
|
1178
|
+
textAlign: "center"
|
|
1179
|
+
}
|
|
1180
|
+
},
|
|
1181
|
+
/* @__PURE__ */ React12.createElement(RenderCheckbox, { onChange: onCheckboxChange, ...checkboxProps })
|
|
1182
|
+
), headCells.map((headCell) => /* @__PURE__ */ React12.createElement(
|
|
1183
|
+
"th",
|
|
1184
|
+
{
|
|
1185
|
+
key: headCell.label,
|
|
1186
|
+
style: {
|
|
1187
|
+
width: headCell.width,
|
|
1188
|
+
minWidth: headCell.minWidth,
|
|
1189
|
+
maxWidth: headCell.maxWidth,
|
|
1190
|
+
textAlign: headCell.numeric ? "right" : "left"
|
|
1191
|
+
}
|
|
1192
|
+
},
|
|
1193
|
+
headCell.label
|
|
1194
|
+
))));
|
|
1195
|
+
}
|
|
1196
|
+
TableHead.displayName = "TableHead";
|
|
1197
|
+
function TableBody(props) {
|
|
1198
|
+
const {
|
|
1199
|
+
rows,
|
|
1200
|
+
cellOrder,
|
|
1201
|
+
rowOptions,
|
|
1202
|
+
showCheckbox,
|
|
1203
|
+
onCheckboxChange,
|
|
1204
|
+
slots: { checkbox: RenderCheckbox = Checkbox_default } = {},
|
|
1205
|
+
slotProps: { checkbox: checkboxProps = {} } = {}
|
|
1206
|
+
} = props;
|
|
1207
|
+
return /* @__PURE__ */ React12.createElement("tbody", null, rows.map((row, rowIndex) => /* @__PURE__ */ React12.createElement("tr", { key: rowIndex }, showCheckbox && /* @__PURE__ */ React12.createElement(
|
|
1208
|
+
"td",
|
|
1209
|
+
{
|
|
1210
|
+
style: {
|
|
1211
|
+
textAlign: "center"
|
|
1212
|
+
}
|
|
1213
|
+
},
|
|
1214
|
+
/* @__PURE__ */ React12.createElement(
|
|
1215
|
+
RenderCheckbox,
|
|
1216
|
+
{
|
|
1217
|
+
onChange: (event) => onCheckboxChange?.(event, rowIndex),
|
|
1218
|
+
...checkboxProps
|
|
1219
|
+
}
|
|
1220
|
+
)
|
|
1221
|
+
), cellOrder.map((cellKey) => /* @__PURE__ */ React12.createElement(
|
|
1222
|
+
"td",
|
|
1223
|
+
{
|
|
1224
|
+
key: cellKey,
|
|
1225
|
+
style: {
|
|
1226
|
+
textAlign: rowOptions?.[cellKey]?.numeric ? "right" : "left"
|
|
1227
|
+
}
|
|
1228
|
+
},
|
|
1229
|
+
row[cellKey]
|
|
1230
|
+
)))));
|
|
1231
|
+
}
|
|
1232
|
+
TableBody.displayName = "TableBody";
|
|
1233
|
+
|
|
1234
|
+
// src/components/Stack/Stack.tsx
|
|
1235
|
+
import { Stack as JoyStack } from "@mui/joy";
|
|
1236
|
+
import { motion as motion14 } from "framer-motion";
|
|
1237
|
+
var MotionStack = motion14(JoyStack);
|
|
1238
|
+
var Stack = MotionStack;
|
|
1239
|
+
Stack.displayName = "Stack";
|
|
1240
|
+
|
|
1241
|
+
// src/components/Stack/index.ts
|
|
1242
|
+
var Stack_default = Stack;
|
|
1243
|
+
|
|
1244
|
+
// src/components/DataTable/DataTable.tsx
|
|
1245
|
+
var OverlayWrapper = styled3("tr", {
|
|
1246
|
+
name: "DataTable",
|
|
1247
|
+
slot: "overlayWrapper"
|
|
1248
|
+
})({
|
|
1249
|
+
position: "sticky",
|
|
1250
|
+
top: `calc(var(--unstable_TableCell-height, 32px))`,
|
|
1251
|
+
left: 0,
|
|
1252
|
+
right: 0,
|
|
1253
|
+
zIndex: 1,
|
|
1254
|
+
"& > td": {
|
|
1255
|
+
height: 0,
|
|
1256
|
+
padding: 0,
|
|
1257
|
+
border: "none !important"
|
|
1258
|
+
}
|
|
1259
|
+
});
|
|
1260
|
+
var numberFormatter = (value) => "Intl" in window ? new Intl.NumberFormat().format(value) : value;
|
|
1261
|
+
function TablePagination(props) {
|
|
1262
|
+
const {
|
|
1263
|
+
paginationModel: { page, pageSize },
|
|
1264
|
+
rowCount,
|
|
1265
|
+
onPageChange
|
|
1266
|
+
} = props;
|
|
1267
|
+
const firstPage = 1;
|
|
1268
|
+
const lastPage = Math.ceil(rowCount / pageSize);
|
|
1269
|
+
const beforePages = [page - 2, page - 1].filter((p) => p > 1);
|
|
1270
|
+
const afterPages = [page + 1, page + 2].filter((p) => p <= lastPage - 1);
|
|
1271
|
+
const isMoreAfterPages = lastPage > 1 && page < lastPage - 3;
|
|
1272
|
+
const isMoreBeforePages = lastPage > 1 && page > 4;
|
|
1273
|
+
return /* @__PURE__ */ React13.createElement(
|
|
1274
|
+
Stack_default,
|
|
1275
|
+
{
|
|
1276
|
+
direction: "row",
|
|
1277
|
+
spacing: 1,
|
|
1278
|
+
sx: {
|
|
1279
|
+
pt: 1,
|
|
1280
|
+
pb: 1
|
|
1281
|
+
},
|
|
1282
|
+
justifyContent: "end",
|
|
1283
|
+
alignItems: "center"
|
|
1284
|
+
},
|
|
1285
|
+
/* @__PURE__ */ React13.createElement(Stack_default, { direction: "row", spacing: 0.5, alignItems: "center" }, /* @__PURE__ */ React13.createElement(
|
|
1286
|
+
IconButton_default,
|
|
1287
|
+
{
|
|
1288
|
+
size: "sm",
|
|
1289
|
+
variant: "plain",
|
|
1290
|
+
color: "neutral",
|
|
1291
|
+
onClick: () => onPageChange(page - 1),
|
|
1292
|
+
disabled: page === firstPage,
|
|
1293
|
+
"aria-label": "Previous page"
|
|
1294
|
+
},
|
|
1295
|
+
/* @__PURE__ */ React13.createElement(PreviousIcon, null)
|
|
1296
|
+
), page !== firstPage && /* @__PURE__ */ React13.createElement(
|
|
1297
|
+
Button_default,
|
|
1298
|
+
{
|
|
1299
|
+
size: "sm",
|
|
1300
|
+
variant: "plain",
|
|
1301
|
+
color: "neutral",
|
|
1302
|
+
onClick: () => onPageChange(firstPage)
|
|
1303
|
+
},
|
|
1304
|
+
firstPage
|
|
1305
|
+
), isMoreBeforePages && /* @__PURE__ */ React13.createElement(
|
|
1306
|
+
Button_default,
|
|
1307
|
+
{
|
|
1308
|
+
size: "sm",
|
|
1309
|
+
variant: "plain",
|
|
1310
|
+
color: "neutral",
|
|
1311
|
+
onClick: () => onPageChange(page - 3)
|
|
1312
|
+
},
|
|
1313
|
+
"..."
|
|
1314
|
+
), beforePages.map((p) => /* @__PURE__ */ React13.createElement(
|
|
1315
|
+
Button_default,
|
|
1316
|
+
{
|
|
1317
|
+
key: p,
|
|
1318
|
+
size: "sm",
|
|
1319
|
+
variant: "plain",
|
|
1320
|
+
color: "neutral",
|
|
1321
|
+
onClick: () => onPageChange(p)
|
|
1322
|
+
},
|
|
1323
|
+
p
|
|
1324
|
+
)), /* @__PURE__ */ React13.createElement(Button_default, { variant: "soft", size: "sm" }, page), afterPages.map((p) => /* @__PURE__ */ React13.createElement(
|
|
1325
|
+
Button_default,
|
|
1326
|
+
{
|
|
1327
|
+
key: p,
|
|
1328
|
+
size: "sm",
|
|
1329
|
+
variant: "plain",
|
|
1330
|
+
color: "neutral",
|
|
1331
|
+
onClick: () => onPageChange(p)
|
|
1332
|
+
},
|
|
1333
|
+
p
|
|
1334
|
+
)), isMoreAfterPages && /* @__PURE__ */ React13.createElement(
|
|
1335
|
+
Button_default,
|
|
1336
|
+
{
|
|
1337
|
+
size: "sm",
|
|
1338
|
+
variant: "plain",
|
|
1339
|
+
color: "neutral",
|
|
1340
|
+
onClick: () => onPageChange(page + 3)
|
|
1341
|
+
},
|
|
1342
|
+
"..."
|
|
1343
|
+
), page !== lastPage && /* @__PURE__ */ React13.createElement(
|
|
1344
|
+
Button_default,
|
|
1345
|
+
{
|
|
1346
|
+
size: "sm",
|
|
1347
|
+
variant: "plain",
|
|
1348
|
+
color: "neutral",
|
|
1349
|
+
onClick: () => onPageChange(lastPage)
|
|
1350
|
+
},
|
|
1351
|
+
lastPage
|
|
1352
|
+
), /* @__PURE__ */ React13.createElement(
|
|
1353
|
+
IconButton_default,
|
|
1354
|
+
{
|
|
1355
|
+
size: "sm",
|
|
1356
|
+
variant: "plain",
|
|
1357
|
+
color: "neutral",
|
|
1358
|
+
onClick: () => onPageChange(page + 1),
|
|
1359
|
+
disabled: page === lastPage,
|
|
1360
|
+
"aria-label": "Next page"
|
|
1361
|
+
},
|
|
1362
|
+
/* @__PURE__ */ React13.createElement(NextIcon, null)
|
|
1363
|
+
))
|
|
1364
|
+
);
|
|
1365
|
+
}
|
|
1366
|
+
var Resizer = (ref) => /* @__PURE__ */ React13.createElement(
|
|
1367
|
+
Box_default,
|
|
1368
|
+
{
|
|
1369
|
+
sx: {
|
|
1370
|
+
position: "absolute",
|
|
1371
|
+
top: 0,
|
|
1372
|
+
right: 0,
|
|
1373
|
+
bottom: 0,
|
|
1374
|
+
width: "4px",
|
|
1375
|
+
cursor: "col-resize"
|
|
1376
|
+
},
|
|
1377
|
+
onMouseDown: (e) => {
|
|
1378
|
+
const initialX = e.clientX;
|
|
1379
|
+
const initialWidth = ref.current?.getBoundingClientRect().width;
|
|
1380
|
+
const onMouseMove = (e2) => {
|
|
1381
|
+
if (initialWidth && initialX) {
|
|
1382
|
+
ref.current.style.width = `${initialWidth + (e2.clientX - initialX)}px`;
|
|
1383
|
+
}
|
|
1384
|
+
};
|
|
1385
|
+
const onMouseUp = () => {
|
|
1386
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
1387
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
1388
|
+
};
|
|
1389
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
1390
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
);
|
|
1394
|
+
var HeadCell = (props) => {
|
|
1395
|
+
const ref = useRef(null);
|
|
1396
|
+
const style = {
|
|
1397
|
+
width: props.width,
|
|
1398
|
+
minWidth: props.minWidth ?? "50px",
|
|
1399
|
+
maxWidth: props.maxWidth,
|
|
1400
|
+
textAlign: props.type === "number" ? "end" : "start",
|
|
1401
|
+
position: props.stickyHeader ? void 0 : "relative"
|
|
1402
|
+
};
|
|
1403
|
+
const resizer = props.resizable ?? true ? Resizer(ref) : null;
|
|
1404
|
+
return /* @__PURE__ */ React13.createElement("th", { ref, key: props.field, style }, props.headerName ?? props.field, resizer);
|
|
1405
|
+
};
|
|
1406
|
+
function useDataTableRenderer({
|
|
1407
|
+
rows,
|
|
1408
|
+
columns,
|
|
1409
|
+
rowCount: totalRowsProp,
|
|
1410
|
+
paginationMode,
|
|
1411
|
+
paginationModel,
|
|
1412
|
+
onPaginationModelChange,
|
|
1413
|
+
selectionModel = [],
|
|
1414
|
+
onSelectionModelChange,
|
|
1415
|
+
getId: _getId,
|
|
1416
|
+
isTotalSelected: _isTotalSelected
|
|
1417
|
+
}) {
|
|
1418
|
+
const [page, setPage] = useState3(paginationModel?.page || 1);
|
|
1419
|
+
const pageSize = paginationModel?.pageSize || 20;
|
|
1420
|
+
const getId = useCallback3(
|
|
1421
|
+
(row, index) => _getId?.(row) ?? row?.id ?? `${(index || 0) + (page - 1) * pageSize}`,
|
|
1422
|
+
[_getId ?? page, pageSize]
|
|
1423
|
+
);
|
|
1424
|
+
const selectedModelSet = useMemo3(
|
|
1425
|
+
() => new Set(selectionModel),
|
|
1426
|
+
[selectionModel]
|
|
1427
|
+
);
|
|
1428
|
+
const dataInPage = useMemo3(
|
|
1429
|
+
() => paginationMode === "server" ? rows : rows.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize),
|
|
1430
|
+
[rows, page, pageSize, paginationMode]
|
|
1431
|
+
);
|
|
1432
|
+
const isAllSelected = useMemo3(
|
|
1433
|
+
() => dataInPage.length > 0 && dataInPage.every((row, i) => selectedModelSet.has(getId(row, i))),
|
|
1434
|
+
[dataInPage, selectedModelSet, page, pageSize, getId]
|
|
1435
|
+
);
|
|
1436
|
+
const rowCount = totalRowsProp || rows.length;
|
|
1437
|
+
const isTotalSelected = useMemo3(
|
|
1438
|
+
() => _isTotalSelected ?? (rowCount > 0 && selectionModel.length === rowCount),
|
|
1439
|
+
[_isTotalSelected, selectionModel, rowCount]
|
|
1440
|
+
);
|
|
1441
|
+
const handlePageChange = useCallback3(
|
|
1442
|
+
(newPage) => {
|
|
1443
|
+
setPage(newPage);
|
|
1444
|
+
onPaginationModelChange?.({ page: newPage, pageSize });
|
|
1445
|
+
},
|
|
1446
|
+
[onPaginationModelChange]
|
|
1447
|
+
);
|
|
1448
|
+
useEffect(() => {
|
|
1449
|
+
handlePageChange(1);
|
|
1450
|
+
}, [rowCount]);
|
|
1451
|
+
useEffect(() => {
|
|
1452
|
+
if (page > Math.ceil(rowCount / pageSize)) {
|
|
1453
|
+
handlePageChange(Math.ceil(rowCount / pageSize));
|
|
1454
|
+
}
|
|
1455
|
+
}, [rowCount, pageSize]);
|
|
1456
|
+
useEffect(() => {
|
|
1457
|
+
onSelectionModelChange?.([]);
|
|
1458
|
+
}, [page]);
|
|
1459
|
+
return {
|
|
1460
|
+
rowCount,
|
|
1461
|
+
page,
|
|
1462
|
+
pageSize,
|
|
1463
|
+
onPaginationModelChange: handlePageChange,
|
|
1464
|
+
getId,
|
|
1465
|
+
HeadCell,
|
|
1466
|
+
dataInPage,
|
|
1467
|
+
isAllSelected,
|
|
1468
|
+
// all rows are selected on this page
|
|
1469
|
+
isTotalSelected,
|
|
1470
|
+
isSelectedRow: useCallback3(
|
|
1471
|
+
(model) => selectedModelSet.has(model),
|
|
1472
|
+
[selectedModelSet]
|
|
1473
|
+
),
|
|
1474
|
+
onAllCheckboxChange: useCallback3(() => {
|
|
1475
|
+
onSelectionModelChange?.(isAllSelected ? [] : dataInPage.map(getId));
|
|
1476
|
+
}, [isAllSelected, dataInPage, onSelectionModelChange]),
|
|
1477
|
+
onCheckboxChange: useCallback3(
|
|
1478
|
+
(event, selectedModel) => {
|
|
1479
|
+
if (selectedModelSet.has(selectedModel)) {
|
|
1480
|
+
const newSelectionModel = selectionModel.filter(
|
|
1481
|
+
(model) => model !== selectedModel
|
|
1482
|
+
);
|
|
1483
|
+
onSelectionModelChange?.(newSelectionModel);
|
|
1484
|
+
} else {
|
|
1485
|
+
const newSelectionModel = [...selectionModel, selectedModel];
|
|
1486
|
+
onSelectionModelChange?.(newSelectionModel);
|
|
1487
|
+
}
|
|
1488
|
+
},
|
|
1489
|
+
[selectionModel, onSelectionModelChange]
|
|
1490
|
+
),
|
|
1491
|
+
columns: useMemo3(
|
|
1492
|
+
() => columns || // fallback
|
|
1493
|
+
Object.keys(rows[0] || {}).map((key) => ({
|
|
1494
|
+
field: key
|
|
1495
|
+
})),
|
|
1496
|
+
[rows, columns]
|
|
1497
|
+
),
|
|
1498
|
+
onTotalSelect: useCallback3(() => {
|
|
1499
|
+
onSelectionModelChange?.(
|
|
1500
|
+
isTotalSelected ? [] : rows.map(getId),
|
|
1501
|
+
!isTotalSelected
|
|
1502
|
+
);
|
|
1503
|
+
}, [isTotalSelected, rows, onSelectionModelChange])
|
|
1504
|
+
};
|
|
1505
|
+
}
|
|
1506
|
+
function DataTable(props) {
|
|
1507
|
+
const {
|
|
1508
|
+
rows,
|
|
1509
|
+
checkboxSelection,
|
|
1510
|
+
selectionModel,
|
|
1511
|
+
onSelectionModelChange,
|
|
1512
|
+
rowCount: _,
|
|
1513
|
+
// rowCount is used in useDataTableRenderer
|
|
1514
|
+
columns: __,
|
|
1515
|
+
// columns is used in useDataTableRenderer
|
|
1516
|
+
onPaginationModelChange: ___,
|
|
1517
|
+
// onPaginationModelChange is used in useDataTableRenderer
|
|
1518
|
+
paginationMode: ____,
|
|
1519
|
+
// paginationMode is used in useDataTableRenderer
|
|
1520
|
+
paginationModel,
|
|
1521
|
+
loading,
|
|
1522
|
+
slots: {
|
|
1523
|
+
checkbox: RenderCheckbox = Checkbox_default,
|
|
1524
|
+
toolbar: Toolbar,
|
|
1525
|
+
footer: Footer,
|
|
1526
|
+
loadingOverlay: LoadingOverlay = () => /* @__PURE__ */ React13.createElement(LinearProgress, { value: 8, variant: "plain" })
|
|
1527
|
+
} = {},
|
|
1528
|
+
slotProps: {
|
|
1529
|
+
checkbox: checkboxProps = {},
|
|
1530
|
+
toolbar: toolbarProps,
|
|
1531
|
+
background: backgroundProps = {}
|
|
1532
|
+
} = {},
|
|
1533
|
+
...innerProps
|
|
1534
|
+
} = props;
|
|
1535
|
+
const {
|
|
1536
|
+
columns,
|
|
1537
|
+
isAllSelected,
|
|
1538
|
+
isSelectedRow,
|
|
1539
|
+
onAllCheckboxChange,
|
|
1540
|
+
onCheckboxChange,
|
|
1541
|
+
getId,
|
|
1542
|
+
rowCount,
|
|
1543
|
+
page,
|
|
1544
|
+
pageSize,
|
|
1545
|
+
onPaginationModelChange,
|
|
1546
|
+
dataInPage,
|
|
1547
|
+
isTotalSelected,
|
|
1548
|
+
onTotalSelect,
|
|
1549
|
+
HeadCell: HeadCell2
|
|
1550
|
+
} = useDataTableRenderer(props);
|
|
1551
|
+
return /* @__PURE__ */ React13.createElement(Box_default, null, /* @__PURE__ */ React13.createElement(
|
|
1552
|
+
Stack_default,
|
|
1553
|
+
{
|
|
1554
|
+
direction: "row",
|
|
1555
|
+
sx: {
|
|
1556
|
+
pt: 1,
|
|
1557
|
+
pb: 1
|
|
1558
|
+
},
|
|
1559
|
+
justifyContent: "space-between",
|
|
1560
|
+
alignItems: "center"
|
|
1561
|
+
},
|
|
1562
|
+
!!checkboxSelection && /* @__PURE__ */ React13.createElement(Stack_default, { direction: "row", spacing: 1 }, !isAllSelected && /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs" }, numberFormatter(selectionModel?.length || 0), " items selected"), isAllSelected && !isTotalSelected && /* @__PURE__ */ React13.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(selectionModel?.length || 0), " items on this page are selected."), /* @__PURE__ */ React13.createElement(Button_default, { size: "sm", variant: "plain", onClick: onTotalSelect }, "Select all ", numberFormatter(rowCount ?? rows.length), " items")), isTotalSelected && /* @__PURE__ */ React13.createElement(Stack_default, { direction: "row", spacing: 1, alignItems: "center" }, /* @__PURE__ */ React13.createElement(Typography_default, { level: "body-xs" }, "All ", numberFormatter(rowCount ?? rows.length), " items are selected."), /* @__PURE__ */ React13.createElement(
|
|
1563
|
+
Button_default,
|
|
1564
|
+
{
|
|
1565
|
+
size: "sm",
|
|
1566
|
+
variant: "plain",
|
|
1567
|
+
color: "danger",
|
|
1568
|
+
onClick: onTotalSelect
|
|
1569
|
+
},
|
|
1570
|
+
"Cancel"
|
|
1571
|
+
))),
|
|
1572
|
+
Toolbar && /* @__PURE__ */ React13.createElement(Toolbar, { ...toolbarProps || {} })
|
|
1573
|
+
), /* @__PURE__ */ React13.createElement(
|
|
1574
|
+
Sheet_default,
|
|
1575
|
+
{
|
|
1576
|
+
variant: "outlined",
|
|
1577
|
+
sx: {
|
|
1578
|
+
overflow: "auto",
|
|
1579
|
+
width: "100%",
|
|
1580
|
+
boxShadow: "sm",
|
|
1581
|
+
borderRadius: "sm"
|
|
1582
|
+
},
|
|
1583
|
+
...backgroundProps
|
|
1584
|
+
},
|
|
1585
|
+
/* @__PURE__ */ React13.createElement(Table, { ...innerProps }, /* @__PURE__ */ React13.createElement("thead", null, /* @__PURE__ */ React13.createElement("tr", null, checkboxSelection && /* @__PURE__ */ React13.createElement(
|
|
1586
|
+
"th",
|
|
1587
|
+
{
|
|
1588
|
+
style: {
|
|
1589
|
+
width: "40px",
|
|
1590
|
+
textAlign: "center"
|
|
1591
|
+
}
|
|
1592
|
+
},
|
|
1593
|
+
/* @__PURE__ */ React13.createElement(
|
|
1594
|
+
RenderCheckbox,
|
|
1595
|
+
{
|
|
1596
|
+
onChange: onAllCheckboxChange,
|
|
1597
|
+
checked: isAllSelected,
|
|
1598
|
+
indeterminate: (selectionModel || []).length > 0 && !isAllSelected,
|
|
1599
|
+
...checkboxProps
|
|
1600
|
+
}
|
|
1601
|
+
)
|
|
1602
|
+
), columns.map((c) => /* @__PURE__ */ React13.createElement(
|
|
1603
|
+
HeadCell2,
|
|
1604
|
+
{
|
|
1605
|
+
key: c.field,
|
|
1606
|
+
stickyHeader: props.stickyHeader,
|
|
1607
|
+
...c
|
|
1608
|
+
}
|
|
1609
|
+
)))), /* @__PURE__ */ React13.createElement("tbody", null, /* @__PURE__ */ React13.createElement(OverlayWrapper, null, !!loading && /* @__PURE__ */ React13.createElement("td", null, /* @__PURE__ */ React13.createElement(
|
|
1610
|
+
Box_default,
|
|
1611
|
+
{
|
|
1612
|
+
sx: {
|
|
1613
|
+
position: "absolute",
|
|
1614
|
+
top: 0,
|
|
1615
|
+
left: 0,
|
|
1616
|
+
right: 0
|
|
1617
|
+
}
|
|
1618
|
+
},
|
|
1619
|
+
/* @__PURE__ */ React13.createElement(LoadingOverlay, null)
|
|
1620
|
+
))), /* @__PURE__ */ React13.createElement(OverlayWrapper, null), dataInPage.map((row, rowIndex) => {
|
|
1621
|
+
const rowId = getId(row, rowIndex);
|
|
1622
|
+
return /* @__PURE__ */ React13.createElement(
|
|
1623
|
+
"tr",
|
|
1624
|
+
{
|
|
1625
|
+
key: rowId,
|
|
1626
|
+
role: checkboxSelection ? "checkbox" : void 0,
|
|
1627
|
+
tabIndex: checkboxSelection ? -1 : void 0,
|
|
1628
|
+
onClick: checkboxSelection ? (e) => onCheckboxChange(e, rowId) : void 0,
|
|
1629
|
+
"aria-checked": checkboxSelection ? isSelectedRow(rowId) : void 0
|
|
1630
|
+
},
|
|
1631
|
+
checkboxSelection && /* @__PURE__ */ React13.createElement(
|
|
1632
|
+
"th",
|
|
1633
|
+
{
|
|
1634
|
+
scope: "row",
|
|
1635
|
+
style: {
|
|
1636
|
+
textAlign: "center"
|
|
1637
|
+
}
|
|
1638
|
+
},
|
|
1639
|
+
/* @__PURE__ */ React13.createElement(
|
|
1640
|
+
RenderCheckbox,
|
|
1641
|
+
{
|
|
1642
|
+
onChange: (e) => onCheckboxChange(e, rowId),
|
|
1643
|
+
checked: isSelectedRow(rowId),
|
|
1644
|
+
...checkboxProps
|
|
1645
|
+
}
|
|
1646
|
+
)
|
|
1647
|
+
),
|
|
1648
|
+
columns.map((column) => /* @__PURE__ */ React13.createElement(
|
|
1649
|
+
"td",
|
|
1650
|
+
{
|
|
1651
|
+
key: column.field,
|
|
1652
|
+
style: {
|
|
1653
|
+
textAlign: column.type === "number" ? "end" : "start"
|
|
1654
|
+
}
|
|
1655
|
+
},
|
|
1656
|
+
column.renderCell?.({
|
|
1657
|
+
row,
|
|
1658
|
+
value: row[column.field],
|
|
1659
|
+
id: rowId
|
|
1660
|
+
}) ?? row[column.field]
|
|
1661
|
+
))
|
|
1662
|
+
);
|
|
1663
|
+
})), Footer && /* @__PURE__ */ React13.createElement(Footer, null))
|
|
1664
|
+
), /* @__PURE__ */ React13.createElement(
|
|
1665
|
+
TablePagination,
|
|
1666
|
+
{
|
|
1667
|
+
paginationModel: useMemo3(() => ({ page, pageSize }), [page, pageSize]),
|
|
1668
|
+
rowCount,
|
|
1669
|
+
onPageChange: onPaginationModelChange
|
|
1670
|
+
}
|
|
1671
|
+
));
|
|
1672
|
+
}
|
|
1673
|
+
DataTable.displayName = "DataTable";
|
|
1674
|
+
|
|
1675
|
+
// src/components/DatePicker/DatePicker.tsx
|
|
1676
|
+
import React15, { forwardRef as forwardRef4, useCallback as useCallback4, useState as useState4 } from "react";
|
|
1677
|
+
import { IMaskInput, IMask } from "react-imask";
|
|
1678
|
+
import CalendarTodayIcon from "@mui/icons-material/esm/CalendarToday.js";
|
|
1679
|
+
import { styled as styled5 } from "@mui/joy";
|
|
1680
|
+
import { FocusTrap, ClickAwayListener, Popper } from "@mui/base";
|
|
1681
|
+
|
|
1682
|
+
// src/components/Input/Input.tsx
|
|
1683
|
+
import React14 from "react";
|
|
1684
|
+
import { Input as JoyInput } from "@mui/joy";
|
|
1685
|
+
import { motion as motion15 } from "framer-motion";
|
|
1686
|
+
var MotionInput = motion15(JoyInput);
|
|
1687
|
+
var Input = (props) => {
|
|
1688
|
+
const {
|
|
1689
|
+
label,
|
|
1690
|
+
helperText,
|
|
1691
|
+
error,
|
|
1692
|
+
style,
|
|
1693
|
+
size,
|
|
1694
|
+
color,
|
|
1695
|
+
disabled,
|
|
1696
|
+
required,
|
|
1697
|
+
...innerProps
|
|
1698
|
+
} = props;
|
|
1699
|
+
if (label) {
|
|
1700
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1701
|
+
FormControl_default,
|
|
1702
|
+
{
|
|
1703
|
+
required,
|
|
1704
|
+
color,
|
|
1705
|
+
size,
|
|
1706
|
+
error,
|
|
1707
|
+
disabled
|
|
1708
|
+
},
|
|
1709
|
+
/* @__PURE__ */ React14.createElement(FormLabel_default, null, label),
|
|
1710
|
+
/* @__PURE__ */ React14.createElement(MotionInput, { ...innerProps }),
|
|
1711
|
+
helperText && /* @__PURE__ */ React14.createElement(FormHelperText_default, null, helperText)
|
|
1712
|
+
);
|
|
1713
|
+
}
|
|
1714
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1715
|
+
MotionInput,
|
|
1716
|
+
{
|
|
1717
|
+
required,
|
|
1718
|
+
color,
|
|
1719
|
+
size,
|
|
1720
|
+
disabled,
|
|
1721
|
+
...innerProps
|
|
1722
|
+
}
|
|
1723
|
+
);
|
|
1724
|
+
};
|
|
1725
|
+
Input.displayName = "Input";
|
|
1726
|
+
|
|
1727
|
+
// src/components/Input/index.ts
|
|
1728
|
+
var Input_default = Input;
|
|
1729
|
+
|
|
1730
|
+
// src/components/DialogActions/DialogActions.tsx
|
|
1731
|
+
import { DialogActions as JoyDialogActions, styled as styled4 } from "@mui/joy";
|
|
1732
|
+
import { motion as motion16 } from "framer-motion";
|
|
1733
|
+
var MotionDialogActions = motion16(JoyDialogActions);
|
|
1734
|
+
var StyledDialogActions = styled4(MotionDialogActions)(({ theme }) => ({
|
|
1735
|
+
padding: theme.spacing(1),
|
|
1736
|
+
gap: theme.spacing(1),
|
|
1737
|
+
flexDirection: "row",
|
|
1738
|
+
justifyContent: "flex-end"
|
|
1739
|
+
}));
|
|
1740
|
+
var DialogActions = StyledDialogActions;
|
|
1741
|
+
DialogActions.displayName = "DialogActions";
|
|
1742
|
+
|
|
1743
|
+
// src/components/DialogActions/index.ts
|
|
1744
|
+
var DialogActions_default = DialogActions;
|
|
1745
|
+
|
|
1746
|
+
// src/components/DatePicker/DatePicker.tsx
|
|
1747
|
+
var StyledPopper = styled5(Popper, {
|
|
1748
|
+
name: "DatePicker",
|
|
1749
|
+
slot: "popper"
|
|
1750
|
+
})(({ theme }) => ({
|
|
1751
|
+
zIndex: theme.zIndex.tooltip
|
|
1752
|
+
}));
|
|
1753
|
+
var CalendarSheet = styled5(Sheet_default, {
|
|
1754
|
+
name: "DatePicker",
|
|
1755
|
+
slot: "sheet",
|
|
1756
|
+
overridesResolver: (props, styles) => styles.root
|
|
1757
|
+
})(({ theme }) => ({
|
|
1758
|
+
width: "264px",
|
|
1759
|
+
boxShadow: theme.shadow.md,
|
|
1760
|
+
borderRadius: theme.radius.md
|
|
1761
|
+
}));
|
|
1762
|
+
var formatValueString = (date) => {
|
|
1763
|
+
let day = `${date.getDate()}`;
|
|
1764
|
+
let month = `${date.getMonth() + 1}`;
|
|
1765
|
+
const year = date.getFullYear();
|
|
1766
|
+
if (Number(day) < 10)
|
|
1767
|
+
day = "0" + day;
|
|
1768
|
+
if (Number(month) < 10)
|
|
1769
|
+
month = "0" + month;
|
|
1770
|
+
return [year, month, day].join("/");
|
|
1771
|
+
};
|
|
1772
|
+
var TextMaskAdapter = React15.forwardRef(
|
|
1773
|
+
function TextMaskAdapter2(props, ref) {
|
|
1774
|
+
const { onChange, ...other } = props;
|
|
1775
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1776
|
+
IMaskInput,
|
|
1777
|
+
{
|
|
1778
|
+
...other,
|
|
1779
|
+
inputRef: ref,
|
|
1780
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
1781
|
+
mask: Date,
|
|
1782
|
+
pattern: "Y/`m/`d",
|
|
1783
|
+
blocks: {
|
|
1784
|
+
d: {
|
|
1785
|
+
mask: IMask.MaskedRange,
|
|
1786
|
+
from: 1,
|
|
1787
|
+
to: 31,
|
|
1788
|
+
maxLength: 2
|
|
1789
|
+
},
|
|
1790
|
+
m: {
|
|
1791
|
+
mask: IMask.MaskedRange,
|
|
1792
|
+
from: 1,
|
|
1793
|
+
to: 12,
|
|
1794
|
+
maxLength: 2
|
|
1795
|
+
},
|
|
1796
|
+
Y: {
|
|
1797
|
+
mask: IMask.MaskedRange,
|
|
1798
|
+
from: 1900,
|
|
1799
|
+
to: 9999
|
|
1800
|
+
}
|
|
1801
|
+
},
|
|
1802
|
+
format: formatValueString,
|
|
1803
|
+
parse: (str) => {
|
|
1804
|
+
const yearMonthDay = str.split("/");
|
|
1805
|
+
return new Date(
|
|
1806
|
+
Number(yearMonthDay[0]),
|
|
1807
|
+
Number(yearMonthDay[1]) - 1,
|
|
1808
|
+
Number(yearMonthDay[2])
|
|
1809
|
+
);
|
|
1810
|
+
},
|
|
1811
|
+
autofix: "pad",
|
|
1812
|
+
overwrite: true,
|
|
1813
|
+
placeholderChar: " "
|
|
1814
|
+
}
|
|
1815
|
+
);
|
|
1816
|
+
}
|
|
1817
|
+
);
|
|
1818
|
+
var DatePicker = forwardRef4(
|
|
1819
|
+
(props, ref) => {
|
|
1820
|
+
const {
|
|
1821
|
+
onChange,
|
|
1822
|
+
disabled,
|
|
1823
|
+
label,
|
|
1824
|
+
error,
|
|
1825
|
+
helperText,
|
|
1826
|
+
minDate,
|
|
1827
|
+
maxDate,
|
|
1828
|
+
disableFuture,
|
|
1829
|
+
disablePast,
|
|
1830
|
+
required
|
|
1831
|
+
} = props;
|
|
1832
|
+
const [value, setValue] = useState4(props.value || "");
|
|
1833
|
+
const [anchorEl, setAnchorEl] = useState4(null);
|
|
1834
|
+
const open = Boolean(anchorEl);
|
|
1835
|
+
const handleChange = useCallback4(
|
|
1836
|
+
(event) => {
|
|
1837
|
+
setValue(event.target.value);
|
|
1838
|
+
onChange?.(event);
|
|
1839
|
+
},
|
|
1840
|
+
[]
|
|
1841
|
+
);
|
|
1842
|
+
const handleCalendarToggle = useCallback4(
|
|
1843
|
+
(event) => {
|
|
1844
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
1845
|
+
},
|
|
1846
|
+
[anchorEl, setAnchorEl]
|
|
1847
|
+
);
|
|
1848
|
+
const picker = /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
|
|
1849
|
+
Input_default,
|
|
1850
|
+
{
|
|
1851
|
+
ref,
|
|
1852
|
+
size: "sm",
|
|
1853
|
+
value,
|
|
1854
|
+
onChange: handleChange,
|
|
1855
|
+
placeholder: "YYYY/MM/DD",
|
|
1856
|
+
disabled,
|
|
1857
|
+
required,
|
|
1858
|
+
slotProps: { input: { component: TextMaskAdapter } },
|
|
1859
|
+
sx: {
|
|
1860
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
1861
|
+
fontFamily: "monospace"
|
|
1862
|
+
},
|
|
1863
|
+
endDecorator: /* @__PURE__ */ React15.createElement(IconButton_default, { variant: "plain", onClick: handleCalendarToggle }, /* @__PURE__ */ React15.createElement(CalendarTodayIcon, null))
|
|
1864
|
+
}
|
|
1865
|
+
), open && /* @__PURE__ */ React15.createElement(ClickAwayListener, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React15.createElement(
|
|
1866
|
+
StyledPopper,
|
|
1867
|
+
{
|
|
1868
|
+
id: "date-picker-popper",
|
|
1869
|
+
open: true,
|
|
1870
|
+
anchorEl,
|
|
1871
|
+
placement: "bottom-end",
|
|
1872
|
+
modifiers: [
|
|
1873
|
+
{
|
|
1874
|
+
name: "offset",
|
|
1875
|
+
options: {
|
|
1876
|
+
offset: [4, 4]
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
]
|
|
1880
|
+
},
|
|
1881
|
+
/* @__PURE__ */ React15.createElement(FocusTrap, { open: true }, /* @__PURE__ */ React15.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React15.createElement(
|
|
1882
|
+
Calendar_default,
|
|
1883
|
+
{
|
|
1884
|
+
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
1885
|
+
onChange: ([date]) => {
|
|
1886
|
+
setValue(formatValueString(date));
|
|
1887
|
+
setAnchorEl(null);
|
|
1888
|
+
},
|
|
1889
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
1890
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
1891
|
+
disableFuture,
|
|
1892
|
+
disablePast
|
|
1893
|
+
}
|
|
1894
|
+
), /* @__PURE__ */ React15.createElement(
|
|
1895
|
+
DialogActions_default,
|
|
1896
|
+
{
|
|
1897
|
+
sx: {
|
|
1898
|
+
p: 1
|
|
1899
|
+
}
|
|
1900
|
+
},
|
|
1901
|
+
/* @__PURE__ */ React15.createElement(
|
|
1902
|
+
Button_default,
|
|
1903
|
+
{
|
|
1904
|
+
size: "sm",
|
|
1905
|
+
variant: "plain",
|
|
1906
|
+
color: "neutral",
|
|
1907
|
+
onClick: () => {
|
|
1908
|
+
setValue("");
|
|
1909
|
+
setAnchorEl(null);
|
|
1910
|
+
}
|
|
1911
|
+
},
|
|
1912
|
+
"Clear"
|
|
1913
|
+
)
|
|
1914
|
+
)))
|
|
1915
|
+
)));
|
|
1916
|
+
if (label) {
|
|
1917
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1918
|
+
FormControl_default,
|
|
1919
|
+
{
|
|
1920
|
+
required,
|
|
1921
|
+
disabled,
|
|
1922
|
+
error,
|
|
1923
|
+
size: "sm"
|
|
1924
|
+
},
|
|
1925
|
+
/* @__PURE__ */ React15.createElement(FormLabel_default, null, label),
|
|
1926
|
+
picker,
|
|
1927
|
+
helperText && /* @__PURE__ */ React15.createElement(FormHelperText_default, null, helperText)
|
|
1928
|
+
);
|
|
1929
|
+
}
|
|
1930
|
+
return picker;
|
|
1931
|
+
}
|
|
1932
|
+
);
|
|
1933
|
+
DatePicker.displayName = "DatePicker";
|
|
1934
|
+
|
|
1935
|
+
// src/components/DateRangePicker/DateRangePicker.tsx
|
|
1936
|
+
import React16, { forwardRef as forwardRef5, useCallback as useCallback5, useMemo as useMemo4, useState as useState5 } from "react";
|
|
1937
|
+
import { IMaskInput as IMaskInput2, IMask as IMask2 } from "react-imask";
|
|
1938
|
+
import CalendarTodayIcon2 from "@mui/icons-material/esm/CalendarToday.js";
|
|
1939
|
+
import { styled as styled6 } from "@mui/joy";
|
|
1940
|
+
import { FocusTrap as FocusTrap2, ClickAwayListener as ClickAwayListener2, Popper as Popper2 } from "@mui/base";
|
|
1941
|
+
var StyledPopper2 = styled6(Popper2, {
|
|
1942
|
+
name: "DateRangePicker",
|
|
1943
|
+
slot: "popper"
|
|
1944
|
+
})(({ theme }) => ({
|
|
1945
|
+
zIndex: theme.zIndex.tooltip
|
|
1946
|
+
}));
|
|
1947
|
+
var CalendarSheet2 = styled6(Sheet_default, {
|
|
1948
|
+
name: "DateRangePicker",
|
|
1949
|
+
slot: "sheet",
|
|
1950
|
+
overridesResolver: (props, styles) => styles.root
|
|
1951
|
+
})(({ theme }) => ({
|
|
1952
|
+
zIndex: theme.zIndex.tooltip,
|
|
1953
|
+
width: "264px",
|
|
1954
|
+
boxShadow: theme.shadow.md,
|
|
1955
|
+
borderRadius: theme.radius.md
|
|
1956
|
+
}));
|
|
1957
|
+
var formatValueString2 = ([date1, date2]) => {
|
|
1958
|
+
const getStr = (date) => {
|
|
1959
|
+
let day = `${date.getDate()}`;
|
|
1960
|
+
let month = `${date.getMonth() + 1}`;
|
|
1961
|
+
const year = date.getFullYear();
|
|
1962
|
+
if (Number(day) < 10)
|
|
1963
|
+
day = "0" + day;
|
|
1964
|
+
if (Number(month) < 10)
|
|
1965
|
+
month = "0" + month;
|
|
1966
|
+
return [year, month, day].join("/");
|
|
1967
|
+
};
|
|
1968
|
+
return [getStr(date1), date2 ? getStr(date2) : ""].join(" - ");
|
|
1969
|
+
};
|
|
1970
|
+
var parseDate = (str) => {
|
|
1971
|
+
const date1 = str.split(" - ")[0] || "";
|
|
1972
|
+
const date2 = str.split(" - ")[1] || "";
|
|
1973
|
+
const yearMonthDay1 = date1.split("/");
|
|
1974
|
+
const yearMonthDay2 = date2.split("/");
|
|
1975
|
+
return [
|
|
1976
|
+
new Date(
|
|
1977
|
+
Number(yearMonthDay1[0]),
|
|
1978
|
+
Number(yearMonthDay1[1]) - 1,
|
|
1979
|
+
Number(yearMonthDay1[2])
|
|
1980
|
+
),
|
|
1981
|
+
new Date(
|
|
1982
|
+
Number(yearMonthDay2[0]),
|
|
1983
|
+
Number(yearMonthDay2[1]) - 1,
|
|
1984
|
+
Number(yearMonthDay2[2])
|
|
1985
|
+
)
|
|
1986
|
+
];
|
|
1987
|
+
};
|
|
1988
|
+
var TextMaskAdapter3 = React16.forwardRef(
|
|
1989
|
+
function TextMaskAdapter4(props, ref) {
|
|
1990
|
+
const { onChange, ...other } = props;
|
|
1991
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1992
|
+
IMaskInput2,
|
|
1993
|
+
{
|
|
1994
|
+
...other,
|
|
1995
|
+
inputRef: ref,
|
|
1996
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
1997
|
+
mask: Date,
|
|
1998
|
+
pattern: "Y/`m/`d - Y/`m/`d",
|
|
1999
|
+
blocks: {
|
|
2000
|
+
d: {
|
|
2001
|
+
mask: IMask2.MaskedRange,
|
|
2002
|
+
from: 1,
|
|
2003
|
+
to: 31,
|
|
2004
|
+
maxLength: 2
|
|
2005
|
+
},
|
|
2006
|
+
m: {
|
|
2007
|
+
mask: IMask2.MaskedRange,
|
|
2008
|
+
from: 1,
|
|
2009
|
+
to: 12,
|
|
2010
|
+
maxLength: 2
|
|
2011
|
+
},
|
|
2012
|
+
Y: {
|
|
2013
|
+
mask: IMask2.MaskedRange,
|
|
2014
|
+
from: 1900,
|
|
2015
|
+
to: 9999
|
|
2016
|
+
}
|
|
2017
|
+
},
|
|
2018
|
+
format: formatValueString2,
|
|
2019
|
+
parse: parseDate,
|
|
2020
|
+
autofix: "pad",
|
|
2021
|
+
overwrite: true,
|
|
2022
|
+
placeholderChar: " "
|
|
2023
|
+
}
|
|
2024
|
+
);
|
|
2025
|
+
}
|
|
2026
|
+
);
|
|
2027
|
+
var DateRangePicker = forwardRef5(
|
|
2028
|
+
(props, ref) => {
|
|
2029
|
+
const {
|
|
2030
|
+
onChange,
|
|
2031
|
+
disabled,
|
|
2032
|
+
label,
|
|
2033
|
+
error,
|
|
2034
|
+
helperText,
|
|
2035
|
+
minDate,
|
|
2036
|
+
maxDate,
|
|
2037
|
+
disableFuture,
|
|
2038
|
+
disablePast,
|
|
2039
|
+
required
|
|
2040
|
+
} = props;
|
|
2041
|
+
const [value, setValue] = useState5(props.value || "");
|
|
2042
|
+
const [anchorEl, setAnchorEl] = useState5(null);
|
|
2043
|
+
const open = Boolean(anchorEl);
|
|
2044
|
+
const calendarValue = useMemo4(
|
|
2045
|
+
() => value ? parseDate(value) : void 0,
|
|
2046
|
+
[value]
|
|
2047
|
+
);
|
|
2048
|
+
const handleChange = useCallback5(
|
|
2049
|
+
(event) => {
|
|
2050
|
+
setValue(event.target.value);
|
|
2051
|
+
onChange?.(event);
|
|
2052
|
+
},
|
|
2053
|
+
[onChange]
|
|
2054
|
+
);
|
|
2055
|
+
const handleCalendarToggle = useCallback5(
|
|
2056
|
+
(event) => {
|
|
2057
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2058
|
+
},
|
|
2059
|
+
[anchorEl, setAnchorEl]
|
|
2060
|
+
);
|
|
2061
|
+
const handleCalendarChange = useCallback5(
|
|
2062
|
+
([date1, date2]) => {
|
|
2063
|
+
if (!date1 || !date2)
|
|
2064
|
+
return;
|
|
2065
|
+
setValue(formatValueString2([date1, date2]));
|
|
2066
|
+
setAnchorEl(null);
|
|
2067
|
+
},
|
|
2068
|
+
[setValue, setAnchorEl]
|
|
2069
|
+
);
|
|
2070
|
+
const picker = /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
|
|
2071
|
+
Input_default,
|
|
2072
|
+
{
|
|
2073
|
+
ref,
|
|
2074
|
+
size: "sm",
|
|
2075
|
+
value,
|
|
2076
|
+
onChange: handleChange,
|
|
2077
|
+
disabled,
|
|
2078
|
+
required,
|
|
2079
|
+
placeholder: "YYYY/MM/DD - YYYY/MM/DD",
|
|
2080
|
+
slotProps: { input: { component: TextMaskAdapter3 } },
|
|
2081
|
+
sx: {
|
|
2082
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
2083
|
+
fontFamily: "monospace"
|
|
2084
|
+
},
|
|
2085
|
+
endDecorator: /* @__PURE__ */ React16.createElement(IconButton_default, { variant: "plain", onClick: handleCalendarToggle }, /* @__PURE__ */ React16.createElement(CalendarTodayIcon2, null))
|
|
2086
|
+
}
|
|
2087
|
+
), open && /* @__PURE__ */ React16.createElement(ClickAwayListener2, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React16.createElement(
|
|
2088
|
+
StyledPopper2,
|
|
2089
|
+
{
|
|
2090
|
+
id: "date-range-picker-popper",
|
|
2091
|
+
open: true,
|
|
2092
|
+
anchorEl,
|
|
2093
|
+
placement: "bottom-end",
|
|
2094
|
+
modifiers: [
|
|
2095
|
+
{
|
|
2096
|
+
name: "offset",
|
|
2097
|
+
options: {
|
|
2098
|
+
offset: [4, 4]
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
]
|
|
2102
|
+
},
|
|
2103
|
+
/* @__PURE__ */ React16.createElement(FocusTrap2, { open: true }, /* @__PURE__ */ React16.createElement(CalendarSheet2, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React16.createElement(
|
|
2104
|
+
Calendar_default,
|
|
2105
|
+
{
|
|
2106
|
+
rangeSelection: true,
|
|
2107
|
+
defaultValue: calendarValue,
|
|
2108
|
+
onChange: handleCalendarChange,
|
|
2109
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
2110
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
2111
|
+
disableFuture,
|
|
2112
|
+
disablePast
|
|
2113
|
+
}
|
|
2114
|
+
), /* @__PURE__ */ React16.createElement(
|
|
2115
|
+
DialogActions_default,
|
|
2116
|
+
{
|
|
2117
|
+
sx: {
|
|
2118
|
+
p: 1
|
|
2119
|
+
}
|
|
2120
|
+
},
|
|
2121
|
+
/* @__PURE__ */ React16.createElement(
|
|
2122
|
+
Button_default,
|
|
2123
|
+
{
|
|
2124
|
+
size: "sm",
|
|
2125
|
+
variant: "plain",
|
|
2126
|
+
color: "neutral",
|
|
2127
|
+
onClick: () => {
|
|
2128
|
+
setValue("");
|
|
2129
|
+
setAnchorEl(null);
|
|
2130
|
+
}
|
|
2131
|
+
},
|
|
2132
|
+
"Clear"
|
|
2133
|
+
)
|
|
2134
|
+
)))
|
|
2135
|
+
)));
|
|
2136
|
+
if (label) {
|
|
2137
|
+
return /* @__PURE__ */ React16.createElement(FormControl_default, { required, disabled, error, size: "sm" }, /* @__PURE__ */ React16.createElement(FormLabel_default, null, label), picker, helperText && /* @__PURE__ */ React16.createElement(FormHelperText_default, null, helperText));
|
|
2138
|
+
}
|
|
2139
|
+
return picker;
|
|
2140
|
+
}
|
|
2141
|
+
);
|
|
2142
|
+
DateRangePicker.displayName = "DateRangePicker";
|
|
2143
|
+
|
|
2144
|
+
// src/components/DialogContent/DialogContent.tsx
|
|
2145
|
+
import { DialogContent as JoyDialogContent, styled as styled7 } from "@mui/joy";
|
|
2146
|
+
import { motion as motion17 } from "framer-motion";
|
|
2147
|
+
var MotionDialogContent = motion17(JoyDialogContent);
|
|
2148
|
+
var StyledDialogContent = styled7(MotionDialogContent)(({ theme }) => ({
|
|
2149
|
+
padding: theme.spacing(0, 3, 2.5)
|
|
2150
|
+
}));
|
|
2151
|
+
var DialogContent = StyledDialogContent;
|
|
2152
|
+
DialogContent.displayName = "DialogContent";
|
|
2153
|
+
|
|
2154
|
+
// src/components/DialogContent/index.ts
|
|
2155
|
+
var DialogContent_default = DialogContent;
|
|
2156
|
+
|
|
2157
|
+
// src/components/DialogTitle/DialogTitle.tsx
|
|
2158
|
+
import { DialogTitle as JoyDialogTitle, styled as styled8 } from "@mui/joy";
|
|
2159
|
+
import { motion as motion18 } from "framer-motion";
|
|
2160
|
+
var MotionDialogTitle = motion18(JoyDialogTitle);
|
|
2161
|
+
var StyledDialogTitle = styled8(MotionDialogTitle)(({ theme }) => ({
|
|
2162
|
+
padding: theme.spacing(2, 3)
|
|
2163
|
+
}));
|
|
2164
|
+
var DialogTitle = StyledDialogTitle;
|
|
2165
|
+
DialogTitle.displayName = "DialogTitle";
|
|
2166
|
+
|
|
2167
|
+
// src/components/DialogTitle/index.ts
|
|
2168
|
+
var DialogTitle_default = DialogTitle;
|
|
2169
|
+
|
|
2170
|
+
// src/components/DialogFrame/DialogFrame.tsx
|
|
2171
|
+
import React18 from "react";
|
|
2172
|
+
|
|
2173
|
+
// src/components/Modal/Modal.tsx
|
|
2174
|
+
import React17 from "react";
|
|
2175
|
+
import {
|
|
2176
|
+
Modal as JoyModal,
|
|
2177
|
+
ModalDialog as JoyModalDialog,
|
|
2178
|
+
ModalClose as JoyModalClose,
|
|
2179
|
+
ModalOverflow as JoyModalOverflow,
|
|
2180
|
+
styled as styled9
|
|
2181
|
+
} from "@mui/joy";
|
|
2182
|
+
import { motion as motion19 } from "framer-motion";
|
|
2183
|
+
var MotionModal = motion19(JoyModal);
|
|
2184
|
+
var Modal = MotionModal;
|
|
2185
|
+
Modal.displayName = "Modal";
|
|
2186
|
+
var MotionModalDialog = motion19(JoyModalDialog);
|
|
2187
|
+
var StyledModalDialog = styled9(MotionModalDialog)({
|
|
2188
|
+
padding: 0
|
|
2189
|
+
});
|
|
2190
|
+
var ModalDialog = StyledModalDialog;
|
|
2191
|
+
ModalDialog.displayName = "ModalDialog";
|
|
2192
|
+
var MotionModalClose = motion19(JoyModalClose);
|
|
2193
|
+
var ModalClose = MotionModalClose;
|
|
2194
|
+
ModalClose.displayName = "ModalClose";
|
|
2195
|
+
var MotionModalOverflow = motion19(JoyModalOverflow);
|
|
2196
|
+
var ModalOverflow = MotionModalOverflow;
|
|
2197
|
+
ModalOverflow.displayName = "ModalOverflow";
|
|
2198
|
+
function ModalFrame(props) {
|
|
2199
|
+
const { title, children, ...innerProps } = props;
|
|
2200
|
+
return /* @__PURE__ */ React17.createElement(StyledModalDialog, { ...innerProps }, /* @__PURE__ */ React17.createElement(ModalClose, null), /* @__PURE__ */ React17.createElement(DialogTitle_default, null, title), /* @__PURE__ */ React17.createElement(DialogContent_default, null, children));
|
|
2201
|
+
}
|
|
2202
|
+
ModalFrame.displayName = "ModalFrame";
|
|
2203
|
+
|
|
2204
|
+
// src/components/DialogFrame/DialogFrame.tsx
|
|
2205
|
+
import { styled as styled10 } from "@mui/joy";
|
|
2206
|
+
var StyledDialogFrame = styled10(ModalDialog)(({ theme }) => ({
|
|
2207
|
+
padding: 0
|
|
2208
|
+
}));
|
|
2209
|
+
function DialogFrame(props) {
|
|
2210
|
+
const { title, children, actions, ...innerProps } = props;
|
|
2211
|
+
return /* @__PURE__ */ React18.createElement(StyledDialogFrame, { ...innerProps }, /* @__PURE__ */ React18.createElement(DialogTitle_default, null, title), /* @__PURE__ */ React18.createElement(DialogContent_default, null, children), /* @__PURE__ */ React18.createElement(DialogActions_default, null, actions));
|
|
2212
|
+
}
|
|
2213
|
+
DialogFrame.displayName = "DialogFrame";
|
|
2214
|
+
|
|
2215
|
+
// src/components/Divider/Divider.tsx
|
|
2216
|
+
import React19 from "react";
|
|
2217
|
+
import { Divider as JoyDivider } from "@mui/joy";
|
|
2218
|
+
import { motion as motion20 } from "framer-motion";
|
|
2219
|
+
var MotionDivider = motion20(JoyDivider);
|
|
2220
|
+
var Divider = (props) => {
|
|
2221
|
+
return /* @__PURE__ */ React19.createElement(MotionDivider, { ...props });
|
|
2222
|
+
};
|
|
2223
|
+
Divider.displayName = "Divider";
|
|
2224
|
+
|
|
2225
|
+
// src/components/InsetDrawer/InsetDrawer.tsx
|
|
2226
|
+
import React20 from "react";
|
|
2227
|
+
import { Drawer as JoyDrawer } from "@mui/joy";
|
|
2228
|
+
import { motion as motion21 } from "framer-motion";
|
|
2229
|
+
var MotionDrawer = motion21(JoyDrawer);
|
|
2230
|
+
var InsetDrawer = (props) => {
|
|
2231
|
+
const { children, ...innerProps } = props;
|
|
2232
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2233
|
+
MotionDrawer,
|
|
2234
|
+
{
|
|
2235
|
+
...innerProps,
|
|
2236
|
+
slotProps: {
|
|
2237
|
+
...innerProps.slotProps,
|
|
2238
|
+
content: {
|
|
2239
|
+
...innerProps.slotProps?.content,
|
|
2240
|
+
sx: {
|
|
2241
|
+
bgcolor: "transparent",
|
|
2242
|
+
p: { md: 3, sm: 0 },
|
|
2243
|
+
boxShadow: "none"
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
},
|
|
2248
|
+
children
|
|
2249
|
+
);
|
|
2250
|
+
};
|
|
2251
|
+
InsetDrawer.displayName = "InsetDrawer";
|
|
2252
|
+
|
|
2253
|
+
// src/components/Grid/Grid.tsx
|
|
2254
|
+
import { Grid as JoyGrid } from "@mui/joy";
|
|
2255
|
+
import { motion as motion22 } from "framer-motion";
|
|
2256
|
+
var MotionGrid = motion22(JoyGrid);
|
|
2257
|
+
var Grid = MotionGrid;
|
|
2258
|
+
Grid.displayName = "Grid";
|
|
2259
|
+
|
|
2260
|
+
// src/components/MonthRangePicker/MonthRangePicker.tsx
|
|
2261
|
+
import React21, { forwardRef as forwardRef6, useCallback as useCallback6, useMemo as useMemo5, useState as useState6 } from "react";
|
|
2262
|
+
import { IMaskInput as IMaskInput3, IMask as IMask3 } from "react-imask";
|
|
2263
|
+
import CalendarTodayIcon3 from "@mui/icons-material/esm/CalendarToday.js";
|
|
2264
|
+
import { styled as styled11 } from "@mui/joy";
|
|
2265
|
+
import { FocusTrap as FocusTrap3, ClickAwayListener as ClickAwayListener3, Popper as Popper3 } from "@mui/base";
|
|
2266
|
+
var StyledPopper3 = styled11(Popper3, {
|
|
2267
|
+
name: "MonthRangePicker",
|
|
2268
|
+
slot: "popper"
|
|
2269
|
+
})(({ theme }) => ({
|
|
2270
|
+
zIndex: theme.zIndex.tooltip
|
|
2271
|
+
}));
|
|
2272
|
+
var CalendarSheet3 = styled11(Sheet_default, {
|
|
2273
|
+
name: "MonthRangePicker",
|
|
2274
|
+
slot: "sheet",
|
|
2275
|
+
overridesResolver: (props, styles) => styles.root
|
|
2276
|
+
})(({ theme }) => ({
|
|
2277
|
+
zIndex: theme.zIndex.tooltip,
|
|
2278
|
+
width: "264px",
|
|
2279
|
+
boxShadow: theme.shadow.md,
|
|
2280
|
+
borderRadius: theme.radius.md
|
|
2281
|
+
}));
|
|
2282
|
+
var formatValueString3 = ([date1, date2]) => {
|
|
2283
|
+
const getStr = (date) => {
|
|
2284
|
+
let month = `${date.getMonth() + 1}`;
|
|
2285
|
+
const year = date.getFullYear();
|
|
2286
|
+
if (Number(month) < 10)
|
|
2287
|
+
month = "0" + month;
|
|
2288
|
+
return [year, month].join("/");
|
|
2289
|
+
};
|
|
2290
|
+
return [getStr(date1), date2 ? getStr(date2) : ""].join(" - ");
|
|
2291
|
+
};
|
|
2292
|
+
var parseDate2 = (str) => {
|
|
2293
|
+
const date1 = str.split(" - ")[0] || "";
|
|
2294
|
+
const date2 = str.split(" - ")[1] || "";
|
|
2295
|
+
const yearMonthDay1 = date1.split("/");
|
|
2296
|
+
const yearMonthDay2 = date2.split("/");
|
|
2297
|
+
return [
|
|
2298
|
+
new Date(Number(yearMonthDay1[0]), Number(yearMonthDay1[1]) - 1),
|
|
2299
|
+
new Date(Number(yearMonthDay2[0]), Number(yearMonthDay2[1]) - 1)
|
|
2300
|
+
];
|
|
2301
|
+
};
|
|
2302
|
+
var TextMaskAdapter5 = React21.forwardRef(
|
|
2303
|
+
function TextMaskAdapter6(props, ref) {
|
|
2304
|
+
const { onChange, ...other } = props;
|
|
2305
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2306
|
+
IMaskInput3,
|
|
2307
|
+
{
|
|
2308
|
+
...other,
|
|
2309
|
+
inputRef: ref,
|
|
2310
|
+
onAccept: (value) => onChange({ target: { name: props.name, value } }),
|
|
2311
|
+
mask: Date,
|
|
2312
|
+
pattern: "Y/`m - Y/`m",
|
|
2313
|
+
blocks: {
|
|
2314
|
+
m: {
|
|
2315
|
+
mask: IMask3.MaskedRange,
|
|
2316
|
+
from: 1,
|
|
2317
|
+
to: 12,
|
|
2318
|
+
maxLength: 2
|
|
2319
|
+
},
|
|
2320
|
+
Y: {
|
|
2321
|
+
mask: IMask3.MaskedRange,
|
|
2322
|
+
from: 1900,
|
|
2323
|
+
to: 9999
|
|
2324
|
+
}
|
|
2325
|
+
},
|
|
2326
|
+
format: formatValueString3,
|
|
2327
|
+
parse: parseDate2,
|
|
2328
|
+
autofix: "pad",
|
|
2329
|
+
overwrite: true,
|
|
2330
|
+
placeholderChar: " "
|
|
2331
|
+
}
|
|
2332
|
+
);
|
|
2333
|
+
}
|
|
2334
|
+
);
|
|
2335
|
+
var MonthRangePicker = forwardRef6(
|
|
2336
|
+
(props, ref) => {
|
|
2337
|
+
const {
|
|
2338
|
+
onChange,
|
|
2339
|
+
disabled,
|
|
2340
|
+
label,
|
|
2341
|
+
error,
|
|
2342
|
+
helperText,
|
|
2343
|
+
minDate,
|
|
2344
|
+
maxDate,
|
|
2345
|
+
disableFuture,
|
|
2346
|
+
disablePast,
|
|
2347
|
+
required
|
|
2348
|
+
} = props;
|
|
2349
|
+
const [value, setValue] = useState6(props.value || "");
|
|
2350
|
+
const [anchorEl, setAnchorEl] = useState6(null);
|
|
2351
|
+
const open = Boolean(anchorEl);
|
|
2352
|
+
const calendarValue = useMemo5(
|
|
2353
|
+
() => value ? parseDate2(value) : void 0,
|
|
2354
|
+
[value]
|
|
2355
|
+
);
|
|
2356
|
+
const handleChange = useCallback6(
|
|
2357
|
+
(event) => {
|
|
2358
|
+
setValue(event.target.value);
|
|
2359
|
+
onChange?.(event);
|
|
2360
|
+
},
|
|
2361
|
+
[onChange]
|
|
2362
|
+
);
|
|
2363
|
+
const handleCalendarToggle = useCallback6(
|
|
2364
|
+
(event) => {
|
|
2365
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
2366
|
+
},
|
|
2367
|
+
[anchorEl, setAnchorEl]
|
|
2368
|
+
);
|
|
2369
|
+
const handleCalendarChange = useCallback6(
|
|
2370
|
+
([date1, date2]) => {
|
|
2371
|
+
if (!date1 || !date2)
|
|
2372
|
+
return;
|
|
2373
|
+
setValue(formatValueString3([date1, date2]));
|
|
2374
|
+
setAnchorEl(null);
|
|
2375
|
+
},
|
|
2376
|
+
[setValue, setAnchorEl]
|
|
2377
|
+
);
|
|
2378
|
+
const picker = /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
2379
|
+
Input_default,
|
|
2380
|
+
{
|
|
2381
|
+
ref,
|
|
2382
|
+
size: "sm",
|
|
2383
|
+
value,
|
|
2384
|
+
onChange: handleChange,
|
|
2385
|
+
disabled,
|
|
2386
|
+
required,
|
|
2387
|
+
placeholder: "YYYY/MM - YYYY/MM",
|
|
2388
|
+
slotProps: { input: { component: TextMaskAdapter5 } },
|
|
2389
|
+
sx: {
|
|
2390
|
+
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
2391
|
+
fontFamily: "monospace"
|
|
2392
|
+
},
|
|
2393
|
+
endDecorator: /* @__PURE__ */ React21.createElement(IconButton_default, { variant: "plain", onClick: handleCalendarToggle }, /* @__PURE__ */ React21.createElement(CalendarTodayIcon3, null))
|
|
2394
|
+
}
|
|
2395
|
+
), open && /* @__PURE__ */ React21.createElement(ClickAwayListener3, { onClickAway: () => setAnchorEl(null) }, /* @__PURE__ */ React21.createElement(
|
|
2396
|
+
StyledPopper3,
|
|
2397
|
+
{
|
|
2398
|
+
id: "date-range-picker-popper",
|
|
2399
|
+
open: true,
|
|
2400
|
+
anchorEl,
|
|
2401
|
+
placement: "bottom-end",
|
|
2402
|
+
modifiers: [
|
|
2403
|
+
{
|
|
2404
|
+
name: "offset",
|
|
2405
|
+
options: {
|
|
2406
|
+
offset: [4, 4]
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
]
|
|
2410
|
+
},
|
|
2411
|
+
/* @__PURE__ */ React21.createElement(FocusTrap3, { open: true }, /* @__PURE__ */ React21.createElement(CalendarSheet3, { tabIndex: -1, role: "presentation" }, /* @__PURE__ */ React21.createElement(
|
|
2412
|
+
Calendar_default,
|
|
2413
|
+
{
|
|
2414
|
+
view: "month",
|
|
2415
|
+
views: ["month"],
|
|
2416
|
+
rangeSelection: true,
|
|
2417
|
+
defaultValue: calendarValue,
|
|
2418
|
+
onChange: handleCalendarChange,
|
|
2419
|
+
minDate: minDate ? new Date(minDate) : void 0,
|
|
2420
|
+
maxDate: maxDate ? new Date(maxDate) : void 0,
|
|
2421
|
+
disableFuture,
|
|
2422
|
+
disablePast
|
|
2423
|
+
}
|
|
2424
|
+
), /* @__PURE__ */ React21.createElement(
|
|
2425
|
+
DialogActions_default,
|
|
2426
|
+
{
|
|
2427
|
+
sx: {
|
|
2428
|
+
p: 1
|
|
2429
|
+
}
|
|
2430
|
+
},
|
|
2431
|
+
/* @__PURE__ */ React21.createElement(
|
|
2432
|
+
Button_default,
|
|
2433
|
+
{
|
|
2434
|
+
size: "sm",
|
|
2435
|
+
variant: "plain",
|
|
2436
|
+
color: "neutral",
|
|
2437
|
+
onClick: () => {
|
|
2438
|
+
setValue("");
|
|
2439
|
+
setAnchorEl(null);
|
|
2440
|
+
}
|
|
2441
|
+
},
|
|
2442
|
+
"Clear"
|
|
2443
|
+
)
|
|
2444
|
+
)))
|
|
2445
|
+
)));
|
|
2446
|
+
if (label) {
|
|
2447
|
+
return /* @__PURE__ */ React21.createElement(FormControl_default, { required, disabled, error, size: "sm" }, /* @__PURE__ */ React21.createElement(FormLabel_default, null, label), picker, helperText && /* @__PURE__ */ React21.createElement(FormHelperText_default, null, helperText));
|
|
2448
|
+
}
|
|
2449
|
+
return picker;
|
|
2450
|
+
}
|
|
2451
|
+
);
|
|
2452
|
+
MonthRangePicker.displayName = "MonthRangePicker";
|
|
2453
|
+
|
|
2454
|
+
// src/components/Radio/Radio.tsx
|
|
2455
|
+
import { Radio as JoyRadio, RadioGroup as JoyRadioGroup } from "@mui/joy";
|
|
2456
|
+
import { motion as motion23 } from "framer-motion";
|
|
2457
|
+
var MotionRadio = motion23(JoyRadio);
|
|
2458
|
+
var Radio = MotionRadio;
|
|
2459
|
+
Radio.displayName = "Radio";
|
|
2460
|
+
var MotionRadioGroup = motion23(JoyRadioGroup);
|
|
2461
|
+
var RadioGroup = MotionRadioGroup;
|
|
2462
|
+
RadioGroup.displayName = "RadioGroup";
|
|
2463
|
+
|
|
2464
|
+
// src/components/RadioList/RadioList.tsx
|
|
2465
|
+
import React22 from "react";
|
|
2466
|
+
function RadioList(props) {
|
|
2467
|
+
const { items, ...innerProps } = props;
|
|
2468
|
+
return /* @__PURE__ */ React22.createElement(RadioGroup, { ...innerProps }, items.map((item) => /* @__PURE__ */ React22.createElement(Radio, { key: `${item.value}`, value: item.value, label: item.label })));
|
|
2469
|
+
}
|
|
2470
|
+
RadioList.displayName = "RadioList";
|
|
2471
|
+
|
|
2472
|
+
// src/components/Select/Select.tsx
|
|
2473
|
+
import React23 from "react";
|
|
2474
|
+
import {
|
|
2475
|
+
Select as JoySelect,
|
|
2476
|
+
Option as JoyOption
|
|
2477
|
+
} from "@mui/joy";
|
|
2478
|
+
import { motion as motion24 } from "framer-motion";
|
|
2479
|
+
var MotionOption = motion24(JoyOption);
|
|
2480
|
+
var Option = MotionOption;
|
|
2481
|
+
Option.displayName = "Option";
|
|
2482
|
+
function Select(props) {
|
|
2483
|
+
const {
|
|
2484
|
+
label,
|
|
2485
|
+
helperText,
|
|
2486
|
+
error,
|
|
2487
|
+
size,
|
|
2488
|
+
color,
|
|
2489
|
+
disabled,
|
|
2490
|
+
required,
|
|
2491
|
+
...innerProps
|
|
2492
|
+
} = props;
|
|
2493
|
+
if (label) {
|
|
2494
|
+
return /* @__PURE__ */ React23.createElement(
|
|
2495
|
+
FormControl_default,
|
|
2496
|
+
{
|
|
2497
|
+
required,
|
|
2498
|
+
disabled,
|
|
2499
|
+
size,
|
|
2500
|
+
color,
|
|
2501
|
+
error
|
|
2502
|
+
},
|
|
2503
|
+
/* @__PURE__ */ React23.createElement(FormLabel_default, null, label),
|
|
2504
|
+
/* @__PURE__ */ React23.createElement(JoySelect, { ...innerProps }),
|
|
2505
|
+
helperText && /* @__PURE__ */ React23.createElement(FormHelperText_default, null, helperText)
|
|
2506
|
+
);
|
|
2507
|
+
}
|
|
2508
|
+
return /* @__PURE__ */ React23.createElement(
|
|
2509
|
+
JoySelect,
|
|
2510
|
+
{
|
|
2511
|
+
required,
|
|
2512
|
+
disabled,
|
|
2513
|
+
size,
|
|
2514
|
+
color,
|
|
2515
|
+
...innerProps
|
|
2516
|
+
}
|
|
2517
|
+
);
|
|
2518
|
+
}
|
|
2519
|
+
Select.displayName = "Select";
|
|
2520
|
+
|
|
2521
|
+
// src/components/Switch/Switch.tsx
|
|
2522
|
+
import React24 from "react";
|
|
2523
|
+
import {
|
|
2524
|
+
Switch as JoySwitch,
|
|
2525
|
+
styled as styled12,
|
|
2526
|
+
switchClasses
|
|
2527
|
+
} from "@mui/joy";
|
|
2528
|
+
import { motion as motion25 } from "framer-motion";
|
|
2529
|
+
var MotionSwitch = motion25(JoySwitch);
|
|
2530
|
+
var StyledThumb = styled12(motion25.div)({
|
|
2531
|
+
"--Icon-fontSize": "calc(var(--Switch-thumbSize) * 0.75)",
|
|
2532
|
+
display: "inline-flex",
|
|
2533
|
+
justifyContent: "center",
|
|
2534
|
+
alignItems: "center",
|
|
2535
|
+
position: "absolute",
|
|
2536
|
+
left: "var(--Switch-thumbOffset)",
|
|
2537
|
+
width: "var(--Switch-thumbWidth)",
|
|
2538
|
+
height: "var(--Switch-thumbSize)",
|
|
2539
|
+
borderRadius: "var(--Switch-thumbRadius)",
|
|
2540
|
+
boxShadow: "var(--Switch-thumbShadow)",
|
|
2541
|
+
color: "var(--Switch-thumbColor)",
|
|
2542
|
+
backgroundColor: "var(--Switch-thumbBackground)",
|
|
2543
|
+
[`&.${switchClasses.checked}`]: {
|
|
2544
|
+
left: "unset",
|
|
2545
|
+
right: "var(--Switch-thumbOffset)"
|
|
2546
|
+
}
|
|
2547
|
+
});
|
|
2548
|
+
var Thumb = (props) => /* @__PURE__ */ React24.createElement(StyledThumb, { ...props, layout: true, transition: spring });
|
|
2549
|
+
var spring = {
|
|
2550
|
+
type: "spring",
|
|
2551
|
+
stiffness: 700,
|
|
2552
|
+
damping: 30
|
|
2553
|
+
};
|
|
2554
|
+
var Switch = (props) => {
|
|
2555
|
+
return /* @__PURE__ */ React24.createElement(
|
|
2556
|
+
MotionSwitch,
|
|
2557
|
+
{
|
|
2558
|
+
...props,
|
|
2559
|
+
slots: {
|
|
2560
|
+
thumb: Thumb,
|
|
2561
|
+
...props.slots
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
);
|
|
2565
|
+
};
|
|
2566
|
+
Switch.displayName = "Switch";
|
|
2567
|
+
|
|
2568
|
+
// src/components/Tabs/Tabs.tsx
|
|
2569
|
+
import { Tabs as JoyTabs, Tab as JoyTab, TabList as JoyTabList, TabPanel as JoyTabPanel } from "@mui/joy";
|
|
2570
|
+
import { motion as motion26 } from "framer-motion";
|
|
2571
|
+
var MotionTabs = motion26(JoyTabs);
|
|
2572
|
+
var Tabs = MotionTabs;
|
|
2573
|
+
Tabs.displayName = "Tabs";
|
|
2574
|
+
var MotionTab = motion26(JoyTab);
|
|
2575
|
+
var Tab = MotionTab;
|
|
2576
|
+
Tab.displayName = "Tab";
|
|
2577
|
+
var MotionTabList = motion26(JoyTabList);
|
|
2578
|
+
var TabList = MotionTabList;
|
|
2579
|
+
TabList.displayName = "TabList";
|
|
2580
|
+
var MotionTabPanel = motion26(JoyTabPanel);
|
|
2581
|
+
var TabPanel = MotionTabPanel;
|
|
2582
|
+
TabPanel.displayName = "TabPanel";
|
|
2583
|
+
|
|
2584
|
+
// src/components/Textarea/Textarea.tsx
|
|
2585
|
+
import React25 from "react";
|
|
2586
|
+
import { Textarea as JoyTextarea } from "@mui/joy";
|
|
2587
|
+
import { motion as motion27 } from "framer-motion";
|
|
2588
|
+
var MotionTextarea = motion27(JoyTextarea);
|
|
2589
|
+
var Textarea = (props) => {
|
|
2590
|
+
const {
|
|
2591
|
+
label,
|
|
2592
|
+
error,
|
|
2593
|
+
helperText,
|
|
2594
|
+
color,
|
|
2595
|
+
size,
|
|
2596
|
+
disabled,
|
|
2597
|
+
required,
|
|
2598
|
+
...innerProps
|
|
2599
|
+
} = props;
|
|
2600
|
+
if (label) {
|
|
2601
|
+
return /* @__PURE__ */ React25.createElement(
|
|
2602
|
+
FormControl_default,
|
|
2603
|
+
{
|
|
2604
|
+
required,
|
|
2605
|
+
disabled,
|
|
2606
|
+
color,
|
|
2607
|
+
size,
|
|
2608
|
+
error
|
|
2609
|
+
},
|
|
2610
|
+
/* @__PURE__ */ React25.createElement(FormLabel_default, null, label),
|
|
2611
|
+
/* @__PURE__ */ React25.createElement(MotionTextarea, { ...innerProps }),
|
|
2612
|
+
helperText && /* @__PURE__ */ React25.createElement(FormHelperText_default, null, helperText)
|
|
2613
|
+
);
|
|
2614
|
+
}
|
|
2615
|
+
return /* @__PURE__ */ React25.createElement(
|
|
2616
|
+
MotionTextarea,
|
|
2617
|
+
{
|
|
2618
|
+
required,
|
|
2619
|
+
disabled,
|
|
2620
|
+
color,
|
|
2621
|
+
size,
|
|
2622
|
+
...innerProps
|
|
2623
|
+
}
|
|
2624
|
+
);
|
|
2625
|
+
};
|
|
2626
|
+
Textarea.displayName = "Textarea";
|
|
2627
|
+
|
|
2628
|
+
// src/components/ThemeProvider/ThemeProvider.tsx
|
|
2629
|
+
import React26 from "react";
|
|
2630
|
+
import {
|
|
2631
|
+
CssBaseline,
|
|
2632
|
+
CssVarsProvider,
|
|
2633
|
+
checkboxClasses,
|
|
2634
|
+
extendTheme
|
|
2635
|
+
} from "@mui/joy";
|
|
2636
|
+
var defaultTheme = extendTheme({
|
|
2637
|
+
cssVarPrefix: "ceed",
|
|
2638
|
+
components: {
|
|
2639
|
+
JoyTable: {
|
|
2640
|
+
defaultProps: {
|
|
2641
|
+
size: "sm",
|
|
2642
|
+
borderAxis: "bothBetween"
|
|
2643
|
+
},
|
|
2644
|
+
styleOverrides: {
|
|
2645
|
+
root: ({ theme }) => ({
|
|
2646
|
+
"--TableRow-stripeBackground": theme.palette.background.level1,
|
|
2647
|
+
"--TableCell-selectedBackground": theme.palette.background.level2,
|
|
2648
|
+
"--TableRow-hoverBackground": theme.palette.background.level3,
|
|
2649
|
+
"& tbody tr[aria-checked=false] th": {
|
|
2650
|
+
"--TableCell-headBackground": "transparent"
|
|
2651
|
+
},
|
|
2652
|
+
"& tbody tr[aria-checked=true]:hover th": {
|
|
2653
|
+
"--TableCell-headBackground": "var(--TableRow-hoverBackground)"
|
|
2654
|
+
},
|
|
2655
|
+
[`& tbody tr[aria-checked=true]:not(:hover) th`]: {
|
|
2656
|
+
"--TableCell-headBackground": "var(--TableCell-selectedBackground)"
|
|
2657
|
+
},
|
|
2658
|
+
[`& tbody tr[aria-checked=true]:not(:hover) td`]: {
|
|
2659
|
+
"--TableCell-dataBackground": "var(--TableCell-selectedBackground)"
|
|
2660
|
+
},
|
|
2661
|
+
[`& .${checkboxClasses.root}`]: {
|
|
2662
|
+
verticalAlign: "middle"
|
|
2663
|
+
}
|
|
2664
|
+
})
|
|
2665
|
+
}
|
|
2666
|
+
},
|
|
2667
|
+
JoyTooltip: {
|
|
2668
|
+
defaultProps: {
|
|
2669
|
+
size: "sm",
|
|
2670
|
+
placement: "top"
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
});
|
|
2675
|
+
function ThemeProvider(props) {
|
|
2676
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(CssVarsProvider, { theme: defaultTheme }, /* @__PURE__ */ React26.createElement(CssBaseline, null), props.children));
|
|
2677
|
+
}
|
|
2678
|
+
ThemeProvider.displayName = "ThemeProvider";
|
|
2679
|
+
|
|
2680
|
+
// src/components/Tooltip/Tooltip.tsx
|
|
2681
|
+
import React27 from "react";
|
|
2682
|
+
import { Tooltip as JoyTooltip } from "@mui/joy";
|
|
2683
|
+
import { motion as motion28 } from "framer-motion";
|
|
2684
|
+
var MotionTooltip = motion28(JoyTooltip);
|
|
2685
|
+
var Tooltip = (props) => {
|
|
2686
|
+
return /* @__PURE__ */ React27.createElement(MotionTooltip, { ...props });
|
|
2687
|
+
};
|
|
2688
|
+
Tooltip.displayName = "Tooltip";
|
|
2689
|
+
export {
|
|
2690
|
+
Accordion,
|
|
2691
|
+
AccordionDetails,
|
|
2692
|
+
AccordionSummary,
|
|
2693
|
+
Accordions,
|
|
2694
|
+
AspectRatio,
|
|
2695
|
+
Autocomplete,
|
|
2696
|
+
AutocompleteListbox,
|
|
2697
|
+
AutocompleteOption,
|
|
2698
|
+
Avatar,
|
|
2699
|
+
AvatarGroup,
|
|
2700
|
+
Badge,
|
|
2701
|
+
Box,
|
|
2702
|
+
Breadcrumbs,
|
|
2703
|
+
Button,
|
|
2704
|
+
Calendar,
|
|
2705
|
+
Card,
|
|
2706
|
+
CardActions,
|
|
2707
|
+
CardContent,
|
|
2708
|
+
CardCover,
|
|
2709
|
+
CardOverflow,
|
|
2710
|
+
Checkbox,
|
|
2711
|
+
Chip,
|
|
2712
|
+
CircularProgress,
|
|
2713
|
+
Container,
|
|
2714
|
+
DataTable,
|
|
2715
|
+
DatePicker,
|
|
2716
|
+
DateRangePicker,
|
|
2717
|
+
DialogActions,
|
|
2718
|
+
DialogContent,
|
|
2719
|
+
DialogFrame,
|
|
2720
|
+
DialogTitle,
|
|
2721
|
+
Divider,
|
|
2722
|
+
Drawer,
|
|
2723
|
+
Dropdown,
|
|
2724
|
+
FormControl,
|
|
2725
|
+
FormHelperText,
|
|
2726
|
+
FormLabel,
|
|
2727
|
+
Grid,
|
|
2728
|
+
IconButton,
|
|
2729
|
+
Input,
|
|
2730
|
+
InsetDrawer,
|
|
2731
|
+
LinearProgress2 as LinearProgress,
|
|
2732
|
+
Link,
|
|
2733
|
+
List,
|
|
2734
|
+
ListDivider,
|
|
2735
|
+
ListItem,
|
|
2736
|
+
ListItemButton,
|
|
2737
|
+
ListItemContent,
|
|
2738
|
+
ListItemDecorator,
|
|
2739
|
+
ListSubheader,
|
|
2740
|
+
Menu,
|
|
2741
|
+
MenuButton,
|
|
2742
|
+
MenuItem,
|
|
2743
|
+
Modal,
|
|
2744
|
+
ModalClose,
|
|
2745
|
+
ModalDialog,
|
|
2746
|
+
ModalFrame,
|
|
2747
|
+
ModalOverflow,
|
|
2748
|
+
MonthRangePicker,
|
|
2749
|
+
Option,
|
|
2750
|
+
Radio,
|
|
2751
|
+
RadioGroup,
|
|
2752
|
+
RadioList,
|
|
2753
|
+
Select,
|
|
2754
|
+
Sheet,
|
|
2755
|
+
Skeleton,
|
|
2756
|
+
Slider,
|
|
2757
|
+
Stack,
|
|
2758
|
+
Step,
|
|
2759
|
+
StepButton,
|
|
2760
|
+
StepIndicator,
|
|
2761
|
+
Stepper,
|
|
2762
|
+
Switch,
|
|
2763
|
+
Tab,
|
|
2764
|
+
TabList,
|
|
2765
|
+
TabPanel,
|
|
2766
|
+
Table,
|
|
2767
|
+
TableBody,
|
|
2768
|
+
TableHead,
|
|
2769
|
+
Tabs,
|
|
2770
|
+
Textarea,
|
|
2771
|
+
ThemeProvider,
|
|
2772
|
+
Tooltip,
|
|
2773
|
+
Typography,
|
|
2774
|
+
accordionClasses,
|
|
2775
|
+
accordionDetailsClasses,
|
|
2776
|
+
accordionSummaryClasses,
|
|
2777
|
+
accordionGroupClasses as accordionsClasses,
|
|
2778
|
+
aspectRatioClasses,
|
|
2779
|
+
autocompleteClasses,
|
|
2780
|
+
autocompleteListboxClasses,
|
|
2781
|
+
autocompleteOptionClasses,
|
|
2782
|
+
avatarClasses,
|
|
2783
|
+
avatarGroupClasses,
|
|
2784
|
+
badgeClasses,
|
|
2785
|
+
boxClasses,
|
|
2786
|
+
breadcrumbsClasses,
|
|
2787
|
+
buttonClasses,
|
|
2788
|
+
cardActionsClasses,
|
|
2789
|
+
cardClasses,
|
|
2790
|
+
cardContentClasses,
|
|
2791
|
+
cardCoverClasses,
|
|
2792
|
+
cardOverflowClasses,
|
|
2793
|
+
checkboxClasses2 as checkboxClasses,
|
|
2794
|
+
chipClasses,
|
|
2795
|
+
circularProgressClasses,
|
|
2796
|
+
dialogActionsClasses,
|
|
2797
|
+
dialogContentClasses,
|
|
2798
|
+
dialogTitleClasses,
|
|
2799
|
+
dividerClasses,
|
|
2800
|
+
drawerClasses,
|
|
2801
|
+
formControlClasses,
|
|
2802
|
+
formHelperTextClasses,
|
|
2803
|
+
formLabelClasses,
|
|
2804
|
+
gridClasses,
|
|
2805
|
+
iconButtonClasses,
|
|
2806
|
+
inputClasses,
|
|
2807
|
+
linearProgressClasses,
|
|
2808
|
+
linkClasses,
|
|
2809
|
+
listClasses,
|
|
2810
|
+
listDividerClasses,
|
|
2811
|
+
listItemButtonClasses,
|
|
2812
|
+
listItemClasses,
|
|
2813
|
+
listItemContentClasses,
|
|
2814
|
+
listItemDecoratorClasses,
|
|
2815
|
+
listSubheaderClasses,
|
|
2816
|
+
menuButtonClasses,
|
|
2817
|
+
menuClasses,
|
|
2818
|
+
menuItemClasses,
|
|
2819
|
+
modalClasses,
|
|
2820
|
+
modalCloseClasses,
|
|
2821
|
+
modalDialogClasses,
|
|
2822
|
+
modalOverflowClasses,
|
|
2823
|
+
optionClasses,
|
|
2824
|
+
radioClasses,
|
|
2825
|
+
radioGroupClasses,
|
|
2826
|
+
selectClasses,
|
|
2827
|
+
sheetClasses,
|
|
2828
|
+
skeletonClasses,
|
|
2829
|
+
sliderClasses,
|
|
2830
|
+
stackClasses,
|
|
2831
|
+
stepButtonClasses,
|
|
2832
|
+
stepClasses,
|
|
2833
|
+
stepperClasses,
|
|
2834
|
+
switchClasses2 as switchClasses,
|
|
2835
|
+
tabListClasses,
|
|
2836
|
+
tabPanelClasses,
|
|
2837
|
+
tableClasses,
|
|
2838
|
+
tabsClasses,
|
|
2839
|
+
textareaClasses,
|
|
2840
|
+
tooltipClasses,
|
|
2841
|
+
typographyClasses
|
|
2842
|
+
};
|