@ceed/cds 0.0.126 → 0.0.128
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/index.js +1 -6
- package/package.json +2 -3
- package/dist/components/Accordions/Accordions.js +0 -66
- package/dist/components/Accordions/index.js +0 -3
- package/dist/components/Autocomplete/Autocomplete.js +0 -251
- package/dist/components/Autocomplete/index.js +0 -3
- package/dist/components/Box/Box.js +0 -6
- package/dist/components/Box/index.js +0 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.js +0 -67
- package/dist/components/Breadcrumbs/index.js +0 -3
- package/dist/components/Button/Button.js +0 -28
- package/dist/components/Button/index.js +0 -3
- package/dist/components/Calendar/Calendar.js +0 -383
- package/dist/components/Calendar/hooks/use-calendar-props.js +0 -80
- package/dist/components/Calendar/hooks/use-calendar.js +0 -244
- package/dist/components/Calendar/index.js +0 -3
- package/dist/components/Calendar/types.js +0 -1
- package/dist/components/Calendar/utils/index.js +0 -72
- package/dist/components/Card/Card.js +0 -22
- package/dist/components/Card/index.js +0 -3
- package/dist/components/Checkbox/Checkbox.js +0 -28
- package/dist/components/Checkbox/index.js +0 -3
- package/dist/components/Chip/Chip.js +0 -6
- package/dist/components/Chip/index.js +0 -3
- package/dist/components/Container/Container.js +0 -65
- package/dist/components/Container/index.js +0 -3
- package/dist/components/CurrencyInput/CurrencyInput.js +0 -108
- package/dist/components/CurrencyInput/hooks/use-currency-setting.js +0 -165
- package/dist/components/CurrencyInput/index.js +0 -3
- package/dist/components/DataTable/DataTable.js +0 -437
- package/dist/components/DataTable/index.js +0 -3
- package/dist/components/DataTable/types.js +0 -1
- package/dist/components/DatePicker/DatePicker.js +0 -207
- package/dist/components/DatePicker/index.js +0 -3
- package/dist/components/DateRangePicker/DateRangePicker.js +0 -209
- package/dist/components/DateRangePicker/index.js +0 -3
- package/dist/components/DialogActions/DialogActions.js +0 -15
- package/dist/components/DialogActions/index.js +0 -3
- package/dist/components/DialogContent/DialogContent.js +0 -12
- package/dist/components/DialogContent/index.js +0 -3
- package/dist/components/DialogFrame/DialogFrame.js +0 -51
- package/dist/components/DialogFrame/index.js +0 -3
- package/dist/components/DialogTitle/DialogTitle.js +0 -12
- 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 -17
- 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 -51
- 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/Markdown/Markdown.js +0 -59
- package/dist/components/Markdown/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 -63
- package/dist/components/Modal/index.js +0 -3
- package/dist/components/MonthPicker/MonthPicker.js +0 -203
- package/dist/components/MonthPicker/index.js +0 -3
- package/dist/components/MonthRangePicker/MonthRangePicker.js +0 -207
- package/dist/components/MonthRangePicker/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 -76
- 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 -50
- package/dist/components/Textarea/index.js +0 -3
- package/dist/components/ThemeProvider/ThemeProvider.js +0 -159
- 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/Uploader/Uploader.js +0 -353
- package/dist/components/Uploader/index.js +0 -3
- package/dist/components/index.js +0 -44
- package/dist/index.mjs +0 -1
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { IconButton as JoyIconButton } from "@mui/joy";
|
|
14
|
-
import { motion } from "framer-motion";
|
|
15
|
-
var MotionIconButton = motion(JoyIconButton);
|
|
16
|
-
var IconButton = function (props) {
|
|
17
|
-
// prop destruction
|
|
18
|
-
// lib hooks
|
|
19
|
-
// state, ref, querystring hooks
|
|
20
|
-
// form hooks
|
|
21
|
-
// query hooks
|
|
22
|
-
// calculated values
|
|
23
|
-
// effects
|
|
24
|
-
// handlers
|
|
25
|
-
return React.createElement(MotionIconButton, __assign({}, props));
|
|
26
|
-
};
|
|
27
|
-
export { IconButton };
|
|
28
|
-
IconButton.displayName = "IconButton";
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import React from "react";
|
|
24
|
-
import { Input as JoyInput } from "@mui/joy";
|
|
25
|
-
import { motion } from "framer-motion";
|
|
26
|
-
import FormControl from "../FormControl";
|
|
27
|
-
import FormLabel from "../FormLabel";
|
|
28
|
-
import FormHelperText from "../FormHelperText";
|
|
29
|
-
var MotionInput = motion(JoyInput);
|
|
30
|
-
var Input = React.forwardRef(function (props, ref) {
|
|
31
|
-
var _a;
|
|
32
|
-
// prop destruction
|
|
33
|
-
var label = props.label, helperText = props.helperText, error = props.error, style = props.style, size = props.size, color = props.color, disabled = props.disabled, required = props.required, innerProps = __rest(props, ["label", "helperText", "error", "style", "size", "color", "disabled", "required"]);
|
|
34
|
-
// lib hooks
|
|
35
|
-
// state, ref, querystring hooks
|
|
36
|
-
// form hooks
|
|
37
|
-
// query hooks
|
|
38
|
-
// calculated values
|
|
39
|
-
// effects
|
|
40
|
-
// handlers
|
|
41
|
-
var input = (React.createElement(MotionInput, __assign({ required: required, color: error ? "danger" : color, size: size, disabled: disabled, slotProps: __assign({ input: __assign({ ref: ref }, (_a = innerProps.slotProps) === null || _a === void 0 ? void 0 : _a.input) }, innerProps.slotProps) }, innerProps)));
|
|
42
|
-
if (label) {
|
|
43
|
-
return (React.createElement(FormControl, { required: required, color: color, size: size, error: error, disabled: disabled },
|
|
44
|
-
React.createElement(FormLabel, null, label),
|
|
45
|
-
input,
|
|
46
|
-
helperText && React.createElement(FormHelperText, null, helperText)));
|
|
47
|
-
}
|
|
48
|
-
return input;
|
|
49
|
-
});
|
|
50
|
-
export { Input };
|
|
51
|
-
Input.displayName = "Input";
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import React from "react";
|
|
24
|
-
import { Drawer as JoyDrawer } from "@mui/joy";
|
|
25
|
-
import { motion } from "framer-motion";
|
|
26
|
-
var MotionDrawer = motion(JoyDrawer);
|
|
27
|
-
var InsetDrawer = function (props) {
|
|
28
|
-
var _a;
|
|
29
|
-
// prop destruction
|
|
30
|
-
var children = props.children, innerProps = __rest(props, ["children"]);
|
|
31
|
-
// lib hooks
|
|
32
|
-
// state, ref, querystring hooks
|
|
33
|
-
// form hooks
|
|
34
|
-
// query hooks
|
|
35
|
-
// calculated values
|
|
36
|
-
// effects
|
|
37
|
-
// handlers
|
|
38
|
-
return (React.createElement(MotionDrawer, __assign({}, innerProps, { slotProps: __assign(__assign({}, innerProps.slotProps), { content: __assign(__assign({}, (_a = innerProps.slotProps) === null || _a === void 0 ? void 0 : _a.content), { sx: {
|
|
39
|
-
bgcolor: "transparent",
|
|
40
|
-
p: { md: 3, sm: 0 },
|
|
41
|
-
boxShadow: "none",
|
|
42
|
-
} }) }) }), children));
|
|
43
|
-
};
|
|
44
|
-
export { InsetDrawer };
|
|
45
|
-
InsetDrawer.displayName = "InsetDrawer";
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import React from "react";
|
|
24
|
-
import ReactMarkdown from "react-markdown";
|
|
25
|
-
import { Divider, Typography } from "../";
|
|
26
|
-
import { Link } from "@mui/joy";
|
|
27
|
-
var Markdown = function (props) {
|
|
28
|
-
// prop destruction
|
|
29
|
-
var color = props.color, textColor = props.textColor, _a = props.defaultLevel, defaultLevel = _a === void 0 ? "body-md" : _a, _b = props.defaultLinkAction, defaultLinkAction = _b === void 0 ? "_self" : _b, markdownOptions = props.markdownOptions, content = props.content, innerProps = __rest(props, ["color", "textColor", "defaultLevel", "defaultLinkAction", "markdownOptions", "content"]);
|
|
30
|
-
// lib hooks
|
|
31
|
-
// state, ref, querystring hooks
|
|
32
|
-
// form hooks
|
|
33
|
-
// query hooks
|
|
34
|
-
// calculated values
|
|
35
|
-
// effects
|
|
36
|
-
// handlers
|
|
37
|
-
return (React.createElement(Typography, __assign({ color: color, textColor: textColor }, innerProps),
|
|
38
|
-
React.createElement(ReactMarkdown, __assign({}, markdownOptions, { children: content, components: __assign({ h1: function (_a) {
|
|
39
|
-
var children = _a.children;
|
|
40
|
-
return (React.createElement(Typography, { color: color, textColor: textColor, level: "h1" }, children));
|
|
41
|
-
}, h2: function (_a) {
|
|
42
|
-
var children = _a.children;
|
|
43
|
-
return (React.createElement(Typography, { color: color, textColor: textColor, level: "h2" }, children));
|
|
44
|
-
}, h3: function (_a) {
|
|
45
|
-
var children = _a.children;
|
|
46
|
-
return (React.createElement(Typography, { color: color, textColor: textColor, level: "h3" }, children));
|
|
47
|
-
}, h4: function (_a) {
|
|
48
|
-
var children = _a.children;
|
|
49
|
-
return (React.createElement(Typography, { color: color, textColor: textColor, level: "h4" }, children));
|
|
50
|
-
}, p: function (_a) {
|
|
51
|
-
var children = _a.children;
|
|
52
|
-
return (React.createElement(Typography, { color: color, textColor: textColor, level: defaultLevel }, children));
|
|
53
|
-
}, a: function (_a) {
|
|
54
|
-
var children = _a.children, href = _a.href;
|
|
55
|
-
return (React.createElement(Link, { href: href, target: defaultLinkAction }, children));
|
|
56
|
-
}, hr: function () { return React.createElement(Divider, null); } }, markdownOptions === null || markdownOptions === void 0 ? void 0 : markdownOptions.components) }))));
|
|
57
|
-
};
|
|
58
|
-
export { Markdown };
|
|
59
|
-
Markdown.displayName = "Markdown";
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import React from "react";
|
|
13
|
-
import { Menu as JoyMenu, MenuButton as JoyMenuButton, MenuItem as JoyMenuItem, } from "@mui/joy";
|
|
14
|
-
import { motion } from "framer-motion";
|
|
15
|
-
var MotionMenu = motion(JoyMenu);
|
|
16
|
-
var Menu = function (props) {
|
|
17
|
-
// prop destruction
|
|
18
|
-
// lib hooks
|
|
19
|
-
// state, ref, querystring hooks
|
|
20
|
-
// form hooks
|
|
21
|
-
// query hooks
|
|
22
|
-
// calculated values
|
|
23
|
-
// effects
|
|
24
|
-
// handlers
|
|
25
|
-
return React.createElement(MotionMenu, __assign({}, props));
|
|
26
|
-
};
|
|
27
|
-
export { Menu };
|
|
28
|
-
Menu.displayName = "Menu";
|
|
29
|
-
var MotionMenuButton = motion(JoyMenuButton);
|
|
30
|
-
var MenuButton = function (props) {
|
|
31
|
-
// prop destruction
|
|
32
|
-
// lib hooks
|
|
33
|
-
// state, ref, querystring hooks
|
|
34
|
-
// form hooks
|
|
35
|
-
// query hooks
|
|
36
|
-
// calculated values
|
|
37
|
-
// effects
|
|
38
|
-
// handlers
|
|
39
|
-
return React.createElement(MotionMenuButton, __assign({}, props));
|
|
40
|
-
};
|
|
41
|
-
export { MenuButton };
|
|
42
|
-
MenuButton.displayName = "MenuButton";
|
|
43
|
-
var MotionMenuItem = motion(JoyMenuItem);
|
|
44
|
-
var MenuItem = function (props) {
|
|
45
|
-
// prop destruction
|
|
46
|
-
// lib hooks
|
|
47
|
-
// state, ref, querystring hooks
|
|
48
|
-
// form hooks
|
|
49
|
-
// query hooks
|
|
50
|
-
// calculated values
|
|
51
|
-
// effects
|
|
52
|
-
// handlers
|
|
53
|
-
return React.createElement(MotionMenuItem, __assign({}, props));
|
|
54
|
-
};
|
|
55
|
-
export { MenuItem };
|
|
56
|
-
MenuItem.displayName = "MenuItem";
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import React from "react";
|
|
24
|
-
import { Modal as JoyModal, ModalDialog as JoyModalDialog, ModalClose as JoyModalClose, ModalOverflow as JoyModalOverflow, styled, } from "@mui/joy";
|
|
25
|
-
import { motion } from "framer-motion";
|
|
26
|
-
import DialogTitle from "../DialogTitle";
|
|
27
|
-
import DialogContent from "../DialogContent";
|
|
28
|
-
var MotionModal = motion(JoyModal);
|
|
29
|
-
var Modal = MotionModal;
|
|
30
|
-
export { Modal };
|
|
31
|
-
Modal.displayName = "Modal";
|
|
32
|
-
var MotionModalDialog = motion(JoyModalDialog);
|
|
33
|
-
var StyledModalDialog = styled(MotionModalDialog)({
|
|
34
|
-
padding: 0,
|
|
35
|
-
});
|
|
36
|
-
var ModalDialog = StyledModalDialog;
|
|
37
|
-
export { ModalDialog };
|
|
38
|
-
ModalDialog.displayName = "ModalDialog";
|
|
39
|
-
var MotionModalClose = motion(JoyModalClose);
|
|
40
|
-
var ModalClose = MotionModalClose;
|
|
41
|
-
export { ModalClose };
|
|
42
|
-
ModalClose.displayName = "ModalClose";
|
|
43
|
-
var MotionModalOverflow = motion(JoyModalOverflow);
|
|
44
|
-
var ModalOverflow = MotionModalOverflow;
|
|
45
|
-
export { ModalOverflow };
|
|
46
|
-
ModalOverflow.displayName = "ModalOverflow";
|
|
47
|
-
function ModalFrame(props) {
|
|
48
|
-
// prop destruction
|
|
49
|
-
var title = props.title, children = props.children, innerProps = __rest(props, ["title", "children"]);
|
|
50
|
-
// lib hooks
|
|
51
|
-
// state, ref, querystring hooks
|
|
52
|
-
// form hooks
|
|
53
|
-
// query hooks
|
|
54
|
-
// calculated values
|
|
55
|
-
// effects
|
|
56
|
-
// handlers
|
|
57
|
-
return (React.createElement(StyledModalDialog, __assign({}, innerProps),
|
|
58
|
-
React.createElement(ModalClose, null),
|
|
59
|
-
React.createElement(DialogTitle, null, title),
|
|
60
|
-
React.createElement(DialogContent, null, children)));
|
|
61
|
-
}
|
|
62
|
-
export { ModalFrame };
|
|
63
|
-
ModalFrame.displayName = "ModalFrame";
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState, } from "react";
|
|
24
|
-
import { IMaskInput, IMask } from "react-imask";
|
|
25
|
-
// @ts-ignore: ESM import 해야만 프레이머에서 정상적으로 동작한다. https://github.com/mui/material-ui/issues/35233
|
|
26
|
-
import CalendarTodayIcon from "@mui/icons-material/esm/CalendarToday.js";
|
|
27
|
-
import { styled } from "@mui/joy";
|
|
28
|
-
import { FocusTrap, ClickAwayListener, Popper } from "@mui/base";
|
|
29
|
-
import Input from "../Input";
|
|
30
|
-
import IconButton from "../IconButton";
|
|
31
|
-
import Sheet from "../Sheet";
|
|
32
|
-
import Calendar from "../Calendar";
|
|
33
|
-
import DialogActions from "../DialogActions";
|
|
34
|
-
import Button from "../Button";
|
|
35
|
-
import FormControl from "../FormControl";
|
|
36
|
-
import FormLabel from "../FormLabel";
|
|
37
|
-
import FormHelperText from "../FormHelperText";
|
|
38
|
-
var StyledPopper = styled(Popper, {
|
|
39
|
-
name: "MonthPicker",
|
|
40
|
-
slot: "popper",
|
|
41
|
-
})(function (_a) {
|
|
42
|
-
var theme = _a.theme;
|
|
43
|
-
return ({
|
|
44
|
-
zIndex: theme.zIndex.tooltip,
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
var CalendarSheet = styled(Sheet, {
|
|
48
|
-
name: "MonthPicker",
|
|
49
|
-
slot: "sheet",
|
|
50
|
-
overridesResolver: function (props, styles) { return styles.root; },
|
|
51
|
-
})(function (_a) {
|
|
52
|
-
var theme = _a.theme;
|
|
53
|
-
return ({
|
|
54
|
-
width: "264px",
|
|
55
|
-
boxShadow: theme.shadow.md,
|
|
56
|
-
borderRadius: theme.radius.md,
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
var MonthPickerContainer = styled("div", {
|
|
60
|
-
name: "MonthPicker",
|
|
61
|
-
slot: "container",
|
|
62
|
-
})({
|
|
63
|
-
width: "100%",
|
|
64
|
-
});
|
|
65
|
-
var formatDateMonth = function (date) {
|
|
66
|
-
var month = "".concat(date.getMonth() + 1);
|
|
67
|
-
var year = date.getFullYear();
|
|
68
|
-
if (Number(month) < 10)
|
|
69
|
-
month = "0" + month;
|
|
70
|
-
return [year, month].join("/");
|
|
71
|
-
};
|
|
72
|
-
var formatValueString = function (date) {
|
|
73
|
-
var getStr = function (dateString) {
|
|
74
|
-
// YYYY/MM(/DD)
|
|
75
|
-
if (!/^\d\d\d\d\/(0[1-9]|1[012])(\/(0[1-9]|[23][0-9]))?$/.test(dateString)) {
|
|
76
|
-
return dateString;
|
|
77
|
-
}
|
|
78
|
-
var yearMonthDay = dateString.split("/");
|
|
79
|
-
var date = new Date(Number(yearMonthDay[0]), Number(yearMonthDay[1]) - 1);
|
|
80
|
-
return formatDateMonth(date);
|
|
81
|
-
};
|
|
82
|
-
return getStr(date);
|
|
83
|
-
};
|
|
84
|
-
var parseDate = function (str) {
|
|
85
|
-
return str.split(" - ")[0] || "";
|
|
86
|
-
};
|
|
87
|
-
var TextMaskAdapter = React.forwardRef(function TextMaskAdapter(props, ref) {
|
|
88
|
-
var onChange = props.onChange, other = __rest(props, ["onChange"]);
|
|
89
|
-
return (React.createElement(IMaskInput, __assign({}, other, { inputRef: ref, onAccept: function (value) {
|
|
90
|
-
return onChange({ target: { name: props.name, value: value } });
|
|
91
|
-
}, mask: Date,
|
|
92
|
-
// other options are optional
|
|
93
|
-
pattern: "Y/m",
|
|
94
|
-
// you can provide your own blocks definitions, default blocks for date mask are:
|
|
95
|
-
blocks: {
|
|
96
|
-
m: {
|
|
97
|
-
mask: IMask.MaskedRange,
|
|
98
|
-
from: 1,
|
|
99
|
-
to: 12,
|
|
100
|
-
maxLength: 2,
|
|
101
|
-
},
|
|
102
|
-
Y: {
|
|
103
|
-
mask: IMask.MaskedRange,
|
|
104
|
-
from: 1900,
|
|
105
|
-
to: 9999,
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
// define date -> str convertion
|
|
109
|
-
format: formatValueString,
|
|
110
|
-
// define str -> date convertion
|
|
111
|
-
parse: parseDate })));
|
|
112
|
-
});
|
|
113
|
-
var MonthPicker = forwardRef(function (props, ref) {
|
|
114
|
-
// prop destruction
|
|
115
|
-
var onChange = props.onChange, disabled = props.disabled, label = props.label, error = props.error, helperText = props.helperText, minDate = props.minDate, maxDate = props.maxDate, disableFuture = props.disableFuture, disablePast = props.disablePast, required = props.required, innerProps = __rest(props, ["onChange", "disabled", "label", "error", "helperText", "minDate", "maxDate", "disableFuture", "disablePast", "required"]);
|
|
116
|
-
// lib hooks
|
|
117
|
-
// state, ref, querystring hooks
|
|
118
|
-
var innerRef = useRef(null);
|
|
119
|
-
var _a = useState(props.value || ""), value = _a[0], setValue = _a[1];
|
|
120
|
-
var _b = useState(null), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
121
|
-
// form hooks
|
|
122
|
-
// query hooks
|
|
123
|
-
// calculated values
|
|
124
|
-
var open = Boolean(anchorEl);
|
|
125
|
-
// effects
|
|
126
|
-
useEffect(function () {
|
|
127
|
-
setValue(props.value ? formatValueString(parseDate(props.value)) : "");
|
|
128
|
-
}, [props.value]);
|
|
129
|
-
useEffect(function () {
|
|
130
|
-
var _a;
|
|
131
|
-
if (!anchorEl) {
|
|
132
|
-
// NOTE: 변경된 값을 blur이벤트 핸들러에서 다룰려면 calendar tooltip이 닫힐 때 blur 이벤트를 발생시켜야 한다.
|
|
133
|
-
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
134
|
-
}
|
|
135
|
-
}, [anchorEl, innerRef]);
|
|
136
|
-
useImperativeHandle(ref, function () { return innerRef.current; }, [
|
|
137
|
-
innerRef.current,
|
|
138
|
-
]);
|
|
139
|
-
// handlers
|
|
140
|
-
var handleChange = useCallback(function (event) {
|
|
141
|
-
setValue(event.target.value);
|
|
142
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
143
|
-
}, [onChange]);
|
|
144
|
-
var handleCalendarToggle = useCallback(function (event) {
|
|
145
|
-
var _a;
|
|
146
|
-
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
147
|
-
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
148
|
-
}, [anchorEl, setAnchorEl, innerRef]);
|
|
149
|
-
var picker = (React.createElement(MonthPickerContainer, null,
|
|
150
|
-
React.createElement(FocusTrap, { open: true },
|
|
151
|
-
React.createElement(React.Fragment, null,
|
|
152
|
-
React.createElement(Input, __assign({}, innerProps, { color: error ? "danger" : innerProps.color, ref: innerRef, size: "sm", value: value, onChange: handleChange, placeholder: "YYYY/MM", disabled: disabled, required: required, slotProps: {
|
|
153
|
-
input: { component: TextMaskAdapter, ref: innerRef },
|
|
154
|
-
}, sx: {
|
|
155
|
-
// NOTE: placeholder char 를 텍스트로 표시하므로 동일한 너비를 가지는 mono font 를 사용해야 이질감이 없다.
|
|
156
|
-
fontFamily: "monospace",
|
|
157
|
-
}, endDecorator: React.createElement(IconButton, { variant: "plain", onClick: handleCalendarToggle },
|
|
158
|
-
React.createElement(CalendarTodayIcon, null)) })),
|
|
159
|
-
open && (React.createElement(ClickAwayListener, { onClickAway: function () { return setAnchorEl(null); } },
|
|
160
|
-
React.createElement(StyledPopper, { id: "date-picker-popper", open: true, anchorEl: anchorEl, placement: "bottom-end",
|
|
161
|
-
// NOTE: 값이 변경 되기전 blur 이벤트 방지
|
|
162
|
-
onMouseDown: function (e) { return e.preventDefault(); }, modifiers: [
|
|
163
|
-
{
|
|
164
|
-
name: "offset",
|
|
165
|
-
options: {
|
|
166
|
-
offset: [4, 4],
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
] },
|
|
170
|
-
React.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" },
|
|
171
|
-
React.createElement(Calendar, { view: "month", views: ["month"], value: !Number.isNaN(new Date(value).getTime())
|
|
172
|
-
? [new Date(value), undefined]
|
|
173
|
-
: undefined, onChange: function (_a) {
|
|
174
|
-
var date = _a[0];
|
|
175
|
-
handleChange({
|
|
176
|
-
target: {
|
|
177
|
-
name: props.name,
|
|
178
|
-
value: formatValueString(formatDateMonth(date)),
|
|
179
|
-
},
|
|
180
|
-
});
|
|
181
|
-
setAnchorEl(null);
|
|
182
|
-
}, minDate: minDate ? new Date(minDate) : undefined, maxDate: maxDate ? new Date(maxDate) : undefined, disableFuture: disableFuture, disablePast: disablePast }),
|
|
183
|
-
React.createElement(DialogActions, { sx: {
|
|
184
|
-
p: 1,
|
|
185
|
-
} },
|
|
186
|
-
React.createElement(Button, { size: "sm", variant: "plain", color: "neutral", onClick: function () {
|
|
187
|
-
handleChange({
|
|
188
|
-
target: {
|
|
189
|
-
name: props.name,
|
|
190
|
-
value: "",
|
|
191
|
-
},
|
|
192
|
-
});
|
|
193
|
-
setAnchorEl(null);
|
|
194
|
-
} }, "Clear"))))))))));
|
|
195
|
-
if (label) {
|
|
196
|
-
return (React.createElement(FormControl, { required: required, disabled: disabled, error: error, size: "sm" },
|
|
197
|
-
React.createElement(FormLabel, null, label),
|
|
198
|
-
picker,
|
|
199
|
-
helperText && React.createElement(FormHelperText, null, helperText)));
|
|
200
|
-
}
|
|
201
|
-
return picker;
|
|
202
|
-
});
|
|
203
|
-
export { MonthPicker };
|