@fluentui/react-datepicker-compat 0.6.29 → 0.6.31
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 +29 -2
- package/dist/index.d.ts +3 -3
- package/lib/components/DatePicker/DatePicker.types.js.map +1 -1
- package/lib/utils/usePopupPositioning.js +0 -1
- package/lib/utils/usePopupPositioning.js.map +1 -1
- package/lib-commonjs/components/DatePicker/DatePicker.types.js.map +1 -1
- package/lib-commonjs/utils/usePopupPositioning.js +0 -2
- package/lib-commonjs/utils/usePopupPositioning.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-datepicker-compat
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 23 Apr 2026 11:59:20 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.6.31](https://github.com/microsoft/fluentui/tree/@fluentui/react-datepicker-compat_v0.6.31)
|
|
8
|
+
|
|
9
|
+
Thu, 23 Apr 2026 11:59:20 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-datepicker-compat_v0.6.30..@fluentui/react-datepicker-compat_v0.6.31)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-calendar-compat to v0.4.1 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
15
|
+
- Bump @fluentui/react-field to v9.5.1 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
16
|
+
- Bump @fluentui/react-input to v9.8.2 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
17
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.2 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
18
|
+
- Bump @fluentui/react-popover to v9.14.2 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
19
|
+
- Bump @fluentui/react-portal to v9.8.12 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
20
|
+
- Bump @fluentui/react-positioning to v9.22.1 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
21
|
+
- Bump @fluentui/react-tabster to v9.26.14 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
22
|
+
- Bump @fluentui/react-utilities to v9.26.3 ([PR #35996](https://github.com/microsoft/fluentui/pull/35996) by beachball)
|
|
23
|
+
|
|
24
|
+
## [0.6.30](https://github.com/microsoft/fluentui/tree/@fluentui/react-datepicker-compat_v0.6.30)
|
|
25
|
+
|
|
26
|
+
Wed, 01 Apr 2026 15:52:43 GMT
|
|
27
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-datepicker-compat_v0.6.29..@fluentui/react-datepicker-compat_v0.6.30)
|
|
28
|
+
|
|
29
|
+
### Patches
|
|
30
|
+
|
|
31
|
+
- Bump @fluentui/react-field to v9.5.0 ([PR #35912](https://github.com/microsoft/fluentui/pull/35912) by beachball)
|
|
32
|
+
- Bump @fluentui/react-input to v9.8.1 ([PR #35912](https://github.com/microsoft/fluentui/pull/35912) by beachball)
|
|
33
|
+
|
|
7
34
|
## [0.6.29](https://github.com/microsoft/fluentui/tree/@fluentui/react-datepicker-compat_v0.6.29)
|
|
8
35
|
|
|
9
|
-
Mon, 30 Mar 2026 14:
|
|
36
|
+
Mon, 30 Mar 2026 14:37:41 GMT
|
|
10
37
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-datepicker-compat_v0.6.28..@fluentui/react-datepicker-compat_v0.6.29)
|
|
11
38
|
|
|
12
39
|
### Patches
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { CalendarStrings } from '@fluentui/react-calendar-compat';
|
|
|
3
3
|
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
4
4
|
import type { ComponentState } from '@fluentui/react-utilities';
|
|
5
5
|
import type { DateFormatting } from '@fluentui/react-calendar-compat';
|
|
6
|
-
import { DayOfWeek } from '@fluentui/react-calendar-compat';
|
|
7
|
-
import { FirstWeekOfYear } from '@fluentui/react-calendar-compat';
|
|
6
|
+
import type { DayOfWeek } from '@fluentui/react-calendar-compat';
|
|
7
|
+
import type { FirstWeekOfYear } from '@fluentui/react-calendar-compat';
|
|
8
8
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
9
|
-
import { Input } from '@fluentui/react-input';
|
|
9
|
+
import type { Input } from '@fluentui/react-input';
|
|
10
10
|
import type { JSXElement } from '@fluentui/react-utilities';
|
|
11
11
|
import type { PortalProps } from '@fluentui/react-portal';
|
|
12
12
|
import type { PositioningProps } from '@fluentui/react-positioning';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DatePicker/DatePicker.types.ts"],"sourcesContent":["import { DayOfWeek, FirstWeekOfYear } from '@fluentui/react-calendar-compat';\nimport { Input } from '@fluentui/react-input';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { CalendarProps, CalendarStrings, DateFormatting } from '@fluentui/react-calendar-compat';\nimport type { PortalProps } from '@fluentui/react-portal';\nimport type { PositioningProps } from '@fluentui/react-positioning';\n\nexport type DatePickerSlots = {\n root: NonNullable<Slot<typeof Input>>;\n calendar: NonNullable<Slot<Partial<CalendarProps>>>;\n popupSurface?: Slot<'div'>;\n};\n\nexport type DatePickerProps = Omit<ComponentProps<Partial<DatePickerSlots>>, 'defaultValue' | 'value'> &\n Pick<PortalProps, 'mountNode'> & {\n /**\n * Callback issued when a date is selected\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onSelectDate?: (date: Date | null | undefined) => void;\n\n /**\n * Whether the DatePicker is a required field or not. When using `<Field>`, this prop is automatically set.\n * @default false\n */\n required?: boolean;\n\n /**\n * Disabled state of the DatePicker.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Whether or not the Input of the DatePicker is underlined.\n * @default false\n */\n underlined?: boolean;\n\n /**\n * Whether the month picker is shown beside the day picker or hidden.\n * @default true\n */\n isMonthPickerVisible?: boolean;\n\n /**\n * Show month picker on top of date picker when visible.\n * @default false\n */\n showMonthPickerAsOverlay?: boolean;\n\n /**\n * Whether the DatePicker allows input a date string directly or not\n * @default false\n */\n allowTextInput?: boolean;\n\n /**\n * Whether the DatePicker should open automatically when the control is focused\n * WARNING: setting this to false creates an accessibility violation and is not recommended\n * @default true\n */\n disableAutoFocus?: boolean;\n\n /**\n * Whether the DatePicker should open when the input is clicked\n * @default true\n */\n openOnClick?: boolean;\n\n /**\n * Whether the DatePicker should be open by default\n *\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * Whether the DatePicker is open or not\n *\n * @default false\n */\n open?: boolean;\n\n /**\n * Callback to run when the DatePicker's open state changes\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onOpenChange?: (open: boolean) => void;\n\n /**\n * Callback to run after the DatePicker's input has been validated\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onValidationResult?: (data: DatePickerValidationResultData) => void;\n\n /**\n * Whether the DatePicker should render the popup as inline or in a portal\n *\n * @default false\n */\n inlinePopup?: boolean;\n\n /**\n * Configure the positioning of the DatePicker dialog\n *\n * @default below\n */\n positioning?: PositioningProps;\n\n /**\n * Placeholder text for the DatePicker\n */\n placeholder?: string;\n\n /**\n * Value of today. If unspecified, current time in client machine will be used.\n */\n today?: Date;\n\n /**\n * Default value of the DatePicker, if any\n *\n * When the component is controlled, `null` should be used instead of `undefined` to avoid controlled vs. uncontrolled\n * ambiguity.\n */\n value?: Date | null;\n\n /**\n * Optional method to format the chosen date to a string to display in the DatePicker\n * @default date.toString()\n */\n formatDate?: (date?: Date) => string;\n\n /**\n * Optional method to parse the text input value to date, it is only useful when allowTextInput is set to true\n * @default new Date(Date.parse(dateStr))\n */\n parseDateFromString?: (dateStr: string) => Date | null;\n\n /**\n * The first day of the week for your locale.\n * @default DayOfWeek.Sunday\n */\n firstDayOfWeek?: DayOfWeek;\n\n /**\n * Localized strings to use in the Calendar\n */\n strings?: CalendarStrings;\n\n /**\n * Whether the month picker should highlight the current month\n * @default false\n */\n highlightCurrentMonth?: boolean;\n\n /**\n * Whether the month picker should highlight the selected month\n * @default false\n */\n highlightSelectedMonth?: boolean;\n\n /**\n * Whether the calendar should show the week number (weeks 1 to 53) before each week row\n * @default false\n */\n showWeekNumbers?: boolean;\n\n /**\n * Defines when the first week of the year should start, FirstWeekOfYear.FirstDay,\n * FirstWeekOfYear.FirstFullWeek or FirstWeekOfYear.FirstFourDayWeek are the possible values\n * @default FirstWeekOfYear.FirstFullWeek\n */\n firstWeekOfYear?: FirstWeekOfYear;\n\n /**\n * Whether the \"Go to today\" link should be shown or not\n */\n showGoToToday?: boolean;\n\n /**\n * Determines if the DatePicker has a border.\n * @default false\n */\n borderless?: boolean;\n\n /**\n * Apply additional formatting to dates, for example localized date formatting.\n */\n dateTimeFormatter?: DateFormatting;\n\n /**\n * The minimum allowable date.\n */\n minDate?: Date;\n\n /**\n * The maximum allowable date.\n */\n maxDate?: Date;\n\n /**\n * The initially highlighted date.\n */\n initialPickerDate?: Date;\n\n /**\n * Allows all elements to be focused, including disabled ones\n * @default false\n */\n allFocusable?: boolean;\n\n /**\n * Whether the CalendarDay close button should be shown or not.\n */\n showCloseButton?: boolean;\n };\n\n/**\n * State used in rendering DatePicker.\n */\nexport type DatePickerState = ComponentState<DatePickerSlots> &\n Pick<DatePickerProps, 'mountNode'> & {\n disabled: boolean;\n inlinePopup: boolean;\n };\n\n/**\n * Data passed to the `onValidationResult` callback.\n */\nexport type DatePickerValidationResultData = {\n /** The error found when validating the input. */\n error?: DatePickerErrorType;\n};\n\n/**\n * Error types returned by the `onValidationResult` callback.\n */\nexport type DatePickerErrorType = 'invalid-input' | 'out-of-bounds' | 'required-input';\n"],"names":[],"mappings":"AA4OA;;CAEC,GACD,WAAuF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/DatePicker/DatePicker.types.ts"],"sourcesContent":["import type { DayOfWeek, FirstWeekOfYear } from '@fluentui/react-calendar-compat';\nimport type { Input } from '@fluentui/react-input';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { CalendarProps, CalendarStrings, DateFormatting } from '@fluentui/react-calendar-compat';\nimport type { PortalProps } from '@fluentui/react-portal';\nimport type { PositioningProps } from '@fluentui/react-positioning';\n\nexport type DatePickerSlots = {\n root: NonNullable<Slot<typeof Input>>;\n calendar: NonNullable<Slot<Partial<CalendarProps>>>;\n popupSurface?: Slot<'div'>;\n};\n\nexport type DatePickerProps = Omit<ComponentProps<Partial<DatePickerSlots>>, 'defaultValue' | 'value'> &\n Pick<PortalProps, 'mountNode'> & {\n /**\n * Callback issued when a date is selected\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onSelectDate?: (date: Date | null | undefined) => void;\n\n /**\n * Whether the DatePicker is a required field or not. When using `<Field>`, this prop is automatically set.\n * @default false\n */\n required?: boolean;\n\n /**\n * Disabled state of the DatePicker.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Whether or not the Input of the DatePicker is underlined.\n * @default false\n */\n underlined?: boolean;\n\n /**\n * Whether the month picker is shown beside the day picker or hidden.\n * @default true\n */\n isMonthPickerVisible?: boolean;\n\n /**\n * Show month picker on top of date picker when visible.\n * @default false\n */\n showMonthPickerAsOverlay?: boolean;\n\n /**\n * Whether the DatePicker allows input a date string directly or not\n * @default false\n */\n allowTextInput?: boolean;\n\n /**\n * Whether the DatePicker should open automatically when the control is focused\n * WARNING: setting this to false creates an accessibility violation and is not recommended\n * @default true\n */\n disableAutoFocus?: boolean;\n\n /**\n * Whether the DatePicker should open when the input is clicked\n * @default true\n */\n openOnClick?: boolean;\n\n /**\n * Whether the DatePicker should be open by default\n *\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * Whether the DatePicker is open or not\n *\n * @default false\n */\n open?: boolean;\n\n /**\n * Callback to run when the DatePicker's open state changes\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onOpenChange?: (open: boolean) => void;\n\n /**\n * Callback to run after the DatePicker's input has been validated\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onValidationResult?: (data: DatePickerValidationResultData) => void;\n\n /**\n * Whether the DatePicker should render the popup as inline or in a portal\n *\n * @default false\n */\n inlinePopup?: boolean;\n\n /**\n * Configure the positioning of the DatePicker dialog\n *\n * @default below\n */\n positioning?: PositioningProps;\n\n /**\n * Placeholder text for the DatePicker\n */\n placeholder?: string;\n\n /**\n * Value of today. If unspecified, current time in client machine will be used.\n */\n today?: Date;\n\n /**\n * Default value of the DatePicker, if any\n *\n * When the component is controlled, `null` should be used instead of `undefined` to avoid controlled vs. uncontrolled\n * ambiguity.\n */\n value?: Date | null;\n\n /**\n * Optional method to format the chosen date to a string to display in the DatePicker\n * @default date.toString()\n */\n formatDate?: (date?: Date) => string;\n\n /**\n * Optional method to parse the text input value to date, it is only useful when allowTextInput is set to true\n * @default new Date(Date.parse(dateStr))\n */\n parseDateFromString?: (dateStr: string) => Date | null;\n\n /**\n * The first day of the week for your locale.\n * @default DayOfWeek.Sunday\n */\n firstDayOfWeek?: DayOfWeek;\n\n /**\n * Localized strings to use in the Calendar\n */\n strings?: CalendarStrings;\n\n /**\n * Whether the month picker should highlight the current month\n * @default false\n */\n highlightCurrentMonth?: boolean;\n\n /**\n * Whether the month picker should highlight the selected month\n * @default false\n */\n highlightSelectedMonth?: boolean;\n\n /**\n * Whether the calendar should show the week number (weeks 1 to 53) before each week row\n * @default false\n */\n showWeekNumbers?: boolean;\n\n /**\n * Defines when the first week of the year should start, FirstWeekOfYear.FirstDay,\n * FirstWeekOfYear.FirstFullWeek or FirstWeekOfYear.FirstFourDayWeek are the possible values\n * @default FirstWeekOfYear.FirstFullWeek\n */\n firstWeekOfYear?: FirstWeekOfYear;\n\n /**\n * Whether the \"Go to today\" link should be shown or not\n */\n showGoToToday?: boolean;\n\n /**\n * Determines if the DatePicker has a border.\n * @default false\n */\n borderless?: boolean;\n\n /**\n * Apply additional formatting to dates, for example localized date formatting.\n */\n dateTimeFormatter?: DateFormatting;\n\n /**\n * The minimum allowable date.\n */\n minDate?: Date;\n\n /**\n * The maximum allowable date.\n */\n maxDate?: Date;\n\n /**\n * The initially highlighted date.\n */\n initialPickerDate?: Date;\n\n /**\n * Allows all elements to be focused, including disabled ones\n * @default false\n */\n allFocusable?: boolean;\n\n /**\n * Whether the CalendarDay close button should be shown or not.\n */\n showCloseButton?: boolean;\n };\n\n/**\n * State used in rendering DatePicker.\n */\nexport type DatePickerState = ComponentState<DatePickerSlots> &\n Pick<DatePickerProps, 'mountNode'> & {\n disabled: boolean;\n inlinePopup: boolean;\n };\n\n/**\n * Data passed to the `onValidationResult` callback.\n */\nexport type DatePickerValidationResultData = {\n /** The error found when validating the input. */\n error?: DatePickerErrorType;\n};\n\n/**\n * Error types returned by the `onValidationResult` callback.\n */\nexport type DatePickerErrorType = 'invalid-input' | 'out-of-bounds' | 'required-input';\n"],"names":[],"mappings":"AA4OA;;CAEC,GACD,WAAuF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/usePopupPositioning.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport type { DatePickerProps } from '../DatePicker';\n\n/**\n * Hook used to handle positioning of the popup.\n *\n * @param props - DatePicker props\n * @returns tuple of trigger and popup refs\n * @internal\n */\nexport function usePopupPositioning(\n props: DatePickerProps,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n): [triggerRef: React.MutableRefObject<HTMLElement | null>, popupRef: React.MutableRefObject<HTMLDivElement | null>] {\n const { positioning } = props;\n\n const popupOptions = {\n position: 'below' as const,\n align: 'start' as const,\n ...resolvePositioningShorthand(positioning),\n };\n\n const { targetRef, containerRef } = usePositioning(popupOptions);\n\n return [targetRef, containerRef];\n}\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/utils/usePopupPositioning.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport type { DatePickerProps } from '../DatePicker';\n\n/**\n * Hook used to handle positioning of the popup.\n *\n * @param props - DatePicker props\n * @returns tuple of trigger and popup refs\n * @internal\n */\nexport function usePopupPositioning(\n props: DatePickerProps,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n): [triggerRef: React.MutableRefObject<HTMLElement | null>, popupRef: React.MutableRefObject<HTMLDivElement | null>] {\n const { positioning } = props;\n\n const popupOptions = {\n position: 'below' as const,\n align: 'start' as const,\n ...resolvePositioningShorthand(positioning),\n };\n\n const { targetRef, containerRef } = usePositioning(popupOptions);\n\n return [targetRef, containerRef];\n}\n"],"names":["resolvePositioningShorthand","usePositioning","usePopupPositioning","props","positioning","popupOptions","position","align","targetRef","containerRef"],"mappings":"AAAA;AAGA,SAASA,2BAA2B,EAAEC,cAAc,QAAQ,8BAA8B;AAG1F;;;;;;CAMC,GACD,OAAO,SAASC,oBACdC,KAAsB;IAGtB,MAAM,EAAEC,WAAW,EAAE,GAAGD;IAExB,MAAME,eAAe;QACnBC,UAAU;QACVC,OAAO;QACP,GAAGP,4BAA4BI,YAAY;IAC7C;IAEA,MAAM,EAAEI,SAAS,EAAEC,YAAY,EAAE,GAAGR,eAAeI;IAEnD,OAAO;QAACG;QAAWC;KAAa;AAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DatePicker/DatePicker.types.ts"],"sourcesContent":["import { DayOfWeek, FirstWeekOfYear } from '@fluentui/react-calendar-compat';\nimport { Input } from '@fluentui/react-input';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { CalendarProps, CalendarStrings, DateFormatting } from '@fluentui/react-calendar-compat';\nimport type { PortalProps } from '@fluentui/react-portal';\nimport type { PositioningProps } from '@fluentui/react-positioning';\n\nexport type DatePickerSlots = {\n root: NonNullable<Slot<typeof Input>>;\n calendar: NonNullable<Slot<Partial<CalendarProps>>>;\n popupSurface?: Slot<'div'>;\n};\n\nexport type DatePickerProps = Omit<ComponentProps<Partial<DatePickerSlots>>, 'defaultValue' | 'value'> &\n Pick<PortalProps, 'mountNode'> & {\n /**\n * Callback issued when a date is selected\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onSelectDate?: (date: Date | null | undefined) => void;\n\n /**\n * Whether the DatePicker is a required field or not. When using `<Field>`, this prop is automatically set.\n * @default false\n */\n required?: boolean;\n\n /**\n * Disabled state of the DatePicker.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Whether or not the Input of the DatePicker is underlined.\n * @default false\n */\n underlined?: boolean;\n\n /**\n * Whether the month picker is shown beside the day picker or hidden.\n * @default true\n */\n isMonthPickerVisible?: boolean;\n\n /**\n * Show month picker on top of date picker when visible.\n * @default false\n */\n showMonthPickerAsOverlay?: boolean;\n\n /**\n * Whether the DatePicker allows input a date string directly or not\n * @default false\n */\n allowTextInput?: boolean;\n\n /**\n * Whether the DatePicker should open automatically when the control is focused\n * WARNING: setting this to false creates an accessibility violation and is not recommended\n * @default true\n */\n disableAutoFocus?: boolean;\n\n /**\n * Whether the DatePicker should open when the input is clicked\n * @default true\n */\n openOnClick?: boolean;\n\n /**\n * Whether the DatePicker should be open by default\n *\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * Whether the DatePicker is open or not\n *\n * @default false\n */\n open?: boolean;\n\n /**\n * Callback to run when the DatePicker's open state changes\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onOpenChange?: (open: boolean) => void;\n\n /**\n * Callback to run after the DatePicker's input has been validated\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onValidationResult?: (data: DatePickerValidationResultData) => void;\n\n /**\n * Whether the DatePicker should render the popup as inline or in a portal\n *\n * @default false\n */\n inlinePopup?: boolean;\n\n /**\n * Configure the positioning of the DatePicker dialog\n *\n * @default below\n */\n positioning?: PositioningProps;\n\n /**\n * Placeholder text for the DatePicker\n */\n placeholder?: string;\n\n /**\n * Value of today. If unspecified, current time in client machine will be used.\n */\n today?: Date;\n\n /**\n * Default value of the DatePicker, if any\n *\n * When the component is controlled, `null` should be used instead of `undefined` to avoid controlled vs. uncontrolled\n * ambiguity.\n */\n value?: Date | null;\n\n /**\n * Optional method to format the chosen date to a string to display in the DatePicker\n * @default date.toString()\n */\n formatDate?: (date?: Date) => string;\n\n /**\n * Optional method to parse the text input value to date, it is only useful when allowTextInput is set to true\n * @default new Date(Date.parse(dateStr))\n */\n parseDateFromString?: (dateStr: string) => Date | null;\n\n /**\n * The first day of the week for your locale.\n * @default DayOfWeek.Sunday\n */\n firstDayOfWeek?: DayOfWeek;\n\n /**\n * Localized strings to use in the Calendar\n */\n strings?: CalendarStrings;\n\n /**\n * Whether the month picker should highlight the current month\n * @default false\n */\n highlightCurrentMonth?: boolean;\n\n /**\n * Whether the month picker should highlight the selected month\n * @default false\n */\n highlightSelectedMonth?: boolean;\n\n /**\n * Whether the calendar should show the week number (weeks 1 to 53) before each week row\n * @default false\n */\n showWeekNumbers?: boolean;\n\n /**\n * Defines when the first week of the year should start, FirstWeekOfYear.FirstDay,\n * FirstWeekOfYear.FirstFullWeek or FirstWeekOfYear.FirstFourDayWeek are the possible values\n * @default FirstWeekOfYear.FirstFullWeek\n */\n firstWeekOfYear?: FirstWeekOfYear;\n\n /**\n * Whether the \"Go to today\" link should be shown or not\n */\n showGoToToday?: boolean;\n\n /**\n * Determines if the DatePicker has a border.\n * @default false\n */\n borderless?: boolean;\n\n /**\n * Apply additional formatting to dates, for example localized date formatting.\n */\n dateTimeFormatter?: DateFormatting;\n\n /**\n * The minimum allowable date.\n */\n minDate?: Date;\n\n /**\n * The maximum allowable date.\n */\n maxDate?: Date;\n\n /**\n * The initially highlighted date.\n */\n initialPickerDate?: Date;\n\n /**\n * Allows all elements to be focused, including disabled ones\n * @default false\n */\n allFocusable?: boolean;\n\n /**\n * Whether the CalendarDay close button should be shown or not.\n */\n showCloseButton?: boolean;\n };\n\n/**\n * State used in rendering DatePicker.\n */\nexport type DatePickerState = ComponentState<DatePickerSlots> &\n Pick<DatePickerProps, 'mountNode'> & {\n disabled: boolean;\n inlinePopup: boolean;\n };\n\n/**\n * Data passed to the `onValidationResult` callback.\n */\nexport type DatePickerValidationResultData = {\n /** The error found when validating the input. */\n error?: DatePickerErrorType;\n};\n\n/**\n * Error types returned by the `onValidationResult` callback.\n */\nexport type DatePickerErrorType = 'invalid-input' | 'out-of-bounds' | 'required-input';\n"],"names":[],"mappings":"AA4OA;;CAEC,GACD,WAAuF"}
|
|
1
|
+
{"version":3,"sources":["../src/components/DatePicker/DatePicker.types.ts"],"sourcesContent":["import type { DayOfWeek, FirstWeekOfYear } from '@fluentui/react-calendar-compat';\nimport type { Input } from '@fluentui/react-input';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { CalendarProps, CalendarStrings, DateFormatting } from '@fluentui/react-calendar-compat';\nimport type { PortalProps } from '@fluentui/react-portal';\nimport type { PositioningProps } from '@fluentui/react-positioning';\n\nexport type DatePickerSlots = {\n root: NonNullable<Slot<typeof Input>>;\n calendar: NonNullable<Slot<Partial<CalendarProps>>>;\n popupSurface?: Slot<'div'>;\n};\n\nexport type DatePickerProps = Omit<ComponentProps<Partial<DatePickerSlots>>, 'defaultValue' | 'value'> &\n Pick<PortalProps, 'mountNode'> & {\n /**\n * Callback issued when a date is selected\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onSelectDate?: (date: Date | null | undefined) => void;\n\n /**\n * Whether the DatePicker is a required field or not. When using `<Field>`, this prop is automatically set.\n * @default false\n */\n required?: boolean;\n\n /**\n * Disabled state of the DatePicker.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Whether or not the Input of the DatePicker is underlined.\n * @default false\n */\n underlined?: boolean;\n\n /**\n * Whether the month picker is shown beside the day picker or hidden.\n * @default true\n */\n isMonthPickerVisible?: boolean;\n\n /**\n * Show month picker on top of date picker when visible.\n * @default false\n */\n showMonthPickerAsOverlay?: boolean;\n\n /**\n * Whether the DatePicker allows input a date string directly or not\n * @default false\n */\n allowTextInput?: boolean;\n\n /**\n * Whether the DatePicker should open automatically when the control is focused\n * WARNING: setting this to false creates an accessibility violation and is not recommended\n * @default true\n */\n disableAutoFocus?: boolean;\n\n /**\n * Whether the DatePicker should open when the input is clicked\n * @default true\n */\n openOnClick?: boolean;\n\n /**\n * Whether the DatePicker should be open by default\n *\n * @default false\n */\n defaultOpen?: boolean;\n\n /**\n * Whether the DatePicker is open or not\n *\n * @default false\n */\n open?: boolean;\n\n /**\n * Callback to run when the DatePicker's open state changes\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onOpenChange?: (open: boolean) => void;\n\n /**\n * Callback to run after the DatePicker's input has been validated\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onValidationResult?: (data: DatePickerValidationResultData) => void;\n\n /**\n * Whether the DatePicker should render the popup as inline or in a portal\n *\n * @default false\n */\n inlinePopup?: boolean;\n\n /**\n * Configure the positioning of the DatePicker dialog\n *\n * @default below\n */\n positioning?: PositioningProps;\n\n /**\n * Placeholder text for the DatePicker\n */\n placeholder?: string;\n\n /**\n * Value of today. If unspecified, current time in client machine will be used.\n */\n today?: Date;\n\n /**\n * Default value of the DatePicker, if any\n *\n * When the component is controlled, `null` should be used instead of `undefined` to avoid controlled vs. uncontrolled\n * ambiguity.\n */\n value?: Date | null;\n\n /**\n * Optional method to format the chosen date to a string to display in the DatePicker\n * @default date.toString()\n */\n formatDate?: (date?: Date) => string;\n\n /**\n * Optional method to parse the text input value to date, it is only useful when allowTextInput is set to true\n * @default new Date(Date.parse(dateStr))\n */\n parseDateFromString?: (dateStr: string) => Date | null;\n\n /**\n * The first day of the week for your locale.\n * @default DayOfWeek.Sunday\n */\n firstDayOfWeek?: DayOfWeek;\n\n /**\n * Localized strings to use in the Calendar\n */\n strings?: CalendarStrings;\n\n /**\n * Whether the month picker should highlight the current month\n * @default false\n */\n highlightCurrentMonth?: boolean;\n\n /**\n * Whether the month picker should highlight the selected month\n * @default false\n */\n highlightSelectedMonth?: boolean;\n\n /**\n * Whether the calendar should show the week number (weeks 1 to 53) before each week row\n * @default false\n */\n showWeekNumbers?: boolean;\n\n /**\n * Defines when the first week of the year should start, FirstWeekOfYear.FirstDay,\n * FirstWeekOfYear.FirstFullWeek or FirstWeekOfYear.FirstFourDayWeek are the possible values\n * @default FirstWeekOfYear.FirstFullWeek\n */\n firstWeekOfYear?: FirstWeekOfYear;\n\n /**\n * Whether the \"Go to today\" link should be shown or not\n */\n showGoToToday?: boolean;\n\n /**\n * Determines if the DatePicker has a border.\n * @default false\n */\n borderless?: boolean;\n\n /**\n * Apply additional formatting to dates, for example localized date formatting.\n */\n dateTimeFormatter?: DateFormatting;\n\n /**\n * The minimum allowable date.\n */\n minDate?: Date;\n\n /**\n * The maximum allowable date.\n */\n maxDate?: Date;\n\n /**\n * The initially highlighted date.\n */\n initialPickerDate?: Date;\n\n /**\n * Allows all elements to be focused, including disabled ones\n * @default false\n */\n allFocusable?: boolean;\n\n /**\n * Whether the CalendarDay close button should be shown or not.\n */\n showCloseButton?: boolean;\n };\n\n/**\n * State used in rendering DatePicker.\n */\nexport type DatePickerState = ComponentState<DatePickerSlots> &\n Pick<DatePickerProps, 'mountNode'> & {\n disabled: boolean;\n inlinePopup: boolean;\n };\n\n/**\n * Data passed to the `onValidationResult` callback.\n */\nexport type DatePickerValidationResultData = {\n /** The error found when validating the input. */\n error?: DatePickerErrorType;\n};\n\n/**\n * Error types returned by the `onValidationResult` callback.\n */\nexport type DatePickerErrorType = 'invalid-input' | 'out-of-bounds' | 'required-input';\n"],"names":[],"mappings":"AA4OA;;CAEC,GACD,WAAuF"}
|
|
@@ -9,8 +9,6 @@ Object.defineProperty(exports, "usePopupPositioning", {
|
|
|
9
9
|
return usePopupPositioning;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
13
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
12
|
const _reactpositioning = require("@fluentui/react-positioning");
|
|
15
13
|
function usePopupPositioning(props) {
|
|
16
14
|
const { positioning } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/usePopupPositioning.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport type { DatePickerProps } from '../DatePicker';\n\n/**\n * Hook used to handle positioning of the popup.\n *\n * @param props - DatePicker props\n * @returns tuple of trigger and popup refs\n * @internal\n */\nexport function usePopupPositioning(\n props: DatePickerProps,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n): [triggerRef: React.MutableRefObject<HTMLElement | null>, popupRef: React.MutableRefObject<HTMLDivElement | null>] {\n const { positioning } = props;\n\n const popupOptions = {\n position: 'below' as const,\n align: 'start' as const,\n ...resolvePositioningShorthand(positioning),\n };\n\n const { targetRef, containerRef } = usePositioning(popupOptions);\n\n return [targetRef, containerRef];\n}\n"],"names":["
|
|
1
|
+
{"version":3,"sources":["../src/utils/usePopupPositioning.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport type { DatePickerProps } from '../DatePicker';\n\n/**\n * Hook used to handle positioning of the popup.\n *\n * @param props - DatePicker props\n * @returns tuple of trigger and popup refs\n * @internal\n */\nexport function usePopupPositioning(\n props: DatePickerProps,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n): [triggerRef: React.MutableRefObject<HTMLElement | null>, popupRef: React.MutableRefObject<HTMLDivElement | null>] {\n const { positioning } = props;\n\n const popupOptions = {\n position: 'below' as const,\n align: 'start' as const,\n ...resolvePositioningShorthand(positioning),\n };\n\n const { targetRef, containerRef } = usePositioning(popupOptions);\n\n return [targetRef, containerRef];\n}\n"],"names":["resolvePositioningShorthand","usePositioning","usePopupPositioning","props","positioning","popupOptions","position","align","targetRef","containerRef"],"mappings":"AAAA;;;;;;;;;;;kCAG4D,8BAA8B;AAUnF,SAASE,oBACdC,KAAsB;IAGtB,MAAM,EAAEC,WAAW,EAAE,GAAGD;IAExB,MAAME,eAAe;QACnBC,UAAU;QACVC,OAAO;QACP,OAAGP,6CAAAA,EAA4BI,YAAY;IAC7C;IAEA,MAAM,EAAEI,SAAS,EAAEC,YAAY,EAAE,OAAGR,gCAAAA,EAAeI;IAEnD,OAAO;QAACG;QAAWC;KAAa;AAClC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-datepicker-compat",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.31",
|
|
4
4
|
"description": "React components for building web experiences",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@fluentui/keyboard-keys": "^9.0.8",
|
|
16
|
-
"@fluentui/react-calendar-compat": "^0.4.
|
|
17
|
-
"@fluentui/react-field": "^9.
|
|
16
|
+
"@fluentui/react-calendar-compat": "^0.4.1",
|
|
17
|
+
"@fluentui/react-field": "^9.5.1",
|
|
18
18
|
"@fluentui/react-icons": "^2.0.245",
|
|
19
|
-
"@fluentui/react-input": "^9.8.
|
|
20
|
-
"@fluentui/react-jsx-runtime": "^9.4.
|
|
21
|
-
"@fluentui/react-popover": "^9.14.
|
|
22
|
-
"@fluentui/react-portal": "^9.8.
|
|
23
|
-
"@fluentui/react-positioning": "^9.22.
|
|
19
|
+
"@fluentui/react-input": "^9.8.2",
|
|
20
|
+
"@fluentui/react-jsx-runtime": "^9.4.2",
|
|
21
|
+
"@fluentui/react-popover": "^9.14.2",
|
|
22
|
+
"@fluentui/react-portal": "^9.8.12",
|
|
23
|
+
"@fluentui/react-positioning": "^9.22.1",
|
|
24
24
|
"@fluentui/react-shared-contexts": "^9.26.2",
|
|
25
|
-
"@fluentui/react-tabster": "^9.26.
|
|
25
|
+
"@fluentui/react-tabster": "^9.26.14",
|
|
26
26
|
"@fluentui/react-theme": "^9.2.1",
|
|
27
|
-
"@fluentui/react-utilities": "^9.26.
|
|
27
|
+
"@fluentui/react-utilities": "^9.26.3",
|
|
28
28
|
"@griffel/react": "^1.5.32",
|
|
29
29
|
"@swc/helpers": "^0.5.1"
|
|
30
30
|
},
|