@dotss/ui 0.0.12 → 1.0.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/Accordion/Accordion.d.ts +1 -1
- package/Backdrop/Backdrop.d.ts +1 -1
- package/Badge/Badge.d.ts +3 -3
- package/BottomSheet/BottomSheet.d.ts +1 -1
- package/BottomSheet/BottomSheetAction/BottomSheetAction.d.ts +1 -1
- package/BottomSheet/BottomSheetContent/BottomSheetContent.d.ts +1 -1
- package/BottomSheet/BottomSheetText/BottomSheetText.d.ts +1 -1
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.d.ts +1 -1
- package/Box/Box.d.ts +1 -1
- package/Button/Button.d.ts +2 -2
- package/Button/index.d.ts +1 -0
- package/Card/Card.d.ts +1 -1
- package/ChainPicker/ChainPicker.d.ts +1 -1
- package/Checkbox/Checkbox.d.ts +2 -2
- package/Chip/Chip.d.ts +1 -1
- package/CircularProgressIndicator/CircularProgressIndicator.d.ts +1 -1
- package/DatePicker/DatePicker.cjs +40 -30
- package/DatePicker/DatePicker.d.ts +2 -1
- package/DatePicker/DatePicker.es.js +477 -301
- package/DatePicker/EventDot/EventDot.d.ts +1 -1
- package/DatePicker/EventDotGroup/EventDotGroup.cjs +3 -3
- package/DatePicker/EventDotGroup/EventDotGroup.d.ts +1 -1
- package/DatePicker/EventDotGroup/EventDotGroup.es.js +14 -14
- package/Dialog/Dialog.d.ts +1 -1
- package/Dialog/DialogText/DialogText.d.ts +1 -1
- package/Dialog/DialogTitle/DialogTitle.d.ts +1 -1
- package/Flexbox/Flexbox.d.ts +1 -1
- package/FocusBoundary/FocusBoundary.d.ts +1 -1
- package/FormControlText/FormControlText.cjs +2 -2
- package/FormControlText/FormControlText.d.ts +1 -1
- package/FormControlText/FormControlText.es.js +14 -14
- package/Icon/Icon.cjs +1 -1
- package/Icon/Icon.d.ts +2 -2
- package/Icon/Icon.es.js +1 -1
- package/IconButton/IconButton.d.ts +2 -2
- package/Label/Label.d.ts +4 -4
- package/LineProgressIndicator/LineProgressIndicator.d.ts +1 -1
- package/Menu/Menu.cjs +6 -6
- package/Menu/Menu.d.ts +1 -1
- package/Menu/Menu.es.js +83 -79
- package/Menu/MenuBlock/MenuBlock.cjs +5 -11
- package/Menu/MenuBlock/MenuBlock.d.ts +1 -1
- package/Menu/MenuBlock/MenuBlock.es.js +19 -29
- package/Menu/MenuButton/MenuButton.cjs +1 -1
- package/Menu/MenuButton/MenuButton.d.ts +1 -1
- package/Menu/MenuButton/MenuButton.es.js +38 -29
- package/NumberKeypad/NumberKeypad.d.ts +2 -2
- package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.d.ts +1 -1
- package/PageControl/PageControl.d.ts +2 -2
- package/Radio/Radio.d.ts +2 -2
- package/RadioGroup/RadioGroup.d.ts +1 -1
- package/SegmentedButton/SegmentedButton.d.ts +2 -2
- package/SegmentedButton/SegmentedButtonBlock/SegmentedButtonBlock.d.ts +1 -1
- package/Select/Option/Option.d.ts +1 -1
- package/Select/Select.d.ts +1 -1
- package/Skeleton/Skeleton.d.ts +3 -3
- package/Slider/Slider.d.ts +1 -1
- package/Snackbar/Snackbar.d.ts +2 -2
- package/Switch/Switch.d.ts +1 -1
- package/Tab/Tab.d.ts +1 -1
- package/Tab/TabBlock/TabBlock.d.ts +1 -1
- package/TextArea/TextArea.d.ts +1 -1
- package/TextField/TextField.d.ts +1 -1
- package/Tooltip/Tooltip.cjs +5 -5
- package/Tooltip/Tooltip.d.ts +4 -2
- package/Tooltip/Tooltip.es.js +84 -84
- package/Typography/Typography.d.ts +2 -2
- package/package.json +1 -1
- package/resources/tictoccroc/icons/fill/alphabet-fill.svg-CvfRsdBW.js +5 -0
- package/resources/tictoccroc/icons/fill/alphabet-fill.svg-HBXWjzrC.cjs +1 -0
- package/resources/tictoccroc/icons/fill/{certified-fill.svg-B_RVx6K_.cjs → certified-fill.svg-DA375i9-.cjs} +1 -1
- package/resources/tictoccroc/icons/fill/{certified-fill.svg-CK7UqYft.js → certified-fill.svg-DBC-EEKD.js} +1 -1
- package/resources/tictoccroc/icons/fill/check-fill.svg-0_5PrDLC.js +5 -0
- package/resources/tictoccroc/icons/fill/check-fill.svg-BKKTgIa3.cjs +1 -0
- package/resources/tictoccroc/icons/fill/index.d.ts +4 -0
- package/resources/tictoccroc/icons/fill/search-fill.svg-BvLNCg-N.cjs +1 -0
- package/resources/tictoccroc/icons/fill/search-fill.svg-DnxhncI6.js +5 -0
- package/resources/tictoccroc/icons/fill/time-fill.svg-CbMJxmhK.js +5 -0
- package/resources/tictoccroc/icons/fill/time-fill.svg-DcMfM75a.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-DI_CztBn.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-Dt89JG4Z.js +236 -0
- package/themes/tictoccroc/colors/background.d.ts +2 -2
- package/themes/tictoccroc/colors/blue.d.ts +1 -1
- package/themes/tictoccroc/colors/classType.d.ts +1 -1
- package/themes/tictoccroc/colors/etc.d.ts +2 -2
- package/themes/tictoccroc/colors/green.d.ts +1 -1
- package/themes/tictoccroc/colors/grey.d.ts +1 -1
- package/themes/tictoccroc/colors/pink.d.ts +1 -1
- package/themes/tictoccroc/colors/yellow.d.ts +1 -1
- package/themes/tictoccroc/parentLight.d.ts +1 -1
- package/themes/tictoccroc/teacherLight.d.ts +1 -1
- package/themes/tictoccroc/typography/body.d.ts +1 -1
- package/themes/tictoccroc/typography/caption.d.ts +1 -1
- package/themes/tictoccroc/typography/display.d.ts +1 -1
- package/themes/tictoccroc/typography/headline.d.ts +1 -1
- package/utils/getIconLabel/getIconLabel.cjs +1 -1
- package/utils/getIconLabel/getIconLabel.d.ts +1 -1
- package/utils/getIconLabel/getIconLabel.es.js +5 -1
- package/utils/getPaletteColor/getPaletteColor.d.ts +1 -1
- package/resources/tictoccroc/icons/index.ts-BmqvB_n6.cjs +0 -1
- package/resources/tictoccroc/icons/index.ts-CzTh-XsD.js +0 -228
package/Accordion/Accordion.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { GeneralComponentProps, PolymorphicComponentProps } from '
|
|
2
|
+
import { GeneralComponentProps, PolymorphicComponentProps } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface AccordionProps extends Omit<GeneralComponentProps<HTMLAttributes<HTMLDivElement>>, 'title'> {
|
|
5
5
|
expand?: boolean;
|
package/Backdrop/Backdrop.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, RefObject } from 'react';
|
|
2
|
-
import { GeneralComponentProps } from '
|
|
2
|
+
import { GeneralComponentProps } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface BackdropProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
|
|
5
5
|
open?: boolean;
|
package/Badge/Badge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { ColorScaleKey } from '
|
|
3
|
-
import { GeneralComponentProps, Size } from '
|
|
4
|
-
import { EtcColorKey } from '
|
|
2
|
+
import { ColorScaleKey } from '../../typings/color';
|
|
3
|
+
import { GeneralComponentProps, Size } from '../../typings/component';
|
|
4
|
+
import { EtcColorKey } from '../../typings/theme/core';
|
|
5
5
|
|
|
6
6
|
export interface BadgeProps extends GeneralComponentProps<Omit<HTMLAttributes<HTMLDivElement>, 'content'>> {
|
|
7
7
|
color?: Extract<ColorScaleKey, 'pink'> | Extract<EtcColorKey, 'orange'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { BackdropProps } from '../Backdrop/Backdrop';
|
|
3
|
-
import { GeneralComponentProps } from '
|
|
3
|
+
import { GeneralComponentProps } from '../../typings/component';
|
|
4
4
|
|
|
5
5
|
export interface BottomSheetProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
|
|
6
6
|
open?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { GeneralComponentProps } from '
|
|
2
|
+
import { GeneralComponentProps } from '../../../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface BottomSheetActionProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
|
|
5
5
|
enableAdjustSpacing?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { GeneralComponentProps } from '
|
|
2
|
+
import { GeneralComponentProps } from '../../../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface BottomSheetContentProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
|
|
5
5
|
enableAdjustSpacing?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
2
|
import { Property } from 'csstype';
|
|
3
|
-
import { GeneralComponentProps } from '
|
|
3
|
+
import { GeneralComponentProps } from '../../../typings/component';
|
|
4
4
|
|
|
5
5
|
export interface BottomSheetTextProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
|
|
6
6
|
type?: 'main' | 'sub';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes } from 'react';
|
|
2
|
-
import { GeneralComponentProps } from '
|
|
2
|
+
import { GeneralComponentProps } from '../../../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface BottomSheetTitleProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
|
|
5
5
|
onClose?: () => void;
|
package/Box/Box.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType, ReactNode } from 'react';
|
|
2
|
-
import { PolymorphicComponentProps, Spacing } from '
|
|
2
|
+
import { PolymorphicComponentProps, Spacing } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export type BoxProps<T extends ElementType = 'div'> = Spacing & PolymorphicComponentProps<T> & {
|
|
5
5
|
visuallyHidden?: boolean;
|
package/Button/Button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { BrandColorKey } from '
|
|
3
|
-
import { GeneralComponentProps, Size, Variant } from '
|
|
2
|
+
import { BrandColorKey } from '../../typings/color';
|
|
3
|
+
import { GeneralComponentProps, Size, Variant } from '../../typings/component';
|
|
4
4
|
|
|
5
5
|
export interface ButtonProps extends GeneralComponentProps<ButtonHTMLAttributes<HTMLButtonElement>> {
|
|
6
6
|
variant?: Extract<Variant, 'filled' | 'outlined' | 'text'>;
|
package/Button/index.d.ts
CHANGED
package/Card/Card.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { GeneralComponentProps, PolymorphicComponentProps, Variant } from '
|
|
2
|
+
import { GeneralComponentProps, PolymorphicComponentProps, Variant } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export type CardProps<T extends ElementType = 'div'> = PolymorphicComponentProps<T> & {
|
|
5
5
|
variant?: Extract<Variant, 'filled' | 'outlined'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { GeneralComponentProps } from '
|
|
2
|
+
import { GeneralComponentProps } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export declare const SCROLL_POSITION_THRESHOLD = 3;
|
|
5
5
|
export interface ChainPickerItem {
|
package/Checkbox/Checkbox.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
|
-
import { BrandColorKey } from '
|
|
3
|
-
import { GeneralComponentProps, Size } from '
|
|
2
|
+
import { BrandColorKey } from '../../typings/color';
|
|
3
|
+
import { GeneralComponentProps, Size } from '../../typings/component';
|
|
4
4
|
|
|
5
5
|
export interface CheckboxProps extends GeneralComponentProps<Omit<InputHTMLAttributes<HTMLInputElement>, 'size'>> {
|
|
6
6
|
size?: Extract<Size, 'medium' | '2xLarge'>;
|
package/Chip/Chip.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementType, ReactNode } from 'react';
|
|
2
|
-
import { PolymorphicComponentProps, Variant } from '
|
|
2
|
+
import { PolymorphicComponentProps, Variant } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export type ChipProps<T extends ElementType = 'div'> = PolymorphicComponentProps<T> & {
|
|
5
5
|
variant?: Extract<Variant, 'filled' | 'outlined'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { GeneralComponentProps, Size } from '
|
|
2
|
+
import { GeneralComponentProps, Size } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface CircularProgressIndicatorProps extends GeneralComponentProps<HTMLAttributes<SVGSVGElement>> {
|
|
5
5
|
size?: Extract<Size, 'large' | 'small'>;
|
|
@@ -1,62 +1,72 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@emotion/react/jsx-runtime"),d=require("react"),at=require("../Flexbox/Flexbox.cjs"),Ee=require("../Icon/Icon.cjs"),_e=require("../IconButton/IconButton.cjs"),ct=require("../Menu/Menu.cjs"),lt=require("../Menu/MenuBlock/MenuBlock.cjs"),Xe=require("../Menu/MenuButton/MenuButton.cjs"),ut=require("../core/useTheme.cjs"),ft=require("@emotion/styled"),te=require("../utils/getContrastingTextColor/getContrastingTextColor.cjs"),dt=e=>e&&e.__esModule?e:{default:e},M=dt(ft),ht=M.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
gap: ${({theme:{spacing:
|
|
6
|
-
`,
|
|
5
|
+
gap: ${({theme:{spacing:e}})=>e.content(2)}px;
|
|
6
|
+
`,Ce=M.default.div`
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
align-items: center;
|
|
9
9
|
justify-content: flex-start;
|
|
10
10
|
max-width: fit-content;
|
|
11
|
-
padding: 0 ${({theme:{spacing:
|
|
12
|
-
cursor: ${({clickable:
|
|
11
|
+
padding: 0 ${({theme:{spacing:e}})=>e.content(3)}px;
|
|
12
|
+
cursor: ${({clickable:e})=>e?"pointer":"default"};
|
|
13
13
|
|
|
14
|
-
${({theme:{typography:{h4B:
|
|
15
|
-
`,
|
|
14
|
+
${({theme:{typography:{h4B:e}}})=>({fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing})};
|
|
15
|
+
`,mt=M.default.div`
|
|
16
16
|
display: flex;
|
|
17
17
|
align-items: center;
|
|
18
18
|
justify-content: center;
|
|
19
|
-
gap: ${({theme:{spacing:
|
|
19
|
+
gap: ${({theme:{spacing:e}})=>e.content(4)}px;
|
|
20
20
|
|
|
21
|
-
${({theme:{typography:{h2B:
|
|
22
|
-
`,
|
|
21
|
+
${({theme:{typography:{h2B:e}}})=>({fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing})};
|
|
22
|
+
`,pt=M.default.div`
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
|
-
padding: 0 ${({theme:{spacing:
|
|
25
|
+
padding: 0 ${({theme:{spacing:e},edgeSpacing:n})=>e.content(n||0)}px;
|
|
26
26
|
|
|
27
27
|
& > span {
|
|
28
28
|
margin: 5px 0;
|
|
29
29
|
flex-grow: 1;
|
|
30
30
|
text-align: center;
|
|
31
|
-
${({theme:{palette:{grey:
|
|
31
|
+
${({theme:{palette:{grey:e},typography:{b4M:n}}})=>({fontSize:n.size,fontWeight:n.weight,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,color:e[50]})};
|
|
32
32
|
}
|
|
33
|
-
`,
|
|
33
|
+
`,gt=M.default.div`
|
|
34
34
|
overflow: hidden;
|
|
35
|
-
`,
|
|
35
|
+
`,yt=M.default.div`
|
|
36
36
|
display: flex;
|
|
37
37
|
transform: translate3d(0, 0, 0);
|
|
38
|
-
`,
|
|
38
|
+
`,Ne=M.default.div`
|
|
39
39
|
display: flex;
|
|
40
40
|
flex-direction: column;
|
|
41
41
|
min-width: 100%;
|
|
42
|
-
gap: ${({theme:{spacing:
|
|
43
|
-
padding: ${({theme:{spacing:
|
|
44
|
-
${({theme:{spacing:
|
|
45
|
-
`,
|
|
42
|
+
gap: ${({theme:{spacing:e}})=>e.content(2)}px;
|
|
43
|
+
padding: ${({theme:{spacing:e}})=>e.content(2)}px
|
|
44
|
+
${({theme:{spacing:e},edgeSpacing:n})=>e.content(n||0)}px;
|
|
45
|
+
`,Be=M.default.div`
|
|
46
46
|
display: flex;
|
|
47
47
|
width: 100%;
|
|
48
|
-
`,
|
|
48
|
+
`,Ke=M.default.div`
|
|
49
49
|
position: relative;
|
|
50
50
|
display: inline-flex;
|
|
51
51
|
align-items: center;
|
|
52
52
|
justify-content: center;
|
|
53
53
|
flex-direction: column;
|
|
54
|
-
gap: ${({theme:{spacing:
|
|
54
|
+
gap: ${({theme:{spacing:e}})=>e.content(1)}px;
|
|
55
55
|
flex: 1;
|
|
56
|
-
cursor:
|
|
57
|
-
pointer-events:
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
pointer-events: auto;
|
|
58
58
|
min-width: 30px;
|
|
59
59
|
|
|
60
|
+
&:focus-visible {
|
|
61
|
+
outline: 2px solid ${({theme:{palette:e}})=>e.grey.black};
|
|
62
|
+
z-index: 10;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&[aria-disabled='true'] {
|
|
66
|
+
cursor: not-allowed;
|
|
67
|
+
color: ${({theme:{palette:e}})=>e.grey[30]};
|
|
68
|
+
}
|
|
69
|
+
|
|
60
70
|
& > div:nth-of-type(1) {
|
|
61
71
|
position: relative;
|
|
62
72
|
display: inline-flex;
|
|
@@ -71,20 +81,20 @@
|
|
|
71
81
|
}
|
|
72
82
|
}
|
|
73
83
|
|
|
74
|
-
${({theme:{typography:{b2R:
|
|
84
|
+
${({theme:{typography:{b2R:e}}})=>({fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing})};
|
|
75
85
|
|
|
76
|
-
${({theme:{palette:{brand:
|
|
86
|
+
${({theme:{palette:{brand:e,grey:n}},variant:r,today:c,selected:l})=>{if(l){let m={fontWeight:700,color:te.default(e.primary.main,[n.white,n[100]]),"& > div:nth-of-type(1):before":{content:'""',position:"absolute",top:"50%",left:"50%",width:30,height:30,transform:"translate(-50%, -50%)",backgroundColor:e.primary.main,borderRadius:"50%"},'&[aria-disabled="true"] > div:nth-of-type(1):before':{backgroundColor:e.primary.disable}};return r==="start"&&(m={fontWeight:700,color:te.default(e.primary.main,[n.white,n[100]]),overflow:"hidden","& > div:nth-of-type(1):before":{content:'""',position:"absolute",top:"50%",left:"50%",width:30,height:30,transform:"translate(-50%, -50%)",backgroundColor:e.primary.main,borderTopLeftRadius:100,borderBottomLeftRadius:100},'&[aria-disabled="true"] > div:nth-of-type(1):before':{backgroundColor:e.primary.disable},"& > div:nth-of-type(1):after":{content:'""',position:"absolute",top:"50%",left:"50%",width:"100%",height:30,transform:"translateY(-50%)",backgroundColor:e.primary.main},'&[aria-disabled="true"] > div:nth-of-type(1):after':{backgroundColor:e.primary.disable}}),r==="end"&&(m={fontWeight:700,color:te.default(e.primary.main,[n.white,n[100]]),overflow:"hidden","& > div:nth-of-type(1):before":{content:'""',position:"absolute",top:"50%",left:"50%",width:30,height:30,transform:"translate(-50%, -50%)",backgroundColor:e.primary.main,borderTopRightRadius:100,borderBottomRightRadius:100},'&[aria-disabled="true"] > div:nth-of-type(1):before':{backgroundColor:e.primary.disable},"& > div:nth-of-type(1):after":{content:'""',position:"absolute",top:"50%",right:"50%",width:"100%",height:30,transform:"translateY(-50%)",backgroundColor:e.primary.main},'&[aria-disabled="true"] > div:nth-of-type(1):after':{backgroundColor:e.primary.disable}}),r==="middle"&&(m={fontWeight:700,color:te.default(e.primary.main,[n.white,n[100]]),overflow:"hidden","& > div:nth-of-type(1):after":{content:'""',position:"absolute",top:"50%",left:"50%",width:"calc(100% + 1px)",height:30,transform:"translate(-50%, -50%)",backgroundColor:e.primary.main},'&[aria-disabled="true"] > div:nth-of-type(1):after':{backgroundColor:e.primary.disable}}),m}return c?{"& > div:nth-of-type(1):after":{content:'""',position:"absolute",top:"50%",left:"50%",width:30,height:30,transform:"translate(-50%, -50%)",border:`1px solid ${e.primary.main}`,borderRadius:"50%"}}:null}};
|
|
77
87
|
|
|
78
|
-
${({theme:{palette:{
|
|
79
|
-
`,
|
|
88
|
+
${({theme:{palette:{pink:e,brand:n}},holiday:r,selected:c})=>{let l=null;return r&&(l={color:te.default(c?n.primary.main:"transparent",[e[30],e[100]]),'&[aria-disabled="true"]':{color:e[30]}}),l}}
|
|
89
|
+
`,Ue=M.default.div`
|
|
80
90
|
display: flex;
|
|
81
91
|
align-items: center;
|
|
82
92
|
justify-content: center;
|
|
83
93
|
|
|
84
|
-
cursor: ${({clickable:
|
|
85
|
-
`,
|
|
94
|
+
cursor: ${({clickable:e})=>e?"pointer":"default"};
|
|
95
|
+
`,Ge=M.default.span`
|
|
86
96
|
width: 100%;
|
|
87
97
|
min-width: 100%;
|
|
88
98
|
height: 6px;
|
|
89
99
|
min-height: 6px;
|
|
90
|
-
`,ce=30,ae=d.forwardRef(function({children:n,onChange:r,value:s,date:o,minDate:u,maxDate:i,holidayDates:p,disableDates:N,showWeekHead:it=!1,multiple:j=!1,period:P=!1,enableMonthSelect:W=!1,showToday:wt=!1,edgeSpacing:ot=0,renderEvent:H,inlineCSS:_t,...qt},Ot){const{spacing:St}=Pt.default(),[Y,ct]=d.useState((typeof o=="string"||typeof o=="number"?new Date(o):o)||new Date),[D,G]=d.useState(()=>Array.isArray(s)&&s.length>0?x(s[0]):x(s)),[b,Q]=d.useState(()=>Array.isArray(s)&&s.length>1?x(s[s.length-1]):null),[M,Mt]=d.useState(0),[w,F]=d.useState(1),[jt,Tt]=d.useState(!1),[at,At]=d.useState(!1),lt=d.useRef(null),m=d.useRef(null),Z=d.useRef(0),v=d.useRef(0),T=d.useRef(!1),K=d.useRef(w),ut=d.useRef(),ft=d.useRef(null),dt=d.useRef(null),k=Y.getFullYear(),tt=Y.getMonth(),Rt=xt(k,tt),U=L(tt),_=x(s),q=x(p),O=x(N),ht=X(Y,u)||Yt(Y,u),pt=I(Y,i)||Yt(Y,i),et=new Date(k,tt-1),nt=new Date(k,tt+1),V=`${k}. ${U}`,E=P&&!!D&&!!b,vt=[{year:et.getFullYear(),month:L(et.getMonth()),weeks:xt(et.getFullYear(),et.getMonth())},{year:k,month:U,weeks:Rt},{year:nt.getFullYear(),month:L(nt.getMonth()),weeks:xt(nt.getFullYear(),nt.getMonth())}],mt=typeof H=="function",Et=vt[1].weeks.length*(ce+(mt?10:0)+St.content(2))+St.content(2),kt=e=>()=>{j&&(m.current&&(m.current.style.transition="none",m.current.style.cursor="grabbing"),Z.current=e,T.current=!0)},z=d.useCallback(()=>{if(!T.current)return;const e=M-v.current,f=Math.abs(M-e),l=M*.1;m.current&&(m.current.style.transform=`translate3d(-${M*w}px, 0, 0)`,m.current.style.cursor="grab",m.current.style.transition="transform 0.2s"),Z.current=0,v.current=0,T.current=!1,!(f<=l)&&(M<e?F(y=>y+1):M>e&&F(y=>y-1))},[M,w]),Wt=e=>()=>{if(!(T.current||w!==1)){if(!P){r==null||r(e,x);return}if(R(e,D)&&Array.isArray(s)&&s.length===1){G(null),Q(null),r==null||r([],x);return}else if(R(e,D)&&!Array.isArray(s)&&R(e,s)){G(null),Q(null),r==null||r([],x);return}if(!D){G(e),r==null||r(e,x);return}if(!b&&D){const[f,l]=I(e,D)?[D,e]:[e,D];G(f),Q(l);const y=Ft([f,l],N);r==null||r(y,x);return}D&&b&&(G(e),Q(null),r==null||r(e,x))}},Xt=e=>kt(e.clientX)(),Bt=e=>kt(e.touches[0].clientX)(),Nt=()=>{jt||(m.current&&(m.current.style.transition="transform 0.2s"),F(e=>e-1))},Gt=()=>{jt||(m.current&&(m.current.style.transition="transform 0.2s"),F(e=>e+1))},yt=()=>At(e=>!e),Kt=e=>{if(!e)return;const[f,l]=e.toString().split(".").map(Number);ct(new Date(f,l-1)),At(!1)};return d.useLayoutEffect(()=>{var e;Mt(((e=lt.current)==null?void 0:e.clientWidth)||0)},[j]),d.useEffect(()=>{const e=()=>{var f;Mt(((f=lt.current)==null?void 0:f.clientWidth)||0)};return window.addEventListener("resize",e),window.addEventListener("scroll",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e)}},[j]),d.useEffect(()=>{const e=m.current,f=(a,g,$)=>{if(!e||!T.current)return;v.current=a-Z.current;const h=g-Z.current,A=5;if(T.current=T.current||Math.abs(v.current)>A&&Math.abs(h)<A*2,$.cancelable&&$.preventDefault(),T.current){if(ht&&v.current>0){z();return}if(pt&&v.current<0){z();return}Math.abs(v.current)>=10&&(e.style.transform=`translate3d(${v.current-M*w}px, 0, 0)`,e.style.cursor="grabbing")}},l=a=>f(a.touches[0].clientX,a.touches[0].clientY,a),y=a=>{T.current&&f(a.clientX,a.clientY,a)};return e==null||e.addEventListener("mousemove",y),e==null||e.addEventListener("touchmove",l),()=>{e==null||e.removeEventListener("mousemove",y),e==null||e.removeEventListener("touchmove",l)}},[M,w,z,pt,ht]),d.useEffect(()=>{Tt(!0),ut.current=setTimeout(()=>{m.current&&(m.current.style.transition="none"),w>K.current?(F(1),ct(e=>new Date(e.setMonth(e.getMonth()+1))),K.current=1):w<K.current?(ct(e=>new Date(e.setMonth(e.getMonth()-1))),F(1),K.current=1):K.current=w,Tt(!1)},200)},[w]),d.useLayoutEffect(()=>{if(!P||!Array.isArray(s))return;const e=Ft(s,N);s.length<e.length&&(r==null||r(e,x))},[P,s,r,N]),d.useEffect(()=>{let e;return at&&(e=setTimeout(()=>{if(dt.current){const f=dt.current.querySelector("ul"),l=f==null?void 0:f.querySelector(`[data-value="${V}"]`);l==null||l.scrollIntoView({block:"start"})}},200)),()=>{clearTimeout(e)}},[at,V]),d.useEffect(()=>()=>{ut.current&&clearTimeout(ut.current)},[]),c.jsxs(te,{ref:Ot,...qt,css:_t,children:[j?c.jsxs(ne,{children:[c.jsx(st.default,{name:"ChevronLeftLine",size:"small",onClick:Nt,disabled:ht}),c.jsxs(oe,{ref:ft,clickable:!!W,onClick:W?yt:void 0,children:[V,W&&c.jsx(st.default,{name:"ArrowDownFill",size:"xSmall"})]}),c.jsx(st.default,{name:"ChevronRightLine",size:"small",onClick:Gt,disabled:pt})]}):c.jsxs(ee,{ref:ft,clickable:!!W,onClick:W?yt:void 0,children:[V,W&&c.jsx(st.default,{name:"ArrowDownFill",size:"xSmall"})]}),W&&c.jsx(Ct.default,{anchorRef:ft,ref:dt,open:at,onClose:yt,onChange:Kt,value:V,placement:j?"bottom-center":"bottom-left",width:160,fitToAnchorWidth:!1,maxHeight:368,children:Array.from({length:130},(e,f)=>{const l=1970+f;return Array.from({length:12},(y,a)=>{const g=a+1,$=g<10?`0${g}`:g,h=new Date(l,a+1,0).getDate(),A=`${l}-${$}-${h}`,C=`${l}-${$}-01`;return X(A,u)||I(C,i)?null:c.jsx(Jt.default,{value:`${l}. ${$}`,children:`${l}. ${$}`},`${l}-${$}`)})})}),it&&c.jsxs(re,{edgeSpacing:ot,children:[c.jsx("span",{children:"일"}),c.jsx("span",{children:"월"}),c.jsx("span",{children:"화"}),c.jsx("span",{children:"수"}),c.jsx("span",{children:"목"}),c.jsx("span",{children:"금"}),c.jsx("span",{children:"토"})]}),c.jsx(se,{ref:lt,children:c.jsxs(ie,{ref:m,onMouseDown:Xt,onMouseUp:z,onMouseLeave:z,onTouchStart:Bt,onTouchEnd:z,onTouchCancel:z,style:{transform:j?`translate3d(-${M*w}px, 0, 0)`:void 0,cursor:j?"grab":void 0,maxHeight:Et},children:[j&&vt.map(({year:e,month:f,weeks:l})=>c.jsx(bt,{edgeSpacing:ot,children:l.map((y,a)=>c.jsx(zt,{children:y.map((g,$)=>{const h=`${e}-${f}-${B(g||0)}`,A=!g,C=R(h,new Date),gt=Array.isArray(q)?q.includes(h):q===h,Dt=Array.isArray(_)?_.includes(h):_===h,$t=!g||(Array.isArray(O)?O.includes(h):O===h)||I(h,i)||X(h,u),rt=E&&R(h,D),Ut=E&&R(h,b),Vt=E&&I(h,D)&&X(h,b),Ht=H==null?void 0:H(h);return c.jsxs(It,{variant:rt?"start":Ut?"end":Vt?"middle":void 0,onClick:Wt(h),today:wt&&C,holiday:gt,selected:Dt,disabled:$t,children:[c.jsx("div",{children:c.jsx("span",{children:g})}),!A&&Ht,!A&&mt&&!Ht&&c.jsx(Lt,{})]},`${e}-${f}-week-row-${$}-${g?h:`${a}-${$}`}`)})},`${e}-${f}-week-row-${String(y)}`))},`week-body-${e}-${f}`)),!j&&c.jsx(bt,{edgeSpacing:ot,children:Rt.map((e,f)=>c.jsx(zt,{children:e.map((l,y)=>{const a=`${k}-${U}-${B(l||0)}`,g=!l,$=R(a,new Date),h=Array.isArray(q)?q.includes(a):q===a,A=Array.isArray(_)?_.includes(a):_===a,C=!l||(Array.isArray(O)?O.includes(a):O===a)||I(a,i)||X(a,u),gt=E&&R(a,D),Dt=E&&R(a,b),$t=E&&I(a,D)&&X(a,b),rt=H==null?void 0:H(a);return c.jsxs(It,{variant:gt?"start":Dt?"end":$t?"middle":void 0,onClick:Wt(a),today:wt&&$,holiday:h,selected:A,disabled:C,children:[c.jsx("div",{children:c.jsx("span",{children:l})}),!g&&rt,!g&&mt&&!rt&&c.jsx(Lt,{})]},`${k}-${U}-week-row-${e}-${l?a:`${f}-${y}`}`)})},`${k}-${U}-week-row-${String(e)}`))})]})}),n]})});function xt(t,n){let r=[];const s=new Date(t,n,1),o=new Date(t,n+1,0).getDate(),u=s.getDay();let i=Array.from({length:u}).fill(null);for(let p=1;p<=o;p+=1)i.push(p),(i.length===7||p===o)&&(r.push(i),i=[]);return r=r.map(p=>Array.from({length:7}).map((N,it)=>p[it]||null)),r}function L(t){return String(t+1).length===1?`0${t+1}`:t+1}function B(t){return String(t).length===1?`0${t}`:t}function x(t){if(Array.isArray(t))return t.map(n=>n instanceof Date?`${n.getFullYear()}-${L(n.getMonth())}-${B(n.getDate())}`:n);if(t instanceof Date)return`${t.getFullYear()}-${L(t.getMonth())}-${B(t.getDate())}`;if(typeof t=="number"){const n=new Date(t);return`${n.getFullYear()}-${L(n.getMonth())}-${B(n.getDate())}`}return t}function I(t,n){if(!t||!n)return!1;const r=t instanceof Date?t:new Date(t);r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);const s=r.getTime(),o=n instanceof Date?n:new Date(n);o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0);const u=o.getTime();return s>u}function X(t,n){if(!t||!n)return!1;const r=t instanceof Date?t:new Date(t);r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);const s=r.getTime(),o=n instanceof Date?n:new Date(n);o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0);const u=o.getTime();return s<u}function Yt(t,n){if(!t||!n)return!1;const r=t instanceof Date?t:new Date(t),s=n instanceof Date?n:new Date(n);return`${r.getFullYear()}-${r.getMonth()}`==`${s.getFullYear()}-${s.getMonth()}`}function R(t,n){if(!t||!n)return!1;const r=t instanceof Date?t:new Date(t);r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);const s=r.getTime(),o=n instanceof Date?n:new Date(n);o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0);const u=o.getTime();return s===u}function Ft(t,n){if(!t||!Array.isArray(t)||t.length===0)return[];const r=t.map(p=>p instanceof Date?p:p===null?new Date:new Date(p)),s=new Date(Math.min(...r.map(p=>p.getTime()))),o=new Date(Math.max(...r.map(p=>p.getTime()))),u=[],i=new Date(s);for(;i<=o;){if(Array.isArray(n)&&n.includes(i)){i.setDate(i.getDate()+1);continue}else if(n===i){i.setDate(i.getDate()+1);continue}u.push(`${i.getFullYear()}-${L(i.getMonth())}-${B(i.getDate())}`),i.setDate(i.getDate()+1)}return u}exports.default=ae;
|
|
100
|
+
`,Dt=30,$t=d.forwardRef(function({children:n,onChange:r,value:c,date:l,minDate:m,maxDate:h,holidayDates:g,disableDates:P,showWeekHead:he=!1,multiple:A=!1,period:re=!1,enableMonthSelect:V=!1,showToday:Ae=!1,edgeSpacing:me=0,renderEvent:F,inlineCSS:Je,monthProps:ne,...Qe},Ze){const{spacing:Te}=ut.default(),[R,pe]=d.useState((typeof l=="string"||typeof l=="number"?new Date(l):l)||new Date),[x,J]=d.useState(()=>Array.isArray(c)&&c.length>0?D(c[0]):D(c)),[z,ie]=d.useState(()=>Array.isArray(c)&&c.length>1?D(c[c.length-1]):null),[k,ve]=d.useState(0),[w,_]=d.useState(1),[Re,We]=d.useState(!1),[ge,ye]=d.useState(!1),Q=d.useRef(null),y=d.useRef(null),se=d.useRef(0),W=d.useRef(0),T=d.useRef(!1),Z=d.useRef(w),De=d.useRef(),oe=d.useRef(null),$e=d.useRef(null),S=R.getFullYear(),ae=R.getMonth(),He=je(S,ae),Y=E(ae),X=D(c),C=D(g),N=D(P),xe=U(R,m)||de(R,m),we=O(R,h)||de(R,h),ce=new Date(S,ae-1),le=new Date(S,ae+1),L=`${S}. ${Y}`,q=`${S}년 ${Y}월`,B=re&&!!x&&!!z,Fe=[{year:ce.getFullYear(),month:E(ce.getMonth()),weeks:je(ce.getFullYear(),ce.getMonth())},{year:S,month:Y,weeks:He},{year:le.getFullYear(),month:E(le.getMonth()),weeks:je(le.getFullYear(),le.getMonth())}],be=typeof F=="function",et=Fe[1].weeks.length*(Dt+(be?10:0)+Te.content(2))+Te.content(2),ze=t=>()=>{A&&(y.current&&(y.current.style.transition="none",y.current.style.cursor="grabbing"),se.current=t,T.current=!0)},I=d.useCallback(()=>{if(!T.current)return;const t=k-W.current,f=Math.abs(k-t),s=k*.1;y.current&&(y.current.style.transform=`translate3d(-${k*w}px, 0, 0)`,y.current.style.cursor="grab",y.current.style.transition="transform 0.2s"),se.current=0,W.current=0,T.current=!1,!(f<=s)&&(k<t?_(a=>a+1):k>t&&_(a=>a-1))},[k,w]),Me=(t,f)=>()=>{if(!(T.current||w!==1)&&!f){if(!re){r==null||r(t,D);return}if(v(t,x)&&Array.isArray(c)&&c.length===1){J(null),ie(null),r==null||r([],D);return}else if(v(t,x)&&!Array.isArray(c)&&v(t,c)){J(null),ie(null),r==null||r([],D);return}if(!x){J(t),r==null||r(t,D);return}if(!z&&x){const[s,a]=O(t,x)?[x,t]:[t,x];J(s),ie(a);const i=Ve([s,a],P);r==null||r(i,D);return}x&&z&&(J(t),ie(null),r==null||r(t,D))}},tt=t=>ze(t.clientX)(),rt=t=>ze(t.touches[0].clientX)(),Ye=()=>{Re||(y.current&&(y.current.style.transition="transform 0.2s"),_(t=>t-1))},Le=()=>{Re||(y.current&&(y.current.style.transition="transform 0.2s"),_(t=>t+1))},ue=t=>{t.stopPropagation(),ye(f=>!f)},nt=()=>ye(!1),it=t=>{if(!t)return;const[f,s]=t.toString().split(".").map(Number);pe(new Date(f,s-1)),ye(!1)},qe=(t,f)=>s=>{const a=new Date(t);let i=null;if(s.stopPropagation(),s.key==="ArrowRight")i=new Date(a),i.setDate(a.getDate()+1);else if(s.key==="ArrowLeft")i=new Date(a),i.setDate(a.getDate()-1);else if(s.key==="ArrowDown")i=new Date(a),i.setDate(a.getDate()+7);else if(s.key==="ArrowUp")i=new Date(a),i.setDate(a.getDate()-7);else if(s.key==="Home")i=new Date(a),i.setDate(a.getDate()-a.getDay());else if(s.key==="End")i=new Date(a),i.setDate(a.getDate()+(6-a.getDay()));else if(s.key==="PageUp")i=new Date(a),i.setMonth(a.getMonth()-1);else if(s.key==="PageDown")i=new Date(a),i.setMonth(a.getMonth()+1);else if(s.key==="Enter"||s.key===" "){s.preventDefault(),Me(t,f)();return}else if(s.key==="Escape"){s.preventDefault(),r==null||r([],D);return}if(i&&Q.current){const $=a.getMonth(),p=a.getFullYear(),b=i.getMonth(),u=i.getFullYear(),j=D(i),H=Q.current.querySelector(`[data-date="${j}"]`);if(H){if($!==b||p!==u){i>a?(Le(),setTimeout(()=>{H.focus()},0)):(Ye(),setTimeout(()=>{H.focus()},0));return}H.focus()}}};return d.useLayoutEffect(()=>{var t;ve(((t=Q.current)==null?void 0:t.clientWidth)||0)},[A]),d.useEffect(()=>{const t=()=>{var f;ve(((f=Q.current)==null?void 0:f.clientWidth)||0)};return window.addEventListener("resize",t),window.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),window.removeEventListener("scroll",t)}},[A]),d.useEffect(()=>{const t=y.current,f=(i,$,p)=>{if(!t||!T.current)return;W.current=i-se.current;const b=$-se.current,u=5;if(T.current=T.current||Math.abs(W.current)>u&&Math.abs(b)<u*2,p.cancelable&&p.preventDefault(),T.current){if(xe&&W.current>0){I();return}if(we&&W.current<0){I();return}Math.abs(W.current)>=10&&(t.style.transform=`translate3d(${W.current-k*w}px, 0, 0)`,t.style.cursor="grabbing")}},s=i=>f(i.touches[0].clientX,i.touches[0].clientY,i),a=i=>{T.current&&f(i.clientX,i.clientY,i)};return t==null||t.addEventListener("mousemove",a),t==null||t.addEventListener("touchmove",s),()=>{t==null||t.removeEventListener("mousemove",a),t==null||t.removeEventListener("touchmove",s)}},[k,w,I,we,xe]),d.useEffect(()=>{We(!0),De.current=setTimeout(()=>{y.current&&(y.current.style.transition="none"),w>Z.current?(_(1),pe(t=>new Date(t.setMonth(t.getMonth()+1))),Z.current=1):w<Z.current?(pe(t=>new Date(t.setMonth(t.getMonth()-1))),_(1),Z.current=1):Z.current=w,We(!1)},200)},[w]),d.useLayoutEffect(()=>{if(!re||!Array.isArray(c))return;const t=Ve(c,P);c.length<t.length&&(r==null||r(t,D))},[re,c,r,P]),d.useEffect(()=>{let t;return ge&&(t=setTimeout(()=>{if($e.current){const f=$e.current.querySelector("ul"),s=f==null?void 0:f.querySelector(`[data-value="${L}"]`);s==null||s.scrollIntoView({block:"start"})}},200)),()=>{clearTimeout(t)}},[ge,L]),d.useEffect(()=>()=>{De.current&&clearTimeout(De.current)},[]),o.jsxs(ht,{ref:Ze,"aria-label":"달력",role:"application",...Qe,css:Je,children:[A?o.jsxs(mt,{children:[o.jsx(_e.default,{name:"ChevronLeftLine",size:"small",onClick:Ye,disabled:xe,"aria-label":`이전 달로 이동, 현재 ${q}`}),V&&o.jsxs(Ue,{ref:oe,clickable:!0,onClick:ue,"aria-label":q,...ne,children:[L,o.jsx(Xe.default,{iconOnly:!0,isMenuOpen:!1,size:"xSmall",variant:"text",menuId:"date-picker-month-menu",onClick:ue,"aria-label":`달 변경, 현재 ${q}`,startAdornment:o.jsx(Ee.default,{name:"ArrowDownFill",size:"xSmall"})})]}),!V&&o.jsx(Ue,{ref:oe,id:"date-picker-title",clickable:!1,"aria-label":q,...ne,children:L}),o.jsx(_e.default,{name:"ChevronRightLine",size:"small",onClick:Le,disabled:we,"aria-label":`다음 달로 이동, 현재 ${q}`})]}):o.jsxs(o.Fragment,{children:[V&&o.jsxs(Ce,{ref:oe,clickable:!0,onClick:ue,"aria-label":q,...ne,children:[L,o.jsx(Xe.default,{iconOnly:!0,isMenuOpen:!1,size:"xSmall",variant:"text",menuId:"date-picker-month-menu",onClick:ue,"aria-label":`달 변경, 현재 ${q}`,startAdornment:o.jsx(Ee.default,{name:"ArrowDownFill",size:"xSmall"})})]}),!V&&o.jsx(Ce,{id:"date-picker-title",clickable:!1,...ne,children:L})]}),V&&o.jsx(ct.default,{id:"date-picker-month-menu",anchorRef:oe,ref:$e,open:ge,onClose:nt,onChange:it,value:L,placement:A?"bottom-center":"bottom-left",width:160,fitToAnchorWidth:!1,maxHeight:368,children:Array.from({length:130},(t,f)=>{const s=1970+f;return Array.from({length:12},(a,i)=>{const $=i+1,p=$<10?`0${$}`:$,b=new Date(s,i+1,0).getDate(),u=`${s}-${p}-${b}`,j=`${s}-${p}-01`;return U(u,m)||O(j,h)?null:o.jsx(lt.default,{value:`${s}. ${p}`,"aria-label":`${s}년 ${p}월 선택`,children:`${s}. ${p}`},`${s}-${p}`)})})}),o.jsxs(at.default,{flexDirection:"column",role:"grid","aria-label":`${S}년 ${Y}월 달력`,children:[he&&o.jsxs(pt,{id:"date-picker-week-head",role:"row",edgeSpacing:me,children:[o.jsx("span",{role:"columnheader",children:"일"}),o.jsx("span",{role:"columnheader",children:"월"}),o.jsx("span",{role:"columnheader",children:"화"}),o.jsx("span",{role:"columnheader",children:"수"}),o.jsx("span",{role:"columnheader",children:"목"}),o.jsx("span",{role:"columnheader",children:"금"}),o.jsx("span",{role:"columnheader",children:"토"})]}),o.jsx(gt,{ref:Q,role:"presentation",children:o.jsxs(yt,{role:"presentation",ref:y,onMouseDown:tt,onMouseUp:I,onMouseLeave:I,onTouchStart:rt,onTouchEnd:I,onTouchCancel:I,style:{transform:A?`translate3d(-${k*w}px, 0, 0)`:void 0,cursor:A?"grab":void 0,maxHeight:et},children:[A&&Fe.map(({year:t,month:f,weeks:s},a)=>o.jsx(Ne,{role:"rowgroup",edgeSpacing:me,className:a===1?"week-body-current":"",children:s.map((i,$)=>o.jsx(Be,{role:"row",children:i.map((p,b)=>{const u=`${t}-${f}-${G(p||0)}`,j=!p,H=v(u,new Date),ke=Array.isArray(C)?C.includes(u):C===u,ee=Array.isArray(X)?X.includes(u):X===u,K=!p||(Array.isArray(N)?N.includes(u):N===u)||O(u,h)||U(u,m),Se=B&&v(u,x),fe=B&&v(u,z),st=B&&O(u,x)&&U(u,z),Ie=de(u,R),ot=Ie&&$===0&&p===1||Ie&&ee,Oe=F==null?void 0:F(u);return o.jsxs(Ke,{as:"button",role:"gridcell",variant:Se?"start":fe?"end":st?"middle":void 0,onClick:Me(u,K),today:Ae&&H,holiday:ke,tabIndex:ot?0:-1,"aria-rowindex":$+1,"aria-colindex":b+1,selected:ee,"aria-selected":ee,"aria-disabled":K,"aria-hidden":p===null,"data-date":u,onKeyDown:qe(u,K),children:[o.jsx("div",{"aria-label":`${Pe(u)}`,children:o.jsx("span",{children:p})}),!j&&Oe,!j&&be&&!Oe&&o.jsx(Ge,{})]},`${t}-${f}-week-row-${b}-${p?u:`${$}-${b}`}`)})},`${t}-${f}-week-row-${String(i)}`))},`week-body-${t}-${f}`)),!A&&o.jsx(Ne,{role:"rowgroup",edgeSpacing:me,children:He.map((t,f)=>o.jsx(Be,{role:"row",children:t.map((s,a)=>{const i=`${S}-${Y}-${G(s||0)}`,$=!s,p=v(i,new Date),b=Array.isArray(C)?C.includes(i):C===i,u=Array.isArray(X)?X.includes(i):X===i,j=!s||(Array.isArray(N)?N.includes(i):N===i)||O(i,h)||U(i,m),H=B&&v(i,x),ke=B&&v(i,z),ee=B&&O(i,x)&&U(i,z),K=de(i,R),Se=K&&f===0&&s===1||K&&u,fe=F==null?void 0:F(i);return o.jsxs(Ke,{as:"button",variant:H?"start":ke?"end":ee?"middle":void 0,role:"gridcell",onClick:Me(i,j),today:Ae&&p,holiday:b,"aria-rowindex":f+1,"aria-colindex":a+1,selected:u,"aria-selected":u,"aria-disabled":j,"aria-hidden":s===null,tabIndex:Se?0:-1,"data-date":i,onKeyDown:qe(i,j),children:[o.jsx("div",{"aria-label":`${Pe(i)}`,children:o.jsx("span",{children:s})}),!$&&fe,!$&&be&&!fe&&o.jsx(Ge,{})]},`${S}-${Y}-week-row-${t}-${s?i:`${f}-${a}`}`)})},`${S}-${Y}-week-row-${String(t)}`))})]})})]}),n]})});function je(e,n){let r=[];const c=new Date(e,n,1),l=new Date(e,n+1,0).getDate(),m=c.getDay();let h=Array.from({length:m}).fill(null);for(let g=1;g<=l;g+=1)h.push(g),(h.length===7||g===l)&&(r.push(h),h=[]);return r=r.map(g=>Array.from({length:7}).map((P,he)=>g[he]||null)),r}function E(e){return String(e+1).length===1?`0${e+1}`:e+1}function G(e){return String(e).length===1?`0${e}`:e}function D(e){if(Array.isArray(e))return e.map(n=>n instanceof Date?`${n.getFullYear()}-${E(n.getMonth())}-${G(n.getDate())}`:n);if(e instanceof Date)return`${e.getFullYear()}-${E(e.getMonth())}-${G(e.getDate())}`;if(typeof e=="number"){const n=new Date(e);return`${n.getFullYear()}-${E(n.getMonth())}-${G(n.getDate())}`}return e}function Pe(e){const[n,r,c]=e.split("-");return`${n}년 ${Number(r)}월 ${Number(c)}일`}function O(e,n){if(!e||!n)return!1;const r=e instanceof Date?e:new Date(e);r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);const c=r.getTime(),l=n instanceof Date?n:new Date(n);l.setHours(0),l.setMinutes(0),l.setSeconds(0),l.setMilliseconds(0);const m=l.getTime();return c>m}function U(e,n){if(!e||!n)return!1;const r=e instanceof Date?e:new Date(e);r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);const c=r.getTime(),l=n instanceof Date?n:new Date(n);l.setHours(0),l.setMinutes(0),l.setSeconds(0),l.setMilliseconds(0);const m=l.getTime();return c<m}function de(e,n){if(!e||!n)return!1;const r=e instanceof Date?e:new Date(e),c=n instanceof Date?n:new Date(n);return`${r.getFullYear()}-${r.getMonth()}`==`${c.getFullYear()}-${c.getMonth()}`}function v(e,n){if(!e||!n)return!1;const r=e instanceof Date?e:new Date(e);r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0);const c=r.getTime(),l=n instanceof Date?n:new Date(n);l.setHours(0),l.setMinutes(0),l.setSeconds(0),l.setMilliseconds(0);const m=l.getTime();return c===m}function Ve(e,n){if(!e||!Array.isArray(e)||e.length===0)return[];const r=e.map(g=>g instanceof Date?g:g===null?new Date:new Date(g)),c=new Date(Math.min(...r.map(g=>g.getTime()))),l=new Date(Math.max(...r.map(g=>g.getTime()))),m=[],h=new Date(c);for(;h<=l;){if(Array.isArray(n)&&n.includes(h)){h.setDate(h.getDate()+1);continue}else if(n===h){h.setDate(h.getDate()+1);continue}m.push(`${h.getFullYear()}-${E(h.getMonth())}-${G(h.getDate())}`),h.setDate(h.getDate()+1)}return m}exports.default=$t;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { GeneralComponentProps } from '
|
|
2
|
+
import { GeneralComponentProps } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export type DateValue = string | number | Date | null;
|
|
5
5
|
export type DatePickerValue = DateValue[] | DateValue;
|
|
@@ -19,6 +19,7 @@ export interface DatePickerProps extends GeneralComponentProps<Omit<HTMLAttribut
|
|
|
19
19
|
showToday?: boolean;
|
|
20
20
|
edgeSpacing?: number;
|
|
21
21
|
renderEvent?: (date: string) => ReactNode;
|
|
22
|
+
monthProps?: HTMLAttributes<HTMLElement>;
|
|
22
23
|
}
|
|
23
24
|
declare const DatePicker: import('react').ForwardRefExoticComponent<DatePickerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
24
25
|
export default DatePicker;
|