react-day-picker 8.0.0-beta.32 → 8.0.0-beta.33
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/CHANGELOG.md +12 -3
- package/build/DayPicker.d.ts +3 -2
- package/build/DayPicker.js +6 -5
- package/build/DayPicker.js.map +1 -1
- package/build/components/Button/Button.d.ts +1 -1
- package/build/components/Button/Button.js +1 -1
- package/build/components/Button/Button.js.map +1 -1
- package/build/components/Caption/Caption.d.ts +7 -0
- package/build/components/Caption/Caption.js +8 -8
- package/build/components/Caption/Caption.js.map +1 -1
- package/build/components/CaptionLabel/CaptionLabel.js +1 -1
- package/build/components/CaptionLabel/CaptionLabel.js.map +1 -1
- package/build/components/Day/Day.js +1 -1
- package/build/components/Day/Day.js.map +1 -1
- package/build/components/Day/hooks/useDay.d.ts +2 -2
- package/build/components/Day/hooks/useDay.js +5 -5
- package/build/components/Day/hooks/useDay.js.map +1 -1
- package/build/components/Day/hooks/useDayFocus.d.ts +1 -1
- package/build/components/Day/hooks/useDayFocus.js +1 -1
- package/build/components/Day/hooks/useDayFocus.js.map +1 -1
- package/build/components/DayContent/DayContent.js +1 -1
- package/build/components/DayContent/DayContent.js.map +1 -1
- package/build/components/Dropdown/Dropdown.d.ts +1 -1
- package/build/components/Dropdown/Dropdown.js +1 -1
- package/build/components/Dropdown/Dropdown.js.map +1 -1
- package/build/components/Footer/Footer.js +1 -1
- package/build/components/Footer/Footer.js.map +1 -1
- package/build/components/Head/Head.js +1 -1
- package/build/components/Head/Head.js.map +1 -1
- package/build/components/IconDropdown/IconDropdown.d.ts +2 -2
- package/build/components/IconDropdown/IconDropdown.js +1 -1
- package/build/components/IconDropdown/IconDropdown.js.map +1 -1
- package/build/components/IconLeft/IconLeft.d.ts +2 -2
- package/build/components/IconLeft/IconLeft.js +3 -3
- package/build/components/IconLeft/IconLeft.js.map +1 -1
- package/build/components/IconRight/IconRight.d.ts +2 -2
- package/build/components/IconRight/IconRight.js +3 -3
- package/build/components/IconRight/IconRight.js.map +1 -1
- package/build/components/MonthsDropdown/MonthsDropdown.d.ts +1 -1
- package/build/components/MonthsDropdown/MonthsDropdown.js +1 -1
- package/build/components/MonthsDropdown/MonthsDropdown.js.map +1 -1
- package/build/components/Navigation/Navigation.d.ts +1 -1
- package/build/components/Navigation/Navigation.js +1 -1
- package/build/components/Navigation/Navigation.js.map +1 -1
- package/build/components/Root/Root.js +1 -2
- package/build/components/Root/Root.js.map +1 -1
- package/build/components/Row/Row.js +1 -1
- package/build/components/Row/Row.js.map +1 -1
- package/build/components/Table/Table.js +1 -1
- package/build/components/Table/Table.js.map +1 -1
- package/build/components/WeekNumber/WeekNumber.js +1 -1
- package/build/components/WeekNumber/WeekNumber.js.map +1 -1
- package/build/components/YearsDropdown/YearsDropdown.d.ts +1 -1
- package/build/components/YearsDropdown/YearsDropdown.js +1 -1
- package/build/components/YearsDropdown/YearsDropdown.js.map +1 -1
- package/build/contexts/DayPicker/DayPickerContext.d.ts +3 -2
- package/build/contexts/DayPicker/DayPickerContext.js +1 -1
- package/build/contexts/DayPicker/DayPickerContext.js.map +1 -1
- package/build/contexts/DayPicker/DayPickerProvider.d.ts +1 -1
- package/build/contexts/DayPicker/DayPickerProvider.js +1 -1
- package/build/contexts/DayPicker/DayPickerProvider.js.map +1 -1
- package/build/contexts/DayPicker/defaultClassNames.js +1 -3
- package/build/contexts/DayPicker/defaultClassNames.js.map +1 -1
- package/build/contexts/DayPicker/labels/labelDay.d.ts +2 -2
- package/build/contexts/DayPicker/labels/labelDay.js +1 -1
- package/build/contexts/DayPicker/labels/labelDay.js.map +1 -1
- package/build/contexts/DayPicker/labels/labelNext.d.ts +2 -2
- package/build/contexts/DayPicker/labels/labelNext.js.map +1 -1
- package/build/contexts/DayPicker/labels/labelPrevious.d.ts +2 -2
- package/build/contexts/DayPicker/labels/labelPrevious.js.map +1 -1
- package/build/contexts/DayPicker/labels/labelWeekNumber.d.ts +2 -2
- package/build/contexts/DayPicker/labels/labelWeekNumber.js.map +1 -1
- package/build/contexts/DayPicker/labels/labelWeekday.d.ts +2 -2
- package/build/contexts/DayPicker/labels/labelWeekday.js.map +1 -1
- package/build/contexts/DayPicker/useDayPicker.js +1 -1
- package/build/contexts/DayPicker/useDayPicker.js.map +1 -1
- package/build/contexts/DayPicker/utils/parseModifierProps.js +1 -0
- package/build/contexts/DayPicker/utils/parseModifierProps.js.map +1 -1
- package/build/contexts/Focus/FocusContext.d.ts +5 -1
- package/build/contexts/Focus/FocusContext.js +63 -3
- package/build/contexts/Focus/FocusContext.js.map +1 -1
- package/build/contexts/Focus/index.d.ts +0 -1
- package/build/contexts/Focus/useFocus.js +1 -1
- package/build/contexts/Focus/useFocus.js.map +1 -1
- package/build/contexts/Navigation/NavigationContext.d.ts +5 -1
- package/build/contexts/Navigation/NavigationContext.js +23 -3
- package/build/contexts/Navigation/NavigationContext.js.map +1 -1
- package/build/contexts/Navigation/index.d.ts +0 -1
- package/build/contexts/Navigation/useNavigation.js +1 -1
- package/build/contexts/Navigation/useNavigation.js.map +1 -1
- package/build/contexts/RootProvider.d.ts +8 -0
- package/build/contexts/{ContextProvider.js → RootProvider.js} +9 -14
- package/build/contexts/RootProvider.js.map +1 -0
- package/build/contexts/SelectMultiple/SelectMultipleContext.d.ts +14 -2
- package/build/contexts/SelectMultiple/SelectMultipleContext.js +73 -3
- package/build/contexts/SelectMultiple/SelectMultipleContext.js.map +1 -1
- package/build/contexts/SelectMultiple/index.d.ts +0 -1
- package/build/contexts/SelectMultiple/useSelectMultiple.js +1 -1
- package/build/contexts/SelectMultiple/useSelectMultiple.js.map +1 -1
- package/build/contexts/SelectRange/SelectRangeContext.d.ts +14 -3
- package/build/contexts/SelectRange/SelectRangeContext.js +114 -3
- package/build/contexts/SelectRange/SelectRangeContext.js.map +1 -1
- package/build/contexts/SelectRange/index.d.ts +0 -1
- package/build/contexts/SelectRange/useSelectRange.js +1 -1
- package/build/contexts/SelectRange/useSelectRange.js.map +1 -1
- package/build/contexts/SelectSingle/SelectSingleContext.d.ts +17 -3
- package/build/contexts/SelectSingle/SelectSingleContext.js +36 -3
- package/build/contexts/SelectSingle/SelectSingleContext.js.map +1 -1
- package/build/contexts/SelectSingle/index.d.ts +0 -1
- package/build/contexts/SelectSingle/useSelectSingle.js +1 -1
- package/build/contexts/SelectSingle/useSelectSingle.js.map +1 -1
- package/build/contexts/index.d.ts +1 -1
- package/build/hooks/useControlledValue/useControlledValue.js +2 -2
- package/build/hooks/useControlledValue/useControlledValue.js.map +1 -1
- package/build/hooks/useInput/useInput.d.ts +11 -32
- package/build/hooks/useInput/useInput.js +2 -4
- package/build/hooks/useInput/useInput.js.map +1 -1
- package/build/hooks/useModifiers/useModifiers.js +3 -5
- package/build/hooks/useModifiers/useModifiers.js.map +1 -1
- package/build/hooks/useModifiers/utils/isDateInRange.d.ts +1 -1
- package/build/hooks/useModifiers/utils/isDateInRange.js.map +1 -1
- package/build/hooks/useModifiers/utils/isMatch.d.ts +1 -1
- package/build/hooks/useModifiers/utils/isMatch.js +10 -8
- package/build/hooks/useModifiers/utils/isMatch.js.map +1 -1
- package/build/main.js +11 -22
- package/build/main.js.map +1 -1
- package/build/types/{DayPickerProps.d.ts → DayPicker.d.ts} +35 -16
- package/build/types/DayPickerCustom.d.ts +11 -0
- package/build/types/{isDayPickerCustom.js → DayPickerCustom.js} +1 -1
- package/build/types/DayPickerCustom.js.map +1 -0
- package/build/types/{DayPickerMultipleProps.d.ts → DayPickerMultiple.d.ts} +5 -5
- package/build/types/{isDayPickerMultiple.js → DayPickerMultiple.js} +1 -1
- package/build/types/DayPickerMultiple.js.map +1 -0
- package/build/types/{DayPickerRangeProps.d.ts → DayPickerRange.d.ts} +6 -6
- package/build/types/{isDayPickerRange.js → DayPickerRange.js} +1 -1
- package/build/types/DayPickerRange.js.map +1 -0
- package/build/types/DayPickerSingle.d.ts +14 -0
- package/build/types/{isDayPickerSingle.js → DayPickerSingle.js} +1 -1
- package/build/types/DayPickerSingle.js.map +1 -0
- package/build/types/EventHandlers.d.ts +51 -0
- package/build/types/Formatters.d.ts +10 -5
- package/build/types/Labels.d.ts +24 -12
- package/build/types/Matchers.d.ts +34 -0
- package/build/types/Matchers.js +27 -0
- package/build/types/Matchers.js.map +1 -0
- package/build/types/Modifiers.d.ts +15 -4
- package/build/types/Styles.d.ts +83 -2
- package/build/types/index.d.ts +7 -50
- package/dist/main.js +555 -589
- package/dist/main.js.map +1 -1
- package/package.json +3 -2
- package/build/contexts/ContextProvider.d.ts +0 -8
- package/build/contexts/ContextProvider.js.map +0 -1
- package/build/contexts/Focus/FocusProvider.d.ts +0 -5
- package/build/contexts/Focus/FocusProvider.js +0 -66
- package/build/contexts/Focus/FocusProvider.js.map +0 -1
- package/build/contexts/Navigation/NavigationProvider.d.ts +0 -5
- package/build/contexts/Navigation/NavigationProvider.js +0 -26
- package/build/contexts/Navigation/NavigationProvider.js.map +0 -1
- package/build/contexts/SelectMultiple/SelectMultipleProvider.d.ts +0 -9
- package/build/contexts/SelectMultiple/SelectMultipleProvider.js +0 -23
- package/build/contexts/SelectMultiple/SelectMultipleProvider.js.map +0 -1
- package/build/contexts/SelectMultiple/SelectMultipleProviderInternal.d.ts +0 -8
- package/build/contexts/SelectMultiple/SelectMultipleProviderInternal.js +0 -61
- package/build/contexts/SelectMultiple/SelectMultipleProviderInternal.js.map +0 -1
- package/build/contexts/SelectRange/SelectRangeProvider.d.ts +0 -9
- package/build/contexts/SelectRange/SelectRangeProvider.js +0 -26
- package/build/contexts/SelectRange/SelectRangeProvider.js.map +0 -1
- package/build/contexts/SelectRange/SelectRangeProviderInternal.d.ts +0 -8
- package/build/contexts/SelectRange/SelectRangeProviderInternal.js +0 -99
- package/build/contexts/SelectRange/SelectRangeProviderInternal.js.map +0 -1
- package/build/contexts/SelectSingle/SelectSingleProvider.d.ts +0 -9
- package/build/contexts/SelectSingle/SelectSingleProvider.js +0 -20
- package/build/contexts/SelectSingle/SelectSingleProvider.js.map +0 -1
- package/build/contexts/SelectSingle/SelectSingleProviderInternal.d.ts +0 -8
- package/build/contexts/SelectSingle/SelectSingleProviderInternal.js +0 -27
- package/build/contexts/SelectSingle/SelectSingleProviderInternal.js.map +0 -1
- package/build/types/CaptionLayout.d.ts +0 -7
- package/build/types/ClassNames.d.ts +0 -3
- package/build/types/Components.d.ts +0 -39
- package/build/types/CustomModifiers.d.ts +0 -4
- package/build/types/DateAfter.d.ts +0 -7
- package/build/types/DateBefore.d.ts +0 -7
- package/build/types/DateFormatter.d.ts +0 -6
- package/build/types/DateInterval.d.ts +0 -8
- package/build/types/DateRange.d.ts +0 -8
- package/build/types/DayClickEventHandler.d.ts +0 -6
- package/build/types/DayFocusEventHandler.d.ts +0 -6
- package/build/types/DayKeyboardEventHandler.d.ts +0 -6
- package/build/types/DayLabelFormatter.d.ts +0 -7
- package/build/types/DayMouseEventHandler.d.ts +0 -6
- package/build/types/DayOfWeekMatcher.d.ts +0 -7
- package/build/types/DayPickerCustomProps.d.ts +0 -11
- package/build/types/DayPickerSingleProps.d.ts +0 -14
- package/build/types/DayTouchEventHandler.d.ts +0 -6
- package/build/types/InternalModifier.d.ts +0 -2
- package/build/types/Matcher.d.ts +0 -10
- package/build/types/Modifier.d.ts +0 -5
- package/build/types/ModifierClassNames.d.ts +0 -5
- package/build/types/ModifierStatus.d.ts +0 -5
- package/build/types/ModifierStyles.d.ts +0 -4
- package/build/types/MonthChangeEventHandler.d.ts +0 -4
- package/build/types/NavButtonLabelFormatter.d.ts +0 -7
- package/build/types/SelectMultipleEventHandler.d.ts +0 -12
- package/build/types/SelectRangeEventHandler.d.ts +0 -10
- package/build/types/SelectSingleEventHandler.d.ts +0 -12
- package/build/types/StyledComponentProps.d.ts +0 -10
- package/build/types/StyledElement.d.ts +0 -76
- package/build/types/WeekNumberClickEventHandler.d.ts +0 -9
- package/build/types/WeekNumberFormatter.d.ts +0 -6
- package/build/types/WeekNumberLabelFormatter.d.ts +0 -5
- package/build/types/WeekdayLabelFormatter.d.ts +0 -4
- package/build/types/isArrayOfDates.d.ts +0 -2
- package/build/types/isArrayOfDates.js +0 -9
- package/build/types/isArrayOfDates.js.map +0 -1
- package/build/types/isDateAfterType.d.ts +0 -3
- package/build/types/isDateAfterType.js +0 -7
- package/build/types/isDateAfterType.js.map +0 -1
- package/build/types/isDateBeforeType.d.ts +0 -3
- package/build/types/isDateBeforeType.js +0 -7
- package/build/types/isDateBeforeType.js.map +0 -1
- package/build/types/isDateInterval.d.ts +0 -3
- package/build/types/isDateInterval.js +0 -10
- package/build/types/isDateInterval.js.map +0 -1
- package/build/types/isDateRange.d.ts +0 -3
- package/build/types/isDateRange.js +0 -8
- package/build/types/isDateRange.js.map +0 -1
- package/build/types/isDateType.d.ts +0 -2
- package/build/types/isDateType.js +0 -9
- package/build/types/isDateType.js.map +0 -1
- package/build/types/isDayOfWeekType.d.ts +0 -3
- package/build/types/isDayOfWeekType.js +0 -7
- package/build/types/isDayOfWeekType.js.map +0 -1
- package/build/types/isDayPickerCustom.d.ts +0 -4
- package/build/types/isDayPickerCustom.js.map +0 -1
- package/build/types/isDayPickerMultiple.d.ts +0 -4
- package/build/types/isDayPickerMultiple.js.map +0 -1
- package/build/types/isDayPickerRange.d.ts +0 -4
- package/build/types/isDayPickerRange.js.map +0 -1
- package/build/types/isDayPickerSingle.d.ts +0 -4
- package/build/types/isDayPickerSingle.js.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** A `Matcher` is a function, a date, an object, or an array of them used to determine if a day matches a modifier. */
|
|
2
|
+
export declare type Matcher = ((date: Date) => boolean) | Date | Date[] | DateRange | DateBefore | DateAfter | DateInterval | DayOfWeek;
|
|
3
|
+
/** A matcher to match a day falling after the specified date, with the date not included. */
|
|
4
|
+
export declare type DateAfter = {
|
|
5
|
+
after: Date;
|
|
6
|
+
};
|
|
7
|
+
/** A matcher to match a day falling before the specified date, with the date not included. */
|
|
8
|
+
export declare type DateBefore = {
|
|
9
|
+
before: Date;
|
|
10
|
+
};
|
|
11
|
+
/** A matcher to match a day falling before and after two dates, where the dates are not included. */
|
|
12
|
+
export declare type DateInterval = {
|
|
13
|
+
before: Date;
|
|
14
|
+
after: Date;
|
|
15
|
+
};
|
|
16
|
+
/** A matcher to match a range of dates. The range can be open. Differently from [[DateInterval]], the dates here are included. */
|
|
17
|
+
export declare type DateRange = {
|
|
18
|
+
from: Date | undefined;
|
|
19
|
+
to?: Date | undefined;
|
|
20
|
+
};
|
|
21
|
+
/** A matcher to match a date being one of the specified days of the week (`0-7`, where `0` is Sunday). */
|
|
22
|
+
export declare type DayOfWeek = {
|
|
23
|
+
dayOfWeek: number[];
|
|
24
|
+
};
|
|
25
|
+
/** Returns true if `matcher` is of type [[DateInterval]]. */
|
|
26
|
+
export declare function isDateInterval(matcher: unknown): matcher is DateInterval;
|
|
27
|
+
/** Returns true if `value` is a [[DateRange]] type. */
|
|
28
|
+
export declare function isDateRange(value: unknown): value is DateRange;
|
|
29
|
+
/** Returns true if `value` is of type [[DateAfter]]. */
|
|
30
|
+
export declare function isDateAfterType(value: unknown): value is DateAfter;
|
|
31
|
+
/** Returns true if `value` is of type [[DateBefore]]. */
|
|
32
|
+
export declare function isDateBeforeType(value: unknown): value is DateBefore;
|
|
33
|
+
/** Returns true if `value` is a [[DayOfWeek]] type. */
|
|
34
|
+
export declare function isDayOfWeekType(value: unknown): value is DayOfWeek;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Returns true if `matcher` is of type [[DateInterval]]. */
|
|
2
|
+
function isDateInterval(matcher) {
|
|
3
|
+
return Boolean(matcher &&
|
|
4
|
+
typeof matcher === 'object' &&
|
|
5
|
+
'before' in matcher &&
|
|
6
|
+
'after' in matcher);
|
|
7
|
+
}
|
|
8
|
+
/** Returns true if `value` is a [[DateRange]] type. */
|
|
9
|
+
function isDateRange(value) {
|
|
10
|
+
// TODO: Check if dates?!
|
|
11
|
+
return Boolean(value && typeof value === 'object' && 'from' in value);
|
|
12
|
+
}
|
|
13
|
+
/** Returns true if `value` is of type [[DateAfter]]. */
|
|
14
|
+
function isDateAfterType(value) {
|
|
15
|
+
return Boolean(value && typeof value === 'object' && 'after' in value);
|
|
16
|
+
}
|
|
17
|
+
/** Returns true if `value` is of type [[DateBefore]]. */
|
|
18
|
+
function isDateBeforeType(value) {
|
|
19
|
+
return Boolean(value && typeof value === 'object' && 'before' in value);
|
|
20
|
+
}
|
|
21
|
+
/** Returns true if `value` is a [[DayOfWeek]] type. */
|
|
22
|
+
function isDayOfWeekType(value) {
|
|
23
|
+
return Boolean(value && typeof value === 'object' && 'dayOfWeek' in value);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { isDateAfterType, isDateBeforeType, isDateInterval, isDateRange, isDayOfWeekType };
|
|
27
|
+
//# sourceMappingURL=Matchers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Matchers.js","sources":["../../src/types/Matchers.ts"],"sourcesContent":["/** A `Matcher` is a function, a date, an object, or an array of them used to determine if a day matches a modifier. */\nexport type Matcher =\n | ((date: Date) => boolean)\n | Date\n | Date[]\n | DateRange\n | DateBefore\n | DateAfter\n | DateInterval\n | DayOfWeek;\n\n/** A matcher to match a day falling after the specified date, with the date not included. */\nexport type DateAfter = { after: Date };\n\n/** A matcher to match a day falling before the specified date, with the date not included. */\nexport type DateBefore = { before: Date };\n\n/** A matcher to match a day falling before and after two dates, where the dates are not included. */\nexport type DateInterval = { before: Date; after: Date };\n\n/** A matcher to match a range of dates. The range can be open. Differently from [[DateInterval]], the dates here are included. */\nexport type DateRange = { from: Date | undefined; to?: Date | undefined };\n\n/** A matcher to match a date being one of the specified days of the week (`0-7`, where `0` is Sunday). */\nexport type DayOfWeek = { dayOfWeek: number[] };\n\n/** Returns true if `matcher` is of type [[DateInterval]]. */\nexport function isDateInterval(matcher: unknown): matcher is DateInterval {\n return Boolean(\n matcher &&\n typeof matcher === 'object' &&\n 'before' in matcher &&\n 'after' in matcher\n );\n}\n\n/** Returns true if `value` is a [[DateRange]] type. */\nexport function isDateRange(value: unknown): value is DateRange {\n // TODO: Check if dates?!\n return Boolean(value && typeof value === 'object' && 'from' in value);\n}\n\n/** Returns true if `value` is of type [[DateAfter]]. */\nexport function isDateAfterType(value: unknown): value is DateAfter {\n return Boolean(value && typeof value === 'object' && 'after' in value);\n}\n\n/** Returns true if `value` is of type [[DateBefore]]. */\nexport function isDateBeforeType(value: unknown): value is DateBefore {\n return Boolean(value && typeof value === 'object' && 'before' in value);\n}\n\n/** Returns true if `value` is a [[DayOfWeek]] type. */\nexport function isDayOfWeekType(value: unknown): value is DayOfWeek {\n return Boolean(value && typeof value === 'object' && 'dayOfWeek' in value);\n}\n"],"names":[],"mappings":"AA0BA;SACgB,cAAc,CAAC,OAAgB;IAC7C,OAAO,OAAO,CACZ,OAAO;QACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,QAAQ,IAAI,OAAO;QACnB,OAAO,IAAI,OAAO,CACrB,CAAC;AACJ,CAAC;AAED;SACgB,WAAW,CAAC,KAAc;;IAExC,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC;AACxE,CAAC;AAED;SACgB,eAAe,CAAC,KAAc;IAC5C,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,CAAC,CAAC;AACzE,CAAC;AAED;SACgB,gBAAgB,CAAC,KAAc;IAC7C,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,IAAI,KAAK,CAAC,CAAC;AAC1E,CAAC;AAED;SACgB,eAAe,CAAC,KAAc;IAC5C,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,WAAW,IAAI,KAAK,CAAC,CAAC;AAC7E;;;;"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import { Matcher } from './
|
|
3
|
-
|
|
4
|
-
/** Represent the map of modifiers with an array of matcher. */
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Matcher } from './Matchers';
|
|
3
|
+
/** The map of modifiers with an array of matcher. */
|
|
5
4
|
export declare type Modifiers = Record<Modifier, Matcher[]> & Record<InternalModifier, Matcher[]>;
|
|
5
|
+
/** The modifiers that are used internally in DayPicker. */
|
|
6
|
+
export declare type InternalModifier = 'selected' | 'disabled' | 'hidden' | 'today' | 'range_start' | 'range_end' | 'range_middle';
|
|
7
|
+
/** A _modifier_ represents different styles or states of a day displayed in the calendar. */
|
|
8
|
+
export declare type Modifier = string;
|
|
9
|
+
/** The status of a modifiers when matched a day. */
|
|
10
|
+
export declare type ModifierStatus = Record<Modifier, true> & Partial<Record<InternalModifier, true>>;
|
|
11
|
+
/** The inline-style to apply to the day matching `modifier`. */
|
|
12
|
+
export declare type ModifierStyles = Record<Modifier, React.CSSProperties> & Partial<Record<InternalModifier, React.CSSProperties>>;
|
|
13
|
+
/** The classnames to assign to each modifier. */
|
|
14
|
+
export declare type ModifierClassNames = Record<Modifier, string> & Partial<Record<InternalModifier, string>>;
|
|
15
|
+
/** A map of matchers to use as custom modifiers.*/
|
|
16
|
+
export declare type CustomModifiers = Record<Modifier, Matcher | Matcher[]>;
|
package/build/types/Styles.d.ts
CHANGED
|
@@ -1,4 +1,85 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** The style (either via class names or via in-line styles) of an element. */
|
|
3
|
+
export declare type StyledElement<T = string | React.CSSProperties> = {
|
|
4
|
+
/** The style of the root element. */
|
|
5
|
+
readonly root: T;
|
|
6
|
+
/** The style of the root element when `numberOfMonths > 1`. */
|
|
7
|
+
readonly multiple_month: T;
|
|
8
|
+
/** The style of the root element when `showWeekNumber={true}`. */
|
|
9
|
+
readonly with_weeknumber: T;
|
|
10
|
+
/** The style of an element visually hidden. */
|
|
11
|
+
readonly vhidden: T;
|
|
12
|
+
/** The style for resetting the buttons. */
|
|
13
|
+
readonly button_reset: T;
|
|
14
|
+
/** The style of the buttons. */
|
|
15
|
+
readonly button: T;
|
|
16
|
+
/** The style of the caption (showing the calendar heading and the navigation) */
|
|
17
|
+
readonly caption: T;
|
|
18
|
+
/** The style of the caption when the first of a series of months. */
|
|
19
|
+
readonly caption_first: T;
|
|
20
|
+
/** The style of the caption when the last of a series of months. */
|
|
21
|
+
readonly caption_last: T;
|
|
22
|
+
/** The style of the caption when in the middle of a series of months.. */
|
|
23
|
+
readonly caption_middle: T;
|
|
24
|
+
/** The style of the caption label (e.g. "September 2021"). */
|
|
25
|
+
readonly caption_label: T;
|
|
26
|
+
/** The style of the drop-downs container. */
|
|
27
|
+
readonly caption_dropdowns: T;
|
|
28
|
+
/** The style of the drop-down (select) element. */
|
|
29
|
+
readonly dropdown: T;
|
|
30
|
+
/** The style of the drop-down to change the month. */
|
|
31
|
+
readonly dropdown_month: T;
|
|
32
|
+
/** The style of the drop-down to change the year. */
|
|
33
|
+
readonly dropdown_year: T;
|
|
34
|
+
/** The style of the drop-down icon. */
|
|
35
|
+
readonly dropdown_icon: T;
|
|
36
|
+
/** The style of the months wrapper. */
|
|
37
|
+
readonly months: T;
|
|
38
|
+
/** The style of the table wrapper. */
|
|
39
|
+
readonly month: T;
|
|
40
|
+
/** The style of table containing the monthly calendar. */
|
|
41
|
+
readonly table: T;
|
|
42
|
+
/** The style of the table body. */
|
|
43
|
+
readonly tbody: T;
|
|
44
|
+
/** The style of the table footer. */
|
|
45
|
+
readonly tfoot: T;
|
|
46
|
+
/** The style of the table’s head. */
|
|
47
|
+
readonly head: T;
|
|
48
|
+
/** The style of the row in the head. */
|
|
49
|
+
readonly head_row: T;
|
|
50
|
+
/** The style of the head cell. */
|
|
51
|
+
readonly head_cell: T;
|
|
52
|
+
/** The style of the navigation container. */
|
|
53
|
+
readonly nav: T;
|
|
54
|
+
/** The style of the navigation button. */
|
|
55
|
+
readonly nav_button: T;
|
|
56
|
+
/** The style of the "previous month" navigation button. */
|
|
57
|
+
readonly nav_button_previous: T;
|
|
58
|
+
/** The style of the "next month" navigation button. */
|
|
59
|
+
readonly nav_button_next: T;
|
|
60
|
+
/** The style of the icon for the navigation button. */
|
|
61
|
+
readonly nav_icon: T;
|
|
62
|
+
/** A style of the table’s row. */
|
|
63
|
+
readonly row: T;
|
|
64
|
+
/** The style of the weeknumber. */
|
|
65
|
+
readonly weeknumber: T;
|
|
66
|
+
/** The style of the table cell containing the day element. */
|
|
67
|
+
readonly cell: T;
|
|
68
|
+
/** The style of the day button (it is a `span` when not interactive). */
|
|
69
|
+
readonly day: T;
|
|
70
|
+
/** The style of a day when outside the month. */
|
|
71
|
+
readonly day_outside: T;
|
|
72
|
+
};
|
|
73
|
+
/** The class names of each element. */
|
|
74
|
+
export declare type ClassNames = Partial<StyledElement<string>>;
|
|
3
75
|
/** The inline-styles of each element. */
|
|
4
76
|
export declare type Styles = Partial<StyledElement<React.CSSProperties>>;
|
|
77
|
+
/** Represent component props to style a component inline or via CSS. */
|
|
78
|
+
export declare type StyledComponent = {
|
|
79
|
+
/** The class name to apply to the container element. */
|
|
80
|
+
className?: string;
|
|
81
|
+
/** The inline style of the container element. */
|
|
82
|
+
style?: React.CSSProperties;
|
|
83
|
+
/** The content of the element. */
|
|
84
|
+
children?: React.ReactNode;
|
|
85
|
+
};
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,54 +1,11 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './DateFormatter';
|
|
8
|
-
export * from './DateInterval';
|
|
9
|
-
export * from './DateRange';
|
|
10
|
-
export * from './DayClickEventHandler';
|
|
11
|
-
export * from './DayFocusEventHandler';
|
|
12
|
-
export * from './DayKeyboardEventHandler';
|
|
13
|
-
export * from './DayLabelFormatter';
|
|
14
|
-
export * from './DayMouseEventHandler';
|
|
15
|
-
export * from './DayOfWeekMatcher';
|
|
16
|
-
export * from './DayPickerProps';
|
|
17
|
-
export * from './DayPickerCustomProps';
|
|
18
|
-
export * from './DayPickerMultipleProps';
|
|
19
|
-
export * from './DayPickerProps';
|
|
20
|
-
export * from './DayPickerRangeProps';
|
|
21
|
-
export * from './DayPickerSingleProps';
|
|
22
|
-
export * from './DayTouchEventHandler';
|
|
23
|
-
export * from './InternalModifier';
|
|
1
|
+
export * from './DayPicker';
|
|
2
|
+
export * from './DayPickerCustom';
|
|
3
|
+
export * from './DayPickerMultiple';
|
|
4
|
+
export * from './DayPickerRange';
|
|
5
|
+
export * from './DayPickerSingle';
|
|
6
|
+
export * from './EventHandlers';
|
|
24
7
|
export * from './Formatters';
|
|
25
|
-
export * from './isArrayOfDates';
|
|
26
|
-
export * from './isDateAfterType';
|
|
27
|
-
export * from './isDateBeforeType';
|
|
28
|
-
export * from './isDateInterval';
|
|
29
|
-
export * from './isDateRange';
|
|
30
|
-
export * from './isDateType';
|
|
31
|
-
export * from './isDayOfWeekType';
|
|
32
|
-
export * from './isDayPickerCustom';
|
|
33
|
-
export * from './isDayPickerMultiple';
|
|
34
|
-
export * from './isDayPickerRange';
|
|
35
|
-
export * from './isDayPickerSingle';
|
|
36
8
|
export * from './Labels';
|
|
37
|
-
export * from './
|
|
38
|
-
export * from './Modifier';
|
|
39
|
-
export * from './ModifierClassNames';
|
|
9
|
+
export * from './Matchers';
|
|
40
10
|
export * from './Modifiers';
|
|
41
|
-
export * from './ModifierStatus';
|
|
42
|
-
export * from './ModifierStyles';
|
|
43
|
-
export * from './MonthChangeEventHandler';
|
|
44
|
-
export * from './NavButtonLabelFormatter';
|
|
45
|
-
export * from './SelectMultipleEventHandler';
|
|
46
|
-
export * from './SelectRangeEventHandler';
|
|
47
|
-
export * from './SelectSingleEventHandler';
|
|
48
|
-
export * from './StyledComponentProps';
|
|
49
|
-
export * from './StyledElement';
|
|
50
11
|
export * from './Styles';
|
|
51
|
-
export * from './WeekdayLabelFormatter';
|
|
52
|
-
export * from './WeekNumberClickEventHandler';
|
|
53
|
-
export * from './WeekNumberFormatter';
|
|
54
|
-
export * from './WeekNumberLabelFormatter';
|