@ceed/cds 0.0.186 → 0.0.187-cjs.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_commonjsHelpers.js +33 -0
- package/dist/_virtual/bind-all.js +5 -0
- package/dist/_virtual/bind.js +5 -0
- package/dist/_virtual/colorManipulator.js +7 -0
- package/dist/_virtual/colorManipulator2.js +5 -0
- package/dist/_virtual/createStyled.js +9 -0
- package/dist/_virtual/createStyled2.js +5 -0
- package/dist/_virtual/extends.js +5 -0
- package/dist/_virtual/index.js +7 -0
- package/dist/_virtual/index10.js +8 -0
- package/dist/_virtual/index11.js +12 -0
- package/dist/_virtual/index12.js +12 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index3.js +9 -0
- package/dist/_virtual/index4.js +5 -0
- package/dist/_virtual/index5.js +8 -0
- package/dist/_virtual/index6.js +8 -0
- package/dist/_virtual/index7.js +12 -0
- package/dist/_virtual/index8.js +8 -0
- package/dist/_virtual/index9.js +8 -0
- package/dist/_virtual/interopRequireDefault.js +5 -0
- package/dist/_virtual/objectWithoutPropertiesLoose.js +5 -0
- package/dist/components/Accordions/Accordions.js +48 -0
- package/dist/components/Autocomplete/Autocomplete.js +198 -0
- package/dist/components/Autocomplete/index.js +10 -0
- package/dist/components/Avatar/Avatar.js +47 -0
- package/dist/components/Box/Box.js +10 -0
- package/dist/components/Box/index.js +10 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +49 -0
- package/dist/components/Button/Button.js +22 -0
- package/dist/components/Button/index.js +10 -0
- package/dist/components/Calendar/Calendar.js +335 -0
- package/dist/components/Calendar/hooks/use-calendar-props.js +76 -0
- package/dist/components/Calendar/hooks/use-calendar.js +249 -0
- package/dist/components/Calendar/index.js +10 -0
- package/dist/components/Calendar/utils/index.js +84 -0
- package/dist/components/Card/Card.js +26 -0
- package/dist/components/Checkbox/Checkbox.js +21 -0
- package/dist/components/Checkbox/index.js +10 -0
- package/dist/components/Chip/Chip.js +10 -0
- package/dist/components/Chip/index.js +10 -0
- package/dist/components/Container/Container.js +51 -0
- package/dist/components/CurrencyInput/CurrencyInput.js +93 -0
- package/dist/components/CurrencyInput/hooks/use-currency-setting.js +169 -0
- package/dist/components/CurrencyInput/index.js +10 -0
- package/dist/components/DataTable/DataTable.js +570 -0
- package/dist/components/DatePicker/DatePicker.js +212 -0
- package/dist/components/DatePicker/index.js +10 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +215 -0
- package/dist/components/DialogActions/DialogActions.js +16 -0
- package/dist/components/DialogActions/index.js +10 -0
- package/dist/components/DialogContent/DialogContent.js +13 -0
- package/dist/components/DialogContent/index.js +10 -0
- package/dist/components/DialogFrame/DialogFrame.js +33 -0
- package/dist/components/DialogTitle/DialogTitle.js +13 -0
- package/dist/components/DialogTitle/index.js +10 -0
- package/dist/components/Divider/Divider.js +21 -0
- package/dist/components/Drawer/Drawer.js +42 -0
- package/dist/components/Dropdown/Dropdown.js +10 -0
- package/dist/components/Dropdown/index.js +10 -0
- package/dist/components/FormControl/FormControl.js +17 -0
- package/dist/components/FormControl/index.js +10 -0
- package/dist/components/FormHelperText/FormHelperText.js +10 -0
- package/dist/components/FormHelperText/index.js +10 -0
- package/dist/components/FormLabel/FormLabel.js +10 -0
- package/dist/components/FormLabel/index.js +10 -0
- package/dist/components/IconButton/IconButton.js +22 -0
- package/dist/components/IconButton/index.js +10 -0
- package/dist/components/Input/Input.js +62 -0
- package/dist/components/Input/index.js +10 -0
- package/dist/components/InsetDrawer/InsetDrawer.js +32 -0
- package/dist/components/Markdown/Markdown.d.ts +6 -22
- package/dist/components/Markdown/Markdown.js +86 -0
- package/dist/components/Menu/Menu.js +46 -0
- package/dist/components/Menu/index.js +11 -0
- package/dist/components/MenuButton/MenuButton.d.ts +1 -1
- package/dist/components/MenuButton/MenuButton.js +28 -0
- package/dist/components/Modal/Modal.js +49 -0
- package/dist/components/MonthPicker/MonthPicker.js +164 -0
- package/dist/components/MonthRangePicker/MonthRangePicker.js +174 -0
- package/dist/components/NavigationGroup/NavigationGroup.js +44 -0
- package/dist/components/NavigationItem/NavigationItem.js +47 -0
- package/dist/components/Navigator/Navigator.js +32 -0
- package/dist/components/Pagination/Pagination.js +119 -0
- package/dist/components/Pagination/index.js +10 -0
- package/dist/components/PercentageInput/PercentageInput.js +87 -0
- package/dist/components/Radio/Radio.js +14 -0
- package/dist/components/RadioList/RadioList.js +20 -0
- package/dist/components/Select/Select.js +59 -0
- package/dist/components/Select/index.js +11 -0
- package/dist/components/Sheet/Sheet.js +10 -0
- package/dist/components/Sheet/index.js +10 -0
- package/dist/components/Stack/index.js +16 -0
- package/dist/components/Stepper/Stepper.js +70 -0
- package/dist/components/Switch/Switch.js +48 -0
- package/dist/components/Table/Table.js +68 -0
- package/dist/components/Tabs/Tabs.js +22 -0
- package/dist/components/Textarea/Textarea.d.ts +3 -17
- package/dist/components/Textarea/Textarea.js +33 -0
- package/dist/components/Textarea/index.js +10 -0
- package/dist/components/ThemeProvider/ThemeProvider.js +250 -0
- package/dist/components/Tooltip/Tooltip.js +21 -0
- package/dist/components/Tooltip/index.js +10 -0
- package/dist/components/Typography/Typography.js +21 -0
- package/dist/components/Typography/index.js +10 -0
- package/dist/components/Uploader/Uploader.d.ts +1 -1
- package/dist/components/Uploader/Uploader.js +366 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter-native-data-key.js +10 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/external-adapter.js +251 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/get-element-from-point-without-honey-pot.js +21 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/honey-pot-data-attribute.js +7 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/is-honey-pot-element.js +9 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js +130 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js +342 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/usage-ledger.js +35 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-adapter.js +62 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-drop-target.js +314 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-monitor.js +98 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/combine.js +15 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/external/file.js +26 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/once.js +20 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/prevent-unhandled.js +104 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/add-attribute.js +12 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/android.js +5 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js +126 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-entering-window.js +57 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-from-another-window.js +20 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window.js +57 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/detect-broken-drag.js +51 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/get-input.js +18 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-firefox.js +17 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari.js +20 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/text-media-type.js +10 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/arrayLikeToArray.js +9 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/arrayWithHoles.js +7 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/arrayWithoutHoles.js +9 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/defineProperty.js +20 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/iterableToArray.js +7 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/iterableToArrayLimit.js +28 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/nonIterableRest.js +7 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/nonIterableSpread.js +7 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/slicedToArray.js +12 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/toConsumableArray.js +12 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/toPrimitive.js +16 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/toPropertyKey.js +11 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/typeof.js +13 -0
- package/dist/external/@atlaskit/pragmatic-drag-and-drop/external/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +14 -0
- package/dist/external/@babel/runtime/helpers/esm/extends.js +18 -0
- package/dist/external/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +16 -0
- package/dist/external/@babel/runtime/helpers/extends.js +30 -0
- package/dist/external/@babel/runtime/helpers/interopRequireDefault.js +21 -0
- package/dist/external/@babel/runtime/helpers/objectWithoutPropertiesLoose.js +28 -0
- package/dist/external/@emotion/cache/dist/emotion-cache.esm.js +655 -0
- package/dist/external/@emotion/memoize/dist/emotion-memoize.esm.js +11 -0
- package/dist/external/@emotion/sheet/dist/emotion-sheet.esm.js +156 -0
- package/dist/external/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js +18 -0
- package/dist/external/@mui/icons-material/esm/ArrowUpwardRounded.js +10 -0
- package/dist/external/@mui/icons-material/esm/CalendarToday.js +10 -0
- package/dist/external/@mui/icons-material/esm/Check.js +10 -0
- package/dist/external/@mui/icons-material/esm/ChevronLeft.js +10 -0
- package/dist/external/@mui/icons-material/esm/ChevronRight.js +10 -0
- package/dist/external/@mui/icons-material/esm/ClearRounded.js +10 -0
- package/dist/external/@mui/icons-material/esm/Close.js +10 -0
- package/dist/external/@mui/icons-material/esm/CloudUploadRounded.js +10 -0
- package/dist/external/@mui/icons-material/esm/ExpandMore.js +10 -0
- package/dist/external/@mui/icons-material/esm/Info.js +10 -0
- package/dist/external/@mui/icons-material/esm/UploadFileRounded.js +10 -0
- package/dist/external/@mui/material/SvgIcon/SvgIcon.js +207 -0
- package/dist/external/@mui/material/SvgIcon/svgIconClasses.js +11 -0
- package/dist/external/@mui/material/colors/blue.js +20 -0
- package/dist/external/@mui/material/colors/common.js +8 -0
- package/dist/external/@mui/material/colors/green.js +20 -0
- package/dist/external/@mui/material/colors/grey.js +20 -0
- package/dist/external/@mui/material/colors/lightBlue.js +20 -0
- package/dist/external/@mui/material/colors/orange.js +20 -0
- package/dist/external/@mui/material/colors/purple.js +20 -0
- package/dist/external/@mui/material/colors/red.js +20 -0
- package/dist/external/@mui/material/styles/createMixins.js +21 -0
- package/dist/external/@mui/material/styles/createPalette.js +314 -0
- package/dist/external/@mui/material/styles/createTheme.js +84 -0
- package/dist/external/@mui/material/styles/createTransitions.js +97 -0
- package/dist/external/@mui/material/styles/createTypography.js +95 -0
- package/dist/external/@mui/material/styles/defaultTheme.js +7 -0
- package/dist/external/@mui/material/styles/identifier.js +5 -0
- package/dist/external/@mui/material/styles/rootShouldForwardProp.js +7 -0
- package/dist/external/@mui/material/styles/shadows.js +13 -0
- package/dist/external/@mui/material/styles/slotShouldForwardProp.js +8 -0
- package/dist/external/@mui/material/styles/styled.js +17 -0
- package/dist/external/@mui/material/styles/useThemeProps.js +19 -0
- package/dist/external/@mui/material/styles/zIndex.js +16 -0
- package/dist/external/@mui/material/utils/capitalize.js +7 -0
- package/dist/external/@mui/material/utils/createSvgIcon.js +45 -0
- package/dist/external/@mui/styled-engine/GlobalStyles/GlobalStyles.js +26 -0
- package/dist/external/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js +39 -0
- package/dist/external/@mui/styled-engine/index.js +57 -0
- package/dist/external/@mui/system/colorManipulator.js +387 -0
- package/dist/external/@mui/system/createStyled.js +272 -0
- package/dist/external/@mui/system/esm/borders.js +66 -0
- package/dist/external/@mui/system/esm/breakpoints.js +71 -0
- package/dist/external/@mui/system/esm/compose.js +28 -0
- package/dist/external/@mui/system/esm/createTheme/applyStyles.js +78 -0
- package/dist/external/@mui/system/esm/createTheme/createBreakpoints.js +84 -0
- package/dist/external/@mui/system/esm/createTheme/createSpacing.js +36 -0
- package/dist/external/@mui/system/esm/createTheme/createTheme.js +47 -0
- package/dist/external/@mui/system/esm/createTheme/index.js +13 -0
- package/dist/external/@mui/system/esm/createTheme/shape.js +7 -0
- package/dist/external/@mui/system/esm/cssGrid.js +99 -0
- package/dist/external/@mui/system/esm/memoize.js +13 -0
- package/dist/external/@mui/system/esm/merge.js +14 -0
- package/dist/external/@mui/system/esm/palette.js +33 -0
- package/dist/external/@mui/system/esm/responsivePropType.js +7 -0
- package/dist/external/@mui/system/esm/sizing.js +76 -0
- package/dist/external/@mui/system/esm/spacing.js +153 -0
- package/dist/external/@mui/system/esm/style.js +83 -0
- package/dist/external/@mui/system/esm/styleFunctionSx/defaultSxConfig.js +295 -0
- package/dist/external/@mui/system/esm/styleFunctionSx/extendSxProp.js +53 -0
- package/dist/external/@mui/system/esm/styleFunctionSx/index.js +14 -0
- package/dist/external/@mui/system/esm/styleFunctionSx/styleFunctionSx.js +134 -0
- package/dist/external/@mui/system/esm/useTheme.js +14 -0
- package/dist/external/@mui/system/esm/useThemeProps/getThemeProps.js +17 -0
- package/dist/external/@mui/system/esm/useThemeProps/useThemeProps.js +24 -0
- package/dist/external/@mui/system/esm/useThemeWithoutDefault.js +33 -0
- package/dist/external/@mui/utils/ClassNameGenerator/ClassNameGenerator.js +20 -0
- package/dist/external/@mui/utils/capitalize/capitalize.js +16 -0
- package/dist/external/@mui/utils/capitalize/index.js +7 -0
- package/dist/external/@mui/utils/clamp/clamp.js +7 -0
- package/dist/external/@mui/utils/clamp/index.js +7 -0
- package/dist/external/@mui/utils/composeClasses/composeClasses.js +25 -0
- package/dist/external/@mui/utils/deepmerge/deepmerge.js +49 -0
- package/dist/external/@mui/utils/deepmerge/index.js +10 -0
- package/dist/external/@mui/utils/formatMuiErrorMessage/formatMuiErrorMessage.js +23 -0
- package/dist/external/@mui/utils/formatMuiErrorMessage/index.js +7 -0
- package/dist/external/@mui/utils/generateUtilityClass/generateUtilityClass.js +27 -0
- package/dist/external/@mui/utils/generateUtilityClasses/generateUtilityClasses.js +13 -0
- package/dist/external/@mui/utils/getDisplayName/getDisplayName.js +54 -0
- package/dist/external/@mui/utils/getDisplayName/index.js +10 -0
- package/dist/external/@mui/utils/resolveProps/resolveProps.js +39 -0
- package/dist/external/bind-event-listener/dist/bind-all.js +56 -0
- package/dist/external/bind-event-listener/dist/bind.js +23 -0
- package/dist/external/bind-event-listener/dist/index.js +23 -0
- package/dist/external/clsx/dist/clsx.js +8 -0
- package/dist/external/object-assign/index.js +101 -0
- package/dist/external/prop-types/checkPropTypes.js +117 -0
- package/dist/external/prop-types/factoryWithThrowingShims.js +76 -0
- package/dist/external/prop-types/factoryWithTypeCheckers.js +627 -0
- package/dist/external/prop-types/index.js +35 -0
- package/dist/external/prop-types/lib/ReactPropTypesSecret.js +23 -0
- package/dist/external/prop-types/lib/has.js +13 -0
- package/dist/external/raf-schd/dist/raf-schd.esm.js +36 -0
- package/dist/external/stylis/src/Enum.js +22 -0
- package/dist/external/stylis/src/Middleware.js +35 -0
- package/dist/external/stylis/src/Parser.js +199 -0
- package/dist/external/stylis/src/Serializer.js +41 -0
- package/dist/external/stylis/src/Tokenizer.js +241 -0
- package/dist/external/stylis/src/Utility.js +132 -0
- package/dist/hooks/use-controlled-state/index.js +25 -0
- package/dist/index.js +521 -2
- package/dist/libs/rehype-accent/index.js +41 -0
- package/package.json +8 -5
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var reactImask = require('react-imask');
|
|
5
|
+
var CalendarToday = require('../../external/@mui/icons-material/esm/CalendarToday.js');
|
|
6
|
+
var joy = require('@mui/joy');
|
|
7
|
+
var base = require('@mui/base');
|
|
8
|
+
var Input = require('../Input/Input.js');
|
|
9
|
+
var IconButton = require('../IconButton/IconButton.js');
|
|
10
|
+
var Sheet = require('../Sheet/Sheet.js');
|
|
11
|
+
var Calendar = require('../Calendar/Calendar.js');
|
|
12
|
+
var DialogActions = require('../DialogActions/DialogActions.js');
|
|
13
|
+
var Button = require('../Button/Button.js');
|
|
14
|
+
var index = require('../../hooks/use-controlled-state/index.js');
|
|
15
|
+
|
|
16
|
+
const CalendarButton = joy.styled(IconButton.IconButton, {
|
|
17
|
+
name: "DatePicker",
|
|
18
|
+
slot: "calendarButton",
|
|
19
|
+
})(({ theme }) => ({
|
|
20
|
+
'&:focus': {
|
|
21
|
+
'--Icon-color': 'currentColor',
|
|
22
|
+
outlineOffset: `${theme.getCssVar('focus-thickness')}`,
|
|
23
|
+
outline: `${theme.getCssVar('focus-thickness')} solid ${theme.getCssVar('palette-focusVisible')}`
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
const StyledPopper = joy.styled(base.Popper, {
|
|
27
|
+
name: "DatePicker",
|
|
28
|
+
slot: "popper",
|
|
29
|
+
})(({ theme }) => ({
|
|
30
|
+
zIndex: theme.zIndex.tooltip,
|
|
31
|
+
}));
|
|
32
|
+
const CalendarSheet = joy.styled(Sheet.Sheet, {
|
|
33
|
+
name: "DatePicker",
|
|
34
|
+
slot: "sheet",
|
|
35
|
+
overridesResolver: (props, styles) => styles.root,
|
|
36
|
+
})(({ theme }) => ({
|
|
37
|
+
width: "264px",
|
|
38
|
+
boxShadow: theme.shadow.md,
|
|
39
|
+
borderRadius: theme.radius.md,
|
|
40
|
+
}));
|
|
41
|
+
const DatePickerRoot = joy.styled("div", {
|
|
42
|
+
name: "DatePicker",
|
|
43
|
+
slot: "root",
|
|
44
|
+
overridesResolver: (props, styles) => styles.root,
|
|
45
|
+
})({
|
|
46
|
+
width: "100%",
|
|
47
|
+
});
|
|
48
|
+
const formatValueString = (date, format) => {
|
|
49
|
+
let day = `${date.getDate()}`;
|
|
50
|
+
let month = `${date.getMonth() + 1}`;
|
|
51
|
+
const year = date.getFullYear();
|
|
52
|
+
if (Number(day) < 10)
|
|
53
|
+
day = "0" + day;
|
|
54
|
+
if (Number(month) < 10)
|
|
55
|
+
month = "0" + month;
|
|
56
|
+
return format
|
|
57
|
+
.replace(/YYYY/g, year.toString())
|
|
58
|
+
.replace(/MM/g, month)
|
|
59
|
+
.replace(/DD/g, day);
|
|
60
|
+
};
|
|
61
|
+
function parseDate(dateString, format) {
|
|
62
|
+
const formatParts = format.split(/[-./\s]/);
|
|
63
|
+
const dateParts = dateString.split(/[-./\s]/);
|
|
64
|
+
if (formatParts.length !== dateParts.length) {
|
|
65
|
+
throw new Error("Invalid date string or format");
|
|
66
|
+
}
|
|
67
|
+
let day, month, year;
|
|
68
|
+
for (let i = 0; i < formatParts.length; i++) {
|
|
69
|
+
const value = parseInt(dateParts[i], 10);
|
|
70
|
+
switch (formatParts[i]) {
|
|
71
|
+
case "DD":
|
|
72
|
+
day = value;
|
|
73
|
+
break;
|
|
74
|
+
case "MM":
|
|
75
|
+
month = value - 1; // JavaScript months are 0-indexed
|
|
76
|
+
break;
|
|
77
|
+
case "YYYY":
|
|
78
|
+
year = value;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const result = new Date(year, month, day);
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
const formatToPattern = (format) => {
|
|
86
|
+
return format
|
|
87
|
+
.replace(/YYYY/g, "Y")
|
|
88
|
+
.replace(/MM/g, "M")
|
|
89
|
+
.replace(/DD/g, "D")
|
|
90
|
+
.replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
91
|
+
};
|
|
92
|
+
const TextMaskAdapter = React.forwardRef(function TextMaskAdapter(props, ref) {
|
|
93
|
+
const { onChange, format, ...other } = props;
|
|
94
|
+
return (React.createElement(reactImask.IMaskInput, { ...other, inputRef: ref, onAccept: (value) => onChange({ target: { name: props.name, value } }), mask: Date, pattern: formatToPattern(format), blocks: {
|
|
95
|
+
D: {
|
|
96
|
+
mask: reactImask.IMask.MaskedRange,
|
|
97
|
+
from: 1,
|
|
98
|
+
to: 31,
|
|
99
|
+
maxLength: 2,
|
|
100
|
+
},
|
|
101
|
+
M: {
|
|
102
|
+
mask: reactImask.IMask.MaskedRange,
|
|
103
|
+
from: 1,
|
|
104
|
+
to: 12,
|
|
105
|
+
maxLength: 2,
|
|
106
|
+
},
|
|
107
|
+
Y: {
|
|
108
|
+
mask: reactImask.IMask.MaskedRange,
|
|
109
|
+
from: 1900,
|
|
110
|
+
to: 9999,
|
|
111
|
+
maxLength: 4,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
// define date -> str convertion
|
|
115
|
+
format: (date) => formatValueString(date, format),
|
|
116
|
+
// define str -> date convertion
|
|
117
|
+
parse: (str) => parseDate(str, format), autofix: "pad", overwrite: true }));
|
|
118
|
+
});
|
|
119
|
+
const DatePicker = React.forwardRef((inProps, ref) => {
|
|
120
|
+
// prop destruction
|
|
121
|
+
const props = joy.useThemeProps({ props: inProps, name: "DatePicker" });
|
|
122
|
+
const { onChange, disabled, label, error, helperText, minDate, maxDate, disableFuture, disablePast, required,
|
|
123
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
124
|
+
sx, className, format = "YYYY/MM/DD", size, inputReadOnly, hideClearButton, readOnly, ...innerProps } = props;
|
|
125
|
+
// lib hooks
|
|
126
|
+
// state, ref, querystring hooks
|
|
127
|
+
const innerRef = React.useRef(null);
|
|
128
|
+
const buttonRef = React.useRef(null);
|
|
129
|
+
const [value, setValue] = index.useControlledState(props.value, props.defaultValue || "", React.useCallback((value) => onChange?.({ target: { name: props.name, value } }), [props.name, onChange]), { disableStrict: true });
|
|
130
|
+
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
131
|
+
// form hooks
|
|
132
|
+
// query hooks
|
|
133
|
+
// calculated values
|
|
134
|
+
const open = Boolean(anchorEl);
|
|
135
|
+
// effects
|
|
136
|
+
React.useEffect(() => {
|
|
137
|
+
if (!anchorEl) {
|
|
138
|
+
// NOTE: 변경된 값을 blur이벤트 핸들러에서 다룰려면 calendar tooltip이 닫힐 때 blur 이벤트를 발생시켜야 한다.
|
|
139
|
+
innerRef.current?.blur();
|
|
140
|
+
}
|
|
141
|
+
}, [anchorEl, innerRef]);
|
|
142
|
+
React.useImperativeHandle(ref, () => innerRef.current, [
|
|
143
|
+
innerRef,
|
|
144
|
+
]);
|
|
145
|
+
// handlers
|
|
146
|
+
const handleChange = React.useCallback((event) => {
|
|
147
|
+
setValue(event.target.value);
|
|
148
|
+
}, [setValue]);
|
|
149
|
+
const handleCalendarToggle = React.useCallback((event) => {
|
|
150
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
151
|
+
// Focus the input again after it has been blurred
|
|
152
|
+
setTimeout(() => {
|
|
153
|
+
innerRef.current?.focus();
|
|
154
|
+
}, 0);
|
|
155
|
+
}, [anchorEl, setAnchorEl, innerRef]);
|
|
156
|
+
const handleInputMouseDown = React.useCallback((event) => {
|
|
157
|
+
if (inputReadOnly) {
|
|
158
|
+
event.preventDefault();
|
|
159
|
+
buttonRef.current?.focus();
|
|
160
|
+
}
|
|
161
|
+
}, [inputReadOnly, buttonRef]);
|
|
162
|
+
return (React.createElement(DatePickerRoot, null,
|
|
163
|
+
React.createElement(base.FocusTrap, { open: true },
|
|
164
|
+
React.createElement(React.Fragment, null,
|
|
165
|
+
React.createElement(Input.Input, { ...innerProps, color: error ? "danger" : innerProps.color, ref: innerRef, size: size, value: value, onChange: handleChange, placeholder: format, disabled: disabled, required: required, error: error, slotProps: {
|
|
166
|
+
input: {
|
|
167
|
+
component: TextMaskAdapter,
|
|
168
|
+
ref: innerRef,
|
|
169
|
+
format,
|
|
170
|
+
sx: { "&:hover": { cursor: inputReadOnly || readOnly ? "default" : "text" } },
|
|
171
|
+
onMouseDown: handleInputMouseDown,
|
|
172
|
+
},
|
|
173
|
+
}, className: className, sx: sx, endDecorator: React.createElement(CalendarButton, { ref: buttonRef, variant: "plain", onClick: readOnly ? undefined : handleCalendarToggle, "aria-label": "Toggle Calendar", "aria-controls": "date-picker-popper", "aria-haspopup": "dialog", "aria-expanded": open, disabled: disabled },
|
|
174
|
+
React.createElement(CalendarToday, null)), label: label, helperText: helperText, readOnly: readOnly || inputReadOnly }),
|
|
175
|
+
open && (React.createElement(base.ClickAwayListener, { onClickAway: () => setAnchorEl(null) },
|
|
176
|
+
React.createElement(StyledPopper, { id: "date-picker-popper", open: true, anchorEl: anchorEl, placement: "bottom-end",
|
|
177
|
+
// NOTE: 값이 변경 되기전 blur 이벤트 방지
|
|
178
|
+
onMouseDown: (e) => e.preventDefault(), modifiers: [
|
|
179
|
+
{
|
|
180
|
+
name: "offset",
|
|
181
|
+
options: {
|
|
182
|
+
offset: [4, 4],
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
], "aria-label": "Calendar Tooltip", "aria-expanded": open },
|
|
186
|
+
React.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" },
|
|
187
|
+
React.createElement(Calendar.Calendar, { value: !Number.isNaN(new Date(value).getTime())
|
|
188
|
+
? [new Date(value), undefined]
|
|
189
|
+
: undefined, onChange: ([date]) => {
|
|
190
|
+
handleChange({
|
|
191
|
+
target: {
|
|
192
|
+
name: props.name,
|
|
193
|
+
value: formatValueString(date, format),
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
setAnchorEl(null);
|
|
197
|
+
}, minDate: minDate ? new Date(minDate) : undefined, maxDate: maxDate ? new Date(maxDate) : undefined, disableFuture: disableFuture, disablePast: disablePast }),
|
|
198
|
+
!hideClearButton && (React.createElement(DialogActions.DialogActions, { sx: {
|
|
199
|
+
p: 1,
|
|
200
|
+
} },
|
|
201
|
+
React.createElement(Button.Button, { size: size, variant: "plain", color: "neutral", onClick: () => {
|
|
202
|
+
handleChange({
|
|
203
|
+
target: {
|
|
204
|
+
name: props.name,
|
|
205
|
+
value: "",
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
setAnchorEl(null);
|
|
209
|
+
} }, "Clear")))))))))));
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
exports.DatePicker = DatePicker;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var reactImask = require('react-imask');
|
|
5
|
+
var CalendarToday = require('../../external/@mui/icons-material/esm/CalendarToday.js');
|
|
6
|
+
var joy = require('@mui/joy');
|
|
7
|
+
var base = require('@mui/base');
|
|
8
|
+
var Input = require('../Input/Input.js');
|
|
9
|
+
var IconButton = require('../IconButton/IconButton.js');
|
|
10
|
+
var Sheet = require('../Sheet/Sheet.js');
|
|
11
|
+
var Calendar = require('../Calendar/Calendar.js');
|
|
12
|
+
var DialogActions = require('../DialogActions/DialogActions.js');
|
|
13
|
+
var Button = require('../Button/Button.js');
|
|
14
|
+
var index = require('../../hooks/use-controlled-state/index.js');
|
|
15
|
+
|
|
16
|
+
const CalendarButton = joy.styled(IconButton.IconButton, {
|
|
17
|
+
name: "DateRangePicker",
|
|
18
|
+
slot: "calendarButton",
|
|
19
|
+
})(({ theme }) => ({
|
|
20
|
+
'&:focus': {
|
|
21
|
+
'--Icon-color': 'currentColor',
|
|
22
|
+
outlineOffset: `${theme.getCssVar('focus-thickness')}`,
|
|
23
|
+
outline: `${theme.getCssVar('focus-thickness')} solid ${theme.getCssVar('palette-focusVisible')}`
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
const StyledPopper = joy.styled(base.Popper, {
|
|
27
|
+
name: "DateRangePicker",
|
|
28
|
+
slot: "popper",
|
|
29
|
+
})(({ theme }) => ({
|
|
30
|
+
zIndex: theme.zIndex.tooltip,
|
|
31
|
+
}));
|
|
32
|
+
const CalendarSheet = joy.styled(Sheet.Sheet, {
|
|
33
|
+
name: "DateRangePicker",
|
|
34
|
+
slot: "sheet",
|
|
35
|
+
overridesResolver: (props, styles) => styles.root,
|
|
36
|
+
})(({ theme }) => ({
|
|
37
|
+
zIndex: theme.zIndex.tooltip,
|
|
38
|
+
width: "264px",
|
|
39
|
+
boxShadow: theme.shadow.md,
|
|
40
|
+
borderRadius: theme.radius.md,
|
|
41
|
+
}));
|
|
42
|
+
const DateRangePickerRoot = joy.styled("div", {
|
|
43
|
+
name: "DateRangePicker",
|
|
44
|
+
slot: "root",
|
|
45
|
+
overridesResolver: (props, styles) => styles.root,
|
|
46
|
+
})({
|
|
47
|
+
width: "100%",
|
|
48
|
+
});
|
|
49
|
+
const formatValueString = ([date1, date2], format) => {
|
|
50
|
+
const getStr = (date) => {
|
|
51
|
+
let day = `${date.getDate()}`;
|
|
52
|
+
let month = `${date.getMonth() + 1}`;
|
|
53
|
+
const year = date.getFullYear();
|
|
54
|
+
if (Number(day) < 10)
|
|
55
|
+
day = "0" + day;
|
|
56
|
+
if (Number(month) < 10)
|
|
57
|
+
month = "0" + month;
|
|
58
|
+
return format
|
|
59
|
+
.replace(/YYYY/g, year.toString())
|
|
60
|
+
.replace(/MM/g, month)
|
|
61
|
+
.replace(/DD/g, day);
|
|
62
|
+
};
|
|
63
|
+
return [getStr(date1), date2 ? getStr(date2) : ""].join(" - ");
|
|
64
|
+
};
|
|
65
|
+
function parseDate(dateString, format) {
|
|
66
|
+
const formatParts = format.split(/[-./\s]/);
|
|
67
|
+
const dateParts = dateString.split(/[-./\s]/);
|
|
68
|
+
let day, month, year;
|
|
69
|
+
for (let i = 0; i < formatParts.length; i++) {
|
|
70
|
+
const value = parseInt(dateParts[i], 10);
|
|
71
|
+
switch (formatParts[i]) {
|
|
72
|
+
case "DD":
|
|
73
|
+
day = value;
|
|
74
|
+
break;
|
|
75
|
+
case "MM":
|
|
76
|
+
month = value - 1; // JavaScript months are 0-indexed
|
|
77
|
+
break;
|
|
78
|
+
case "YYYY":
|
|
79
|
+
year = value;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const result = new Date(year, month, day);
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
const parseDates = (str, format) => {
|
|
87
|
+
const date1 = str.split(" - ")[0] || "";
|
|
88
|
+
const date2 = str.split(" - ")[1] || "";
|
|
89
|
+
return [parseDate(date1, format), parseDate(date2, format)];
|
|
90
|
+
};
|
|
91
|
+
const formatToPattern = (format) => {
|
|
92
|
+
return `${format} - ${format}`
|
|
93
|
+
.replace(/YYYY/g, "Y")
|
|
94
|
+
.replace(/MM/g, "M")
|
|
95
|
+
.replace(/DD/g, "D")
|
|
96
|
+
.replace(/[^YMD\s]/g, (match) => `${match}\``);
|
|
97
|
+
};
|
|
98
|
+
const TextMaskAdapter = React.forwardRef(function TextMaskAdapter(props, ref) {
|
|
99
|
+
const { onChange, format, ...other } = props;
|
|
100
|
+
return (React.createElement(reactImask.IMaskInput, { ...other, inputRef: ref, onAccept: (value) => onChange({ target: { name: props.name, value } }), mask: Date,
|
|
101
|
+
// other options are optional
|
|
102
|
+
pattern: formatToPattern(format),
|
|
103
|
+
// you can provide your own blocks definitions, default blocks for date mask are:
|
|
104
|
+
blocks: {
|
|
105
|
+
D: {
|
|
106
|
+
mask: reactImask.IMask.MaskedRange,
|
|
107
|
+
from: 1,
|
|
108
|
+
to: 31,
|
|
109
|
+
maxLength: 2,
|
|
110
|
+
},
|
|
111
|
+
M: {
|
|
112
|
+
mask: reactImask.IMask.MaskedRange,
|
|
113
|
+
from: 1,
|
|
114
|
+
to: 12,
|
|
115
|
+
maxLength: 2,
|
|
116
|
+
},
|
|
117
|
+
Y: {
|
|
118
|
+
mask: reactImask.IMask.MaskedRange,
|
|
119
|
+
from: 1900,
|
|
120
|
+
to: 9999,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
// define date -> str convertion
|
|
124
|
+
format: (dates) => formatValueString(dates, format),
|
|
125
|
+
// define str -> date convertion
|
|
126
|
+
parse: (str) => parseDates(str, format),
|
|
127
|
+
// optional interval options
|
|
128
|
+
// min={new Date(2000, 0, 1)} // defaults to `1900-01-01`
|
|
129
|
+
// max={new Date(2020, 0, 1)} // defaults to `9999-01-01`
|
|
130
|
+
autofix: "pad", overwrite: true }));
|
|
131
|
+
});
|
|
132
|
+
const DateRangePicker = React.forwardRef((inProps, ref) => {
|
|
133
|
+
// prop destruction
|
|
134
|
+
const props = joy.useThemeProps({ props: inProps, name: "DateRangePicker" });
|
|
135
|
+
const { onChange, disabled, label, error, helperText, minDate, maxDate, disableFuture, disablePast, required,
|
|
136
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
137
|
+
sx, className, format = "YYYY/MM/DD", size, inputReadOnly, hideClearButton, readOnly, ...innerProps } = props;
|
|
138
|
+
// lib hooks
|
|
139
|
+
// state, ref, querystring hooks
|
|
140
|
+
const innerRef = React.useRef(null);
|
|
141
|
+
const buttonRef = React.useRef(null);
|
|
142
|
+
const [value, setValue] = index.useControlledState(props.value, props.defaultValue || "", React.useCallback((value) => onChange?.({ target: { name: props.name, value } }), [props.name, onChange]), { disableStrict: true });
|
|
143
|
+
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
144
|
+
// form hooks
|
|
145
|
+
// query hooks
|
|
146
|
+
// calculated values
|
|
147
|
+
const open = Boolean(anchorEl);
|
|
148
|
+
const calendarValue = React.useMemo(() => (value ? parseDates(value, format) : undefined), [value, format]);
|
|
149
|
+
// effects
|
|
150
|
+
React.useEffect(() => {
|
|
151
|
+
if (!anchorEl) {
|
|
152
|
+
// NOTE: 변경된 값을 blur이벤트 핸들러에서 다룰려면 calendar tooltip이 닫힐 때 blur 이벤트를 발생시켜야 한다.
|
|
153
|
+
innerRef.current?.blur();
|
|
154
|
+
}
|
|
155
|
+
}, [anchorEl, innerRef]);
|
|
156
|
+
React.useImperativeHandle(ref, () => innerRef.current, [
|
|
157
|
+
innerRef,
|
|
158
|
+
]);
|
|
159
|
+
// handlers
|
|
160
|
+
const handleChange = React.useCallback((event) => {
|
|
161
|
+
setValue(event.target.value);
|
|
162
|
+
}, [setValue]);
|
|
163
|
+
const handleCalendarToggle = React.useCallback((event) => {
|
|
164
|
+
setAnchorEl(anchorEl ? null : event.currentTarget);
|
|
165
|
+
innerRef.current?.focus();
|
|
166
|
+
}, [anchorEl, setAnchorEl, innerRef]);
|
|
167
|
+
const handleCalendarChange = React.useCallback(([date1, date2]) => {
|
|
168
|
+
if (!date1 || !date2)
|
|
169
|
+
return;
|
|
170
|
+
setValue(formatValueString([date1, date2], format));
|
|
171
|
+
setAnchorEl(null);
|
|
172
|
+
}, [setValue, setAnchorEl, format]);
|
|
173
|
+
const handleInputMouseDown = React.useCallback((event) => {
|
|
174
|
+
if (inputReadOnly) {
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
buttonRef.current?.focus();
|
|
177
|
+
}
|
|
178
|
+
}, [inputReadOnly, buttonRef]);
|
|
179
|
+
return (React.createElement(DateRangePickerRoot, null,
|
|
180
|
+
React.createElement(base.FocusTrap, { open: true },
|
|
181
|
+
React.createElement(React.Fragment, null,
|
|
182
|
+
React.createElement(Input.Input, { ...innerProps, color: error ? "danger" : innerProps.color, ref: ref, size: size, value: value, onChange: handleChange, disabled: disabled, required: required, placeholder: `${format} - ${format}`, slotProps: {
|
|
183
|
+
input: {
|
|
184
|
+
component: TextMaskAdapter,
|
|
185
|
+
ref: innerRef,
|
|
186
|
+
format,
|
|
187
|
+
sx: { "&:hover": { cursor: inputReadOnly || readOnly ? "default" : "text" } },
|
|
188
|
+
onMouseDown: handleInputMouseDown,
|
|
189
|
+
},
|
|
190
|
+
}, error: error, className: className, sx: sx, endDecorator: React.createElement(CalendarButton, { ref: buttonRef, variant: "plain", onClick: readOnly ? undefined : handleCalendarToggle, "aria-label": "Toggle Calendar", "aria-controls": "date-range-picker-popper", "aria-haspopup": "dialog", "aria-expanded": open, disabled: disabled },
|
|
191
|
+
React.createElement(CalendarToday, null)), label: label, helperText: helperText, readOnly: readOnly || inputReadOnly }),
|
|
192
|
+
open && (React.createElement(base.ClickAwayListener, { onClickAway: () => setAnchorEl(null) },
|
|
193
|
+
React.createElement(StyledPopper, { id: "date-range-picker-popper", open: true, anchorEl: anchorEl, placement: "bottom-end",
|
|
194
|
+
// NOTE: 값이 변경 되기전 blur 이벤트 방지
|
|
195
|
+
onMouseDown: (e) => e.preventDefault(), modifiers: [
|
|
196
|
+
{
|
|
197
|
+
name: "offset",
|
|
198
|
+
options: {
|
|
199
|
+
offset: [4, 4],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
], "aria-label": "Calendar Tooltip", "aria-expanded": open },
|
|
203
|
+
React.createElement(CalendarSheet, { tabIndex: -1, role: "presentation" },
|
|
204
|
+
React.createElement(Calendar.Calendar, { rangeSelection: true, defaultValue: calendarValue, onChange: handleCalendarChange, minDate: minDate ? new Date(minDate) : undefined, maxDate: maxDate ? new Date(maxDate) : undefined, disableFuture: disableFuture, disablePast: disablePast }),
|
|
205
|
+
!hideClearButton && (React.createElement(DialogActions.DialogActions, { sx: {
|
|
206
|
+
p: 1,
|
|
207
|
+
} },
|
|
208
|
+
React.createElement(Button.Button, { size: size, variant: "plain", color: "neutral", onClick: () => {
|
|
209
|
+
setValue("");
|
|
210
|
+
setAnchorEl(null);
|
|
211
|
+
} }, "Clear")))))))))));
|
|
212
|
+
});
|
|
213
|
+
DateRangePicker.displayName = "DateRangePicker";
|
|
214
|
+
|
|
215
|
+
exports.DateRangePicker = DateRangePicker;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var joy = require('@mui/joy');
|
|
4
|
+
var framerMotion = require('framer-motion');
|
|
5
|
+
|
|
6
|
+
const MotionDialogActions = framerMotion.motion(joy.DialogActions);
|
|
7
|
+
const StyledDialogActions = joy.styled(MotionDialogActions)(({ theme }) => ({
|
|
8
|
+
padding: theme.spacing(2),
|
|
9
|
+
gap: theme.spacing(2),
|
|
10
|
+
flexDirection: "row",
|
|
11
|
+
justifyContent: "flex-end",
|
|
12
|
+
}));
|
|
13
|
+
const DialogActions = StyledDialogActions;
|
|
14
|
+
DialogActions.displayName = "DialogActions";
|
|
15
|
+
|
|
16
|
+
exports.DialogActions = DialogActions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var joy = require('@mui/joy');
|
|
4
|
+
var framerMotion = require('framer-motion');
|
|
5
|
+
|
|
6
|
+
const MotionDialogContent = framerMotion.motion(joy.DialogContent);
|
|
7
|
+
const StyledDialogContent = joy.styled(MotionDialogContent)(({ theme }) => ({
|
|
8
|
+
padding: theme.spacing(0, 6, 5),
|
|
9
|
+
}));
|
|
10
|
+
const DialogContent = StyledDialogContent;
|
|
11
|
+
DialogContent.displayName = "DialogContent";
|
|
12
|
+
|
|
13
|
+
exports.DialogContent = DialogContent;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var DialogTitle = require('../DialogTitle/DialogTitle.js');
|
|
5
|
+
var DialogContent = require('../DialogContent/DialogContent.js');
|
|
6
|
+
var Modal = require('../Modal/Modal.js');
|
|
7
|
+
var DialogActions = require('../DialogActions/DialogActions.js');
|
|
8
|
+
var joy = require('@mui/joy');
|
|
9
|
+
|
|
10
|
+
const StyledDialogFrame = joy.styled(Modal.ModalDialog, {
|
|
11
|
+
name: "Dialog",
|
|
12
|
+
slot: "Root",
|
|
13
|
+
})({
|
|
14
|
+
padding: 0,
|
|
15
|
+
});
|
|
16
|
+
const DialogFrame = React.forwardRef((props, ref) => {
|
|
17
|
+
// prop destruction
|
|
18
|
+
const { title, children, actions, fullscreen, ...innerProps } = props;
|
|
19
|
+
// lib hooks
|
|
20
|
+
// state, ref, querystring hooks
|
|
21
|
+
// form hooks
|
|
22
|
+
// query hooks
|
|
23
|
+
// calculated values
|
|
24
|
+
// effects
|
|
25
|
+
// handlers
|
|
26
|
+
return (React.createElement(StyledDialogFrame, { layout: fullscreen ? "fullscreen" : "center", ref: ref, ...innerProps },
|
|
27
|
+
React.createElement(DialogTitle.DialogTitle, null, title),
|
|
28
|
+
React.createElement(DialogContent.DialogContent, null, children),
|
|
29
|
+
React.createElement(DialogActions.DialogActions, null, actions)));
|
|
30
|
+
});
|
|
31
|
+
DialogFrame.displayName = "DialogFrame";
|
|
32
|
+
|
|
33
|
+
exports.DialogFrame = DialogFrame;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var joy = require('@mui/joy');
|
|
4
|
+
var framerMotion = require('framer-motion');
|
|
5
|
+
|
|
6
|
+
const MotionDialogTitle = framerMotion.motion(joy.DialogTitle);
|
|
7
|
+
const StyledDialogTitle = joy.styled(MotionDialogTitle)(({ theme }) => ({
|
|
8
|
+
padding: theme.spacing(4, 6),
|
|
9
|
+
}));
|
|
10
|
+
const DialogTitle = StyledDialogTitle;
|
|
11
|
+
DialogTitle.displayName = "DialogTitle";
|
|
12
|
+
|
|
13
|
+
exports.DialogTitle = DialogTitle;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var joy = require('@mui/joy');
|
|
5
|
+
var framerMotion = require('framer-motion');
|
|
6
|
+
|
|
7
|
+
const MotionDivider = framerMotion.motion(joy.Divider);
|
|
8
|
+
const Divider = (props) => {
|
|
9
|
+
// prop destruction
|
|
10
|
+
// lib hooks
|
|
11
|
+
// state, ref, querystring hooks
|
|
12
|
+
// form hooks
|
|
13
|
+
// query hooks
|
|
14
|
+
// calculated values
|
|
15
|
+
// effects
|
|
16
|
+
// handlers
|
|
17
|
+
return React.createElement(MotionDivider, { ...props });
|
|
18
|
+
};
|
|
19
|
+
Divider.displayName = "Divider";
|
|
20
|
+
|
|
21
|
+
exports.Divider = Divider;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var joy = require('@mui/joy');
|
|
5
|
+
var framerMotion = require('framer-motion');
|
|
6
|
+
|
|
7
|
+
const MotionDrawer = framerMotion.motion(joy.Drawer);
|
|
8
|
+
const Drawer = (props) => {
|
|
9
|
+
// prop destruction
|
|
10
|
+
const { children, size, ...innerProps } = props;
|
|
11
|
+
// lib hooks
|
|
12
|
+
const theme = joy.useTheme();
|
|
13
|
+
// state, ref, querystring hooks
|
|
14
|
+
// form hooks
|
|
15
|
+
// query hooks
|
|
16
|
+
// calculated values
|
|
17
|
+
// effects
|
|
18
|
+
// handlers
|
|
19
|
+
return (React.createElement(MotionDrawer, { ...innerProps, slotProps: {
|
|
20
|
+
...innerProps.slotProps,
|
|
21
|
+
content: {
|
|
22
|
+
...innerProps.slotProps?.content,
|
|
23
|
+
sx: {
|
|
24
|
+
bgcolor: "transparent",
|
|
25
|
+
boxShadow: "none",
|
|
26
|
+
[theme.breakpoints.down("md")]: {
|
|
27
|
+
width: "100%",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
}, sx: {
|
|
32
|
+
...props.sx,
|
|
33
|
+
"--Drawer-horizontalSize": {
|
|
34
|
+
sm: "360px",
|
|
35
|
+
md: "600px",
|
|
36
|
+
lg: "900px",
|
|
37
|
+
}[size || "md"],
|
|
38
|
+
} }, children));
|
|
39
|
+
};
|
|
40
|
+
Drawer.displayName = "Drawer";
|
|
41
|
+
|
|
42
|
+
exports.Drawer = Drawer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var joy = require('@mui/joy');
|
|
4
|
+
var framerMotion = require('framer-motion');
|
|
5
|
+
|
|
6
|
+
const MotionDropdown = framerMotion.motion(joy.Dropdown);
|
|
7
|
+
const Dropdown = MotionDropdown;
|
|
8
|
+
Dropdown.displayName = "Dropdown";
|
|
9
|
+
|
|
10
|
+
exports.Dropdown = Dropdown;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var joy = require('@mui/joy');
|
|
4
|
+
var framerMotion = require('framer-motion');
|
|
5
|
+
|
|
6
|
+
const MotionFormControl = framerMotion.motion(joy.FormControl);
|
|
7
|
+
const FormControl = joy.styled(MotionFormControl)(({ theme }) => ({
|
|
8
|
+
[`.${joy.formLabelClasses.root}`]: {
|
|
9
|
+
display: "block",
|
|
10
|
+
},
|
|
11
|
+
[`.${joy.formLabelClasses.asterisk}`]: {
|
|
12
|
+
marginLeft: theme.spacing(0.5),
|
|
13
|
+
},
|
|
14
|
+
}));
|
|
15
|
+
FormControl.displayName = "FormControl";
|
|
16
|
+
|
|
17
|
+
exports.FormControl = FormControl;
|