@chayns-components/date 5.0.0-beta.433
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/LICENSE +21 -0
- package/README.md +34 -0
- package/lib/components/calendar/Calendar.d.ts +36 -0
- package/lib/components/calendar/Calendar.js +141 -0
- package/lib/components/calendar/Calendar.js.map +1 -0
- package/lib/components/calendar/Calendar.styles.d.ts +4 -0
- package/lib/components/calendar/Calendar.styles.js +20 -0
- package/lib/components/calendar/Calendar.styles.js.map +1 -0
- package/lib/components/calendar/month-wrapper/MonthWrapper.d.ts +17 -0
- package/lib/components/calendar/month-wrapper/MonthWrapper.js +137 -0
- package/lib/components/calendar/month-wrapper/MonthWrapper.js.map +1 -0
- package/lib/components/calendar/month-wrapper/MonthWrapper.styles.d.ts +271 -0
- package/lib/components/calendar/month-wrapper/MonthWrapper.styles.js +24 -0
- package/lib/components/calendar/month-wrapper/MonthWrapper.styles.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/Month.d.ts +14 -0
- package/lib/components/calendar/month-wrapper/month/Month.js +43 -0
- package/lib/components/calendar/month-wrapper/month/Month.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/Month.styles.d.ts +4 -0
- package/lib/components/calendar/month-wrapper/month/Month.styles.js +23 -0
- package/lib/components/calendar/month-wrapper/month/Month.styles.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.d.ts +12 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js +60 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.d.ts +2 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js +17 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.d.ts +12 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.js +66 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.d.ts +15 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js +75 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/Day.styles.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.d.ts +6 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js +20 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.d.ts +7 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js +21 -0
- package/lib/components/calendar/month-wrapper/month/day-wrapper/day/category/Category.styles.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.d.ts +7 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js +45 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.d.ts +2 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js +16 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/WeekdayWrapper.styles.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.d.ts +6 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js +18 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.js.map +1 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.d.ts +4 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js +19 -0
- package/lib/components/calendar/month-wrapper/month/weekday-wrapper/weekday/Weekday.styles.js.map +1 -0
- package/lib/components/date-info/DateInfo.d.ts +37 -0
- package/lib/components/date-info/DateInfo.js +110 -0
- package/lib/components/date-info/DateInfo.js.map +1 -0
- package/lib/components/opening-times/OpeningTimes.d.ts +27 -0
- package/lib/components/opening-times/OpeningTimes.js +135 -0
- package/lib/components/opening-times/OpeningTimes.js.map +1 -0
- package/lib/components/opening-times/OpeningTimes.styles.d.ts +8 -0
- package/lib/components/opening-times/OpeningTimes.styles.js +19 -0
- package/lib/components/opening-times/OpeningTimes.styles.js.map +1 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.d.ts +12 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.js +94 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.js.map +1 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.d.ts +2 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.js +13 -0
- package/lib/components/opening-times/opening-inputs/OpeningInputs.styles.js.map +1 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.d.ts +14 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.js +100 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.js.map +1 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.d.ts +274 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js +46 -0
- package/lib/components/opening-times/opening-inputs/opening-input/OpeningInput.styles.js.map +1 -0
- package/lib/constants/dateInfo.d.ts +22 -0
- package/lib/constants/dateInfo.js +629 -0
- package/lib/constants/dateInfo.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +28 -0
- package/lib/index.js.map +1 -0
- package/lib/types/calendar.d.ts +32 -0
- package/lib/types/calendar.js +22 -0
- package/lib/types/calendar.js.map +1 -0
- package/lib/types/openingTimes.d.ts +28 -0
- package/lib/types/openingTimes.js +13 -0
- package/lib/types/openingTimes.js.map +1 -0
- package/lib/utils/calendar.d.ts +15 -0
- package/lib/utils/calendar.js +58 -0
- package/lib/utils/calendar.js.map +1 -0
- package/lib/utils/dateInfo.d.ts +55 -0
- package/lib/utils/dateInfo.js +364 -0
- package/lib/utils/dateInfo.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import type { WithTheme } from '@chayns-components/core';
|
|
4
|
+
type StyledMonthWrapperProps = WithTheme<{
|
|
5
|
+
height: number;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const StyledMonthWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledMonthWrapperProps>>;
|
|
8
|
+
export declare const StyledMotionWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<{
|
|
9
|
+
color?: string | undefined;
|
|
10
|
+
defaultChecked?: boolean | undefined;
|
|
11
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
12
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
13
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
14
|
+
accessKey?: string | undefined;
|
|
15
|
+
autoFocus?: boolean | undefined;
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
|
|
18
|
+
contextMenu?: string | undefined;
|
|
19
|
+
dir?: string | undefined;
|
|
20
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
21
|
+
hidden?: boolean | undefined;
|
|
22
|
+
id?: string | undefined;
|
|
23
|
+
lang?: string | undefined;
|
|
24
|
+
nonce?: string | undefined;
|
|
25
|
+
slot?: string | undefined;
|
|
26
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
27
|
+
tabIndex?: number | undefined;
|
|
28
|
+
title?: string | undefined;
|
|
29
|
+
translate?: "yes" | "no" | undefined;
|
|
30
|
+
radioGroup?: string | undefined;
|
|
31
|
+
role?: import("react").AriaRole | undefined;
|
|
32
|
+
about?: string | undefined;
|
|
33
|
+
content?: string | undefined;
|
|
34
|
+
datatype?: string | undefined;
|
|
35
|
+
inlist?: any;
|
|
36
|
+
prefix?: string | undefined;
|
|
37
|
+
property?: string | undefined;
|
|
38
|
+
rel?: string | undefined;
|
|
39
|
+
resource?: string | undefined;
|
|
40
|
+
rev?: string | undefined;
|
|
41
|
+
typeof?: string | undefined;
|
|
42
|
+
vocab?: string | undefined;
|
|
43
|
+
autoCapitalize?: string | undefined;
|
|
44
|
+
autoCorrect?: string | undefined;
|
|
45
|
+
autoSave?: string | undefined;
|
|
46
|
+
itemProp?: string | undefined;
|
|
47
|
+
itemScope?: boolean | undefined;
|
|
48
|
+
itemType?: string | undefined;
|
|
49
|
+
itemID?: string | undefined;
|
|
50
|
+
itemRef?: string | undefined;
|
|
51
|
+
results?: number | undefined;
|
|
52
|
+
security?: string | undefined;
|
|
53
|
+
unselectable?: "on" | "off" | undefined;
|
|
54
|
+
inputMode?: "none" | "text" | "search" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
55
|
+
is?: string | undefined;
|
|
56
|
+
"aria-activedescendant"?: string | undefined;
|
|
57
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
58
|
+
"aria-autocomplete"?: "none" | "list" | "both" | "inline" | undefined;
|
|
59
|
+
"aria-braillelabel"?: string | undefined;
|
|
60
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
61
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
62
|
+
"aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
63
|
+
"aria-colcount"?: number | undefined;
|
|
64
|
+
"aria-colindex"?: number | undefined;
|
|
65
|
+
"aria-colindextext"?: string | undefined;
|
|
66
|
+
"aria-colspan"?: number | undefined;
|
|
67
|
+
"aria-controls"?: string | undefined;
|
|
68
|
+
"aria-current"?: boolean | "time" | "true" | "false" | "step" | "page" | "date" | "location" | undefined;
|
|
69
|
+
"aria-describedby"?: string | undefined;
|
|
70
|
+
"aria-description"?: string | undefined;
|
|
71
|
+
"aria-details"?: string | undefined;
|
|
72
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
73
|
+
"aria-dropeffect"?: "none" | "link" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
74
|
+
"aria-errormessage"?: string | undefined;
|
|
75
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
76
|
+
"aria-flowto"?: string | undefined;
|
|
77
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
78
|
+
"aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
|
|
79
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
80
|
+
"aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
81
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
82
|
+
"aria-label"?: string | undefined;
|
|
83
|
+
"aria-labelledby"?: string | undefined;
|
|
84
|
+
"aria-level"?: number | undefined;
|
|
85
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
86
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
87
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
88
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
89
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
90
|
+
"aria-owns"?: string | undefined;
|
|
91
|
+
"aria-placeholder"?: string | undefined;
|
|
92
|
+
"aria-posinset"?: number | undefined;
|
|
93
|
+
"aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
|
|
94
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
95
|
+
"aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
|
|
96
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
97
|
+
"aria-roledescription"?: string | undefined;
|
|
98
|
+
"aria-rowcount"?: number | undefined;
|
|
99
|
+
"aria-rowindex"?: number | undefined;
|
|
100
|
+
"aria-rowindextext"?: string | undefined;
|
|
101
|
+
"aria-rowspan"?: number | undefined;
|
|
102
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
103
|
+
"aria-setsize"?: number | undefined;
|
|
104
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
105
|
+
"aria-valuemax"?: number | undefined;
|
|
106
|
+
"aria-valuemin"?: number | undefined;
|
|
107
|
+
"aria-valuenow"?: number | undefined;
|
|
108
|
+
"aria-valuetext"?: string | undefined;
|
|
109
|
+
dangerouslySetInnerHTML?: {
|
|
110
|
+
__html: string | TrustedHTML;
|
|
111
|
+
} | undefined;
|
|
112
|
+
onCopy?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
113
|
+
onCopyCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
114
|
+
onCut?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
115
|
+
onCutCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
116
|
+
onPaste?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
117
|
+
onPasteCapture?: import("react").ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
118
|
+
onCompositionEnd?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
119
|
+
onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
120
|
+
onCompositionStart?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
121
|
+
onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
122
|
+
onCompositionUpdate?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
123
|
+
onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLDivElement> | undefined;
|
|
124
|
+
onFocus?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
125
|
+
onFocusCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
126
|
+
onBlur?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
127
|
+
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement> | undefined;
|
|
128
|
+
onChange?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
129
|
+
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
130
|
+
onBeforeInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
131
|
+
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
132
|
+
onInput?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
133
|
+
onInputCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
134
|
+
onReset?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
135
|
+
onResetCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
136
|
+
onSubmit?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
137
|
+
onSubmitCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
138
|
+
onInvalid?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
139
|
+
onInvalidCapture?: import("react").FormEventHandler<HTMLDivElement> | undefined;
|
|
140
|
+
onLoad?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
141
|
+
onLoadCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
142
|
+
onError?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
143
|
+
onErrorCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
144
|
+
onKeyDown?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
145
|
+
onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
146
|
+
onKeyPress?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
147
|
+
onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
148
|
+
onKeyUp?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
149
|
+
onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
150
|
+
onAbort?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
151
|
+
onAbortCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
152
|
+
onCanPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
153
|
+
onCanPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
154
|
+
onCanPlayThrough?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
155
|
+
onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
156
|
+
onDurationChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
157
|
+
onDurationChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
158
|
+
onEmptied?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
159
|
+
onEmptiedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
160
|
+
onEncrypted?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
161
|
+
onEncryptedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
162
|
+
onEnded?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
163
|
+
onEndedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
164
|
+
onLoadedData?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
165
|
+
onLoadedDataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
166
|
+
onLoadedMetadata?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
167
|
+
onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
168
|
+
onLoadStart?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
169
|
+
onLoadStartCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
170
|
+
onPause?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
171
|
+
onPauseCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
172
|
+
onPlay?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
173
|
+
onPlayCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
174
|
+
onPlaying?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
175
|
+
onPlayingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
176
|
+
onProgress?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
177
|
+
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
178
|
+
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
179
|
+
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
180
|
+
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
181
|
+
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
182
|
+
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
183
|
+
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
184
|
+
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
185
|
+
onSeekingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
186
|
+
onStalled?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
187
|
+
onStalledCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
188
|
+
onSuspend?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
189
|
+
onSuspendCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
190
|
+
onTimeUpdate?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
191
|
+
onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
192
|
+
onVolumeChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
193
|
+
onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
194
|
+
onWaiting?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
195
|
+
onWaitingCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
196
|
+
onAuxClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
197
|
+
onAuxClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
198
|
+
onClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
199
|
+
onClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
200
|
+
onContextMenu?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
201
|
+
onContextMenuCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
202
|
+
onDoubleClick?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
203
|
+
onDoubleClickCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
204
|
+
onDragCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
205
|
+
onDragEndCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
206
|
+
onDragEnter?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
207
|
+
onDragEnterCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
208
|
+
onDragExit?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
209
|
+
onDragExitCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
210
|
+
onDragLeave?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
211
|
+
onDragLeaveCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
212
|
+
onDragOver?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
213
|
+
onDragOverCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
214
|
+
onDragStartCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
215
|
+
onDrop?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
216
|
+
onDropCapture?: import("react").DragEventHandler<HTMLDivElement> | undefined;
|
|
217
|
+
onMouseDown?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
218
|
+
onMouseDownCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
219
|
+
onMouseEnter?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
220
|
+
onMouseLeave?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
221
|
+
onMouseMove?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
222
|
+
onMouseMoveCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
223
|
+
onMouseOut?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
224
|
+
onMouseOutCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
225
|
+
onMouseOver?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
226
|
+
onMouseOverCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
227
|
+
onMouseUp?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
228
|
+
onMouseUpCapture?: import("react").MouseEventHandler<HTMLDivElement> | undefined;
|
|
229
|
+
onSelect?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
230
|
+
onSelectCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
231
|
+
onTouchCancel?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
232
|
+
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
233
|
+
onTouchEnd?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
234
|
+
onTouchEndCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
235
|
+
onTouchMove?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
236
|
+
onTouchMoveCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
237
|
+
onTouchStart?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
238
|
+
onTouchStartCapture?: import("react").TouchEventHandler<HTMLDivElement> | undefined;
|
|
239
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
240
|
+
onPointerDownCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
241
|
+
onPointerMove?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
242
|
+
onPointerMoveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
243
|
+
onPointerUp?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
244
|
+
onPointerUpCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
245
|
+
onPointerCancel?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
246
|
+
onPointerCancelCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
247
|
+
onPointerEnter?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
248
|
+
onPointerEnterCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
249
|
+
onPointerLeave?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
250
|
+
onPointerLeaveCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
251
|
+
onPointerOver?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
252
|
+
onPointerOverCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
253
|
+
onPointerOut?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
254
|
+
onPointerOutCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
255
|
+
onGotPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
256
|
+
onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
257
|
+
onLostPointerCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
258
|
+
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement> | undefined;
|
|
259
|
+
onScroll?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
260
|
+
onScrollCapture?: import("react").UIEventHandler<HTMLDivElement> | undefined;
|
|
261
|
+
onWheel?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
262
|
+
onWheelCapture?: import("react").WheelEventHandler<HTMLDivElement> | undefined;
|
|
263
|
+
onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
264
|
+
onAnimationEnd?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
265
|
+
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
266
|
+
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
267
|
+
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
|
|
268
|
+
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
269
|
+
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
270
|
+
} & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLDivElement>, never>> & Omit<import("framer-motion").ForwardRefComponent<HTMLDivElement, import("framer-motion").HTMLMotionProps<"div">>, keyof import("react").Component<any, {}, any>>;
|
|
271
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledMotionWrapper = exports.StyledMonthWrapper = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
var _framerMotion = require("framer-motion");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
const StyledMonthWrapper = exports.StyledMonthWrapper = _styledComponents.default.div`
|
|
11
|
+
width: 100%;
|
|
12
|
+
overflow-x: clip;
|
|
13
|
+
height: ${_ref => {
|
|
14
|
+
let {
|
|
15
|
+
height
|
|
16
|
+
} = _ref;
|
|
17
|
+
return height;
|
|
18
|
+
}}px;
|
|
19
|
+
`;
|
|
20
|
+
const StyledMotionWrapper = exports.StyledMotionWrapper = (0, _styledComponents.default)(_framerMotion.motion.div)`
|
|
21
|
+
display: flex;
|
|
22
|
+
height: 100%;
|
|
23
|
+
`;
|
|
24
|
+
//# sourceMappingURL=MonthWrapper.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MonthWrapper.styles.js","names":["_styledComponents","_interopRequireDefault","require","_framerMotion","obj","__esModule","default","StyledMonthWrapper","exports","styled","div","_ref","height","StyledMotionWrapper","motion"],"sources":["../../../../src/components/calendar/month-wrapper/MonthWrapper.styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { motion } from 'framer-motion';\nimport type { WithTheme } from '@chayns-components/core';\n\ntype StyledMonthWrapperProps = WithTheme<{ height: number }>;\n\nexport const StyledMonthWrapper = styled.div<StyledMonthWrapperProps>`\n width: 100%;\n overflow-x: clip;\n height: ${({ height }) => height}px;\n`;\n\nexport const StyledMotionWrapper = styled(motion.div)`\n display: flex;\n height: 100%;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAAuC,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAKhC,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAGE,yBAAM,CAACC,GAA6B;AACtE;AACA;AACA,cAAcC,IAAA;EAAA,IAAC;IAAEC;EAAO,CAAC,GAAAD,IAAA;EAAA,OAAKC,MAAM;AAAA,CAAC;AACrC,CAAC;AAEM,MAAMC,mBAAmB,GAAAL,OAAA,CAAAK,mBAAA,GAAG,IAAAJ,yBAAM,EAACK,oBAAM,CAACJ,GAAG,CAAE;AACtD;AACA;AACA,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import type { Locale } from 'date-fns';
|
|
3
|
+
import type { Categories, EMonth, HighlightedDates } from '../../../../types/calendar';
|
|
4
|
+
export type MonthProps = {
|
|
5
|
+
month: EMonth;
|
|
6
|
+
year: string;
|
|
7
|
+
locale: Locale;
|
|
8
|
+
highlightedDates?: HighlightedDates[];
|
|
9
|
+
onSelect: (date: Date) => void;
|
|
10
|
+
selectedDate?: Date;
|
|
11
|
+
categories?: Categories[];
|
|
12
|
+
};
|
|
13
|
+
declare const Month: FC<MonthProps>;
|
|
14
|
+
export default Month;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _Month = require("./Month.styles");
|
|
9
|
+
var _WeekdayWrapper = _interopRequireDefault(require("./weekday-wrapper/WeekdayWrapper"));
|
|
10
|
+
var _DayWrapper = _interopRequireDefault(require("./day-wrapper/DayWrapper"));
|
|
11
|
+
var _calendar = require("../../../../utils/calendar");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
const Month = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
month,
|
|
18
|
+
year,
|
|
19
|
+
locale,
|
|
20
|
+
highlightedDates,
|
|
21
|
+
selectedDate,
|
|
22
|
+
onSelect,
|
|
23
|
+
categories
|
|
24
|
+
} = _ref;
|
|
25
|
+
const [currentYear] = (0, _react.useState)(new Date().getFullYear());
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_Month.StyledMonth, null, /*#__PURE__*/_react.default.createElement(_Month.StyledMonthHead, null, /*#__PURE__*/_react.default.createElement(_Month.StyledMonthName, null, `${(0, _calendar.formatMonth)({
|
|
27
|
+
locale,
|
|
28
|
+
month
|
|
29
|
+
})} ${String(currentYear) !== year ? year : ''}`)), /*#__PURE__*/_react.default.createElement(_WeekdayWrapper.default, {
|
|
30
|
+
locale: locale
|
|
31
|
+
}), /*#__PURE__*/_react.default.createElement(_DayWrapper.default, {
|
|
32
|
+
key: `day-wrapper-${month}`,
|
|
33
|
+
categories: categories,
|
|
34
|
+
selectedDate: selectedDate,
|
|
35
|
+
month: month,
|
|
36
|
+
year: year,
|
|
37
|
+
onSelect: onSelect,
|
|
38
|
+
highlightedDates: highlightedDates
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
Month.displayName = 'Month';
|
|
42
|
+
var _default = exports.default = Month;
|
|
43
|
+
//# sourceMappingURL=Month.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Month.js","names":["_react","_interopRequireWildcard","require","_Month","_WeekdayWrapper","_interopRequireDefault","_DayWrapper","_calendar","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","Month","_ref","month","year","locale","highlightedDates","selectedDate","onSelect","categories","currentYear","useState","Date","getFullYear","createElement","StyledMonth","StyledMonthHead","StyledMonthName","formatMonth","String","key","displayName","_default","exports"],"sources":["../../../../../src/components/calendar/month-wrapper/month/Month.tsx"],"sourcesContent":["import React, { FC, useState } from 'react';\nimport { StyledMonth, StyledMonthHead, StyledMonthName } from './Month.styles';\nimport WeekdayWrapper from './weekday-wrapper/WeekdayWrapper';\nimport DayWrapper from './day-wrapper/DayWrapper';\nimport type { Locale } from 'date-fns';\nimport type { Categories, EMonth, HighlightedDates } from '../../../../types/calendar';\nimport { formatMonth } from '../../../../utils/calendar';\n\nexport type MonthProps = {\n month: EMonth;\n year: string;\n locale: Locale;\n highlightedDates?: HighlightedDates[];\n onSelect: (date: Date) => void;\n selectedDate?: Date;\n categories?: Categories[];\n};\n\nconst Month: FC<MonthProps> = ({\n month,\n year,\n locale,\n highlightedDates,\n selectedDate,\n onSelect,\n categories,\n}) => {\n const [currentYear] = useState(new Date().getFullYear());\n\n return (\n <StyledMonth>\n <StyledMonthHead>\n <StyledMonthName>{`${formatMonth({ locale, month })} ${String(currentYear) !== year ? year : ''}`}</StyledMonthName>\n </StyledMonthHead>\n <WeekdayWrapper locale={locale} />\n <DayWrapper\n key={`day-wrapper-${month}`}\n categories={categories}\n selectedDate={selectedDate}\n month={month}\n year={year}\n onSelect={onSelect}\n highlightedDates={highlightedDates}\n />\n </StyledMonth>\n );\n};\n\nMonth.displayName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B,EAAEA;EAAiB,CACtC,CACQ,CAAC;AAEtB,CAAC;AAEDL,KAAK,CAACoB,WAAW,GAAG,OAAO;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA1C,OAAA,GAEboB,KAAK"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledMonth: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
3
|
+
export declare const StyledMonthHead: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
4
|
+
export declare const StyledMonthName: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledMonthName = exports.StyledMonthHead = exports.StyledMonth = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const StyledMonth = exports.StyledMonth = _styledComponents.default.div`
|
|
10
|
+
height: 100%;
|
|
11
|
+
aspect-ratio: 1;
|
|
12
|
+
`;
|
|
13
|
+
const StyledMonthHead = exports.StyledMonthHead = _styledComponents.default.div`
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
`;
|
|
17
|
+
const StyledMonthName = exports.StyledMonthName = _styledComponents.default.div`
|
|
18
|
+
font-weight: bold;
|
|
19
|
+
width: 100%;
|
|
20
|
+
text-align: center;
|
|
21
|
+
user-select: none;
|
|
22
|
+
`;
|
|
23
|
+
//# sourceMappingURL=Month.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Month.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledMonth","exports","styled","div","StyledMonthHead","StyledMonthName"],"sources":["../../../../../src/components/calendar/month-wrapper/month/Month.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledMonth = styled.div`\n height: 100%;\n aspect-ratio: 1;\n`;\n\nexport const StyledMonthHead = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const StyledMonthName = styled.div`\n font-weight: bold;\n width: 100%;\n text-align: center;\n user-select: none;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,yBAAM,CAACC,GAAI;AACtC;AACA;AACA,CAAC;AAEM,MAAMC,eAAe,GAAAH,OAAA,CAAAG,eAAA,GAAGF,yBAAM,CAACC,GAAI;AAC1C;AACA;AACA,CAAC;AAEM,MAAME,eAAe,GAAAJ,OAAA,CAAAI,eAAA,GAAGH,yBAAM,CAACC,GAAI;AAC1C;AACA;AACA;AACA;AACA,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import type { Categories, EMonth, HighlightedDates } from '../../../../../types/calendar';
|
|
3
|
+
export type DayWrapperProps = {
|
|
4
|
+
month: EMonth;
|
|
5
|
+
year: string;
|
|
6
|
+
highlightedDates?: HighlightedDates[];
|
|
7
|
+
onSelect: (date: Date) => void;
|
|
8
|
+
selectedDate?: Date;
|
|
9
|
+
categories?: Categories[];
|
|
10
|
+
};
|
|
11
|
+
declare const DayWrapper: FC<DayWrapperProps>;
|
|
12
|
+
export default DayWrapper;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _dateFns = require("date-fns");
|
|
9
|
+
var _DayWrapper = require("./DayWrapper.styles");
|
|
10
|
+
var _Day = _interopRequireDefault(require("./day/Day"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const DayWrapper = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
month,
|
|
17
|
+
year,
|
|
18
|
+
highlightedDates,
|
|
19
|
+
onSelect,
|
|
20
|
+
selectedDate,
|
|
21
|
+
categories
|
|
22
|
+
} = _ref;
|
|
23
|
+
const dayOfCurrentMonth = (0, _react.useMemo)(() => new Date(Number(year), month - 1, 13), [month, year]);
|
|
24
|
+
const days = (0, _react.useMemo)(() => {
|
|
25
|
+
const dateArray = [];
|
|
26
|
+
const currentDate = (0, _dateFns.startOfMonth)(dayOfCurrentMonth);
|
|
27
|
+
const startDay = (0, _dateFns.startOfWeek)(currentDate, {
|
|
28
|
+
weekStartsOn: 1
|
|
29
|
+
});
|
|
30
|
+
for (let i = 0; i < 42; i++) {
|
|
31
|
+
const newDate = (0, _dateFns.addDays)(startDay, i);
|
|
32
|
+
dateArray.push(newDate);
|
|
33
|
+
}
|
|
34
|
+
return dateArray;
|
|
35
|
+
}, [dayOfCurrentMonth]);
|
|
36
|
+
const handleDayClick = (0, _react.useCallback)((date, shouldFireEvent) => {
|
|
37
|
+
if (shouldFireEvent) {
|
|
38
|
+
onSelect(date);
|
|
39
|
+
}
|
|
40
|
+
}, [onSelect]);
|
|
41
|
+
const dayElements = (0, _react.useMemo)(() => {
|
|
42
|
+
const items = [];
|
|
43
|
+
days.forEach(day => {
|
|
44
|
+
items.push( /*#__PURE__*/_react.default.createElement(_Day.default, {
|
|
45
|
+
key: `single-day-${day.toDateString()}`,
|
|
46
|
+
categories: categories,
|
|
47
|
+
date: day,
|
|
48
|
+
isSelected: selectedDate ? (0, _dateFns.isSameDay)(day, selectedDate) : false,
|
|
49
|
+
isSameMonth: (0, _dateFns.isSameMonth)(day, dayOfCurrentMonth),
|
|
50
|
+
onClick: handleDayClick,
|
|
51
|
+
highlightedDates: highlightedDates
|
|
52
|
+
}));
|
|
53
|
+
});
|
|
54
|
+
return items;
|
|
55
|
+
}, [categories, dayOfCurrentMonth, days, handleDayClick, highlightedDates, selectedDate]);
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_DayWrapper.StyledDayWrapper, null, dayElements);
|
|
57
|
+
};
|
|
58
|
+
DayWrapper.displayName = 'DayWrapper';
|
|
59
|
+
var _default = exports.default = DayWrapper;
|
|
60
|
+
//# sourceMappingURL=DayWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DayWrapper.js","names":["_react","_interopRequireWildcard","require","_dateFns","_DayWrapper","_Day","_interopRequireDefault","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","DayWrapper","_ref","month","year","highlightedDates","onSelect","selectedDate","categories","dayOfCurrentMonth","useMemo","Date","Number","days","dateArray","currentDate","startOfMonth","startDay","startOfWeek","weekStartsOn","newDate","addDays","push","handleDayClick","useCallback","date","shouldFireEvent","dayElements","items","forEach","day","createElement","key","toDateString","isSelected","isSameDay","isSameMonth","onClick","StyledDayWrapper","displayName","_default","exports"],"sources":["../../../../../../src/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.tsx"],"sourcesContent":["import React, { FC, type ReactElement, useCallback, useMemo } from 'react';\nimport { startOfMonth, startOfWeek, addDays, isSameMonth, isSameDay } from 'date-fns';\nimport { StyledDayWrapper } from './DayWrapper.styles';\nimport Day from './day/Day';\nimport type { Categories, EMonth, HighlightedDates } from '../../../../../types/calendar';\n\nexport type DayWrapperProps = {\n month: EMonth;\n year: string;\n highlightedDates?: HighlightedDates[];\n onSelect: (date: Date) => void;\n selectedDate?: Date;\n categories?: Categories[];\n};\n\nconst DayWrapper: FC<DayWrapperProps> = ({\n month,\n year,\n highlightedDates,\n onSelect,\n selectedDate,\n categories,\n}) => {\n const dayOfCurrentMonth = useMemo(() => new Date(Number(year), month - 1, 13), [month, year]);\n\n const days = useMemo(() => {\n const dateArray: Date[] = [];\n\n const currentDate = startOfMonth(dayOfCurrentMonth);\n\n const startDay = startOfWeek(currentDate, { weekStartsOn: 1 });\n\n for (let i = 0; i < 42; i++) {\n const newDate = addDays(startDay, i);\n dateArray.push(newDate);\n }\n\n return dateArray;\n }, [dayOfCurrentMonth]);\n\n const handleDayClick = useCallback(\n (date: Date, shouldFireEvent: boolean) => {\n if (shouldFireEvent) {\n onSelect(date);\n }\n },\n [onSelect],\n );\n\n const dayElements = useMemo(() => {\n const items: ReactElement[] = [];\n\n days.forEach((day) => {\n items.push(\n <Day\n key={`single-day-${day.toDateString()}`}\n categories={categories}\n date={day}\n isSelected={selectedDate ? isSameDay(day, selectedDate) : false}\n isSameMonth={isSameMonth(day, dayOfCurrentMonth)}\n onClick={handleDayClick}\n highlightedDates={highlightedDates}\n />,\n );\n });\n\n return items;\n }, [categories, dayOfCurrentMonth, days, handleDayClick, highlightedDates, selectedDate]);\n\n return <StyledDayWrapper>{dayElements}</StyledDayWrapper>;\n};\n\nDayWrapper.displayName = 'DayWrapper';\n\nexport default DayWrapper;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAA4B,SAAAI,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAH,UAAA,SAAAG,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAF,OAAA,EAAAE,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAJ,CAAA,UAAAG,CAAA,CAAAE,GAAA,CAAAL,CAAA,OAAAM,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAZ,CAAA,oBAAAY,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAA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yledDayWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StyledDayWrapper = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const StyledDayWrapper = exports.StyledDayWrapper = _styledComponents.default.div`
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-rows: repeat(6, 1fr);
|
|
12
|
+
grid-template-columns: repeat(7, 1fr);
|
|
13
|
+
padding-top: 6px;
|
|
14
|
+
gap: 2px;
|
|
15
|
+
margin: 0 15px;
|
|
16
|
+
`;
|
|
17
|
+
//# sourceMappingURL=DayWrapper.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DayWrapper.styles.js","names":["_styledComponents","_interopRequireDefault","require","obj","__esModule","default","StyledDayWrapper","exports","styled","div"],"sources":["../../../../../../src/components/calendar/month-wrapper/month/day-wrapper/DayWrapper.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledDayWrapper = styled.div`\n display: grid;\n grid-template-rows: repeat(6, 1fr);\n grid-template-columns: repeat(7, 1fr);\n padding-top: 6px;\n gap: 2px;\n margin: 0 15px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAuC,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEhC,MAAMG,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,yBAAM,CAACC,GAAI;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import type { Categories, HighlightedDates } from '../../../../../../types/calendar';
|
|
3
|
+
export type DayProps = {
|
|
4
|
+
date: Date;
|
|
5
|
+
isSameMonth: boolean;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
onClick: (date: Date, isSameMonth: boolean) => void;
|
|
8
|
+
highlightedDates?: HighlightedDates[];
|
|
9
|
+
categories?: Categories[];
|
|
10
|
+
};
|
|
11
|
+
declare const Day: FC<DayProps>;
|
|
12
|
+
export default Day;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _dateFns = require("date-fns");
|
|
9
|
+
var _Day = require("./Day.styles");
|
|
10
|
+
var _Category = _interopRequireDefault(require("./category/Category"));
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const Day = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
date,
|
|
17
|
+
highlightedDates,
|
|
18
|
+
categories,
|
|
19
|
+
isSameMonth,
|
|
20
|
+
isSelected,
|
|
21
|
+
onClick
|
|
22
|
+
} = _ref;
|
|
23
|
+
const [fontSize, setFontSize] = (0, _react.useState)();
|
|
24
|
+
const dayRef = (0, _react.useRef)(null);
|
|
25
|
+
const styles = (0, _react.useMemo)(() => {
|
|
26
|
+
if (!highlightedDates || !isSameMonth) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
return highlightedDates.find(highlightedDate => highlightedDate.dates.some(highlighted => (0, _dateFns.isSameDay)(highlighted, date)))?.style;
|
|
30
|
+
}, [date, highlightedDates, isSameMonth]);
|
|
31
|
+
const categoryElements = (0, _react.useMemo)(() => {
|
|
32
|
+
if (!categories) return [];
|
|
33
|
+
return categories.flatMap(category => category.dates.filter(day => (0, _dateFns.isSameDay)(day, date)).map(day => /*#__PURE__*/_react.default.createElement(_Category.default, {
|
|
34
|
+
key: day.getTime() * Math.random(),
|
|
35
|
+
color: category.color
|
|
36
|
+
})));
|
|
37
|
+
}, [categories, date]);
|
|
38
|
+
(0, _react.useEffect)(() => {
|
|
39
|
+
if (dayRef.current) {
|
|
40
|
+
const resizeObserver = new ResizeObserver(entries => {
|
|
41
|
+
if (entries && entries[0]) {
|
|
42
|
+
const observedWidth = entries[0].contentRect.width;
|
|
43
|
+
setFontSize(`${observedWidth / 2}px`);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
resizeObserver.observe(dayRef.current);
|
|
47
|
+
return () => {
|
|
48
|
+
resizeObserver.disconnect();
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return () => {};
|
|
52
|
+
}, []);
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_Day.StyledDay, {
|
|
54
|
+
ref: dayRef,
|
|
55
|
+
onClick: () => onClick(date, isSameMonth),
|
|
56
|
+
isSameMonth: isSameMonth,
|
|
57
|
+
backgroundColor: styles?.backgroundColor,
|
|
58
|
+
textColor: styles?.textColor
|
|
59
|
+
}, /*#__PURE__*/_react.default.createElement(_Day.StyledDayNumber, {
|
|
60
|
+
isSelected: isSelected,
|
|
61
|
+
fontSize: fontSize
|
|
62
|
+
}, date.getDate()), categoryElements && /*#__PURE__*/_react.default.createElement(_Day.StyledDayCategoryWrapper, null, categoryElements));
|
|
63
|
+
};
|
|
64
|
+
Day.displayName = 'Day';
|
|
65
|
+
var _default = exports.default = Day;
|
|
66
|
+
//# sourceMappingURL=Day.js.map
|