@fluentui/react-datepicker-compat 0.4.41 → 0.4.43

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.
Files changed (30) hide show
  1. package/CHANGELOG.md +32 -2
  2. package/lib/DatePicker.js.map +1 -1
  3. package/lib/components/DatePicker/DatePicker.js.map +1 -1
  4. package/lib/components/DatePicker/DatePicker.types.js +3 -1
  5. package/lib/components/DatePicker/DatePicker.types.js.map +1 -1
  6. package/lib/components/DatePicker/defaults.js.map +1 -1
  7. package/lib/components/DatePicker/index.js.map +1 -1
  8. package/lib/components/DatePicker/renderDatePicker.js.map +1 -1
  9. package/lib/components/DatePicker/useDatePicker.js +3 -2
  10. package/lib/components/DatePicker/useDatePicker.js.map +1 -1
  11. package/lib/components/DatePicker/useDatePickerStyles.styles.js +2 -0
  12. package/lib/components/DatePicker/useDatePickerStyles.styles.js.map +1 -1
  13. package/lib/index.js.map +1 -1
  14. package/lib/utils/usePopupPositioning.js.map +1 -1
  15. package/lib-commonjs/DatePicker.js.map +1 -1
  16. package/lib-commonjs/components/DatePicker/DatePicker.js.map +1 -1
  17. package/lib-commonjs/components/DatePicker/DatePicker.types.js +3 -1
  18. package/lib-commonjs/components/DatePicker/DatePicker.types.js.map +1 -1
  19. package/lib-commonjs/components/DatePicker/defaults.js +3 -3
  20. package/lib-commonjs/components/DatePicker/defaults.js.map +1 -1
  21. package/lib-commonjs/components/DatePicker/index.js.map +1 -1
  22. package/lib-commonjs/components/DatePicker/renderDatePicker.js.map +1 -1
  23. package/lib-commonjs/components/DatePicker/useDatePicker.js +3 -2
  24. package/lib-commonjs/components/DatePicker/useDatePicker.js.map +1 -1
  25. package/lib-commonjs/components/DatePicker/useDatePickerStyles.styles.js +1 -0
  26. package/lib-commonjs/components/DatePicker/useDatePickerStyles.styles.js.map +1 -1
  27. package/lib-commonjs/index.js +3 -3
  28. package/lib-commonjs/index.js.map +1 -1
  29. package/lib-commonjs/utils/usePopupPositioning.js.map +1 -1
  30. package/package.json +11 -11
package/CHANGELOG.md CHANGED
@@ -1,12 +1,42 @@
1
1
  # Change Log - @fluentui/react-datepicker-compat
2
2
 
3
- This log was last generated on Mon, 17 Jun 2024 07:31:08 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 04 Jul 2024 15:13:32 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.4.43](https://github.com/microsoft/fluentui/tree/@fluentui/react-datepicker-compat_v0.4.43)
8
+
9
+ Thu, 04 Jul 2024 15:13:32 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-datepicker-compat_v0.4.42..@fluentui/react-datepicker-compat_v0.4.43)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-input to v9.4.81 ([PR #31918](https://github.com/microsoft/fluentui/pull/31918) by beachball)
15
+
16
+ ## [0.4.42](https://github.com/microsoft/fluentui/tree/@fluentui/react-datepicker-compat_v0.4.42)
17
+
18
+ Mon, 01 Jul 2024 20:30:47 GMT
19
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-datepicker-compat_v0.4.41..@fluentui/react-datepicker-compat_v0.4.42)
20
+
21
+ ### Patches
22
+
23
+ - feat: update DatePicker to use legacyTrapFocus ([PR #31801](https://github.com/microsoft/fluentui/pull/31801) by sarah.higley@microsoft.com)
24
+ - chore: Update react-icons package to ^2.0.245 ([PR #31802](https://github.com/microsoft/fluentui/pull/31802) by ololubek@microsoft.com)
25
+ - fix: datepicker popup is not hidden from the a11y tree ([PR #31819](https://github.com/microsoft/fluentui/pull/31819) by sarah.higley@microsoft.com)
26
+ - chore: add eslint react-compiler ([PR #31457](https://github.com/microsoft/fluentui/pull/31457) by seanmonahan@microsoft.com)
27
+ - Bump @fluentui/react-calendar-compat to v0.1.12 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
28
+ - Bump @fluentui/react-field to v9.1.69 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
29
+ - Bump @fluentui/react-input to v9.4.80 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
30
+ - Bump @fluentui/react-jsx-runtime to v9.0.40 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
31
+ - Bump @fluentui/react-popover to v9.9.13 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
32
+ - Bump @fluentui/react-portal to v9.4.29 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
33
+ - Bump @fluentui/react-positioning to v9.15.4 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
34
+ - Bump @fluentui/react-tabster to v9.22.1 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
35
+ - Bump @fluentui/react-utilities to v9.18.11 ([PR #31861](https://github.com/microsoft/fluentui/pull/31861) by beachball)
36
+
7
37
  ## [0.4.41](https://github.com/microsoft/fluentui/tree/@fluentui/react-datepicker-compat_v0.4.41)
8
38
 
9
- Mon, 17 Jun 2024 07:31:08 GMT
39
+ Mon, 17 Jun 2024 07:34:17 GMT
10
40
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-datepicker-compat_v0.4.40..@fluentui/react-datepicker-compat_v0.4.41)
11
41
 
12
42
  ### Patches
@@ -1 +1 @@
1
- {"version":3,"sources":["DatePicker.ts"],"sourcesContent":["export * from './components/DatePicker/index';\n"],"names":[],"mappings":"AAAA,cAAc,gCAAgC"}
1
+ {"version":3,"sources":["DatePicker.ts"],"sourcesContent":["export * from './components/DatePicker/index';\n"],"names":[],"rangeMappings":"","mappings":"AAAA,cAAc,gCAAgC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["DatePicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderDatePicker_unstable } from './renderDatePicker';\nimport { useDatePicker_unstable } from './useDatePicker';\nimport { useDatePickerStyles_unstable } from './useDatePickerStyles.styles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { DatePickerProps } from './DatePicker.types';\n\nexport const DatePicker: ForwardRefComponent<DatePickerProps> = React.forwardRef((props, ref) => {\n const state = useDatePicker_unstable(props, ref);\n\n useDatePickerStyles_unstable(state);\n return renderDatePicker_unstable(state);\n}) as ForwardRefComponent<DatePickerProps>;\nDatePicker.displayName = 'DatePicker';\n"],"names":["React","renderDatePicker_unstable","useDatePicker_unstable","useDatePickerStyles_unstable","DatePicker","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,4BAA4B,QAAQ,+BAA+B;AAI5E,OAAO,MAAMC,2BAAmDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,QAAQN,uBAAuBI,OAAOC;IAE5CJ,6BAA6BK;IAC7B,OAAOP,0BAA0BO;AACnC,GAA2C;AAC3CJ,WAAWK,WAAW,GAAG"}
1
+ {"version":3,"sources":["DatePicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderDatePicker_unstable } from './renderDatePicker';\nimport { useDatePicker_unstable } from './useDatePicker';\nimport { useDatePickerStyles_unstable } from './useDatePickerStyles.styles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { DatePickerProps } from './DatePicker.types';\n\nexport const DatePicker: ForwardRefComponent<DatePickerProps> = React.forwardRef((props, ref) => {\n const state = useDatePicker_unstable(props, ref);\n\n useDatePickerStyles_unstable(state);\n return renderDatePicker_unstable(state);\n}) as ForwardRefComponent<DatePickerProps>;\nDatePicker.displayName = 'DatePicker';\n"],"names":["React","renderDatePicker_unstable","useDatePicker_unstable","useDatePickerStyles_unstable","DatePicker","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,yBAAyB,QAAQ,qBAAqB;AAC/D,SAASC,sBAAsB,QAAQ,kBAAkB;AACzD,SAASC,4BAA4B,QAAQ,+BAA+B;AAI5E,OAAO,MAAMC,2BAAmDJ,MAAMK,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,QAAQN,uBAAuBI,OAAOC;IAE5CJ,6BAA6BK;IAC7B,OAAOP,0BAA0BO;AACnC,GAA2C;AAC3CJ,WAAWK,WAAW,GAAG"}
@@ -1 +1,3 @@
1
- export { };
1
+ /**
2
+ * Error types returned by the `onValidationResult` callback.
3
+ */ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["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":"AAAA,WA+OuF"}
1
+ {"version":3,"sources":["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":[],"rangeMappings":";;","mappings":"AA4OA;;CAEC,GACD,WAAuF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["defaults.ts"],"sourcesContent":["import { defaultCalendarStrings } from '@fluentui/react-calendar-compat';\nimport type { CalendarStrings } from '@fluentui/react-calendar-compat';\nimport type { DatePickerErrorType } from './DatePicker.types';\n\nexport const defaultDatePickerStrings: CalendarStrings = {\n ...defaultCalendarStrings,\n prevMonthAriaLabel: 'Go to previous month',\n nextMonthAriaLabel: 'Go to next month',\n prevYearAriaLabel: 'Go to previous year',\n nextYearAriaLabel: 'Go to next year',\n closeButtonAriaLabel: 'Close date picker',\n};\n\nexport const defaultDatePickerErrorStrings: Record<DatePickerErrorType, string> = {\n 'invalid-input': 'Invalid date format',\n 'out-of-bounds': 'Date is out of bounds',\n 'required-input': 'Field is required',\n};\n"],"names":["defaultCalendarStrings","defaultDatePickerStrings","prevMonthAriaLabel","nextMonthAriaLabel","prevYearAriaLabel","nextYearAriaLabel","closeButtonAriaLabel","defaultDatePickerErrorStrings"],"mappings":"AAAA,SAASA,sBAAsB,QAAQ,kCAAkC;AAIzE,OAAO,MAAMC,2BAA4C;IACvD,GAAGD,sBAAsB;IACzBE,oBAAoB;IACpBC,oBAAoB;IACpBC,mBAAmB;IACnBC,mBAAmB;IACnBC,sBAAsB;AACxB,EAAE;AAEF,OAAO,MAAMC,gCAAqE;IAChF,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;AACpB,EAAE"}
1
+ {"version":3,"sources":["defaults.ts"],"sourcesContent":["import { defaultCalendarStrings } from '@fluentui/react-calendar-compat';\nimport type { CalendarStrings } from '@fluentui/react-calendar-compat';\nimport type { DatePickerErrorType } from './DatePicker.types';\n\nexport const defaultDatePickerStrings: CalendarStrings = {\n ...defaultCalendarStrings,\n prevMonthAriaLabel: 'Go to previous month',\n nextMonthAriaLabel: 'Go to next month',\n prevYearAriaLabel: 'Go to previous year',\n nextYearAriaLabel: 'Go to next year',\n closeButtonAriaLabel: 'Close date picker',\n};\n\nexport const defaultDatePickerErrorStrings: Record<DatePickerErrorType, string> = {\n 'invalid-input': 'Invalid date format',\n 'out-of-bounds': 'Date is out of bounds',\n 'required-input': 'Field is required',\n};\n"],"names":["defaultCalendarStrings","defaultDatePickerStrings","prevMonthAriaLabel","nextMonthAriaLabel","prevYearAriaLabel","nextYearAriaLabel","closeButtonAriaLabel","defaultDatePickerErrorStrings"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,SAASA,sBAAsB,QAAQ,kCAAkC;AAIzE,OAAO,MAAMC,2BAA4C;IACvD,GAAGD,sBAAsB;IACzBE,oBAAoB;IACpBC,oBAAoB;IACpBC,mBAAmB;IACnBC,mBAAmB;IACnBC,sBAAsB;AACxB,EAAE;AAEF,OAAO,MAAMC,gCAAqE;IAChF,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;AACpB,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './defaults';\nexport * from './DatePicker';\nexport * from './DatePicker.types';\nexport * from './renderDatePicker';\nexport * from './useDatePicker';\nexport * from './useDatePickerStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,kBAAkB;AAChC,cAAc,+BAA+B"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './defaults';\nexport * from './DatePicker';\nexport * from './DatePicker.types';\nexport * from './renderDatePicker';\nexport * from './useDatePicker';\nexport * from './useDatePickerStyles.styles';\n"],"names":[],"rangeMappings":";;;;;","mappings":"AAAA,cAAc,aAAa;AAC3B,cAAc,eAAe;AAC7B,cAAc,qBAAqB;AACnC,cAAc,qBAAqB;AACnC,cAAc,kBAAkB;AAChC,cAAc,+BAA+B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderDatePicker.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Portal } from '@fluentui/react-portal';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { DatePickerSlots, DatePickerState } from './DatePicker.types';\n\n/**\n * Render the final JSX of DatePicker\n */\nexport const renderDatePicker_unstable = (state: DatePickerState) => {\n assertSlots<DatePickerSlots>(state);\n const { inlinePopup } = state;\n\n return (\n <>\n <state.root />\n {state.popupSurface &&\n (inlinePopup ? (\n <state.popupSurface>\n <state.calendar />\n </state.popupSurface>\n ) : (\n <Portal mountNode={state.mountNode}>\n <state.popupSurface>\n <state.calendar />\n </state.popupSurface>\n </Portal>\n ))}\n </>\n );\n};\n"],"names":["Portal","assertSlots","renderDatePicker_unstable","state","inlinePopup","root","popupSurface","calendar","mountNode"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAASC,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxCF,YAA6BE;IAC7B,MAAM,EAAEC,WAAW,EAAE,GAAGD;IAExB,qBACE;;0BACE,KAACA,MAAME,IAAI;YACVF,MAAMG,YAAY,IAChBF,CAAAA,4BACC,KAACD,MAAMG,YAAY;0BACjB,cAAA,KAACH,MAAMI,QAAQ;+BAGjB,KAACP;gBAAOQ,WAAWL,MAAMK,SAAS;0BAChC,cAAA,KAACL,MAAMG,YAAY;8BACjB,cAAA,KAACH,MAAMI,QAAQ;;cAGrB;;;AAGR,EAAE"}
1
+ {"version":3,"sources":["renderDatePicker.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Portal } from '@fluentui/react-portal';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { DatePickerSlots, DatePickerState } from './DatePicker.types';\n\n/**\n * Render the final JSX of DatePicker\n */\nexport const renderDatePicker_unstable = (state: DatePickerState) => {\n assertSlots<DatePickerSlots>(state);\n const { inlinePopup } = state;\n\n return (\n <>\n <state.root />\n {state.popupSurface &&\n (inlinePopup ? (\n <state.popupSurface>\n <state.calendar />\n </state.popupSurface>\n ) : (\n <Portal mountNode={state.mountNode}>\n <state.popupSurface>\n <state.calendar />\n </state.popupSurface>\n </Portal>\n ))}\n </>\n );\n};\n"],"names":["Portal","assertSlots","renderDatePicker_unstable","state","inlinePopup","root","popupSurface","calendar","mountNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,MAAM,QAAQ,yBAAyB;AAChD,SAASC,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,4BAA4B,CAACC;IACxCF,YAA6BE;IAC7B,MAAM,EAAEC,WAAW,EAAE,GAAGD;IAExB,qBACE;;0BACE,KAACA,MAAME,IAAI;YACVF,MAAMG,YAAY,IAChBF,CAAAA,4BACC,KAACD,MAAMG,YAAY;0BACjB,cAAA,KAACH,MAAMI,QAAQ;+BAGjB,KAACP;gBAAOQ,WAAWL,MAAMK,SAAS;0BAChC,cAAA,KAACL,MAAMG,YAAY;8BACjB,cAAA,KAACH,MAAMI,QAAQ;;cAGrB;;;AAGR,EAAE"}
@@ -30,6 +30,7 @@ function useFocusLogic() {
30
30
  ];
31
31
  }
32
32
  function usePopupVisibility(props) {
33
+ 'use no memo';
33
34
  const [open, setOpen] = useControllableState({
34
35
  initialState: false,
35
36
  defaultState: props.defaultOpen,
@@ -92,6 +93,7 @@ const defaultParseDateFromString = (dateStr)=>{
92
93
  * @param props - props from this instance of DatePicker
93
94
  * @param ref - reference to root Input slot
94
95
  */ export const useDatePicker_unstable = (props, ref)=>{
96
+ 'use no memo';
95
97
  const { allowTextInput = false, allFocusable = false, borderless = false, dateTimeFormatter, defaultOpen = false, disableAutoFocus = true, firstDayOfWeek = DayOfWeek.Sunday, firstWeekOfYear = FirstWeekOfYear.FirstDay, formatDate = defaultFormatDate, highlightCurrentMonth = false, highlightSelectedMonth = false, initialPickerDate: initialPickerDateProp, inlinePopup = false, isMonthPickerVisible = true, maxDate, minDate, mountNode, onOpenChange, onSelectDate: onUserSelectDate, openOnClick = true, onValidationResult, parseDateFromString = defaultParseDateFromString, showCloseButton = false, showGoToToday = true, showMonthPickerAsOverlay = false, showWeekNumbers = false, strings = defaultDatePickerStrings, today, underlined = false, value, ...restOfProps } = props;
96
98
  const initialPickerDate = React.useMemo(()=>initialPickerDateProp !== null && initialPickerDateProp !== void 0 ? initialPickerDateProp : new Date(), [
97
99
  initialPickerDateProp
@@ -309,7 +311,6 @@ const defaultParseDateFromString = (dateStr)=>{
309
311
  const [triggerWrapperRef, popupRef] = usePopupPositioning(props);
310
312
  const inputRoot = slot.always(props.root, {
311
313
  defaultProps: {
312
- 'aria-owns': open ? popupSurfaceId : undefined,
313
314
  ref: triggerWrapperRef
314
315
  },
315
316
  elementType: 'span'
@@ -364,7 +365,7 @@ const defaultParseDateFromString = (dateStr)=>{
364
365
  const { modalAttributes } = useModalAttributes({
365
366
  trapFocus: true,
366
367
  alwaysFocusable: true,
367
- legacyTrapFocus: false
368
+ legacyTrapFocus: true
368
369
  });
369
370
  const popupSurface = open ? slot.optional(props.popupSurface, {
370
371
  renderByDefault: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["useDatePicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar, compareDatePart, DayOfWeek, FirstWeekOfYear } from '@fluentui/react-calendar-compat';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { defaultDatePickerStrings } from './defaults';\nimport { Input } from '@fluentui/react-input';\nimport {\n mergeCallbacks,\n useControllableState,\n useEventCallback,\n useId,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n slot,\n} from '@fluentui/react-utilities';\nimport { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopupPositioning } from '../../utils/usePopupPositioning';\nimport type { CalendarProps, ICalendar } from '@fluentui/react-calendar-compat';\nimport type { DatePickerProps, DatePickerState, DatePickerValidationResultData } from './DatePicker.types';\nimport type { InputProps, InputOnChangeData } from '@fluentui/react-input';\n\nfunction isDateOutOfBounds(date: Date, minDate?: Date, maxDate?: Date): boolean {\n return (!!minDate && compareDatePart(minDate!, date) > 0) || (!!maxDate && compareDatePart(maxDate!, date) < 0);\n}\n\nfunction useFocusLogic() {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const preventFocusOpeningPicker = React.useRef(false);\n\n const focus = React.useCallback(() => {\n inputRef.current?.focus?.();\n }, []);\n\n const preventNextFocusOpeningPicker = React.useCallback(() => {\n preventFocusOpeningPicker.current = true;\n }, []);\n\n return [focus, inputRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] as const;\n}\n\nfunction usePopupVisibility(props: DatePickerProps) {\n const [open, setOpen] = useControllableState({\n initialState: false,\n defaultState: props.defaultOpen,\n state: props.open,\n });\n const isMounted = React.useRef(false);\n\n React.useEffect(\n () => {\n if (isMounted.current && !open) {\n // If DatePicker's menu (Calendar) is closed, run onAfterMenuDismiss\n props.onOpenChange?.(false);\n }\n isMounted.current = true;\n },\n // Should only run on allowTextInput or open change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.allowTextInput, open],\n );\n\n return [open, setOpen] as const;\n}\n\nfunction useSelectedDate({ formatDate, onSelectDate, value }: DatePickerProps) {\n const [selectedDate, setSelectedDateState] = useControllableState<Date | null | undefined>({\n initialState: null,\n state: value,\n });\n const [formattedDate, setFormattedDate] = React.useState(() => (value && formatDate ? formatDate(value) : ''));\n\n const setSelectedDate = (newDate: Date | null | undefined) => {\n onSelectDate?.(newDate);\n setSelectedDateState(newDate);\n setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');\n };\n\n React.useEffect(() => {\n setFormattedDate(value && formatDate ? formatDate(value) : '');\n }, [formatDate, value]);\n\n return [selectedDate, formattedDate, setSelectedDate, setFormattedDate] as const;\n}\n\nconst defaultFormatDate = (date?: Date) => (date ? date.toDateString() : '');\nconst defaultParseDateFromString = (dateStr: string) => {\n const date = Date.parse(dateStr);\n return date ? new Date(date) : null;\n};\n\n/**\n * Create the state required to render DatePicker.\n *\n * The returned state can be modified with hooks such as useDatePickerStyles_unstable,\n * before being passed to renderDatePicker_unstable.\n *\n * @param props - props from this instance of DatePicker\n * @param ref - reference to root Input slot\n */\nexport const useDatePicker_unstable = (props: DatePickerProps, ref: React.Ref<HTMLInputElement>): DatePickerState => {\n const {\n allowTextInput = false,\n allFocusable = false,\n borderless = false,\n dateTimeFormatter,\n defaultOpen = false,\n disableAutoFocus = true,\n firstDayOfWeek = DayOfWeek.Sunday,\n firstWeekOfYear = FirstWeekOfYear.FirstDay,\n formatDate = defaultFormatDate,\n highlightCurrentMonth = false,\n highlightSelectedMonth = false,\n initialPickerDate: initialPickerDateProp,\n inlinePopup = false,\n isMonthPickerVisible = true,\n maxDate,\n minDate,\n mountNode,\n onOpenChange,\n onSelectDate: onUserSelectDate,\n openOnClick = true,\n onValidationResult,\n parseDateFromString = defaultParseDateFromString,\n showCloseButton = false,\n showGoToToday = true,\n showMonthPickerAsOverlay = false,\n showWeekNumbers = false,\n strings = defaultDatePickerStrings,\n today,\n underlined = false,\n value,\n ...restOfProps\n } = props;\n\n const initialPickerDate = React.useMemo(() => initialPickerDateProp ?? new Date(), [initialPickerDateProp]);\n\n const calendar = React.useRef<ICalendar>(null);\n const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();\n const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({\n formatDate,\n onSelectDate: onUserSelectDate,\n value,\n });\n const [open, setOpenState] = usePopupVisibility(props);\n const fieldContext = useFieldContext();\n const required = fieldContext?.required ?? props.required;\n const defaultId = useId('datePicker-input');\n const popupSurfaceId = useId('datePicker-popupSurface');\n\n const validateTextInput = React.useCallback(\n (date: Date | null = null): void => {\n let error: DatePickerValidationResultData['error'];\n\n if (allowTextInput) {\n if (formattedDate || date) {\n // Don't parse if the selected date has the same formatted string as what we're about to parse.\n // The formatted string might be ambiguous (ex: \"1/2/3\" or \"New Year Eve\") and the parser might\n // not be able to come up with the exact same date.\n if (selectedDate && formatDate && formatDate(date ?? selectedDate) === formattedDate) {\n return;\n }\n date = date || parseDateFromString!(formattedDate);\n\n // Check if date is null or date is an invalid date\n if (!date || isNaN(date.getTime())) {\n // Reset input if formatting is available\n setSelectedDate(selectedDate);\n error = 'invalid-input';\n } else {\n if (isDateOutOfBounds(date, minDate, maxDate)) {\n error = 'out-of-bounds';\n } else {\n setSelectedDate(date);\n }\n }\n } else {\n if (required) {\n error = 'required-input';\n }\n\n onUserSelectDate?.(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n\n onValidationResult?.({ error });\n },\n [\n allowTextInput,\n formatDate,\n formattedDate,\n maxDate,\n minDate,\n onUserSelectDate,\n onValidationResult,\n parseDateFromString,\n required,\n selectedDate,\n setSelectedDate,\n ],\n );\n\n const setOpen = React.useCallback(\n (newState: boolean) => {\n onOpenChange?.(newState);\n setOpenState(newState);\n\n if (!open && !props.disabled) {\n focus();\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [focus, onOpenChange, props.disabled, setOpenState],\n );\n\n const dismissDatePickerPopup = React.useCallback(\n (newlySelectedDate?: Date | null): void => {\n if (open) {\n setOpen(false);\n\n validateTextInput(newlySelectedDate);\n if (!allowTextInput && newlySelectedDate) {\n setSelectedDate(newlySelectedDate);\n }\n }\n },\n [allowTextInput, open, setOpen, setSelectedDate, validateTextInput],\n );\n\n const showDatePickerPopup = React.useCallback((): void => {\n if (!open) {\n preventNextFocusOpeningPicker();\n setOpen(true);\n }\n }, [open, preventNextFocusOpeningPicker, setOpen]);\n\n /**\n * Callback for closing the calendar callout\n */\n const calendarDismissed = React.useCallback(\n (newlySelectedDate?: Date): void => {\n preventNextFocusOpeningPicker();\n dismissDatePickerPopup(newlySelectedDate);\n },\n [dismissDatePickerPopup, preventNextFocusOpeningPicker],\n );\n\n const onInputChange = React.useCallback(\n (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => {\n const { value: newValue } = data;\n\n if (allowTextInput) {\n if (open) {\n dismissDatePickerPopup();\n }\n\n setFormattedDate(newValue);\n }\n },\n [allowTextInput, dismissDatePickerPopup, open, setFormattedDate],\n );\n\n const onInputBlur: React.FocusEventHandler<HTMLInputElement> = React.useCallback((): void => {\n validateTextInput();\n }, [validateTextInput]);\n\n const onInputKeyDown = React.useCallback(\n (ev: React.KeyboardEvent<HTMLElement>): void => {\n switch (ev.key) {\n case Enter:\n ev.preventDefault();\n ev.stopPropagation();\n if (!open) {\n validateTextInput();\n showDatePickerPopup();\n } else {\n // When DatePicker allows input date string directly,\n // it is expected to hit another enter to close the popup\n if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n }\n break;\n\n case Escape:\n ev.stopPropagation();\n ev.preventDefault();\n if (open) {\n calendarDismissed();\n }\n break;\n\n case ArrowDown:\n ev.preventDefault();\n if (!open) {\n showDatePickerPopup();\n }\n break;\n\n default:\n break;\n }\n },\n [calendarDismissed, dismissDatePickerPopup, open, props.allowTextInput, showDatePickerPopup, validateTextInput],\n );\n\n const onInputFocus: React.FocusEventHandler<HTMLInputElement> = React.useCallback((): void => {\n if (disableAutoFocus) {\n return;\n }\n\n if (!allowTextInput) {\n if (!preventFocusOpeningPicker.current) {\n showDatePickerPopup();\n }\n preventFocusOpeningPicker.current = false;\n }\n }, [allowTextInput, disableAutoFocus, preventFocusOpeningPicker, showDatePickerPopup]);\n\n const onInputClick: React.MouseEventHandler<HTMLInputElement> = React.useCallback((): void => {\n // default openOnClick to !props.disableAutoFocus for legacy support of disableAutoFocus behavior\n if ((props.openOnClick || !props.disableAutoFocus) && !open && !props.disabled) {\n showDatePickerPopup();\n return;\n }\n\n if (allowTextInput) {\n dismissDatePickerPopup();\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n props.disabled,\n props.disableAutoFocus,\n props.openOnClick,\n showDatePickerPopup,\n ]);\n\n const onIconClick = (ev: React.MouseEvent<HTMLElement>): void => {\n ev.stopPropagation();\n if (!open && !props.disabled) {\n showDatePickerPopup();\n } else if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n };\n\n const inputAppearance: InputProps['appearance'] = underlined\n ? 'underline'\n : borderless\n ? 'filled-lighter'\n : 'outline';\n\n const [triggerWrapperRef, popupRef] = usePopupPositioning(props);\n\n const inputRoot = slot.always(props.root, {\n defaultProps: {\n 'aria-owns': open ? popupSurfaceId : undefined,\n ref: triggerWrapperRef,\n },\n elementType: 'span',\n });\n inputRoot.ref = useMergedRefs(inputRoot.ref, triggerWrapperRef);\n\n const input = slot.always(props.input, {\n elementType: 'input',\n });\n input.ref = useMergedRefs(input.ref, ref, rootRef);\n\n // Props to create a semantic but non-focusable button on the element with the click-to-open handler\n // Used for voice control and touch screen reader accessibility\n const inputLabelledBy = props['aria-labelledby'];\n const inputId = props.id ?? defaultId;\n const iconA11yProps = React.useMemo(\n () => ({\n role: 'button',\n 'aria-expanded': open,\n 'aria-labelledby': inputLabelledBy ?? inputId,\n }),\n [open, inputLabelledBy, inputId],\n );\n\n const contentAfter = slot.always(props.contentAfter || {}, {\n defaultProps: {\n children: <CalendarMonthRegular />,\n ...iconA11yProps,\n },\n elementType: 'span',\n });\n contentAfter.onClick = useEventCallback(mergeCallbacks(contentAfter.onClick, onIconClick));\n\n const root = slot.always(restOfProps, {\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n readOnly: !allowTextInput,\n role: 'combobox',\n id: inputId,\n },\n elementType: Input,\n });\n root.root = inputRoot;\n root.input = input;\n root.contentAfter = contentAfter;\n root.onChange = useEventCallback(mergeCallbacks(root.onChange, onInputChange));\n root.onBlur = useEventCallback(mergeCallbacks(root.onBlur, onInputBlur));\n root.onKeyDown = useEventCallback(mergeCallbacks(root.onKeyDown, onInputKeyDown));\n root.onFocus = useEventCallback(mergeCallbacks(root.onFocus, onInputFocus));\n root.onClick = useEventCallback(mergeCallbacks(root.onClick, onInputClick));\n\n const { modalAttributes } = useModalAttributes({ trapFocus: true, alwaysFocusable: true, legacyTrapFocus: false });\n const popupSurface = open\n ? slot.optional(props.popupSurface, {\n renderByDefault: true,\n defaultProps: {\n 'aria-label': 'Calendar',\n 'aria-modal': true,\n id: popupSurfaceId,\n role: 'dialog',\n ref: popupRef,\n ...modalAttributes,\n },\n elementType: 'div',\n })\n : undefined;\n const { targetDocument } = useFluent();\n useOnClickOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open,\n });\n useOnScrollOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open,\n }); // When the popup is opened, focus should go to the calendar.\n // In v8 this was done by focusing after the callout was positioned, but in v9 this can be simulated by using a\n // useEffect hook.\n React.useEffect(() => {\n if (open && !props.disabled && calendar.current) {\n calendar.current.focus();\n }\n }, [disableAutoFocus, open, props.disabled]);\n const calendarShorthand = slot.always(props.calendar, {\n defaultProps: {\n allFocusable,\n componentRef: calendar,\n dateTimeFormatter,\n firstDayOfWeek,\n firstWeekOfYear,\n highlightCurrentMonth,\n highlightSelectedMonth,\n isMonthPickerVisible,\n maxDate,\n minDate,\n showCloseButton,\n showGoToToday,\n showMonthPickerAsOverlay,\n showWeekNumbers,\n strings,\n today,\n value: selectedDate || initialPickerDate,\n },\n elementType: Calendar,\n });\n calendarShorthand.onDismiss = useEventCallback(mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed));\n calendarShorthand.onSelectDate = useEventCallback(mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed));\n const state: DatePickerState = {\n disabled: !!props.disabled,\n inlinePopup,\n components: { root: Input, calendar: Calendar as React.FC<Partial<CalendarProps>>, popupSurface: 'div' },\n calendar: calendarShorthand,\n mountNode,\n root,\n popupSurface,\n };\n\n state.root.value = formattedDate;\n\n return state;\n};\n"],"names":["React","ArrowDown","Enter","Escape","Calendar","compareDatePart","DayOfWeek","FirstWeekOfYear","CalendarMonthRegular","defaultDatePickerStrings","Input","mergeCallbacks","useControllableState","useEventCallback","useId","useMergedRefs","useOnClickOutside","useOnScrollOutside","slot","useFieldContext_unstable","useFieldContext","useFluent_unstable","useFluent","useModalAttributes","usePopupPositioning","isDateOutOfBounds","date","minDate","maxDate","useFocusLogic","inputRef","useRef","preventFocusOpeningPicker","focus","useCallback","current","preventNextFocusOpeningPicker","usePopupVisibility","props","open","setOpen","initialState","defaultState","defaultOpen","state","isMounted","useEffect","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","useDatePicker_unstable","ref","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","Sunday","firstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","initialPickerDateProp","inlinePopup","isMonthPickerVisible","mountNode","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","today","underlined","restOfProps","useMemo","calendar","rootRef","setOpenState","fieldContext","required","defaultId","popupSurfaceId","validateTextInput","error","isNaN","getTime","newState","disabled","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","preventDefault","stopPropagation","onInputFocus","onInputClick","onIconClick","inputAppearance","triggerWrapperRef","popupRef","inputRoot","always","root","defaultProps","undefined","elementType","input","inputLabelledBy","inputId","id","iconA11yProps","role","contentAfter","children","onClick","appearance","readOnly","onChange","onBlur","onKeyDown","onFocus","modalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurface","optional","renderByDefault","targetDocument","element","callback","refs","calendarShorthand","componentRef","onDismiss","components"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,EAAEC,KAAK,EAAEC,MAAM,QAAQ,0BAA0B;AACnE,SAASC,QAAQ,EAAEC,eAAe,EAAEC,SAAS,EAAEC,eAAe,QAAQ,kCAAkC;AACxG,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,wBAAwB,QAAQ,aAAa;AACtD,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SACEC,cAAc,EACdC,oBAAoB,EACpBC,gBAAgB,EAChBC,KAAK,EACLC,aAAa,EACbC,iBAAiB,EACjBC,kBAAkB,EAClBC,IAAI,QACC,4BAA4B;AACnC,SAASC,4BAA4BC,eAAe,QAAQ,wBAAwB;AACpF,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,mBAAmB,QAAQ,kCAAkC;AAKtE,SAASC,kBAAkBC,IAAU,EAAEC,OAAc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/G,kBAAkB;IAClBvC,MAAM8C,SAAS,CAAC;QACd,IAAIP,QAAQ,CAACD,MAAMsE,QAAQ,IAAIZ,SAAS7D,OAAO,EAAE;YAC/C6D,SAAS7D,OAAO,CAACF,KAAK;QACxB;IACF,GAAG;QAACsC;QAAkBhC;QAAMD,MAAMsE,QAAQ;KAAC;IAC3C,MAAMoD,oBAAoB9I,KAAK+G,MAAM,CAAC3F,MAAM0D,QAAQ,EAAE;QACpDmC,cAAc;YACZ/D;YACA6F,cAAcjE;YACd1B;YACAE;YACAE;YACAE;YACAC;YACAI;YACArD;YACAD;YACA4D;YACAC;YACAC;YACAC;YACAC;YACAC;YACAxC,OAAOC,gBAAgByB;QACzB;QACAuD,aAAajI;IACf;IACA4J,kBAAkBE,SAAS,GAAGrJ,iBAAiBF,eAAeqJ,kBAAkBE,SAAS,EAAElD;IAC3FgD,kBAAkB7G,YAAY,GAAGtC,iBAAiBF,eAAeqJ,kBAAkB7G,YAAY,EAAE6D;IACjG,MAAMpE,QAAyB;QAC7BgE,UAAU,CAAC,CAACtE,MAAMsE,QAAQ;QAC1B5B;QACAmF,YAAY;YAAEjC,MAAMxH;YAAOsF,UAAU5F;YAA8CqJ,cAAc;QAAM;QACvGzD,UAAUgE;QACV9E;QACAgD;QACAuB;IACF;IAEA7G,MAAMsF,IAAI,CAAC9E,KAAK,GAAGG;IAEnB,OAAOX;AACT,EAAE"}
1
+ {"version":3,"sources":["useDatePicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar, compareDatePart, DayOfWeek, FirstWeekOfYear } from '@fluentui/react-calendar-compat';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { defaultDatePickerStrings } from './defaults';\nimport { Input } from '@fluentui/react-input';\nimport {\n mergeCallbacks,\n useControllableState,\n useEventCallback,\n useId,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n slot,\n} from '@fluentui/react-utilities';\nimport { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopupPositioning } from '../../utils/usePopupPositioning';\nimport type { CalendarProps, ICalendar } from '@fluentui/react-calendar-compat';\nimport type { DatePickerProps, DatePickerState, DatePickerValidationResultData } from './DatePicker.types';\nimport type { InputProps, InputOnChangeData } from '@fluentui/react-input';\n\nfunction isDateOutOfBounds(date: Date, minDate?: Date, maxDate?: Date): boolean {\n return (!!minDate && compareDatePart(minDate!, date) > 0) || (!!maxDate && compareDatePart(maxDate!, date) < 0);\n}\n\nfunction useFocusLogic() {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const preventFocusOpeningPicker = React.useRef(false);\n\n const focus = React.useCallback(() => {\n inputRef.current?.focus?.();\n }, []);\n\n const preventNextFocusOpeningPicker = React.useCallback(() => {\n preventFocusOpeningPicker.current = true;\n }, []);\n\n return [focus, inputRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] as const;\n}\n\nfunction usePopupVisibility(props: DatePickerProps) {\n 'use no memo';\n\n const [open, setOpen] = useControllableState({\n initialState: false,\n defaultState: props.defaultOpen,\n state: props.open,\n });\n const isMounted = React.useRef(false);\n\n React.useEffect(\n () => {\n if (isMounted.current && !open) {\n // If DatePicker's menu (Calendar) is closed, run onAfterMenuDismiss\n props.onOpenChange?.(false);\n }\n isMounted.current = true;\n },\n // Should only run on allowTextInput or open change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.allowTextInput, open],\n );\n\n return [open, setOpen] as const;\n}\n\nfunction useSelectedDate({ formatDate, onSelectDate, value }: DatePickerProps) {\n const [selectedDate, setSelectedDateState] = useControllableState<Date | null | undefined>({\n initialState: null,\n state: value,\n });\n const [formattedDate, setFormattedDate] = React.useState(() => (value && formatDate ? formatDate(value) : ''));\n\n const setSelectedDate = (newDate: Date | null | undefined) => {\n onSelectDate?.(newDate);\n setSelectedDateState(newDate);\n setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');\n };\n\n React.useEffect(() => {\n setFormattedDate(value && formatDate ? formatDate(value) : '');\n }, [formatDate, value]);\n\n return [selectedDate, formattedDate, setSelectedDate, setFormattedDate] as const;\n}\n\nconst defaultFormatDate = (date?: Date) => (date ? date.toDateString() : '');\nconst defaultParseDateFromString = (dateStr: string) => {\n const date = Date.parse(dateStr);\n return date ? new Date(date) : null;\n};\n\n/**\n * Create the state required to render DatePicker.\n *\n * The returned state can be modified with hooks such as useDatePickerStyles_unstable,\n * before being passed to renderDatePicker_unstable.\n *\n * @param props - props from this instance of DatePicker\n * @param ref - reference to root Input slot\n */\nexport const useDatePicker_unstable = (props: DatePickerProps, ref: React.Ref<HTMLInputElement>): DatePickerState => {\n 'use no memo';\n\n const {\n allowTextInput = false,\n allFocusable = false,\n borderless = false,\n dateTimeFormatter,\n defaultOpen = false,\n disableAutoFocus = true,\n firstDayOfWeek = DayOfWeek.Sunday,\n firstWeekOfYear = FirstWeekOfYear.FirstDay,\n formatDate = defaultFormatDate,\n highlightCurrentMonth = false,\n highlightSelectedMonth = false,\n initialPickerDate: initialPickerDateProp,\n inlinePopup = false,\n isMonthPickerVisible = true,\n maxDate,\n minDate,\n mountNode,\n onOpenChange,\n onSelectDate: onUserSelectDate,\n openOnClick = true,\n onValidationResult,\n parseDateFromString = defaultParseDateFromString,\n showCloseButton = false,\n showGoToToday = true,\n showMonthPickerAsOverlay = false,\n showWeekNumbers = false,\n strings = defaultDatePickerStrings,\n today,\n underlined = false,\n value,\n ...restOfProps\n } = props;\n\n const initialPickerDate = React.useMemo(() => initialPickerDateProp ?? new Date(), [initialPickerDateProp]);\n\n const calendar = React.useRef<ICalendar>(null);\n const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();\n const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({\n formatDate,\n onSelectDate: onUserSelectDate,\n value,\n });\n const [open, setOpenState] = usePopupVisibility(props);\n const fieldContext = useFieldContext();\n const required = fieldContext?.required ?? props.required;\n const defaultId = useId('datePicker-input');\n const popupSurfaceId = useId('datePicker-popupSurface');\n\n const validateTextInput = React.useCallback(\n (date: Date | null = null): void => {\n let error: DatePickerValidationResultData['error'];\n\n if (allowTextInput) {\n if (formattedDate || date) {\n // Don't parse if the selected date has the same formatted string as what we're about to parse.\n // The formatted string might be ambiguous (ex: \"1/2/3\" or \"New Year Eve\") and the parser might\n // not be able to come up with the exact same date.\n if (selectedDate && formatDate && formatDate(date ?? selectedDate) === formattedDate) {\n return;\n }\n date = date || parseDateFromString!(formattedDate);\n\n // Check if date is null or date is an invalid date\n if (!date || isNaN(date.getTime())) {\n // Reset input if formatting is available\n setSelectedDate(selectedDate);\n error = 'invalid-input';\n } else {\n if (isDateOutOfBounds(date, minDate, maxDate)) {\n error = 'out-of-bounds';\n } else {\n setSelectedDate(date);\n }\n }\n } else {\n if (required) {\n error = 'required-input';\n }\n\n onUserSelectDate?.(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n\n onValidationResult?.({ error });\n },\n [\n allowTextInput,\n formatDate,\n formattedDate,\n maxDate,\n minDate,\n onUserSelectDate,\n onValidationResult,\n parseDateFromString,\n required,\n selectedDate,\n setSelectedDate,\n ],\n );\n\n const setOpen = React.useCallback(\n (newState: boolean) => {\n onOpenChange?.(newState);\n setOpenState(newState);\n\n if (!open && !props.disabled) {\n focus();\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [focus, onOpenChange, props.disabled, setOpenState],\n );\n\n const dismissDatePickerPopup = React.useCallback(\n (newlySelectedDate?: Date | null): void => {\n if (open) {\n setOpen(false);\n\n validateTextInput(newlySelectedDate);\n if (!allowTextInput && newlySelectedDate) {\n setSelectedDate(newlySelectedDate);\n }\n }\n },\n [allowTextInput, open, setOpen, setSelectedDate, validateTextInput],\n );\n\n const showDatePickerPopup = React.useCallback((): void => {\n if (!open) {\n preventNextFocusOpeningPicker();\n setOpen(true);\n }\n }, [open, preventNextFocusOpeningPicker, setOpen]);\n\n /**\n * Callback for closing the calendar callout\n */\n const calendarDismissed = React.useCallback(\n (newlySelectedDate?: Date): void => {\n preventNextFocusOpeningPicker();\n dismissDatePickerPopup(newlySelectedDate);\n },\n [dismissDatePickerPopup, preventNextFocusOpeningPicker],\n );\n\n const onInputChange = React.useCallback(\n (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => {\n const { value: newValue } = data;\n\n if (allowTextInput) {\n if (open) {\n dismissDatePickerPopup();\n }\n\n setFormattedDate(newValue);\n }\n },\n [allowTextInput, dismissDatePickerPopup, open, setFormattedDate],\n );\n\n const onInputBlur: React.FocusEventHandler<HTMLInputElement> = React.useCallback((): void => {\n validateTextInput();\n }, [validateTextInput]);\n\n const onInputKeyDown = React.useCallback(\n (ev: React.KeyboardEvent<HTMLElement>): void => {\n switch (ev.key) {\n case Enter:\n ev.preventDefault();\n ev.stopPropagation();\n if (!open) {\n validateTextInput();\n showDatePickerPopup();\n } else {\n // When DatePicker allows input date string directly,\n // it is expected to hit another enter to close the popup\n if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n }\n break;\n\n case Escape:\n ev.stopPropagation();\n ev.preventDefault();\n if (open) {\n calendarDismissed();\n }\n break;\n\n case ArrowDown:\n ev.preventDefault();\n if (!open) {\n showDatePickerPopup();\n }\n break;\n\n default:\n break;\n }\n },\n [calendarDismissed, dismissDatePickerPopup, open, props.allowTextInput, showDatePickerPopup, validateTextInput],\n );\n\n const onInputFocus: React.FocusEventHandler<HTMLInputElement> = React.useCallback((): void => {\n if (disableAutoFocus) {\n return;\n }\n\n if (!allowTextInput) {\n if (!preventFocusOpeningPicker.current) {\n showDatePickerPopup();\n }\n preventFocusOpeningPicker.current = false;\n }\n }, [allowTextInput, disableAutoFocus, preventFocusOpeningPicker, showDatePickerPopup]);\n\n const onInputClick: React.MouseEventHandler<HTMLInputElement> = React.useCallback((): void => {\n // default openOnClick to !props.disableAutoFocus for legacy support of disableAutoFocus behavior\n if ((props.openOnClick || !props.disableAutoFocus) && !open && !props.disabled) {\n showDatePickerPopup();\n return;\n }\n\n if (allowTextInput) {\n dismissDatePickerPopup();\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n props.disabled,\n props.disableAutoFocus,\n props.openOnClick,\n showDatePickerPopup,\n ]);\n\n const onIconClick = (ev: React.MouseEvent<HTMLElement>): void => {\n ev.stopPropagation();\n if (!open && !props.disabled) {\n showDatePickerPopup();\n } else if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n };\n\n const inputAppearance: InputProps['appearance'] = underlined\n ? 'underline'\n : borderless\n ? 'filled-lighter'\n : 'outline';\n\n const [triggerWrapperRef, popupRef] = usePopupPositioning(props);\n\n const inputRoot = slot.always(props.root, {\n defaultProps: {\n ref: triggerWrapperRef,\n },\n elementType: 'span',\n });\n inputRoot.ref = useMergedRefs(inputRoot.ref, triggerWrapperRef);\n\n const input = slot.always(props.input, {\n elementType: 'input',\n });\n input.ref = useMergedRefs(input.ref, ref, rootRef);\n\n // Props to create a semantic but non-focusable button on the element with the click-to-open handler\n // Used for voice control and touch screen reader accessibility\n const inputLabelledBy = props['aria-labelledby'];\n const inputId = props.id ?? defaultId;\n const iconA11yProps = React.useMemo(\n () => ({\n role: 'button',\n 'aria-expanded': open,\n 'aria-labelledby': inputLabelledBy ?? inputId,\n }),\n [open, inputLabelledBy, inputId],\n );\n\n const contentAfter = slot.always(props.contentAfter || {}, {\n defaultProps: {\n children: <CalendarMonthRegular />,\n ...iconA11yProps,\n },\n elementType: 'span',\n });\n contentAfter.onClick = useEventCallback(mergeCallbacks(contentAfter.onClick, onIconClick));\n\n const root = slot.always(restOfProps, {\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n readOnly: !allowTextInput,\n role: 'combobox',\n id: inputId,\n },\n elementType: Input,\n });\n root.root = inputRoot;\n root.input = input;\n root.contentAfter = contentAfter;\n root.onChange = useEventCallback(mergeCallbacks(root.onChange, onInputChange));\n root.onBlur = useEventCallback(mergeCallbacks(root.onBlur, onInputBlur));\n root.onKeyDown = useEventCallback(mergeCallbacks(root.onKeyDown, onInputKeyDown));\n root.onFocus = useEventCallback(mergeCallbacks(root.onFocus, onInputFocus));\n root.onClick = useEventCallback(mergeCallbacks(root.onClick, onInputClick));\n\n const { modalAttributes } = useModalAttributes({ trapFocus: true, alwaysFocusable: true, legacyTrapFocus: true });\n const popupSurface = open\n ? slot.optional(props.popupSurface, {\n renderByDefault: true,\n defaultProps: {\n 'aria-label': 'Calendar',\n 'aria-modal': true,\n id: popupSurfaceId,\n role: 'dialog',\n ref: popupRef,\n ...modalAttributes,\n },\n elementType: 'div',\n })\n : undefined;\n const { targetDocument } = useFluent();\n useOnClickOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open,\n });\n useOnScrollOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open,\n }); // When the popup is opened, focus should go to the calendar.\n // In v8 this was done by focusing after the callout was positioned, but in v9 this can be simulated by using a\n // useEffect hook.\n React.useEffect(() => {\n if (open && !props.disabled && calendar.current) {\n calendar.current.focus();\n }\n }, [disableAutoFocus, open, props.disabled]);\n const calendarShorthand = slot.always(props.calendar, {\n defaultProps: {\n allFocusable,\n componentRef: calendar,\n dateTimeFormatter,\n firstDayOfWeek,\n firstWeekOfYear,\n highlightCurrentMonth,\n highlightSelectedMonth,\n isMonthPickerVisible,\n maxDate,\n minDate,\n showCloseButton,\n showGoToToday,\n showMonthPickerAsOverlay,\n showWeekNumbers,\n strings,\n today,\n value: selectedDate || initialPickerDate,\n },\n elementType: Calendar,\n });\n calendarShorthand.onDismiss = useEventCallback(mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed));\n calendarShorthand.onSelectDate = useEventCallback(mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed));\n const state: DatePickerState = {\n disabled: !!props.disabled,\n inlinePopup,\n components: { root: Input, calendar: Calendar as React.FC<Partial<CalendarProps>>, popupSurface: 'div' },\n calendar: calendarShorthand,\n mountNode,\n root,\n popupSurface,\n };\n\n state.root.value = formattedDate;\n\n return state;\n};\n"],"names":["React","ArrowDown","Enter","Escape","Calendar","compareDatePart","DayOfWeek","FirstWeekOfYear","CalendarMonthRegular","defaultDatePickerStrings","Input","mergeCallbacks","useControllableState","useEventCallback","useId","useMergedRefs","useOnClickOutside","useOnScrollOutside","slot","useFieldContext_unstable","useFieldContext","useFluent_unstable","useFluent","useModalAttributes","usePopupPositioning","isDateOutOfBounds","date","minDate","maxDate","useFocusLogic","inputRef","useRef","preventFocusOpeningPicker","focus","useCallback","current","preventNextFocusOpeningPicker","usePopupVisibility","props","open","setOpen","initialState","defaultState","defaultOpen","state","isMounted","useEffect","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","useDatePicker_unstable","ref","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","Sunday","firstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","initialPickerDateProp","inlinePopup","isMonthPickerVisible","mountNode","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","today","underlined","restOfProps","useMemo","calendar","rootRef","setOpenState","fieldContext","required","defaultId","popupSurfaceId","validateTextInput","error","isNaN","getTime","newState","disabled","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","preventDefault","stopPropagation","onInputFocus","onInputClick","onIconClick","inputAppearance","triggerWrapperRef","popupRef","inputRoot","always","root","defaultProps","elementType","input","inputLabelledBy","inputId","id","iconA11yProps","role","contentAfter","children","onClick","appearance","undefined","readOnly","onChange","onBlur","onKeyDown","onFocus","modalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurface","optional","renderByDefault","targetDocument","element","callback","refs","calendarShorthand","componentRef","onDismiss","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,SAAS,EAAEC,KAAK,EAAEC,MAAM,QAAQ,0BAA0B;AACnE,SAASC,QAAQ,EAAEC,eAAe,EAAEC,SAAS,EAAEC,eAAe,QAAQ,kCAAkC;AACxG,SAASC,oBAAoB,QAAQ,wBAAwB;AAC7D,SAASC,wBAAwB,QAAQ,aAAa;AACtD,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SACEC,cAAc,EACdC,oBAAoB,EACpBC,gBAAgB,EAChBC,KAAK,EACLC,aAAa,EACbC,iBAAiB,EACjBC,kBAAkB,EAClBC,IAAI,QACC,4BAA4B;AACnC,SAASC,4BAA4BC,eAAe,QAAQ,wBAAwB;AACpF,SAASC,sBAAsBC,SAAS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AA,KAAML;QAChBkD,MAAM;YAACjC;YAAmBC;SAAS;QACnCnB,UAAU,CAACrE;IACb,IAAI,6DAA6D;IACjE,+GAA+G;IAC/G,kBAAkB;IAClBvC,MAAM8C,SAAS,CAAC;QACd,IAAIP,QAAQ,CAACD,MAAMsE,QAAQ,IAAIZ,SAAS7D,OAAO,EAAE;YAC/C6D,SAAS7D,OAAO,CAACF,KAAK;QACxB;IACF,GAAG;QAACsC;QAAkBhC;QAAMD,MAAMsE,QAAQ;KAAC;IAC3C,MAAMoD,oBAAoB9I,KAAK+G,MAAM,CAAC3F,MAAM0D,QAAQ,EAAE;QACpDmC,cAAc;YACZ/D;YACA6F,cAAcjE;YACd1B;YACAE;YACAE;YACAE;YACAC;YACAI;YACArD;YACAD;YACA4D;YACAC;YACAC;YACAC;YACAC;YACAC;YACAxC,OAAOC,gBAAgByB;QACzB;QACAsD,aAAahI;IACf;IACA4J,kBAAkBE,SAAS,GAAGrJ,iBAAiBF,eAAeqJ,kBAAkBE,SAAS,EAAElD;IAC3FgD,kBAAkB7G,YAAY,GAAGtC,iBAAiBF,eAAeqJ,kBAAkB7G,YAAY,EAAE6D;IACjG,MAAMpE,QAAyB;QAC7BgE,UAAU,CAAC,CAACtE,MAAMsE,QAAQ;QAC1B5B;QACAmF,YAAY;YAAEjC,MAAMxH;YAAOsF,UAAU5F;YAA8CqJ,cAAc;QAAM;QACvGzD,UAAUgE;QACV9E;QACAgD;QACAuB;IACF;IAEA7G,MAAMsF,IAAI,CAAC9E,KAAK,GAAGG;IAEnB,OAAOX;AACT,EAAE"}
@@ -26,6 +26,8 @@ const usePopupSurfaceClassName = /*#__PURE__*/__resetStyles("r1ytv1z8", null, ["
26
26
  * Apply styling to the DatePicker slots based on the state
27
27
  */
28
28
  export const useDatePickerStyles_unstable = state => {
29
+ 'use no memo';
30
+
29
31
  const styles = useStyles();
30
32
  const popupSurfaceClassName = usePopupSurfaceClassName();
31
33
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","typographyStyles","datePickerClassNames","root","calendar","popupSurface","useStyles","base","qhf8xq","Bceei9c","xfaavh","disabled","inline","Bj3rh1h","d","usePopupSurfaceClassName","useDatePickerStyles_unstable","state","styles","popupSurfaceClassName","inlinePopup","className"],"sources":["useDatePickerStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const datePickerClassNames = {\n root: 'fui-DatePicker',\n calendar: 'fui-DatePicker__calendar',\n popupSurface: 'fui-DatePicker__popupSurface'\n};\nconst useStyles = makeStyles({\n base: {\n position: 'relative',\n cursor: 'pointer',\n '& input': {\n cursor: 'pointer'\n }\n },\n disabled: {\n cursor: 'default',\n '& input': {\n cursor: 'default'\n }\n },\n inline: {\n // When rendering inline, the popupSurface will be rendered under relatively positioned elements such as Input.\n // This is due to the surface being positioned as absolute, therefore zIndex: 1 ensures that won't happen.\n zIndex: 1\n }\n});\nconst usePopupSurfaceClassName = makeResetStyles({\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow16,\n borderRadius: tokens.borderRadiusMedium,\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: tokens.colorTransparentStroke,\n display: 'inline-flex',\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1\n});\n/**\n * Apply styling to the DatePicker slots based on the state\n */ export const useDatePickerStyles_unstable = (state)=>{\n const styles = useStyles();\n const popupSurfaceClassName = usePopupSurfaceClassName();\n const { disabled, inlinePopup } = state;\n state.root.className = mergeClasses(datePickerClassNames.root, styles.base, disabled && styles.disabled, state.root.className);\n if (state.popupSurface) {\n state.popupSurface.className = mergeClasses(datePickerClassNames.popupSurface, popupSurfaceClassName, state.popupSurface.className, inlinePopup && styles.inline);\n }\n state.calendar.className = mergeClasses(datePickerClassNames.calendar, state.calendar.className);\n return state;\n};\n"],"mappings":"AAAA,SAAAA,aAAA,EAAAC,QAAA,EAA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,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","typographyStyles","datePickerClassNames","root","calendar","popupSurface","useStyles","base","qhf8xq","Bceei9c","xfaavh","disabled","inline","Bj3rh1h","d","usePopupSurfaceClassName","useDatePickerStyles_unstable","state","styles","popupSurfaceClassName","inlinePopup","className"],"sources":["useDatePickerStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const datePickerClassNames = {\n root: 'fui-DatePicker',\n calendar: 'fui-DatePicker__calendar',\n popupSurface: 'fui-DatePicker__popupSurface'\n};\nconst useStyles = makeStyles({\n base: {\n position: 'relative',\n cursor: 'pointer',\n '& input': {\n cursor: 'pointer'\n }\n },\n disabled: {\n cursor: 'default',\n '& input': {\n cursor: 'default'\n }\n },\n inline: {\n // When rendering inline, the popupSurface will be rendered under relatively positioned elements such as Input.\n // This is due to the surface being positioned as absolute, therefore zIndex: 1 ensures that won't happen.\n zIndex: 1\n }\n});\nconst usePopupSurfaceClassName = makeResetStyles({\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow16,\n borderRadius: tokens.borderRadiusMedium,\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: tokens.colorTransparentStroke,\n display: 'inline-flex',\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1\n});\n/**\n * Apply styling to the DatePicker slots based on the state\n */ export const useDatePickerStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n const popupSurfaceClassName = usePopupSurfaceClassName();\n const { disabled, inlinePopup } = state;\n state.root.className = mergeClasses(datePickerClassNames.root, styles.base, disabled && styles.disabled, state.root.className);\n if (state.popupSurface) {\n state.popupSurface.className = mergeClasses(datePickerClassNames.popupSurface, popupSurfaceClassName, state.popupSurface.className, inlinePopup && styles.inline);\n }\n state.calendar.className = mergeClasses(datePickerClassNames.calendar, state.calendar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B,CAACE,QAAQ,EAAEa,KAAK,CAACb,QAAQ,CAACiB,SAAS,CAAC;EAChG,OAAOJ,KAAK;AAChB,CAAC","ignoreList":[]}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export {\n DatePicker,\n datePickerClassNames,\n defaultDatePickerErrorStrings,\n defaultDatePickerStrings,\n renderDatePicker_unstable,\n useDatePicker_unstable,\n useDatePickerStyles_unstable,\n} from './DatePicker';\nexport type { DatePickerErrorType, DatePickerProps, DatePickerValidationResultData } from './DatePicker';\n// Re-exporting so there's no need to add @fluentui/react-calendar-compat to dependencies just to localize.\nexport type { CalendarStrings } from '@fluentui/react-calendar-compat';\n"],"names":["DatePicker","datePickerClassNames","defaultDatePickerErrorStrings","defaultDatePickerStrings","renderDatePicker_unstable","useDatePicker_unstable","useDatePickerStyles_unstable"],"mappings":"AAAA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,6BAA6B,EAC7BC,wBAAwB,EACxBC,yBAAyB,EACzBC,sBAAsB,EACtBC,4BAA4B,QACvB,eAAe"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export {\n DatePicker,\n datePickerClassNames,\n defaultDatePickerErrorStrings,\n defaultDatePickerStrings,\n renderDatePicker_unstable,\n useDatePicker_unstable,\n useDatePickerStyles_unstable,\n} from './DatePicker';\nexport type { DatePickerErrorType, DatePickerProps, DatePickerValidationResultData } from './DatePicker';\n// Re-exporting so there's no need to add @fluentui/react-calendar-compat to dependencies just to localize.\nexport type { CalendarStrings } from '@fluentui/react-calendar-compat';\n"],"names":["DatePicker","datePickerClassNames","defaultDatePickerErrorStrings","defaultDatePickerStrings","renderDatePicker_unstable","useDatePicker_unstable","useDatePickerStyles_unstable"],"rangeMappings":"","mappings":"AAAA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,6BAA6B,EAC7BC,wBAAwB,EACxBC,yBAAyB,EACzBC,sBAAsB,EACtBC,4BAA4B,QACvB,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"sources":["usePopupPositioning.ts"],"sourcesContent":["import * 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): [triggerRef: React.MutableRefObject<HTMLElement>, popupRef: React.MutableRefObject<HTMLDivElement>] {\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":["React","resolvePositioningShorthand","usePositioning","usePopupPositioning","props","positioning","popupOptions","position","align","targetRef","containerRef"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,EAAEC,cAAc,QAAQ,8BAA8B;AAG1F;;;;;;CAMC,GACD,OAAO,SAASC,oBACdC,KAAsB;IAEtB,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
+ {"version":3,"sources":["usePopupPositioning.ts"],"sourcesContent":["import * 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): [triggerRef: React.MutableRefObject<HTMLElement>, popupRef: React.MutableRefObject<HTMLDivElement>] {\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":["React","resolvePositioningShorthand","usePositioning","usePopupPositioning","props","positioning","popupOptions","position","align","targetRef","containerRef"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,EAAEC,cAAc,QAAQ,8BAA8B;AAG1F;;;;;;CAMC,GACD,OAAO,SAASC,oBACdC,KAAsB;IAEtB,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":["DatePicker.js"],"sourcesContent":["export * from './components/DatePicker/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
1
+ {"version":3,"sources":["DatePicker.ts"],"sourcesContent":["export * from './components/DatePicker/index';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["DatePicker.js"],"sourcesContent":["import * as React from 'react';\nimport { renderDatePicker_unstable } from './renderDatePicker';\nimport { useDatePicker_unstable } from './useDatePicker';\nimport { useDatePickerStyles_unstable } from './useDatePickerStyles.styles';\nexport const DatePicker = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useDatePicker_unstable(props, ref);\n useDatePickerStyles_unstable(state);\n return renderDatePicker_unstable(state);\n});\nDatePicker.displayName = 'DatePicker';\n"],"names":["DatePicker","React","forwardRef","props","ref","state","useDatePicker_unstable","useDatePickerStyles_unstable","renderDatePicker_unstable","displayName"],"mappings":";;;;+BAIaA;;;eAAAA;;;;iEAJU;kCACmB;+BACH;2CACM;AACtC,MAAMA,aAAa,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7D,MAAMC,QAAQC,IAAAA,qCAAsB,EAACH,OAAOC;IAC5CG,IAAAA,uDAA4B,EAACF;IAC7B,OAAOG,IAAAA,2CAAyB,EAACH;AACrC;AACAL,WAAWS,WAAW,GAAG"}
1
+ {"version":3,"sources":["DatePicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderDatePicker_unstable } from './renderDatePicker';\nimport { useDatePicker_unstable } from './useDatePicker';\nimport { useDatePickerStyles_unstable } from './useDatePickerStyles.styles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { DatePickerProps } from './DatePicker.types';\n\nexport const DatePicker: ForwardRefComponent<DatePickerProps> = React.forwardRef((props, ref) => {\n const state = useDatePicker_unstable(props, ref);\n\n useDatePickerStyles_unstable(state);\n return renderDatePicker_unstable(state);\n}) as ForwardRefComponent<DatePickerProps>;\nDatePicker.displayName = 'DatePicker';\n"],"names":["DatePicker","React","forwardRef","props","ref","state","useDatePicker_unstable","useDatePickerStyles_unstable","renderDatePicker_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAOaA;;;eAAAA;;;;iEAPU;kCACmB;+BACH;2CACM;AAItC,MAAMA,aAAAA,WAAAA,GAAmDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACvF,MAAMC,QAAQC,IAAAA,qCAAAA,EAAuBH,OAAOC;IAE5CG,IAAAA,uDAAAA,EAA6BF;IAC7B,OAAOG,IAAAA,2CAAAA,EAA0BH;AACnC;AACAL,WAAWS,WAAW,GAAG"}
@@ -1,4 +1,6 @@
1
- "use strict";
1
+ /**
2
+ * Error types returned by the `onValidationResult` callback.
3
+ */ "use strict";
2
4
  Object.defineProperty(exports, "__esModule", {
3
5
  value: true
4
6
  });
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
1
+ {"version":3,"sources":["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":[],"rangeMappings":";;","mappings":"AA4OA;;CAEC"}
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- defaultDatePickerStrings: function() {
13
- return defaultDatePickerStrings;
14
- },
15
12
  defaultDatePickerErrorStrings: function() {
16
13
  return defaultDatePickerErrorStrings;
14
+ },
15
+ defaultDatePickerStrings: function() {
16
+ return defaultDatePickerStrings;
17
17
  }
18
18
  });
19
19
  const _reactcalendarcompat = require("@fluentui/react-calendar-compat");
@@ -1 +1 @@
1
- {"version":3,"sources":["defaults.js"],"sourcesContent":["import { defaultCalendarStrings } from '@fluentui/react-calendar-compat';\nexport const defaultDatePickerStrings = {\n ...defaultCalendarStrings,\n prevMonthAriaLabel: 'Go to previous month',\n nextMonthAriaLabel: 'Go to next month',\n prevYearAriaLabel: 'Go to previous year',\n nextYearAriaLabel: 'Go to next year',\n closeButtonAriaLabel: 'Close date picker'\n};\nexport const defaultDatePickerErrorStrings = {\n 'invalid-input': 'Invalid date format',\n 'out-of-bounds': 'Date is out of bounds',\n 'required-input': 'Field is required'\n};\n"],"names":["defaultDatePickerStrings","defaultDatePickerErrorStrings","defaultCalendarStrings","prevMonthAriaLabel","nextMonthAriaLabel","prevYearAriaLabel","nextYearAriaLabel","closeButtonAriaLabel"],"mappings":";;;;;;;;;;;IACaA,wBAAwB;eAAxBA;;IAQAC,6BAA6B;eAA7BA;;;qCAT0B;AAChC,MAAMD,2BAA2B;IACpC,GAAGE,2CAAsB;IACzBC,oBAAoB;IACpBC,oBAAoB;IACpBC,mBAAmB;IACnBC,mBAAmB;IACnBC,sBAAsB;AAC1B;AACO,MAAMN,gCAAgC;IACzC,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;AACtB"}
1
+ {"version":3,"sources":["defaults.ts"],"sourcesContent":["import { defaultCalendarStrings } from '@fluentui/react-calendar-compat';\nimport type { CalendarStrings } from '@fluentui/react-calendar-compat';\nimport type { DatePickerErrorType } from './DatePicker.types';\n\nexport const defaultDatePickerStrings: CalendarStrings = {\n ...defaultCalendarStrings,\n prevMonthAriaLabel: 'Go to previous month',\n nextMonthAriaLabel: 'Go to next month',\n prevYearAriaLabel: 'Go to previous year',\n nextYearAriaLabel: 'Go to next year',\n closeButtonAriaLabel: 'Close date picker',\n};\n\nexport const defaultDatePickerErrorStrings: Record<DatePickerErrorType, string> = {\n 'invalid-input': 'Invalid date format',\n 'out-of-bounds': 'Date is out of bounds',\n 'required-input': 'Field is required',\n};\n"],"names":["defaultDatePickerErrorStrings","defaultDatePickerStrings","defaultCalendarStrings","prevMonthAriaLabel","nextMonthAriaLabel","prevYearAriaLabel","nextYearAriaLabel","closeButtonAriaLabel"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAaaA,6BAAAA;eAAAA;;IATAC,wBAAAA;eAAAA;;;qCAJ0B;AAIhC,MAAMA,2BAA4C;IACvD,GAAGC,2CAAsB;IACzBC,oBAAoB;IACpBC,oBAAoB;IACpBC,mBAAmB;IACnBC,mBAAmB;IACnBC,sBAAsB;AACxB;AAEO,MAAMP,gCAAqE;IAChF,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;AACpB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './defaults';\nexport * from './DatePicker';\nexport * from './DatePicker.types';\nexport * from './renderDatePicker';\nexport * from './useDatePicker';\nexport * from './useDatePickerStyles.styles';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export * from './defaults';\nexport * from './DatePicker';\nexport * from './DatePicker.types';\nexport * from './renderDatePicker';\nexport * from './useDatePicker';\nexport * from './useDatePickerStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["renderDatePicker.js"],"sourcesContent":[" import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { Portal } from '@fluentui/react-portal';\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of DatePicker\n */ export const renderDatePicker_unstable = (state)=>{\n assertSlots(state);\n const { inlinePopup } = state;\n return /*#__PURE__*/ _jsxs(_Fragment, {\n children: [\n /*#__PURE__*/ _jsx(state.root, {}),\n state.popupSurface && (inlinePopup ? /*#__PURE__*/ _jsx(state.popupSurface, {\n children: /*#__PURE__*/ _jsx(state.calendar, {})\n }) : /*#__PURE__*/ _jsx(Portal, {\n mountNode: state.mountNode,\n children: /*#__PURE__*/ _jsx(state.popupSurface, {\n children: /*#__PURE__*/ _jsx(state.calendar, {})\n })\n }))\n ]\n });\n};\n"],"names":["renderDatePicker_unstable","state","assertSlots","inlinePopup","_jsxs","_Fragment","children","_jsx","root","popupSurface","calendar","Portal","mountNode"],"mappings":";;;;+BAKiBA;;;eAAAA;;;4BALmD;6BAC7C;gCACK;AAGjB,MAAMA,4BAA4B,CAACC;IAC1CC,IAAAA,2BAAW,EAACD;IACZ,MAAM,EAAEE,WAAW,EAAE,GAAGF;IACxB,OAAO,WAAW,GAAGG,IAAAA,gBAAK,EAACC,oBAAS,EAAE;QAClCC,UAAU;YACN,WAAW,GAAGC,IAAAA,eAAI,EAACN,MAAMO,IAAI,EAAE,CAAC;YAChCP,MAAMQ,YAAY,IAAKN,CAAAA,cAAc,WAAW,GAAGI,IAAAA,eAAI,EAACN,MAAMQ,YAAY,EAAE;gBACxEH,UAAU,WAAW,GAAGC,IAAAA,eAAI,EAACN,MAAMS,QAAQ,EAAE,CAAC;YAClD,KAAK,WAAW,GAAGH,IAAAA,eAAI,EAACI,mBAAM,EAAE;gBAC5BC,WAAWX,MAAMW,SAAS;gBAC1BN,UAAU,WAAW,GAAGC,IAAAA,eAAI,EAACN,MAAMQ,YAAY,EAAE;oBAC7CH,UAAU,WAAW,GAAGC,IAAAA,eAAI,EAACN,MAAMS,QAAQ,EAAE,CAAC;gBAClD;YACJ,EAAC;SACJ;IACL;AACJ"}
1
+ {"version":3,"sources":["renderDatePicker.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Portal } from '@fluentui/react-portal';\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { DatePickerSlots, DatePickerState } from './DatePicker.types';\n\n/**\n * Render the final JSX of DatePicker\n */\nexport const renderDatePicker_unstable = (state: DatePickerState) => {\n assertSlots<DatePickerSlots>(state);\n const { inlinePopup } = state;\n\n return (\n <>\n <state.root />\n {state.popupSurface &&\n (inlinePopup ? (\n <state.popupSurface>\n <state.calendar />\n </state.popupSurface>\n ) : (\n <Portal mountNode={state.mountNode}>\n <state.popupSurface>\n <state.calendar />\n </state.popupSurface>\n </Portal>\n ))}\n </>\n );\n};\n"],"names":["renderDatePicker_unstable","state","assertSlots","inlinePopup","_jsxs","_Fragment","_jsx","root","popupSurface","calendar","Portal","mountNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;4BATb;6BAEuB;gCACK;AAMrB,MAAMA,4BAA4B,CAACC;IACxCC,IAAAA,2BAAAA,EAA6BD;IAC7B,MAAM,EAAEE,WAAW,EAAE,GAAGF;IAExB,OAAA,WAAA,GACEG,IAAAA,gBAAA,EAAAC,oBAAA,EAAA;;0BACEC,IAAAA,eAAA,EAACL,MAAMM,IAAI,EAAA,CAAA;YACVN,MAAMO,YAAY,IAChBL,CAAAA,cAAAA,WAAAA,GACCG,IAAAA,eAAA,EAACL,MAAMO,YAAY,EAAA;0BACjB,WAAA,GAAAF,IAAAA,eAAA,EAACL,MAAMQ,QAAQ,EAAA,CAAA;+BAGjBH,IAAAA,eAAA,EAACI,mBAAAA,EAAAA;gBAAOC,WAAWV,MAAMU,SAAS;0BAChC,WAAA,GAAAL,IAAAA,eAAA,EAACL,MAAMO,YAAY,EAAA;8BACjB,WAAA,GAAAF,IAAAA,eAAA,EAACL,MAAMQ,QAAQ,EAAA,CAAA;;;;;AAM7B"}
@@ -41,6 +41,7 @@ function useFocusLogic() {
41
41
  ];
42
42
  }
43
43
  function usePopupVisibility(props) {
44
+ 'use no memo';
44
45
  const [open, setOpen] = (0, _reactutilities.useControllableState)({
45
46
  initialState: false,
46
47
  defaultState: props.defaultOpen,
@@ -93,6 +94,7 @@ const defaultParseDateFromString = (dateStr)=>{
93
94
  return date ? new Date(date) : null;
94
95
  };
95
96
  const useDatePicker_unstable = (props, ref)=>{
97
+ 'use no memo';
96
98
  const { allowTextInput = false, allFocusable = false, borderless = false, dateTimeFormatter, defaultOpen = false, disableAutoFocus = true, firstDayOfWeek = _reactcalendarcompat.DayOfWeek.Sunday, firstWeekOfYear = _reactcalendarcompat.FirstWeekOfYear.FirstDay, formatDate = defaultFormatDate, highlightCurrentMonth = false, highlightSelectedMonth = false, initialPickerDate: initialPickerDateProp, inlinePopup = false, isMonthPickerVisible = true, maxDate, minDate, mountNode, onOpenChange, onSelectDate: onUserSelectDate, openOnClick = true, onValidationResult, parseDateFromString = defaultParseDateFromString, showCloseButton = false, showGoToToday = true, showMonthPickerAsOverlay = false, showWeekNumbers = false, strings = _defaults.defaultDatePickerStrings, today, underlined = false, value, ...restOfProps } = props;
97
99
  const initialPickerDate = _react.useMemo(()=>initialPickerDateProp !== null && initialPickerDateProp !== void 0 ? initialPickerDateProp : new Date(), [
98
100
  initialPickerDateProp
@@ -309,7 +311,6 @@ const useDatePicker_unstable = (props, ref)=>{
309
311
  const [triggerWrapperRef, popupRef] = (0, _usePopupPositioning.usePopupPositioning)(props);
310
312
  const inputRoot = _reactutilities.slot.always(props.root, {
311
313
  defaultProps: {
312
- 'aria-owns': open ? popupSurfaceId : undefined,
313
314
  ref: triggerWrapperRef
314
315
  },
315
316
  elementType: 'span'
@@ -364,7 +365,7 @@ const useDatePicker_unstable = (props, ref)=>{
364
365
  const { modalAttributes } = (0, _reacttabster.useModalAttributes)({
365
366
  trapFocus: true,
366
367
  alwaysFocusable: true,
367
- legacyTrapFocus: false
368
+ legacyTrapFocus: true
368
369
  });
369
370
  const popupSurface = open ? _reactutilities.slot.optional(props.popupSurface, {
370
371
  renderByDefault: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["useDatePicker.js"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar, compareDatePart, DayOfWeek, FirstWeekOfYear } from '@fluentui/react-calendar-compat';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { defaultDatePickerStrings } from './defaults';\nimport { Input } from '@fluentui/react-input';\nimport { mergeCallbacks, useControllableState, useEventCallback, useId, useMergedRefs, useOnClickOutside, useOnScrollOutside, slot } from '@fluentui/react-utilities';\nimport { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopupPositioning } from '../../utils/usePopupPositioning';\nfunction isDateOutOfBounds(date, minDate, maxDate) {\n return !!minDate && compareDatePart(minDate, date) > 0 || !!maxDate && compareDatePart(maxDate, date) < 0;\n}\nfunction useFocusLogic() {\n const inputRef = React.useRef(null);\n const preventFocusOpeningPicker = React.useRef(false);\n const focus = React.useCallback(()=>{\n var _inputRef_current_focus, _inputRef_current;\n (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : (_inputRef_current_focus = _inputRef_current.focus) === null || _inputRef_current_focus === void 0 ? void 0 : _inputRef_current_focus.call(_inputRef_current);\n }, []);\n const preventNextFocusOpeningPicker = React.useCallback(()=>{\n preventFocusOpeningPicker.current = true;\n }, []);\n return [\n focus,\n inputRef,\n preventFocusOpeningPicker,\n preventNextFocusOpeningPicker\n ];\n}\nfunction usePopupVisibility(props) {\n const [open, setOpen] = useControllableState({\n initialState: false,\n defaultState: props.defaultOpen,\n state: props.open\n });\n const isMounted = React.useRef(false);\n React.useEffect(()=>{\n if (isMounted.current && !open) {\n var // If DatePicker's menu (Calendar) is closed, run onAfterMenuDismiss\n _props_onOpenChange;\n (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(props, false);\n }\n isMounted.current = true;\n }, // Should only run on allowTextInput or open change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n props.allowTextInput,\n open\n ]);\n return [\n open,\n setOpen\n ];\n}\nfunction useSelectedDate({ formatDate, onSelectDate, value }) {\n const [selectedDate, setSelectedDateState] = useControllableState({\n initialState: null,\n state: value\n });\n const [formattedDate, setFormattedDate] = React.useState(()=>value && formatDate ? formatDate(value) : '');\n const setSelectedDate = (newDate)=>{\n onSelectDate === null || onSelectDate === void 0 ? void 0 : onSelectDate(newDate);\n setSelectedDateState(newDate);\n setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');\n };\n React.useEffect(()=>{\n setFormattedDate(value && formatDate ? formatDate(value) : '');\n }, [\n formatDate,\n value\n ]);\n return [\n selectedDate,\n formattedDate,\n setSelectedDate,\n setFormattedDate\n ];\n}\nconst defaultFormatDate = (date)=>date ? date.toDateString() : '';\nconst defaultParseDateFromString = (dateStr)=>{\n const date = Date.parse(dateStr);\n return date ? new Date(date) : null;\n};\n/**\n * Create the state required to render DatePicker.\n *\n * The returned state can be modified with hooks such as useDatePickerStyles_unstable,\n * before being passed to renderDatePicker_unstable.\n *\n * @param props - props from this instance of DatePicker\n * @param ref - reference to root Input slot\n */ export const useDatePicker_unstable = (props, ref)=>{\n const { allowTextInput = false, allFocusable = false, borderless = false, dateTimeFormatter, defaultOpen = false, disableAutoFocus = true, firstDayOfWeek = DayOfWeek.Sunday, firstWeekOfYear = FirstWeekOfYear.FirstDay, formatDate = defaultFormatDate, highlightCurrentMonth = false, highlightSelectedMonth = false, initialPickerDate: initialPickerDateProp, inlinePopup = false, isMonthPickerVisible = true, maxDate, minDate, mountNode, onOpenChange, onSelectDate: onUserSelectDate, openOnClick = true, onValidationResult, parseDateFromString = defaultParseDateFromString, showCloseButton = false, showGoToToday = true, showMonthPickerAsOverlay = false, showWeekNumbers = false, strings = defaultDatePickerStrings, today, underlined = false, value, ...restOfProps } = props;\n const initialPickerDate = React.useMemo(()=>initialPickerDateProp !== null && initialPickerDateProp !== void 0 ? initialPickerDateProp : new Date(), [\n initialPickerDateProp\n ]);\n const calendar = React.useRef(null);\n const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();\n const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({\n formatDate,\n onSelectDate: onUserSelectDate,\n value\n });\n const [open, setOpenState] = usePopupVisibility(props);\n const fieldContext = useFieldContext();\n var _fieldContext_required;\n const required = (_fieldContext_required = fieldContext === null || fieldContext === void 0 ? void 0 : fieldContext.required) !== null && _fieldContext_required !== void 0 ? _fieldContext_required : props.required;\n const defaultId = useId('datePicker-input');\n const popupSurfaceId = useId('datePicker-popupSurface');\n const validateTextInput = React.useCallback((date = null)=>{\n let error;\n if (allowTextInput) {\n if (formattedDate || date) {\n // Don't parse if the selected date has the same formatted string as what we're about to parse.\n // The formatted string might be ambiguous (ex: \"1/2/3\" or \"New Year Eve\") and the parser might\n // not be able to come up with the exact same date.\n if (selectedDate && formatDate && formatDate(date !== null && date !== void 0 ? date : selectedDate) === formattedDate) {\n return;\n }\n date = date || parseDateFromString(formattedDate);\n // Check if date is null or date is an invalid date\n if (!date || isNaN(date.getTime())) {\n // Reset input if formatting is available\n setSelectedDate(selectedDate);\n error = 'invalid-input';\n } else {\n if (isDateOutOfBounds(date, minDate, maxDate)) {\n error = 'out-of-bounds';\n } else {\n setSelectedDate(date);\n }\n }\n } else {\n if (required) {\n error = 'required-input';\n }\n onUserSelectDate === null || onUserSelectDate === void 0 ? void 0 : onUserSelectDate(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n onValidationResult === null || onValidationResult === void 0 ? void 0 : onValidationResult({\n error\n });\n }, [\n allowTextInput,\n formatDate,\n formattedDate,\n maxDate,\n minDate,\n onUserSelectDate,\n onValidationResult,\n parseDateFromString,\n required,\n selectedDate,\n setSelectedDate\n ]);\n const setOpen = React.useCallback((newState)=>{\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(newState);\n setOpenState(newState);\n if (!open && !props.disabled) {\n focus();\n }\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n focus,\n onOpenChange,\n props.disabled,\n setOpenState\n ]);\n const dismissDatePickerPopup = React.useCallback((newlySelectedDate)=>{\n if (open) {\n setOpen(false);\n validateTextInput(newlySelectedDate);\n if (!allowTextInput && newlySelectedDate) {\n setSelectedDate(newlySelectedDate);\n }\n }\n }, [\n allowTextInput,\n open,\n setOpen,\n setSelectedDate,\n validateTextInput\n ]);\n const showDatePickerPopup = React.useCallback(()=>{\n if (!open) {\n preventNextFocusOpeningPicker();\n setOpen(true);\n }\n }, [\n open,\n preventNextFocusOpeningPicker,\n setOpen\n ]);\n /**\n * Callback for closing the calendar callout\n */ const calendarDismissed = React.useCallback((newlySelectedDate)=>{\n preventNextFocusOpeningPicker();\n dismissDatePickerPopup(newlySelectedDate);\n }, [\n dismissDatePickerPopup,\n preventNextFocusOpeningPicker\n ]);\n const onInputChange = React.useCallback((ev, data)=>{\n const { value: newValue } = data;\n if (allowTextInput) {\n if (open) {\n dismissDatePickerPopup();\n }\n setFormattedDate(newValue);\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n setFormattedDate\n ]);\n const onInputBlur = React.useCallback(()=>{\n validateTextInput();\n }, [\n validateTextInput\n ]);\n const onInputKeyDown = React.useCallback((ev)=>{\n switch(ev.key){\n case Enter:\n ev.preventDefault();\n ev.stopPropagation();\n if (!open) {\n validateTextInput();\n showDatePickerPopup();\n } else {\n // When DatePicker allows input date string directly,\n // it is expected to hit another enter to close the popup\n if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n }\n break;\n case Escape:\n ev.stopPropagation();\n ev.preventDefault();\n if (open) {\n calendarDismissed();\n }\n break;\n case ArrowDown:\n ev.preventDefault();\n if (!open) {\n showDatePickerPopup();\n }\n break;\n default:\n break;\n }\n }, [\n calendarDismissed,\n dismissDatePickerPopup,\n open,\n props.allowTextInput,\n showDatePickerPopup,\n validateTextInput\n ]);\n const onInputFocus = React.useCallback(()=>{\n if (disableAutoFocus) {\n return;\n }\n if (!allowTextInput) {\n if (!preventFocusOpeningPicker.current) {\n showDatePickerPopup();\n }\n preventFocusOpeningPicker.current = false;\n }\n }, [\n allowTextInput,\n disableAutoFocus,\n preventFocusOpeningPicker,\n showDatePickerPopup\n ]);\n const onInputClick = React.useCallback(()=>{\n // default openOnClick to !props.disableAutoFocus for legacy support of disableAutoFocus behavior\n if ((props.openOnClick || !props.disableAutoFocus) && !open && !props.disabled) {\n showDatePickerPopup();\n return;\n }\n if (allowTextInput) {\n dismissDatePickerPopup();\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n props.disabled,\n props.disableAutoFocus,\n props.openOnClick,\n showDatePickerPopup\n ]);\n const onIconClick = (ev)=>{\n ev.stopPropagation();\n if (!open && !props.disabled) {\n showDatePickerPopup();\n } else if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n };\n const inputAppearance = underlined ? 'underline' : borderless ? 'filled-lighter' : 'outline';\n const [triggerWrapperRef, popupRef] = usePopupPositioning(props);\n const inputRoot = slot.always(props.root, {\n defaultProps: {\n 'aria-owns': open ? popupSurfaceId : undefined,\n ref: triggerWrapperRef\n },\n elementType: 'span'\n });\n inputRoot.ref = useMergedRefs(inputRoot.ref, triggerWrapperRef);\n const input = slot.always(props.input, {\n elementType: 'input'\n });\n input.ref = useMergedRefs(input.ref, ref, rootRef);\n // Props to create a semantic but non-focusable button on the element with the click-to-open handler\n // Used for voice control and touch screen reader accessibility\n const inputLabelledBy = props['aria-labelledby'];\n var _props_id;\n const inputId = (_props_id = props.id) !== null && _props_id !== void 0 ? _props_id : defaultId;\n const iconA11yProps = React.useMemo(()=>({\n role: 'button',\n 'aria-expanded': open,\n 'aria-labelledby': inputLabelledBy !== null && inputLabelledBy !== void 0 ? inputLabelledBy : inputId\n }), [\n open,\n inputLabelledBy,\n inputId\n ]);\n const contentAfter = slot.always(props.contentAfter || {}, {\n defaultProps: {\n children: /*#__PURE__*/ React.createElement(CalendarMonthRegular, null),\n ...iconA11yProps\n },\n elementType: 'span'\n });\n contentAfter.onClick = useEventCallback(mergeCallbacks(contentAfter.onClick, onIconClick));\n const root = slot.always(restOfProps, {\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n readOnly: !allowTextInput,\n role: 'combobox',\n id: inputId\n },\n elementType: Input\n });\n root.root = inputRoot;\n root.input = input;\n root.contentAfter = contentAfter;\n root.onChange = useEventCallback(mergeCallbacks(root.onChange, onInputChange));\n root.onBlur = useEventCallback(mergeCallbacks(root.onBlur, onInputBlur));\n root.onKeyDown = useEventCallback(mergeCallbacks(root.onKeyDown, onInputKeyDown));\n root.onFocus = useEventCallback(mergeCallbacks(root.onFocus, onInputFocus));\n root.onClick = useEventCallback(mergeCallbacks(root.onClick, onInputClick));\n const { modalAttributes } = useModalAttributes({\n trapFocus: true,\n alwaysFocusable: true,\n legacyTrapFocus: false\n });\n const popupSurface = open ? slot.optional(props.popupSurface, {\n renderByDefault: true,\n defaultProps: {\n 'aria-label': 'Calendar',\n 'aria-modal': true,\n id: popupSurfaceId,\n role: 'dialog',\n ref: popupRef,\n ...modalAttributes\n },\n elementType: 'div'\n }) : undefined;\n const { targetDocument } = useFluent();\n useOnClickOutside({\n element: targetDocument,\n callback: (ev)=>dismissDatePickerPopup(),\n refs: [\n triggerWrapperRef,\n popupRef\n ],\n disabled: !open\n });\n useOnScrollOutside({\n element: targetDocument,\n callback: (ev)=>dismissDatePickerPopup(),\n refs: [\n triggerWrapperRef,\n popupRef\n ],\n disabled: !open\n }); // When the popup is opened, focus should go to the calendar.\n // In v8 this was done by focusing after the callout was positioned, but in v9 this can be simulated by using a\n // useEffect hook.\n React.useEffect(()=>{\n if (open && !props.disabled && calendar.current) {\n calendar.current.focus();\n }\n }, [\n disableAutoFocus,\n open,\n props.disabled\n ]);\n const calendarShorthand = slot.always(props.calendar, {\n defaultProps: {\n allFocusable,\n componentRef: calendar,\n dateTimeFormatter,\n firstDayOfWeek,\n firstWeekOfYear,\n highlightCurrentMonth,\n highlightSelectedMonth,\n isMonthPickerVisible,\n maxDate,\n minDate,\n showCloseButton,\n showGoToToday,\n showMonthPickerAsOverlay,\n showWeekNumbers,\n strings,\n today,\n value: selectedDate || initialPickerDate\n },\n elementType: Calendar\n });\n calendarShorthand.onDismiss = useEventCallback(mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed));\n calendarShorthand.onSelectDate = useEventCallback(mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed));\n const state = {\n disabled: !!props.disabled,\n inlinePopup,\n components: {\n root: Input,\n calendar: Calendar,\n popupSurface: 'div'\n },\n calendar: calendarShorthand,\n mountNode,\n root,\n popupSurface\n };\n state.root.value = formattedDate;\n return state;\n};\n"],"names":["useDatePicker_unstable","isDateOutOfBounds","date","minDate","maxDate","compareDatePart","useFocusLogic","inputRef","React","useRef","preventFocusOpeningPicker","focus","useCallback","_inputRef_current_focus","_inputRef_current","current","call","preventNextFocusOpeningPicker","usePopupVisibility","props","open","setOpen","useControllableState","initialState","defaultState","defaultOpen","state","isMounted","useEffect","_props_onOpenChange","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","ref","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","DayOfWeek","Sunday","firstWeekOfYear","FirstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","initialPickerDateProp","inlinePopup","isMonthPickerVisible","mountNode","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","defaultDatePickerStrings","today","underlined","restOfProps","useMemo","calendar","rootRef","setOpenState","fieldContext","useFieldContext","_fieldContext_required","required","defaultId","useId","popupSurfaceId","validateTextInput","error","isNaN","getTime","newState","disabled","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","Enter","preventDefault","stopPropagation","Escape","ArrowDown","onInputFocus","onInputClick","onIconClick","inputAppearance","triggerWrapperRef","popupRef","usePopupPositioning","inputRoot","slot","always","root","defaultProps","undefined","elementType","useMergedRefs","input","inputLabelledBy","_props_id","inputId","id","iconA11yProps","role","contentAfter","children","createElement","CalendarMonthRegular","onClick","useEventCallback","mergeCallbacks","appearance","readOnly","Input","onChange","onBlur","onKeyDown","onFocus","modalAttributes","useModalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurface","optional","renderByDefault","targetDocument","useFluent","useOnClickOutside","element","callback","refs","useOnScrollOutside","calendarShorthand","componentRef","Calendar","onDismiss","components"],"mappings":";;;;+BA6FiBA;;;eAAAA;;;;iEA7FM;8BACkB;qCAC6B;4BACjC;0BACI;4BACnB;gCACoH;4BAC9E;qCACZ;8BACb;qCACC;AACpC,SAASC,kBAAkBC,IAAI,EAAEC,OAAO,EAAEC,OAAO;IAC7C,OAAO,CAAC,CAACD,WAAWE,IAAAA,oCAAe,EAACF,SAASD,QAAQ,KAAK,CAAC,CAACE,WAAWC,IAAAA,oCAAe,EAACD,SAASF,QAAQ;AAC5G;AACA,SAASI;IACL,MAAMC,WAAWC,OAAMC,MAAM,CAAC;IAC9B,MAAMC,4BAA4BF,OAAMC,MAAM,CAAC;IAC/C,MAAME,QAAQH,OAAMI,WAAW,CAAC;QAC5B,IAAIC,yBAAyBC;QAC5BA,CAAAA,oBAAoBP,SAASQ,OAAO,AAAD,MAAO,QAAQD,sBAAsB,KAAK,IAAI,KAAK,IAAI,AAACD,CAAAA,0BAA0BC,kBAAkBH,KAAK,AAAD,MAAO,QAAQE,4BAA4B,KAAK,IAAI,KAAK,IAAIA,wBAAwBG,IAAI,CAACF;IAC1O,GAAG,EAAE;IACL,MAAMG,gCAAgCT,OAAMI,WAAW,CAAC;QACpDF,0BAA0BK,OAAO,GAAG;IACxC,GAAG,EAAE;IACL,OAAO;QACHJ;QACAJ;QACAG;QACAO;KACH;AACL;AACA,SAASC,mBAAmBC,KAAK;IAC7B,MAAM,CAACC,MAAMC,QAAQ,GAAGC,IAAAA,oCAAoB,EAAC;QACzCC,cAAc;QACdC,cAAcL,MAAMM,WAAW;QAC/BC,OAAOP,MAAMC,IAAI;IACrB;IACA,MAAMO,YAAYnB,OAAMC,MAAM,CAAC;IAC/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;KACjB;IACD,MAAMoE,oBAAoB3C,oBAAI,CAACC,MAAM,CAACvG,MAAM8D,QAAQ,EAAE;QAClD2C,cAAc;YACV1E;YACAmH,cAAcpF;YACd7B;YACAE;YACAG;YACAG;YACAC;YACAI;YACA7D;YACAD;YACAoE;YACAC;YACAC;YACAC;YACAC;YACAE;YACA1C,OAAOC,gBAAgB0B;QAC3B;QACAgE,aAAawC,6BAAQ;IACzB;IACAF,kBAAkBG,SAAS,GAAG3B,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACuB,kBAAkBG,SAAS,EAAEnE;IAC3FgE,kBAAkBlI,YAAY,GAAG0G,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACuB,kBAAkBlI,YAAY,EAAEkE;IACjG,MAAM1E,QAAQ;QACVsE,UAAU,CAAC,CAAC7E,MAAM6E,QAAQ;QAC1BhC;QACAwG,YAAY;YACR7C,MAAMqB,iBAAK;YACX/D,UAAUqF,6BAAQ;YAClBZ,cAAc;QAClB;QACAzE,UAAUmF;QACVlG;QACAyD;QACA+B;IACJ;IACAhI,MAAMiG,IAAI,CAACxF,KAAK,GAAGG;IACnB,OAAOZ;AACX"}
1
+ {"version":3,"sources":["useDatePicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar, compareDatePart, DayOfWeek, FirstWeekOfYear } from '@fluentui/react-calendar-compat';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { defaultDatePickerStrings } from './defaults';\nimport { Input } from '@fluentui/react-input';\nimport {\n mergeCallbacks,\n useControllableState,\n useEventCallback,\n useId,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n slot,\n} from '@fluentui/react-utilities';\nimport { useFieldContext_unstable as useFieldContext } from '@fluentui/react-field';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopupPositioning } from '../../utils/usePopupPositioning';\nimport type { CalendarProps, ICalendar } from '@fluentui/react-calendar-compat';\nimport type { DatePickerProps, DatePickerState, DatePickerValidationResultData } from './DatePicker.types';\nimport type { InputProps, InputOnChangeData } from '@fluentui/react-input';\n\nfunction isDateOutOfBounds(date: Date, minDate?: Date, maxDate?: Date): boolean {\n return (!!minDate && compareDatePart(minDate!, date) > 0) || (!!maxDate && compareDatePart(maxDate!, date) < 0);\n}\n\nfunction useFocusLogic() {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const preventFocusOpeningPicker = React.useRef(false);\n\n const focus = React.useCallback(() => {\n inputRef.current?.focus?.();\n }, []);\n\n const preventNextFocusOpeningPicker = React.useCallback(() => {\n preventFocusOpeningPicker.current = true;\n }, []);\n\n return [focus, inputRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] as const;\n}\n\nfunction usePopupVisibility(props: DatePickerProps) {\n 'use no memo';\n\n const [open, setOpen] = useControllableState({\n initialState: false,\n defaultState: props.defaultOpen,\n state: props.open,\n });\n const isMounted = React.useRef(false);\n\n React.useEffect(\n () => {\n if (isMounted.current && !open) {\n // If DatePicker's menu (Calendar) is closed, run onAfterMenuDismiss\n props.onOpenChange?.(false);\n }\n isMounted.current = true;\n },\n // Should only run on allowTextInput or open change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.allowTextInput, open],\n );\n\n return [open, setOpen] as const;\n}\n\nfunction useSelectedDate({ formatDate, onSelectDate, value }: DatePickerProps) {\n const [selectedDate, setSelectedDateState] = useControllableState<Date | null | undefined>({\n initialState: null,\n state: value,\n });\n const [formattedDate, setFormattedDate] = React.useState(() => (value && formatDate ? formatDate(value) : ''));\n\n const setSelectedDate = (newDate: Date | null | undefined) => {\n onSelectDate?.(newDate);\n setSelectedDateState(newDate);\n setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');\n };\n\n React.useEffect(() => {\n setFormattedDate(value && formatDate ? formatDate(value) : '');\n }, [formatDate, value]);\n\n return [selectedDate, formattedDate, setSelectedDate, setFormattedDate] as const;\n}\n\nconst defaultFormatDate = (date?: Date) => (date ? date.toDateString() : '');\nconst defaultParseDateFromString = (dateStr: string) => {\n const date = Date.parse(dateStr);\n return date ? new Date(date) : null;\n};\n\n/**\n * Create the state required to render DatePicker.\n *\n * The returned state can be modified with hooks such as useDatePickerStyles_unstable,\n * before being passed to renderDatePicker_unstable.\n *\n * @param props - props from this instance of DatePicker\n * @param ref - reference to root Input slot\n */\nexport const useDatePicker_unstable = (props: DatePickerProps, ref: React.Ref<HTMLInputElement>): DatePickerState => {\n 'use no memo';\n\n const {\n allowTextInput = false,\n allFocusable = false,\n borderless = false,\n dateTimeFormatter,\n defaultOpen = false,\n disableAutoFocus = true,\n firstDayOfWeek = DayOfWeek.Sunday,\n firstWeekOfYear = FirstWeekOfYear.FirstDay,\n formatDate = defaultFormatDate,\n highlightCurrentMonth = false,\n highlightSelectedMonth = false,\n initialPickerDate: initialPickerDateProp,\n inlinePopup = false,\n isMonthPickerVisible = true,\n maxDate,\n minDate,\n mountNode,\n onOpenChange,\n onSelectDate: onUserSelectDate,\n openOnClick = true,\n onValidationResult,\n parseDateFromString = defaultParseDateFromString,\n showCloseButton = false,\n showGoToToday = true,\n showMonthPickerAsOverlay = false,\n showWeekNumbers = false,\n strings = defaultDatePickerStrings,\n today,\n underlined = false,\n value,\n ...restOfProps\n } = props;\n\n const initialPickerDate = React.useMemo(() => initialPickerDateProp ?? new Date(), [initialPickerDateProp]);\n\n const calendar = React.useRef<ICalendar>(null);\n const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();\n const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({\n formatDate,\n onSelectDate: onUserSelectDate,\n value,\n });\n const [open, setOpenState] = usePopupVisibility(props);\n const fieldContext = useFieldContext();\n const required = fieldContext?.required ?? props.required;\n const defaultId = useId('datePicker-input');\n const popupSurfaceId = useId('datePicker-popupSurface');\n\n const validateTextInput = React.useCallback(\n (date: Date | null = null): void => {\n let error: DatePickerValidationResultData['error'];\n\n if (allowTextInput) {\n if (formattedDate || date) {\n // Don't parse if the selected date has the same formatted string as what we're about to parse.\n // The formatted string might be ambiguous (ex: \"1/2/3\" or \"New Year Eve\") and the parser might\n // not be able to come up with the exact same date.\n if (selectedDate && formatDate && formatDate(date ?? selectedDate) === formattedDate) {\n return;\n }\n date = date || parseDateFromString!(formattedDate);\n\n // Check if date is null or date is an invalid date\n if (!date || isNaN(date.getTime())) {\n // Reset input if formatting is available\n setSelectedDate(selectedDate);\n error = 'invalid-input';\n } else {\n if (isDateOutOfBounds(date, minDate, maxDate)) {\n error = 'out-of-bounds';\n } else {\n setSelectedDate(date);\n }\n }\n } else {\n if (required) {\n error = 'required-input';\n }\n\n onUserSelectDate?.(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n\n onValidationResult?.({ error });\n },\n [\n allowTextInput,\n formatDate,\n formattedDate,\n maxDate,\n minDate,\n onUserSelectDate,\n onValidationResult,\n parseDateFromString,\n required,\n selectedDate,\n setSelectedDate,\n ],\n );\n\n const setOpen = React.useCallback(\n (newState: boolean) => {\n onOpenChange?.(newState);\n setOpenState(newState);\n\n if (!open && !props.disabled) {\n focus();\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [focus, onOpenChange, props.disabled, setOpenState],\n );\n\n const dismissDatePickerPopup = React.useCallback(\n (newlySelectedDate?: Date | null): void => {\n if (open) {\n setOpen(false);\n\n validateTextInput(newlySelectedDate);\n if (!allowTextInput && newlySelectedDate) {\n setSelectedDate(newlySelectedDate);\n }\n }\n },\n [allowTextInput, open, setOpen, setSelectedDate, validateTextInput],\n );\n\n const showDatePickerPopup = React.useCallback((): void => {\n if (!open) {\n preventNextFocusOpeningPicker();\n setOpen(true);\n }\n }, [open, preventNextFocusOpeningPicker, setOpen]);\n\n /**\n * Callback for closing the calendar callout\n */\n const calendarDismissed = React.useCallback(\n (newlySelectedDate?: Date): void => {\n preventNextFocusOpeningPicker();\n dismissDatePickerPopup(newlySelectedDate);\n },\n [dismissDatePickerPopup, preventNextFocusOpeningPicker],\n );\n\n const onInputChange = React.useCallback(\n (ev: React.ChangeEvent<HTMLInputElement>, data: InputOnChangeData) => {\n const { value: newValue } = data;\n\n if (allowTextInput) {\n if (open) {\n dismissDatePickerPopup();\n }\n\n setFormattedDate(newValue);\n }\n },\n [allowTextInput, dismissDatePickerPopup, open, setFormattedDate],\n );\n\n const onInputBlur: React.FocusEventHandler<HTMLInputElement> = React.useCallback((): void => {\n validateTextInput();\n }, [validateTextInput]);\n\n const onInputKeyDown = React.useCallback(\n (ev: React.KeyboardEvent<HTMLElement>): void => {\n switch (ev.key) {\n case Enter:\n ev.preventDefault();\n ev.stopPropagation();\n if (!open) {\n validateTextInput();\n showDatePickerPopup();\n } else {\n // When DatePicker allows input date string directly,\n // it is expected to hit another enter to close the popup\n if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n }\n break;\n\n case Escape:\n ev.stopPropagation();\n ev.preventDefault();\n if (open) {\n calendarDismissed();\n }\n break;\n\n case ArrowDown:\n ev.preventDefault();\n if (!open) {\n showDatePickerPopup();\n }\n break;\n\n default:\n break;\n }\n },\n [calendarDismissed, dismissDatePickerPopup, open, props.allowTextInput, showDatePickerPopup, validateTextInput],\n );\n\n const onInputFocus: React.FocusEventHandler<HTMLInputElement> = React.useCallback((): void => {\n if (disableAutoFocus) {\n return;\n }\n\n if (!allowTextInput) {\n if (!preventFocusOpeningPicker.current) {\n showDatePickerPopup();\n }\n preventFocusOpeningPicker.current = false;\n }\n }, [allowTextInput, disableAutoFocus, preventFocusOpeningPicker, showDatePickerPopup]);\n\n const onInputClick: React.MouseEventHandler<HTMLInputElement> = React.useCallback((): void => {\n // default openOnClick to !props.disableAutoFocus for legacy support of disableAutoFocus behavior\n if ((props.openOnClick || !props.disableAutoFocus) && !open && !props.disabled) {\n showDatePickerPopup();\n return;\n }\n\n if (allowTextInput) {\n dismissDatePickerPopup();\n }\n }, [\n allowTextInput,\n dismissDatePickerPopup,\n open,\n props.disabled,\n props.disableAutoFocus,\n props.openOnClick,\n showDatePickerPopup,\n ]);\n\n const onIconClick = (ev: React.MouseEvent<HTMLElement>): void => {\n ev.stopPropagation();\n if (!open && !props.disabled) {\n showDatePickerPopup();\n } else if (props.allowTextInput) {\n dismissDatePickerPopup();\n }\n };\n\n const inputAppearance: InputProps['appearance'] = underlined\n ? 'underline'\n : borderless\n ? 'filled-lighter'\n : 'outline';\n\n const [triggerWrapperRef, popupRef] = usePopupPositioning(props);\n\n const inputRoot = slot.always(props.root, {\n defaultProps: {\n ref: triggerWrapperRef,\n },\n elementType: 'span',\n });\n inputRoot.ref = useMergedRefs(inputRoot.ref, triggerWrapperRef);\n\n const input = slot.always(props.input, {\n elementType: 'input',\n });\n input.ref = useMergedRefs(input.ref, ref, rootRef);\n\n // Props to create a semantic but non-focusable button on the element with the click-to-open handler\n // Used for voice control and touch screen reader accessibility\n const inputLabelledBy = props['aria-labelledby'];\n const inputId = props.id ?? defaultId;\n const iconA11yProps = React.useMemo(\n () => ({\n role: 'button',\n 'aria-expanded': open,\n 'aria-labelledby': inputLabelledBy ?? inputId,\n }),\n [open, inputLabelledBy, inputId],\n );\n\n const contentAfter = slot.always(props.contentAfter || {}, {\n defaultProps: {\n children: <CalendarMonthRegular />,\n ...iconA11yProps,\n },\n elementType: 'span',\n });\n contentAfter.onClick = useEventCallback(mergeCallbacks(contentAfter.onClick, onIconClick));\n\n const root = slot.always(restOfProps, {\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n readOnly: !allowTextInput,\n role: 'combobox',\n id: inputId,\n },\n elementType: Input,\n });\n root.root = inputRoot;\n root.input = input;\n root.contentAfter = contentAfter;\n root.onChange = useEventCallback(mergeCallbacks(root.onChange, onInputChange));\n root.onBlur = useEventCallback(mergeCallbacks(root.onBlur, onInputBlur));\n root.onKeyDown = useEventCallback(mergeCallbacks(root.onKeyDown, onInputKeyDown));\n root.onFocus = useEventCallback(mergeCallbacks(root.onFocus, onInputFocus));\n root.onClick = useEventCallback(mergeCallbacks(root.onClick, onInputClick));\n\n const { modalAttributes } = useModalAttributes({ trapFocus: true, alwaysFocusable: true, legacyTrapFocus: true });\n const popupSurface = open\n ? slot.optional(props.popupSurface, {\n renderByDefault: true,\n defaultProps: {\n 'aria-label': 'Calendar',\n 'aria-modal': true,\n id: popupSurfaceId,\n role: 'dialog',\n ref: popupRef,\n ...modalAttributes,\n },\n elementType: 'div',\n })\n : undefined;\n const { targetDocument } = useFluent();\n useOnClickOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open,\n });\n useOnScrollOutside({\n element: targetDocument,\n callback: ev => dismissDatePickerPopup(),\n refs: [triggerWrapperRef, popupRef],\n disabled: !open,\n }); // When the popup is opened, focus should go to the calendar.\n // In v8 this was done by focusing after the callout was positioned, but in v9 this can be simulated by using a\n // useEffect hook.\n React.useEffect(() => {\n if (open && !props.disabled && calendar.current) {\n calendar.current.focus();\n }\n }, [disableAutoFocus, open, props.disabled]);\n const calendarShorthand = slot.always(props.calendar, {\n defaultProps: {\n allFocusable,\n componentRef: calendar,\n dateTimeFormatter,\n firstDayOfWeek,\n firstWeekOfYear,\n highlightCurrentMonth,\n highlightSelectedMonth,\n isMonthPickerVisible,\n maxDate,\n minDate,\n showCloseButton,\n showGoToToday,\n showMonthPickerAsOverlay,\n showWeekNumbers,\n strings,\n today,\n value: selectedDate || initialPickerDate,\n },\n elementType: Calendar,\n });\n calendarShorthand.onDismiss = useEventCallback(mergeCallbacks(calendarShorthand.onDismiss, calendarDismissed));\n calendarShorthand.onSelectDate = useEventCallback(mergeCallbacks(calendarShorthand.onSelectDate, calendarDismissed));\n const state: DatePickerState = {\n disabled: !!props.disabled,\n inlinePopup,\n components: { root: Input, calendar: Calendar as React.FC<Partial<CalendarProps>>, popupSurface: 'div' },\n calendar: calendarShorthand,\n mountNode,\n root,\n popupSurface,\n };\n\n state.root.value = formattedDate;\n\n return state;\n};\n"],"names":["useDatePicker_unstable","isDateOutOfBounds","date","minDate","maxDate","compareDatePart","useFocusLogic","inputRef","React","useRef","preventFocusOpeningPicker","focus","useCallback","current","preventNextFocusOpeningPicker","usePopupVisibility","props","open","setOpen","useControllableState","initialState","defaultState","defaultOpen","state","isMounted","useEffect","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","ref","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","DayOfWeek","Sunday","firstWeekOfYear","FirstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","initialPickerDateProp","inlinePopup","isMonthPickerVisible","mountNode","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","defaultDatePickerStrings","today","underlined","restOfProps","useMemo","calendar","rootRef","setOpenState","fieldContext","useFieldContext","required","defaultId","useId","popupSurfaceId","validateTextInput","error","isNaN","getTime","newState","disabled","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","Enter","preventDefault","stopPropagation","Escape","ArrowDown","onInputFocus","onInputClick","onIconClick","inputAppearance","triggerWrapperRef","popupRef","usePopupPositioning","inputRoot","slot","always","root","defaultProps","elementType","useMergedRefs","input","inputLabelledBy","inputId","id","iconA11yProps","role","contentAfter","children","createElement","CalendarMonthRegular","onClick","useEventCallback","mergeCallbacks","appearance","undefined","readOnly","Input","onChange","onBlur","onKeyDown","onFocus","modalAttributes","useModalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurface","optional","renderByDefault","targetDocument","useFluent","useOnClickOutside","element","callback","refs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MAAM+F,IAAI,CAACvF,KAAK,GAAGG;IAEnB,OAAOX;AACT"}
@@ -49,6 +49,7 @@ const usePopupSurfaceClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r1ytv1
49
49
  ".r1ytv1z8{background-color:var(--colorNeutralBackground1);box-shadow:var(--shadow16);border-radius:var(--borderRadiusMedium);border-width:1px;border-style:solid;border-color:var(--colorTransparentStroke);display:inline-flex;color:var(--colorNeutralForeground1);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);}"
50
50
  ]);
51
51
  const useDatePickerStyles_unstable = (state)=>{
52
+ 'use no memo';
52
53
  const styles = useStyles();
53
54
  const popupSurfaceClassName = usePopupSurfaceClassName();
54
55
  const { disabled, inlinePopup } = state;
@@ -1 +1 @@
1
- {"version":3,"sources":["useDatePickerStyles.styles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const datePickerClassNames = {\n root: 'fui-DatePicker',\n calendar: 'fui-DatePicker__calendar',\n popupSurface: 'fui-DatePicker__popupSurface'\n};\nconst useStyles = /*#__PURE__*/__styles({\n base: {\n qhf8xq: \"f10pi13n\",\n Bceei9c: \"f1k6fduh\",\n xfaavh: \"faxec97\"\n },\n disabled: {\n Bceei9c: \"f158kwzp\",\n xfaavh: \"f19qwlmg\"\n },\n inline: {\n Bj3rh1h: \"f19g0ac\"\n }\n}, {\n d: [\".f10pi13n{position:relative;}\", \".f1k6fduh{cursor:pointer;}\", \".faxec97 input{cursor:pointer;}\", \".f158kwzp{cursor:default;}\", \".f19qwlmg input{cursor:default;}\", \".f19g0ac{z-index:1;}\"]\n});\nconst usePopupSurfaceClassName = /*#__PURE__*/__resetStyles(\"r1ytv1z8\", null, [\".r1ytv1z8{background-color:var(--colorNeutralBackground1);box-shadow:var(--shadow16);border-radius:var(--borderRadiusMedium);border-width:1px;border-style:solid;border-color:var(--colorTransparentStroke);display:inline-flex;color:var(--colorNeutralForeground1);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase300);}\"]);\n/**\n * Apply styling to the DatePicker slots based on the state\n */\nexport const useDatePickerStyles_unstable = state => {\n const styles = useStyles();\n const popupSurfaceClassName = usePopupSurfaceClassName();\n const {\n disabled,\n inlinePopup\n } = state;\n state.root.className = mergeClasses(datePickerClassNames.root, styles.base, disabled && styles.disabled, state.root.className);\n if (state.popupSurface) {\n state.popupSurface.className = mergeClasses(datePickerClassNames.popupSurface, popupSurfaceClassName, state.popupSurface.className, inlinePopup && styles.inline);\n }\n state.calendar.className = mergeClasses(datePickerClassNames.calendar, state.calendar.className);\n return state;\n};\n//# sourceMappingURL=useDatePickerStyles.styles.js.map"],"names":["datePickerClassNames","useDatePickerStyles_unstable","root","calendar","popupSurface","useStyles","__styles","base","qhf8xq","Bceei9c","xfaavh","disabled","inline","Bj3rh1h","d","usePopupSurfaceClassName","__resetStyles","state","styles","popupSurfaceClassName","inlinePopup","className","mergeClasses"],"mappings":";;;;;;;;;;;IAEaA,oBAAoB;eAApBA;;IAyBAC,4BAA4B;eAA5BA;;;uBA3ByC;AAE/C,MAAMD,uBAAuB;IAClCE,MAAM;IACNC,UAAU;IACVC,cAAc;AAChB;AACA,MAAMC,YAAY,WAAW,GAAEC,IAAAA,eAAQ,EAAC;IACtCC,MAAM;QACJC,QAAQ;QACRC,SAAS;QACTC,QAAQ;IACV;IACAC,UAAU;QACRF,SAAS;QACTC,QAAQ;IACV;IACAE,QAAQ;QACNC,SAAS;IACX;AACF,GAAG;IACDC,GAAG;QAAC;QAAiC;QAA8B;QAAmC;QAA8B;QAAoC;KAAuB;AACjM;AACA,MAAMC,2BAA2B,WAAW,GAAEC,IAAAA,oBAAa,EAAC,YAAY,MAAM;IAAC;CAAsZ;AAI9d,MAAMf,+BAA+BgB,CAAAA;IAC1C,MAAMC,SAASb;IACf,MAAMc,wBAAwBJ;IAC9B,MAAM,EACJJ,QAAQ,EACRS,WAAW,EACZ,GAAGH;IACJA,MAAMf,IAAI,CAACmB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,qBAAqBE,IAAI,EAAEgB,OAAOX,IAAI,EAAEI,YAAYO,OAAOP,QAAQ,EAAEM,MAAMf,IAAI,CAACmB,SAAS;IAC7H,IAAIJ,MAAMb,YAAY,EAAE;QACtBa,MAAMb,YAAY,CAACiB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,qBAAqBI,YAAY,EAAEe,uBAAuBF,MAAMb,YAAY,CAACiB,SAAS,EAAED,eAAeF,OAAON,MAAM;IAClK;IACAK,MAAMd,QAAQ,CAACkB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,qBAAqBG,QAAQ,EAAEc,MAAMd,QAAQ,CAACkB,SAAS;IAC/F,OAAOJ;AACT,GACA,sDAAsD"}
1
+ {"version":3,"sources":["useDatePickerStyles.styles.js"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nexport const datePickerClassNames = {\n root: 'fui-DatePicker',\n calendar: 'fui-DatePicker__calendar',\n popupSurface: 'fui-DatePicker__popupSurface'\n};\nconst useStyles = makeStyles({\n base: {\n position: 'relative',\n cursor: 'pointer',\n '& input': {\n cursor: 'pointer'\n }\n },\n disabled: {\n cursor: 'default',\n '& input': {\n cursor: 'default'\n }\n },\n inline: {\n // When rendering inline, the popupSurface will be rendered under relatively positioned elements such as Input.\n // This is due to the surface being positioned as absolute, therefore zIndex: 1 ensures that won't happen.\n zIndex: 1\n }\n});\nconst usePopupSurfaceClassName = makeResetStyles({\n backgroundColor: tokens.colorNeutralBackground1,\n boxShadow: tokens.shadow16,\n borderRadius: tokens.borderRadiusMedium,\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: tokens.colorTransparentStroke,\n display: 'inline-flex',\n color: tokens.colorNeutralForeground1,\n ...typographyStyles.body1\n});\n/**\n * Apply styling to the DatePicker slots based on the state\n */ export const useDatePickerStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n const popupSurfaceClassName = usePopupSurfaceClassName();\n const { disabled, inlinePopup } = state;\n state.root.className = mergeClasses(datePickerClassNames.root, styles.base, disabled && styles.disabled, state.root.className);\n if (state.popupSurface) {\n state.popupSurface.className = mergeClasses(datePickerClassNames.popupSurface, popupSurfaceClassName, state.popupSurface.className, inlinePopup && styles.inline);\n }\n state.calendar.className = mergeClasses(datePickerClassNames.calendar, state.calendar.className);\n return state;\n};\n"],"names":["datePickerClassNames","useDatePickerStyles_unstable","root","calendar","popupSurface","useStyles","__styles","base","qhf8xq","Bceei9c","xfaavh","disabled","inline","Bj3rh1h","d","usePopupSurfaceClassName","__resetStyles","state","styles","popupSurfaceClassName","inlinePopup","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,oBAAoB;eAApBA;;IAsCIC,4BAA4B;eAA5BA;;;uBAxCyC;AAEnD,MAAMD,uBAAuB;IAChCE,MAAM;IACNC,UAAU;IACVC,cAAc;AAClB;AACA,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,MAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;IAAA;IAAAC,UAAA;QAAAF,SAAA;QAAAC,QAAA;IAAA;IAAAE,QAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAoBlB,MAAMC,2BAAwB,WAAA,GAAGC,IAAAA,oBAAA,EAAA,YAAA,MAAA;IAAA;CAUhC;AAGU,MAAMf,+BAAgCgB,CAAAA;IAC7C;IACA,MAAMC,SAASb;IACf,MAAMc,wBAAwBJ;IAC9B,MAAM,EAAEJ,QAAQ,EAAES,WAAAA,EAAa,GAAGH;IAClCA,MAAMf,IAAI,CAACmB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,qBAAqBE,IAAI,EAAEgB,OAAOX,IAAI,EAAEI,YAAYO,OAAOP,QAAQ,EAAEM,MAAMf,IAAI,CAACmB,SAAS;IAC7H,IAAIJ,MAAMb,YAAY,EAAE;QACpBa,MAAMb,YAAY,CAACiB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,qBAAqBI,YAAY,EAAEe,uBAAuBF,MAAMb,YAAY,CAACiB,SAAS,EAAED,eAAeF,OAAON,MAAM;IACpK;IACAK,MAAMd,QAAQ,CAACkB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,qBAAqBG,QAAQ,EAAEc,MAAMd,QAAQ,CAACkB,SAAS;IAC/F,OAAOJ;AACX"}
@@ -24,11 +24,11 @@ _export(exports, {
24
24
  renderDatePicker_unstable: function() {
25
25
  return _DatePicker.renderDatePicker_unstable;
26
26
  },
27
- useDatePicker_unstable: function() {
28
- return _DatePicker.useDatePicker_unstable;
29
- },
30
27
  useDatePickerStyles_unstable: function() {
31
28
  return _DatePicker.useDatePickerStyles_unstable;
29
+ },
30
+ useDatePicker_unstable: function() {
31
+ return _DatePicker.useDatePicker_unstable;
32
32
  }
33
33
  });
34
34
  const _DatePicker = require("./DatePicker");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export { DatePicker, datePickerClassNames, defaultDatePickerErrorStrings, defaultDatePickerStrings, renderDatePicker_unstable, useDatePicker_unstable, useDatePickerStyles_unstable } from './DatePicker';\n"],"names":["DatePicker","datePickerClassNames","defaultDatePickerErrorStrings","defaultDatePickerStrings","renderDatePicker_unstable","useDatePicker_unstable","useDatePickerStyles_unstable"],"mappings":";;;;;;;;;;;IAASA,UAAU;eAAVA,sBAAU;;IAAEC,oBAAoB;eAApBA,gCAAoB;;IAAEC,6BAA6B;eAA7BA,yCAA6B;;IAAEC,wBAAwB;eAAxBA,oCAAwB;;IAAEC,yBAAyB;eAAzBA,qCAAyB;;IAAEC,sBAAsB;eAAtBA,kCAAsB;;IAAEC,4BAA4B;eAA5BA,wCAA4B;;;4BAAQ"}
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export {\n DatePicker,\n datePickerClassNames,\n defaultDatePickerErrorStrings,\n defaultDatePickerStrings,\n renderDatePicker_unstable,\n useDatePicker_unstable,\n useDatePickerStyles_unstable,\n} from './DatePicker';\nexport type { DatePickerErrorType, DatePickerProps, DatePickerValidationResultData } from './DatePicker';\n// Re-exporting so there's no need to add @fluentui/react-calendar-compat to dependencies just to localize.\nexport type { CalendarStrings } from '@fluentui/react-calendar-compat';\n"],"names":["DatePicker","datePickerClassNames","defaultDatePickerErrorStrings","defaultDatePickerStrings","renderDatePicker_unstable","useDatePickerStyles_unstable","useDatePicker_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACEA,UAAU;eAAVA,sBAAU;;IACVC,oBAAoB;eAApBA,gCAAoB;;IACpBC,6BAA6B;eAA7BA,yCAA6B;;IAC7BC,wBAAwB;eAAxBA,oCAAwB;;IACxBC,yBAAyB;eAAzBA,qCAAyB;;IAEzBC,4BAA4B;eAA5BA,wCAA4B;;IAD5BC,sBAAsB;eAAtBA,kCAAsB;;;4BAEjB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["usePopupPositioning.js"],"sourcesContent":["import * as React from 'react';\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\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 */ export function usePopupPositioning(props) {\n const { positioning } = props;\n const popupOptions = {\n position: 'below',\n align: 'start',\n ...resolvePositioningShorthand(positioning)\n };\n const { targetRef, containerRef } = usePositioning(popupOptions);\n return [\n targetRef,\n containerRef\n ];\n}\n"],"names":["usePopupPositioning","props","positioning","popupOptions","position","align","resolvePositioningShorthand","targetRef","containerRef","usePositioning"],"mappings":";;;;+BAQoBA;;;eAAAA;;;;iEARG;kCACqC;AAOjD,SAASA,oBAAoBC,KAAK;IACzC,MAAM,EAAEC,WAAW,EAAE,GAAGD;IACxB,MAAME,eAAe;QACjBC,UAAU;QACVC,OAAO;QACP,GAAGC,IAAAA,6CAA2B,EAACJ,YAAY;IAC/C;IACA,MAAM,EAAEK,SAAS,EAAEC,YAAY,EAAE,GAAGC,IAAAA,gCAAc,EAACN;IACnD,OAAO;QACHI;QACAC;KACH;AACL"}
1
+ {"version":3,"sources":["usePopupPositioning.ts"],"sourcesContent":["import * 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): [triggerRef: React.MutableRefObject<HTMLElement>, popupRef: React.MutableRefObject<HTMLDivElement>] {\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":["usePopupPositioning","props","positioning","popupOptions","position","align","resolvePositioningShorthand","targetRef","containerRef","usePositioning"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWgBA;;;eAAAA;;;;iEAXO;kCACqC;AAUrD,SAASA,oBACdC,KAAsB;IAEtB,MAAM,EAAEC,WAAW,EAAE,GAAGD;IAExB,MAAME,eAAe;QACnBC,UAAU;QACVC,OAAO;QACP,GAAGC,IAAAA,6CAAAA,EAA4BJ,YAAY;IAC7C;IAEA,MAAM,EAAEK,SAAS,EAAEC,YAAY,EAAE,GAAGC,IAAAA,gCAAAA,EAAeN;IAEnD,OAAO;QAACI;QAAWC;KAAa;AAClC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-datepicker-compat",
3
- "version": "0.4.41",
3
+ "version": "0.4.43",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -36,18 +36,18 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@fluentui/keyboard-keys": "^9.0.7",
39
- "@fluentui/react-calendar-compat": "^0.1.11",
40
- "@fluentui/react-field": "^9.1.68",
41
- "@fluentui/react-icons": "^2.0.239",
42
- "@fluentui/react-input": "^9.4.79",
43
- "@fluentui/react-jsx-runtime": "^9.0.39",
44
- "@fluentui/react-popover": "^9.9.12",
45
- "@fluentui/react-portal": "^9.4.28",
46
- "@fluentui/react-positioning": "^9.15.3",
39
+ "@fluentui/react-calendar-compat": "^0.1.12",
40
+ "@fluentui/react-field": "^9.1.69",
41
+ "@fluentui/react-icons": "^2.0.245",
42
+ "@fluentui/react-input": "^9.4.81",
43
+ "@fluentui/react-jsx-runtime": "^9.0.40",
44
+ "@fluentui/react-popover": "^9.9.13",
45
+ "@fluentui/react-portal": "^9.4.29",
46
+ "@fluentui/react-positioning": "^9.15.4",
47
47
  "@fluentui/react-shared-contexts": "^9.19.0",
48
- "@fluentui/react-tabster": "^9.22.0",
48
+ "@fluentui/react-tabster": "^9.22.1",
49
49
  "@fluentui/react-theme": "^9.1.19",
50
- "@fluentui/react-utilities": "^9.18.10",
50
+ "@fluentui/react-utilities": "^9.18.11",
51
51
  "@griffel/react": "^1.5.22",
52
52
  "@swc/helpers": "^0.5.1"
53
53
  },