@ceed/cds 0.0.185 → 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 +7 -5
- 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/framer/index.js +30 -30
- package/package.json +8 -5
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const getCalendarDates = (date) => {
|
|
4
|
+
const dates = [];
|
|
5
|
+
const firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
6
|
+
const lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
7
|
+
const firstWeekInThisMonth = Math.ceil((firstDay.getDay() + 1) / 7);
|
|
8
|
+
const lastWeekInThisMonth = Math.ceil((lastDay.getDate() + firstDay.getDay()) / 7);
|
|
9
|
+
let day = 1;
|
|
10
|
+
for (let i = 1; i <= lastWeekInThisMonth; i++) {
|
|
11
|
+
const week = [];
|
|
12
|
+
for (let j = 1; j <= 7; j++) {
|
|
13
|
+
if (i === firstWeekInThisMonth && j < firstDay.getDay() + 1) {
|
|
14
|
+
week.push(undefined);
|
|
15
|
+
}
|
|
16
|
+
else if (day > lastDay.getDate()) {
|
|
17
|
+
week.push(undefined);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
week.push(day);
|
|
21
|
+
day++;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
dates.push(week);
|
|
25
|
+
}
|
|
26
|
+
return dates;
|
|
27
|
+
};
|
|
28
|
+
const getYearName = (date, locale) => {
|
|
29
|
+
return date.toLocaleString(locale, { year: "numeric" });
|
|
30
|
+
};
|
|
31
|
+
const getMonthName = (date, locale) => {
|
|
32
|
+
return date.toLocaleString(locale, { year: "numeric", month: "long" });
|
|
33
|
+
};
|
|
34
|
+
const getMonthNameFromIndex = (index, locale) => {
|
|
35
|
+
return new Date(0, index).toLocaleString(locale, { month: "short" });
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* 일~토 / Sun ~ Sat 같은 요일 이름을 가져옵니다.
|
|
39
|
+
*/
|
|
40
|
+
const getWeekdayNames = (locale) => {
|
|
41
|
+
const currentDay = new Date().getDay();
|
|
42
|
+
const date = new Date();
|
|
43
|
+
date.setDate(date.getDate() - currentDay);
|
|
44
|
+
return Array.from({ length: 7 }).map(() => {
|
|
45
|
+
const day = date.toLocaleString(locale, { weekday: "short" });
|
|
46
|
+
date.setDate(date.getDate() + 1);
|
|
47
|
+
return day;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
const isToday = (date) => {
|
|
51
|
+
const today = new Date();
|
|
52
|
+
const d = new Date(date);
|
|
53
|
+
d.setHours(0, 0, 0, 0);
|
|
54
|
+
today.setHours(0, 0, 0, 0);
|
|
55
|
+
return d.getTime() === today.getTime();
|
|
56
|
+
};
|
|
57
|
+
const isSameDay = (date1, date2) => {
|
|
58
|
+
const d1 = new Date(date1);
|
|
59
|
+
const d2 = new Date(date2);
|
|
60
|
+
d1.setHours(0, 0, 0, 0);
|
|
61
|
+
d2.setHours(0, 0, 0, 0);
|
|
62
|
+
return d1.getTime() === d2.getTime();
|
|
63
|
+
};
|
|
64
|
+
const isWithinRange = (d1, d2, date) => {
|
|
65
|
+
const dateToCheck = new Date(date);
|
|
66
|
+
dateToCheck.setHours(0, 0, 0, 0);
|
|
67
|
+
const minDate = new Date(Math.min(d1.getTime(), d2.getTime()));
|
|
68
|
+
const maxDate = new Date(Math.max(d1.getTime(), d2.getTime()));
|
|
69
|
+
return dateToCheck >= minDate && dateToCheck <= maxDate;
|
|
70
|
+
};
|
|
71
|
+
const isSameMonth = (date1, date2) => {
|
|
72
|
+
return (date1.getFullYear() === date2.getFullYear() &&
|
|
73
|
+
date1.getMonth() === date2.getMonth());
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
exports.getCalendarDates = getCalendarDates;
|
|
77
|
+
exports.getMonthName = getMonthName;
|
|
78
|
+
exports.getMonthNameFromIndex = getMonthNameFromIndex;
|
|
79
|
+
exports.getWeekdayNames = getWeekdayNames;
|
|
80
|
+
exports.getYearName = getYearName;
|
|
81
|
+
exports.isSameDay = isSameDay;
|
|
82
|
+
exports.isSameMonth = isSameMonth;
|
|
83
|
+
exports.isToday = isToday;
|
|
84
|
+
exports.isWithinRange = isWithinRange;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var joy = require('@mui/joy');
|
|
4
|
+
var framerMotion = require('framer-motion');
|
|
5
|
+
|
|
6
|
+
const MotionCard = framerMotion.motion(joy.Card);
|
|
7
|
+
const Card = MotionCard;
|
|
8
|
+
Card.displayName = "Card";
|
|
9
|
+
const MotionCardContent = framerMotion.motion(joy.CardContent);
|
|
10
|
+
const CardContent = MotionCardContent;
|
|
11
|
+
CardContent.displayName = "CardContent";
|
|
12
|
+
const MotionCardCover = framerMotion.motion(joy.CardCover);
|
|
13
|
+
const CardCover = MotionCardCover;
|
|
14
|
+
CardCover.displayName = "CardCover";
|
|
15
|
+
const MotionCardActions = framerMotion.motion(joy.CardActions);
|
|
16
|
+
const CardActions = MotionCardActions;
|
|
17
|
+
CardActions.displayName = "CardActions";
|
|
18
|
+
const MotionCardOverflow = framerMotion.motion(joy.CardOverflow);
|
|
19
|
+
const CardOverflow = MotionCardOverflow;
|
|
20
|
+
CardOverflow.displayName = "CardOverflow";
|
|
21
|
+
|
|
22
|
+
exports.Card = Card;
|
|
23
|
+
exports.CardActions = CardActions;
|
|
24
|
+
exports.CardContent = CardContent;
|
|
25
|
+
exports.CardCover = CardCover;
|
|
26
|
+
exports.CardOverflow = CardOverflow;
|
|
@@ -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 MotionCheckbox = framerMotion.motion(joy.Checkbox);
|
|
8
|
+
const Checkbox = (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(MotionCheckbox, { ...props });
|
|
18
|
+
};
|
|
19
|
+
Checkbox.displayName = "Checkbox";
|
|
20
|
+
|
|
21
|
+
exports.Checkbox = Checkbox;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var joy = require('@mui/joy');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
const ContainerRoot = joy.styled("div", {
|
|
7
|
+
name: "Container",
|
|
8
|
+
slot: "root",
|
|
9
|
+
shouldForwardProp: (prop) => prop !== "maxWidth" && prop !== "overrideBreakpoint",
|
|
10
|
+
})(({ theme, maxWidth = "lg", overrideBreakpoint }) => [
|
|
11
|
+
{
|
|
12
|
+
width: "100%",
|
|
13
|
+
marginLeft: "auto",
|
|
14
|
+
boxSizing: "border-box",
|
|
15
|
+
marginRight: "auto",
|
|
16
|
+
display: "block", // Fix IE11 layout when used with main.
|
|
17
|
+
paddingLeft: theme.spacing(4),
|
|
18
|
+
paddingRight: theme.spacing(4),
|
|
19
|
+
[theme.breakpoints.up("md")]: {
|
|
20
|
+
paddingLeft: theme.spacing(8),
|
|
21
|
+
paddingRight: theme.spacing(8),
|
|
22
|
+
},
|
|
23
|
+
maxWidth: theme.breakpoints.values[maxWidth],
|
|
24
|
+
},
|
|
25
|
+
overrideBreakpoint
|
|
26
|
+
? {
|
|
27
|
+
paddingLeft: theme.breakpoints.values[overrideBreakpoint] >=
|
|
28
|
+
theme.breakpoints.values.lg
|
|
29
|
+
? theme.spacing(8)
|
|
30
|
+
: theme.spacing(4),
|
|
31
|
+
paddingRight: theme.breakpoints.values[overrideBreakpoint] >=
|
|
32
|
+
theme.breakpoints.values.lg
|
|
33
|
+
? theme.spacing(8)
|
|
34
|
+
: theme.spacing(4),
|
|
35
|
+
}
|
|
36
|
+
: null,
|
|
37
|
+
]);
|
|
38
|
+
const Container = React.forwardRef(function Container(props, ref) {
|
|
39
|
+
// prop destruction
|
|
40
|
+
// lib hooks
|
|
41
|
+
// state, ref, querystring hooks
|
|
42
|
+
// form hooks
|
|
43
|
+
// query hooks
|
|
44
|
+
// calculated values
|
|
45
|
+
// effects
|
|
46
|
+
// handlers
|
|
47
|
+
return React.createElement(ContainerRoot, { ref: ref, ...props });
|
|
48
|
+
});
|
|
49
|
+
Container.displayName = "Container";
|
|
50
|
+
|
|
51
|
+
exports.Container = Container;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var IntlMessageFormat = require('intl-messageformat');
|
|
5
|
+
var reactNumberFormat = require('react-number-format');
|
|
6
|
+
var Input = require('../Input/Input.js');
|
|
7
|
+
var joy = require('@mui/joy');
|
|
8
|
+
var useCurrencySetting = require('./hooks/use-currency-setting.js');
|
|
9
|
+
var index = require('../../hooks/use-controlled-state/index.js');
|
|
10
|
+
|
|
11
|
+
const TextMaskAdapter = React.forwardRef(function TextMaskAdapter(props, ref) {
|
|
12
|
+
// prop destruction
|
|
13
|
+
const { onChange, ...innerProps } = props;
|
|
14
|
+
// lib hooks
|
|
15
|
+
// state, ref, querystring hooks
|
|
16
|
+
// form hooks
|
|
17
|
+
// query hooks
|
|
18
|
+
// calculated values
|
|
19
|
+
// effects
|
|
20
|
+
// handlers
|
|
21
|
+
return (React.createElement(reactNumberFormat.NumericFormat, { ...innerProps, onValueChange: ({ value }) => {
|
|
22
|
+
onChange?.({
|
|
23
|
+
target: { name: props.name, value },
|
|
24
|
+
});
|
|
25
|
+
}, valueIsNumericString: true, getInputRef: ref, allowNegative: false }));
|
|
26
|
+
});
|
|
27
|
+
const CurrencyInputRoot = joy.styled(Input.Input, {
|
|
28
|
+
name: "CurrencyInput",
|
|
29
|
+
slot: "root",
|
|
30
|
+
overridesResolver: (props, styles) => styles.root,
|
|
31
|
+
})({});
|
|
32
|
+
const CurrencyInput = React.forwardRef(function CurrencyInput(inProps, ref) {
|
|
33
|
+
// prop destruction
|
|
34
|
+
const props = joy.useThemeProps({ props: inProps, name: "CurrencyInput" });
|
|
35
|
+
const { currency = "USD", name, onChange, label, error, helperText, required, disabled, useMinorUnit,
|
|
36
|
+
// NOTE: 스타일 관련된 props는 최상위 엘리먼트에 적용한다.
|
|
37
|
+
sx, className, ...innerProps } = props;
|
|
38
|
+
// lib hooks
|
|
39
|
+
const { symbol, thousandSeparator, decimalSeparator, placeholder, fixedDecimalScale, decimalScale, } = useCurrencySetting.useCurrencySetting(currency);
|
|
40
|
+
// state, ref, querystring hooks
|
|
41
|
+
const [_value, setValue] = index.useControlledState(props.value, props.defaultValue, React.useCallback((value) => onChange?.({ target: { name, value } }), [onChange, name]));
|
|
42
|
+
const value = React.useMemo(() => {
|
|
43
|
+
if (_value && useMinorUnit) {
|
|
44
|
+
return _value / Math.pow(10, decimalScale);
|
|
45
|
+
}
|
|
46
|
+
return _value;
|
|
47
|
+
}, [_value, useMinorUnit, decimalScale]);
|
|
48
|
+
const max = React.useMemo(() => {
|
|
49
|
+
if (props.max && useMinorUnit) {
|
|
50
|
+
return props.max / Math.pow(10, decimalScale);
|
|
51
|
+
}
|
|
52
|
+
return props.max;
|
|
53
|
+
}, [props.max, useMinorUnit, decimalScale]);
|
|
54
|
+
const [isOverLimit, setIsOverLimit] = React.useState(!!max && !!value && value > max);
|
|
55
|
+
// form hooks
|
|
56
|
+
// query hooks
|
|
57
|
+
// calculated values
|
|
58
|
+
// effects
|
|
59
|
+
// handlers
|
|
60
|
+
const handleChange = React.useCallback((event) => {
|
|
61
|
+
if (event.target.value === "") {
|
|
62
|
+
setValue(undefined);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const amount = useMinorUnit
|
|
66
|
+
? Number(event.target.value?.replace(decimalSeparator, ""))
|
|
67
|
+
: Number(event.target.value);
|
|
68
|
+
if (!!max && Number(event.target.value) > max) {
|
|
69
|
+
setIsOverLimit(true);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
setIsOverLimit(false);
|
|
73
|
+
}
|
|
74
|
+
setValue(amount);
|
|
75
|
+
}, [decimalSeparator, max, useMinorUnit, setValue]);
|
|
76
|
+
return (React.createElement(CurrencyInputRoot, { ...innerProps, ref: ref, value: value, placeholder: placeholder, onChange: handleChange, error: error || isOverLimit, disabled: disabled, required: required, color: error || isOverLimit ? "danger" : props.color, label: label, helperText: isOverLimit
|
|
77
|
+
? new IntlMessageFormat.IntlMessageFormat(`limit: {amount, number, ::currency/${currency} unit-width-narrow}`).format({ amount: max })
|
|
78
|
+
: helperText, slotProps: {
|
|
79
|
+
input: {
|
|
80
|
+
component: TextMaskAdapter,
|
|
81
|
+
decimalSeparator,
|
|
82
|
+
thousandSeparator,
|
|
83
|
+
prefix: symbol,
|
|
84
|
+
fixedDecimalScale,
|
|
85
|
+
decimalScale,
|
|
86
|
+
"aria-label": innerProps["aria-label"],
|
|
87
|
+
},
|
|
88
|
+
}, sx: {
|
|
89
|
+
...sx,
|
|
90
|
+
}, className: className }));
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
exports.CurrencyInput = CurrencyInput;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var IntlMessageFormat = require('intl-messageformat');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @see https://docs.adyen.com/development-resources/currency-codes/
|
|
7
|
+
*/
|
|
8
|
+
const CURRENCY_DECIMAL_MAP = {
|
|
9
|
+
AED: 2,
|
|
10
|
+
ALL: 2,
|
|
11
|
+
AMD: 2,
|
|
12
|
+
ANG: 2,
|
|
13
|
+
AOA: 2,
|
|
14
|
+
ARS: 2,
|
|
15
|
+
AUD: 2,
|
|
16
|
+
AWG: 2,
|
|
17
|
+
AZN: 2,
|
|
18
|
+
BAM: 2,
|
|
19
|
+
BBD: 2,
|
|
20
|
+
BDT: 2,
|
|
21
|
+
BGN: 2,
|
|
22
|
+
BHD: 3,
|
|
23
|
+
BMD: 2,
|
|
24
|
+
BND: 2,
|
|
25
|
+
BOB: 2,
|
|
26
|
+
BRL: 2,
|
|
27
|
+
BSD: 2,
|
|
28
|
+
BWP: 2,
|
|
29
|
+
BYN: 2,
|
|
30
|
+
BZD: 2,
|
|
31
|
+
CAD: 2,
|
|
32
|
+
CHF: 2,
|
|
33
|
+
CLP: 2,
|
|
34
|
+
CNH: 2,
|
|
35
|
+
CNY: 2,
|
|
36
|
+
COP: 2,
|
|
37
|
+
CRC: 2,
|
|
38
|
+
CUP: 2,
|
|
39
|
+
CVE: 0,
|
|
40
|
+
CZK: 2,
|
|
41
|
+
DJF: 0,
|
|
42
|
+
DKK: 2,
|
|
43
|
+
DOP: 2,
|
|
44
|
+
DZD: 2,
|
|
45
|
+
EGP: 2,
|
|
46
|
+
ETB: 2,
|
|
47
|
+
EUR: 2,
|
|
48
|
+
FJD: 2,
|
|
49
|
+
FKP: 2,
|
|
50
|
+
GBP: 2,
|
|
51
|
+
GEL: 2,
|
|
52
|
+
GHS: 2,
|
|
53
|
+
GIP: 2,
|
|
54
|
+
GMD: 2,
|
|
55
|
+
GNF: 0,
|
|
56
|
+
GTQ: 2,
|
|
57
|
+
GYD: 2,
|
|
58
|
+
HKD: 2,
|
|
59
|
+
HNL: 2,
|
|
60
|
+
HTG: 2,
|
|
61
|
+
HUF: 2,
|
|
62
|
+
IDR: 0,
|
|
63
|
+
ILS: 2,
|
|
64
|
+
INR: 2,
|
|
65
|
+
IQD: 3,
|
|
66
|
+
ISK: 2,
|
|
67
|
+
JMD: 2,
|
|
68
|
+
JOD: 3,
|
|
69
|
+
JPY: 0,
|
|
70
|
+
KES: 2,
|
|
71
|
+
KGS: 2,
|
|
72
|
+
KHR: 2,
|
|
73
|
+
KMF: 0,
|
|
74
|
+
KRW: 0,
|
|
75
|
+
KWD: 3,
|
|
76
|
+
KYD: 2,
|
|
77
|
+
KZT: 2,
|
|
78
|
+
LAK: 2,
|
|
79
|
+
LBP: 2,
|
|
80
|
+
LKR: 2,
|
|
81
|
+
LYD: 3,
|
|
82
|
+
MAD: 2,
|
|
83
|
+
MDL: 2,
|
|
84
|
+
MKD: 2,
|
|
85
|
+
MMK: 2,
|
|
86
|
+
MNT: 2,
|
|
87
|
+
MOP: 2,
|
|
88
|
+
MRU: 2,
|
|
89
|
+
MUR: 2,
|
|
90
|
+
MVR: 2,
|
|
91
|
+
MWK: 2,
|
|
92
|
+
MXN: 2,
|
|
93
|
+
MYR: 2,
|
|
94
|
+
MZN: 2,
|
|
95
|
+
NAD: 2,
|
|
96
|
+
NGN: 2,
|
|
97
|
+
NIO: 2,
|
|
98
|
+
NOK: 2,
|
|
99
|
+
NPR: 2,
|
|
100
|
+
NZD: 2,
|
|
101
|
+
OMR: 3,
|
|
102
|
+
PAB: 2,
|
|
103
|
+
PEN: 2,
|
|
104
|
+
PGK: 2,
|
|
105
|
+
PHP: 2,
|
|
106
|
+
PKR: 2,
|
|
107
|
+
PLN: 2,
|
|
108
|
+
PYG: 0,
|
|
109
|
+
QAR: 2,
|
|
110
|
+
RON: 2,
|
|
111
|
+
RSD: 2,
|
|
112
|
+
RUB: 2,
|
|
113
|
+
RWF: 0,
|
|
114
|
+
SAR: 2,
|
|
115
|
+
SBD: 2,
|
|
116
|
+
SCR: 2,
|
|
117
|
+
SEK: 2,
|
|
118
|
+
SGD: 2,
|
|
119
|
+
SHP: 2,
|
|
120
|
+
SLE: 2,
|
|
121
|
+
SOS: 2,
|
|
122
|
+
SRD: 2,
|
|
123
|
+
STN: 2,
|
|
124
|
+
SVC: 2,
|
|
125
|
+
SZL: 2,
|
|
126
|
+
THB: 2,
|
|
127
|
+
TND: 3,
|
|
128
|
+
TOP: 2,
|
|
129
|
+
TRY: 2,
|
|
130
|
+
TTD: 2,
|
|
131
|
+
TWD: 2,
|
|
132
|
+
TZS: 2,
|
|
133
|
+
UAH: 2,
|
|
134
|
+
UGX: 0,
|
|
135
|
+
USD: 2,
|
|
136
|
+
UYU: 2,
|
|
137
|
+
UZS: 2,
|
|
138
|
+
VEF: 2,
|
|
139
|
+
VND: 0,
|
|
140
|
+
VUV: 0,
|
|
141
|
+
WST: 2,
|
|
142
|
+
XAF: 0,
|
|
143
|
+
XCD: 2,
|
|
144
|
+
XOF: 0,
|
|
145
|
+
XPF: 0,
|
|
146
|
+
YER: 2,
|
|
147
|
+
ZAR: 2,
|
|
148
|
+
ZMW: 2,
|
|
149
|
+
};
|
|
150
|
+
const useCurrencySetting = (currencyCode = "USD") => {
|
|
151
|
+
const [symbol, thousandSeparator, decimalSeparator, ...rest] = new IntlMessageFormat(`{amount, number, ::currency/${currencyCode} unit-width-narrow}`)
|
|
152
|
+
.format({ amount: 1000 })
|
|
153
|
+
.toString()
|
|
154
|
+
.replace(/\d/g, "")
|
|
155
|
+
.split("");
|
|
156
|
+
const decimalScale = CURRENCY_DECIMAL_MAP[currencyCode];
|
|
157
|
+
return {
|
|
158
|
+
symbol: `${symbol} `,
|
|
159
|
+
thousandSeparator,
|
|
160
|
+
decimalSeparator,
|
|
161
|
+
placeholder: decimalSeparator
|
|
162
|
+
? `${symbol} 0${decimalSeparator}${Array.from(Array(decimalScale)).map(() => 0).join('')}`
|
|
163
|
+
: `${symbol} 0`,
|
|
164
|
+
fixedDecimalScale: !!decimalSeparator,
|
|
165
|
+
decimalScale,
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
exports.useCurrencySetting = useCurrencySetting;
|