@fluentui/react-datepicker-compat 0.3.6 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +145 -1
- package/CHANGELOG.md +39 -2
- package/lib/components/Calendar/Calendar.js +9 -7
- package/lib/components/Calendar/Calendar.js.map +1 -1
- package/lib/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib/components/CalendarDay/CalendarDay.js +8 -11
- package/lib/components/CalendarDay/CalendarDay.js.map +1 -1
- package/lib/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js +8 -10
- package/lib/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js +8 -5
- package/lib/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridRow.js +1 -1
- package/lib/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
- package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js +1 -1
- package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
- package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib/components/CalendarDayGrid/useWeekCornerStyles.styles.js.map +1 -1
- package/lib/components/CalendarDayGrid/useWeeks.js +4 -3
- package/lib/components/CalendarDayGrid/useWeeks.js.map +1 -1
- package/lib/components/CalendarMonth/CalendarMonth.js +10 -8
- package/lib/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib/components/CalendarMonth/useCalendarMonthStyles.js.map +1 -1
- package/lib/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib/components/CalendarYear/CalendarYear.js +38 -39
- package/lib/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/components/DatePicker/renderDatePicker.js +15 -6
- package/lib/components/DatePicker/renderDatePicker.js.map +1 -1
- package/lib/components/DatePicker/useDatePicker.js +18 -13
- package/lib/components/DatePicker/useDatePicker.js.map +1 -1
- package/lib/components/DatePicker/useDatePickerStyles.styles.js.map +1 -1
- package/lib/utils/dateGrid/findAvailableDate.js +1 -1
- package/lib/utils/dateGrid/findAvailableDate.js.map +1 -1
- package/lib/utils/dateGrid/getBoundedDateRange.js.map +1 -1
- package/lib/utils/dateGrid/getDateRangeTypeToUse.js.map +1 -1
- package/lib/utils/dateGrid/getDayGrid.js +3 -2
- package/lib/utils/dateGrid/getDayGrid.js.map +1 -1
- package/lib/utils/dateGrid/isAfterMaxDate.js +1 -1
- package/lib/utils/dateGrid/isAfterMaxDate.js.map +1 -1
- package/lib/utils/dateGrid/isBeforeMinDate.js +1 -1
- package/lib/utils/dateGrid/isBeforeMinDate.js.map +1 -1
- package/lib/utils/dateGrid/isContiguous.js.map +1 -1
- package/lib/utils/dateGrid/isRestrictedDate.js +1 -1
- package/lib/utils/dateGrid/isRestrictedDate.js.map +1 -1
- package/lib/utils/dateMath/dateMath.js.map +1 -1
- package/lib/utils/dom.js.map +1 -1
- package/lib/utils/focus.js.map +1 -1
- package/lib/utils/usePopupPositioning.js +2 -2
- package/lib/utils/usePopupPositioning.js.map +1 -1
- package/lib-commonjs/Calendar.js +2 -2
- package/lib-commonjs/Calendar.js.map +1 -1
- package/lib-commonjs/CalendarDay.js +2 -2
- package/lib-commonjs/CalendarDay.js.map +1 -1
- package/lib-commonjs/CalendarDayGrid.js +2 -2
- package/lib-commonjs/CalendarDayGrid.js.map +1 -1
- package/lib-commonjs/CalendarMonth.js +2 -2
- package/lib-commonjs/CalendarMonth.js.map +1 -1
- package/lib-commonjs/CalendarPicker.js +2 -2
- package/lib-commonjs/CalendarPicker.js.map +1 -1
- package/lib-commonjs/CalendarYear.js +2 -2
- package/lib-commonjs/CalendarYear.js.map +1 -1
- package/lib-commonjs/DatePicker.js +2 -2
- package/lib-commonjs/DatePicker.js.map +1 -1
- package/lib-commonjs/components/Calendar/Calendar.js +32 -28
- package/lib-commonjs/components/Calendar/Calendar.js.map +1 -1
- package/lib-commonjs/components/Calendar/Calendar.types.js +5 -3
- package/lib-commonjs/components/Calendar/Calendar.types.js.map +1 -1
- package/lib-commonjs/components/Calendar/defaults.js +3 -1
- package/lib-commonjs/components/Calendar/defaults.js.map +1 -1
- package/lib-commonjs/components/Calendar/index.js +7 -5
- package/lib-commonjs/components/Calendar/index.js.map +1 -1
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js +12 -8
- package/lib-commonjs/components/Calendar/useCalendarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/CalendarDay.js +25 -26
- package/lib-commonjs/components/CalendarDay/CalendarDay.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/CalendarDay.types.js +2 -2
- package/lib-commonjs/components/CalendarDay/CalendarDay.types.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/index.js +4 -4
- package/lib-commonjs/components/CalendarDay/index.js.map +1 -1
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js +13 -9
- package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js +27 -27
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.types.js +2 -2
- package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.types.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js +29 -24
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js +8 -6
- package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js +6 -4
- package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/index.js +10 -6
- package/lib-commonjs/components/CalendarDayGrid/index.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js +29 -23
- package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useWeekCornerStyles.styles.js +9 -5
- package/lib-commonjs/components/CalendarDayGrid/useWeekCornerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarDayGrid/useWeeks.js +9 -6
- package/lib-commonjs/components/CalendarDayGrid/useWeeks.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js +24 -21
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.types.js +2 -2
- package/lib-commonjs/components/CalendarMonth/CalendarMonth.types.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/index.js +4 -4
- package/lib-commonjs/components/CalendarMonth/index.js.map +1 -1
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.js +5 -3
- package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/index.js +3 -3
- package/lib-commonjs/components/CalendarPicker/index.js.map +1 -1
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js +20 -16
- package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/CalendarYear.js +60 -59
- package/lib-commonjs/components/CalendarYear/CalendarYear.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/CalendarYear.types.js +2 -2
- package/lib-commonjs/components/CalendarYear/CalendarYear.types.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/index.js +4 -4
- package/lib-commonjs/components/CalendarYear/index.js.map +1 -1
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js +5 -3
- package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.styles.js.map +1 -1
- package/lib-commonjs/components/DatePicker/DatePicker.js +7 -5
- package/lib-commonjs/components/DatePicker/DatePicker.js.map +1 -1
- package/lib-commonjs/components/DatePicker/defaults.js +6 -2
- package/lib-commonjs/components/DatePicker/defaults.js.map +1 -1
- package/lib-commonjs/components/DatePicker/index.js +7 -7
- package/lib-commonjs/components/DatePicker/index.js.map +1 -1
- package/lib-commonjs/components/DatePicker/renderDatePicker.js +22 -12
- package/lib-commonjs/components/DatePicker/renderDatePicker.js.map +1 -1
- package/lib-commonjs/components/DatePicker/useDatePicker.js +59 -52
- package/lib-commonjs/components/DatePicker/useDatePicker.js.map +1 -1
- package/lib-commonjs/components/DatePicker/useDatePickerStyles.styles.js +9 -5
- package/lib-commonjs/components/DatePicker/useDatePickerStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +98 -34
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/animations.js +45 -15
- package/lib-commonjs/utils/animations.js.map +1 -1
- package/lib-commonjs/utils/constants.js +18 -6
- package/lib-commonjs/utils/constants.js.map +1 -1
- package/lib-commonjs/utils/dateFormatting/dateFormatting.defaults.js +24 -8
- package/lib-commonjs/utils/dateFormatting/dateFormatting.defaults.js.map +1 -1
- package/lib-commonjs/utils/dateFormatting/index.js +3 -3
- package/lib-commonjs/utils/dateFormatting/index.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/findAvailableDate.js +4 -2
- package/lib-commonjs/utils/dateGrid/findAvailableDate.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/getBoundedDateRange.js +3 -1
- package/lib-commonjs/utils/dateGrid/getBoundedDateRange.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/getDateRangeTypeToUse.js +3 -1
- package/lib-commonjs/utils/dateGrid/getDateRangeTypeToUse.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/getDayGrid.js +6 -3
- package/lib-commonjs/utils/dateGrid/getDayGrid.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/index.js +6 -6
- package/lib-commonjs/utils/dateGrid/index.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isAfterMaxDate.js +4 -2
- package/lib-commonjs/utils/dateGrid/isAfterMaxDate.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isBeforeMinDate.js +4 -2
- package/lib-commonjs/utils/dateGrid/isBeforeMinDate.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isContiguous.js +3 -1
- package/lib-commonjs/utils/dateGrid/isContiguous.js.map +1 -1
- package/lib-commonjs/utils/dateGrid/isRestrictedDate.js +4 -2
- package/lib-commonjs/utils/dateGrid/isRestrictedDate.js.map +1 -1
- package/lib-commonjs/utils/dateMath/dateMath.js +54 -18
- package/lib-commonjs/utils/dateMath/dateMath.js.map +1 -1
- package/lib-commonjs/utils/dateMath/index.js +2 -2
- package/lib-commonjs/utils/dateMath/index.js.map +1 -1
- package/lib-commonjs/utils/dom.js +5 -3
- package/lib-commonjs/utils/dom.js.map +1 -1
- package/lib-commonjs/utils/focus.js +3 -1
- package/lib-commonjs/utils/focus.js.map +1 -1
- package/lib-commonjs/utils/index.js +8 -8
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/usePopupPositioning.js +9 -7
- package/lib-commonjs/utils/usePopupPositioning.js.map +1 -1
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useCalendarYearStyles.styles.js"],"sourcesContent":["import { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';\n/**\n * @internal\n *\n * Apply styling to the CalendarYear slots based on the state\n */\nexport const useCalendarYearStyles_unstable = props => {\n return useCalendarPickerStyles_unstable(props);\n};\n//# sourceMappingURL=useCalendarYearStyles.styles.js.map"],"names":["useCalendarYearStyles_unstable","props","useCalendarPickerStyles_unstable"],"mappings":";;;;+BAMaA
|
|
1
|
+
{"version":3,"sources":["useCalendarYearStyles.styles.js"],"sourcesContent":["import { useCalendarPickerStyles_unstable } from '../CalendarPicker/useCalendarPickerStyles.styles';\n/**\n * @internal\n *\n * Apply styling to the CalendarYear slots based on the state\n */\nexport const useCalendarYearStyles_unstable = props => {\n return useCalendarPickerStyles_unstable(props);\n};\n//# sourceMappingURL=useCalendarYearStyles.styles.js.map"],"names":["useCalendarYearStyles_unstable","props","useCalendarPickerStyles_unstable"],"mappings":";;;;+BAMaA;;;eAAAA;;;+CANoC;AAM1C,MAAMA,iCAAiCC,CAAAA;IAC5C,OAAOC,IAAAA,+DAAgC,EAACD;AAC1C,GACA,wDAAwD"}
|
|
@@ -4,16 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "DatePicker", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return DatePicker;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
11
13
|
const _renderDatePicker = require("./renderDatePicker");
|
|
12
14
|
const _useDatePicker = require("./useDatePicker");
|
|
13
|
-
const
|
|
15
|
+
const _useDatePickerStylesstyles = require("./useDatePickerStyles.styles");
|
|
14
16
|
const DatePicker = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
15
17
|
const state = (0, _useDatePicker.useDatePicker_unstable)(props, ref);
|
|
16
|
-
(0,
|
|
18
|
+
(0, _useDatePickerStylesstyles.useDatePickerStyles_unstable)(state);
|
|
17
19
|
return (0, _renderDatePicker.renderDatePicker_unstable)(state);
|
|
18
20
|
});
|
|
19
21
|
DatePicker.displayName = 'DatePicker';
|
|
@@ -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
|
|
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"}
|
|
@@ -9,8 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
defaultDatePickerStrings: ()
|
|
13
|
-
|
|
12
|
+
defaultDatePickerStrings: function() {
|
|
13
|
+
return defaultDatePickerStrings;
|
|
14
|
+
},
|
|
15
|
+
defaultDatePickerErrorStrings: function() {
|
|
16
|
+
return defaultDatePickerErrorStrings;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
const _defaults = require("../Calendar/defaults");
|
|
16
20
|
const defaultDatePickerStrings = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["defaults.js"],"sourcesContent":["import { defaultCalendarStrings } from '../Calendar/defaults';\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
|
|
1
|
+
{"version":3,"sources":["defaults.js"],"sourcesContent":["import { defaultCalendarStrings } from '../Calendar/defaults';\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;;;0BAT0B;AAChC,MAAMD,2BAA2B;IACpC,GAAGE,gCAAsB;IACzBC,oBAAoB;IACpBC,oBAAoB;IACpBC,mBAAmB;IACnBC,mBAAmB;IACnBC,sBAAsB;AAC1B;AACO,MAAMN,gCAAgC;IACzC,iBAAiB;IACjB,iBAAiB;IACjB,kBAAkB;AACtB"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const _export_star = require("@swc/helpers/_/_export_star");
|
|
6
|
+
_export_star._(require("./defaults"), exports);
|
|
7
|
+
_export_star._(require("./DatePicker"), exports);
|
|
8
|
+
_export_star._(require("./DatePicker.types"), exports);
|
|
9
|
+
_export_star._(require("./renderDatePicker"), exports);
|
|
10
|
+
_export_star._(require("./useDatePicker"), exports);
|
|
11
|
+
_export_star._(require("./useDatePickerStyles.styles"), exports);
|
|
@@ -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":";;;;;
|
|
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,20 +1,30 @@
|
|
|
1
|
-
/** @jsxRuntime
|
|
1
|
+
/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ "use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "renderDatePicker_unstable", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderDatePicker_unstable;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const _reactPortal = require("@fluentui/react-portal");
|
|
13
|
-
const _reactUtilities = require("@fluentui/react-utilities");
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactportal = require("@fluentui/react-portal");
|
|
13
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
14
14
|
const renderDatePicker_unstable = (state)=>{
|
|
15
|
-
(0,
|
|
16
|
-
const { inlinePopup
|
|
17
|
-
return /*#__PURE__*/ (0,
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
(0, _reactutilities.assertSlots)(state);
|
|
16
|
+
const { inlinePopup } = state;
|
|
17
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
18
|
+
children: [
|
|
19
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {}),
|
|
20
|
+
state.popupSurface && (inlinePopup ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.popupSurface, {
|
|
21
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.calendar, {})
|
|
22
|
+
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactportal.Portal, {
|
|
23
|
+
mountNode: state.mountNode,
|
|
24
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.popupSurface, {
|
|
25
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.calendar, {})
|
|
26
|
+
})
|
|
27
|
+
}))
|
|
28
|
+
]
|
|
29
|
+
});
|
|
20
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderDatePicker.js"],"sourcesContent":["/** @jsxRuntime
|
|
1
|
+
{"version":3,"sources":["renderDatePicker.js"],"sourcesContent":["/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ 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":"AAAA,0BAA0B,GAAG,iDAAiD;;;;+BAK7DA;;;eAAAA;;;4BALkI;6BAC5H;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"}
|
|
@@ -4,20 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(exports, "useDatePicker_unstable", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return useDatePicker_unstable;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
10
|
-
const _react = /*#__PURE__*/
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _keyboardkeys = require("@fluentui/keyboard-keys");
|
|
14
|
+
const _Calendar = require("../Calendar/Calendar");
|
|
15
|
+
const _reacticons = require("@fluentui/react-icons");
|
|
14
16
|
const _utils = require("../../utils");
|
|
15
17
|
const _defaults = require("./defaults");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
18
|
+
const _reactinput = require("@fluentui/react-input");
|
|
19
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
20
|
+
const _reactfield = require("@fluentui/react-field");
|
|
21
|
+
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
22
|
+
const _reacttabster = require("@fluentui/react-tabster");
|
|
21
23
|
const _usePopupPositioning = require("../../utils/usePopupPositioning");
|
|
22
24
|
function isDateOutOfBounds(date, minDate, maxDate) {
|
|
23
25
|
return !!minDate && (0, _utils.compareDatePart)(minDate, date) > 0 || !!maxDate && (0, _utils.compareDatePart)(maxDate, date) < 0;
|
|
@@ -26,7 +28,7 @@ function useFocusLogic() {
|
|
|
26
28
|
const inputRef = _react.useRef(null);
|
|
27
29
|
const preventFocusOpeningPicker = _react.useRef(false);
|
|
28
30
|
const focus = _react.useCallback(()=>{
|
|
29
|
-
var
|
|
31
|
+
var _inputRef_current_focus, _inputRef_current;
|
|
30
32
|
(_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);
|
|
31
33
|
}, []);
|
|
32
34
|
const preventNextFocusOpeningPicker = _react.useCallback(()=>{
|
|
@@ -40,7 +42,7 @@ function useFocusLogic() {
|
|
|
40
42
|
];
|
|
41
43
|
}
|
|
42
44
|
function usePopupVisibility(props) {
|
|
43
|
-
const [open, setOpen] = (0,
|
|
45
|
+
const [open, setOpen] = (0, _reactutilities.useControllableState)({
|
|
44
46
|
initialState: false,
|
|
45
47
|
defaultState: props.defaultOpen,
|
|
46
48
|
state: props.open
|
|
@@ -48,8 +50,8 @@ function usePopupVisibility(props) {
|
|
|
48
50
|
const isMounted = _react.useRef(false);
|
|
49
51
|
_react.useEffect(()=>{
|
|
50
52
|
if (isMounted.current && !open) {
|
|
51
|
-
var _props_onOpenChange;
|
|
52
|
-
(_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(
|
|
53
|
+
var _props_onOpenChange, _props;
|
|
54
|
+
(_props_onOpenChange = (_props = props).onOpenChange) === null || _props_onOpenChange === void 0 ? void 0 : _props_onOpenChange.call(_props, false);
|
|
53
55
|
}
|
|
54
56
|
isMounted.current = true;
|
|
55
57
|
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -62,14 +64,15 @@ function usePopupVisibility(props) {
|
|
|
62
64
|
setOpen
|
|
63
65
|
];
|
|
64
66
|
}
|
|
65
|
-
function useSelectedDate({ formatDate
|
|
66
|
-
const [selectedDate, setSelectedDateState] = (0,
|
|
67
|
+
function useSelectedDate({ formatDate, onSelectDate, value }) {
|
|
68
|
+
const [selectedDate, setSelectedDateState] = (0, _reactutilities.useControllableState)({
|
|
67
69
|
initialState: null,
|
|
68
70
|
state: value
|
|
69
71
|
});
|
|
70
72
|
const [formattedDate, setFormattedDate] = _react.useState(()=>value && formatDate ? formatDate(value) : '');
|
|
71
73
|
const setSelectedDate = (newDate)=>{
|
|
72
|
-
|
|
74
|
+
var _onSelectDate;
|
|
75
|
+
(_onSelectDate = onSelectDate) === null || _onSelectDate === void 0 ? void 0 : _onSelectDate(newDate);
|
|
73
76
|
setSelectedDateState(newDate);
|
|
74
77
|
setFormattedDate(newDate && formatDate ? formatDate(newDate) : '');
|
|
75
78
|
};
|
|
@@ -92,7 +95,8 @@ const defaultParseDateFromString = (dateStr)=>{
|
|
|
92
95
|
return date ? new Date(date) : null;
|
|
93
96
|
};
|
|
94
97
|
const useDatePicker_unstable = (props, ref)=>{
|
|
95
|
-
|
|
98
|
+
var _fieldContext;
|
|
99
|
+
const { allowTextInput = false, allFocusable = false, borderless = false, dateTimeFormatter, defaultOpen = false, disableAutoFocus = true, firstDayOfWeek = _utils.DayOfWeek.Sunday, firstWeekOfYear = _utils.FirstWeekOfYear.FirstDay, formatDate = defaultFormatDate, highlightCurrentMonth = false, highlightSelectedMonth = false, initialPickerDate = new Date(), 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;
|
|
96
100
|
const calendar = _react.useRef(null);
|
|
97
101
|
const [focus, rootRef, preventFocusOpeningPicker, preventNextFocusOpeningPicker] = useFocusLogic();
|
|
98
102
|
const [selectedDate, formattedDate, setSelectedDate, setFormattedDate] = useSelectedDate({
|
|
@@ -101,11 +105,12 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
101
105
|
value
|
|
102
106
|
});
|
|
103
107
|
const [open, setOpenState] = usePopupVisibility(props);
|
|
104
|
-
const fieldContext = (0,
|
|
108
|
+
const fieldContext = (0, _reactfield.useFieldContext_unstable)();
|
|
105
109
|
var _fieldContext_required;
|
|
106
|
-
const required = (_fieldContext_required = fieldContext === null ||
|
|
107
|
-
const popupSurfaceId = (0,
|
|
110
|
+
const required = (_fieldContext_required = (_fieldContext = fieldContext) === null || _fieldContext === void 0 ? void 0 : _fieldContext.required) !== null && _fieldContext_required !== void 0 ? _fieldContext_required : props.required;
|
|
111
|
+
const popupSurfaceId = (0, _reactutilities.useId)('datePicker-popupSurface');
|
|
108
112
|
const validateTextInput = _react.useCallback((date = null)=>{
|
|
113
|
+
var _onValidationResult;
|
|
109
114
|
let error;
|
|
110
115
|
if (allowTextInput) {
|
|
111
116
|
if (formattedDate || date) {
|
|
@@ -129,15 +134,16 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
129
134
|
}
|
|
130
135
|
}
|
|
131
136
|
} else {
|
|
137
|
+
var _onUserSelectDate;
|
|
132
138
|
if (required) {
|
|
133
139
|
error = 'required-input';
|
|
134
140
|
}
|
|
135
|
-
onUserSelectDate === null ||
|
|
141
|
+
(_onUserSelectDate = onUserSelectDate) === null || _onUserSelectDate === void 0 ? void 0 : _onUserSelectDate(date);
|
|
136
142
|
}
|
|
137
143
|
} else if (required && !formattedDate) {
|
|
138
144
|
error = 'required-input';
|
|
139
145
|
}
|
|
140
|
-
onValidationResult === null ||
|
|
146
|
+
(_onValidationResult = onValidationResult) === null || _onValidationResult === void 0 ? void 0 : _onValidationResult({
|
|
141
147
|
error
|
|
142
148
|
});
|
|
143
149
|
}, [
|
|
@@ -154,7 +160,8 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
154
160
|
setSelectedDate
|
|
155
161
|
]);
|
|
156
162
|
const setOpen = _react.useCallback((newState)=>{
|
|
157
|
-
|
|
163
|
+
var _onOpenChange;
|
|
164
|
+
(_onOpenChange = onOpenChange) === null || _onOpenChange === void 0 ? void 0 : _onOpenChange(newState);
|
|
158
165
|
setOpenState(newState);
|
|
159
166
|
if (!open && !props.disabled) {
|
|
160
167
|
focus();
|
|
@@ -200,7 +207,7 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
200
207
|
preventNextFocusOpeningPicker
|
|
201
208
|
]);
|
|
202
209
|
const onInputChange = _react.useCallback((ev, data)=>{
|
|
203
|
-
const { value: newValue
|
|
210
|
+
const { value: newValue } = data;
|
|
204
211
|
if (allowTextInput) {
|
|
205
212
|
if (open) {
|
|
206
213
|
dismissDatePickerPopup();
|
|
@@ -220,7 +227,7 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
220
227
|
]);
|
|
221
228
|
const onInputKeyDown = _react.useCallback((ev)=>{
|
|
222
229
|
switch(ev.key){
|
|
223
|
-
case
|
|
230
|
+
case _keyboardkeys.Enter:
|
|
224
231
|
ev.preventDefault();
|
|
225
232
|
ev.stopPropagation();
|
|
226
233
|
if (!open) {
|
|
@@ -234,14 +241,14 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
234
241
|
}
|
|
235
242
|
}
|
|
236
243
|
break;
|
|
237
|
-
case
|
|
244
|
+
case _keyboardkeys.Escape:
|
|
238
245
|
ev.stopPropagation();
|
|
239
246
|
ev.preventDefault();
|
|
240
247
|
if (open) {
|
|
241
248
|
calendarDismissed();
|
|
242
249
|
}
|
|
243
250
|
break;
|
|
244
|
-
case
|
|
251
|
+
case _keyboardkeys.ArrowDown:
|
|
245
252
|
ev.preventDefault();
|
|
246
253
|
if (ev.altKey && !open) {
|
|
247
254
|
showDatePickerPopup();
|
|
@@ -302,45 +309,45 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
302
309
|
};
|
|
303
310
|
const inputAppearance = underlined ? 'underline' : borderless ? 'filled-lighter' : 'outline';
|
|
304
311
|
const [triggerWrapperRef, popupRef] = (0, _usePopupPositioning.usePopupPositioning)(props);
|
|
305
|
-
const root =
|
|
312
|
+
const root = _reactutilities.slot.always(restOfProps, {
|
|
306
313
|
defaultProps: {
|
|
307
314
|
appearance: inputAppearance,
|
|
308
315
|
'aria-controls': open ? popupSurfaceId : undefined,
|
|
309
316
|
'aria-expanded': open,
|
|
310
317
|
'aria-haspopup': 'dialog',
|
|
311
|
-
contentAfter: /*#__PURE__*/ _react.createElement(
|
|
318
|
+
contentAfter: /*#__PURE__*/ _react.createElement(_reacticons.CalendarMonthRegular, {
|
|
312
319
|
onClick: onIconClick
|
|
313
320
|
}),
|
|
314
321
|
readOnly: !allowTextInput,
|
|
315
322
|
role: 'combobox'
|
|
316
323
|
},
|
|
317
|
-
elementType:
|
|
324
|
+
elementType: _reactinput.Input
|
|
318
325
|
});
|
|
319
|
-
const inputRoot =
|
|
326
|
+
const inputRoot = _reactutilities.slot.always(props.root, {
|
|
320
327
|
defaultProps: {
|
|
321
328
|
'aria-owns': open ? popupSurfaceId : undefined,
|
|
322
329
|
ref: triggerWrapperRef
|
|
323
330
|
},
|
|
324
331
|
elementType: 'span'
|
|
325
332
|
});
|
|
326
|
-
inputRoot.ref = (0,
|
|
333
|
+
inputRoot.ref = (0, _reactutilities.useMergedRefs)(inputRoot.ref, triggerWrapperRef);
|
|
327
334
|
root.root = inputRoot;
|
|
328
|
-
const inputShorthand =
|
|
335
|
+
const inputShorthand = _reactutilities.slot.always(props.input, {
|
|
329
336
|
elementType: 'input'
|
|
330
337
|
});
|
|
331
|
-
inputShorthand.ref = (0,
|
|
338
|
+
inputShorthand.ref = (0, _reactutilities.useMergedRefs)(inputShorthand.ref, ref, rootRef);
|
|
332
339
|
root.input = inputShorthand;
|
|
333
|
-
root.onChange = (0,
|
|
334
|
-
root.onBlur = (0,
|
|
335
|
-
root.onKeyDown = (0,
|
|
336
|
-
root.onFocus = (0,
|
|
337
|
-
root.onClick = (0,
|
|
338
|
-
const { modalAttributes
|
|
340
|
+
root.onChange = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(root.onChange, onInputChange));
|
|
341
|
+
root.onBlur = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(root.onBlur, onInputBlur));
|
|
342
|
+
root.onKeyDown = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(root.onKeyDown, onInputKeyDown));
|
|
343
|
+
root.onFocus = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(root.onFocus, onInputFocus));
|
|
344
|
+
root.onClick = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(root.onClick, onInputClick));
|
|
345
|
+
const { modalAttributes } = (0, _reacttabster.useModalAttributes)({
|
|
339
346
|
trapFocus: true,
|
|
340
347
|
alwaysFocusable: true,
|
|
341
348
|
legacyTrapFocus: false
|
|
342
349
|
});
|
|
343
|
-
const popupSurface = open ?
|
|
350
|
+
const popupSurface = open ? _reactutilities.slot.optional(props.popupSurface, {
|
|
344
351
|
renderByDefault: true,
|
|
345
352
|
defaultProps: {
|
|
346
353
|
'aria-label': 'Calendar',
|
|
@@ -352,8 +359,8 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
352
359
|
},
|
|
353
360
|
elementType: 'div'
|
|
354
361
|
}) : undefined;
|
|
355
|
-
const { targetDocument
|
|
356
|
-
(0,
|
|
362
|
+
const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
|
|
363
|
+
(0, _reactutilities.useOnClickOutside)({
|
|
357
364
|
element: targetDocument,
|
|
358
365
|
callback: (ev)=>dismissDatePickerPopup(),
|
|
359
366
|
refs: [
|
|
@@ -362,7 +369,7 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
362
369
|
],
|
|
363
370
|
disabled: !open
|
|
364
371
|
});
|
|
365
|
-
(0,
|
|
372
|
+
(0, _reactutilities.useOnScrollOutside)({
|
|
366
373
|
element: targetDocument,
|
|
367
374
|
callback: (ev)=>dismissDatePickerPopup(),
|
|
368
375
|
refs: [
|
|
@@ -382,7 +389,7 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
382
389
|
open,
|
|
383
390
|
props.disabled
|
|
384
391
|
]);
|
|
385
|
-
const calendarShorthand =
|
|
392
|
+
const calendarShorthand = _reactutilities.slot.always(props.calendar, {
|
|
386
393
|
defaultProps: {
|
|
387
394
|
allFocusable,
|
|
388
395
|
componentRef: calendar,
|
|
@@ -402,16 +409,16 @@ const useDatePicker_unstable = (props, ref)=>{
|
|
|
402
409
|
today,
|
|
403
410
|
value: selectedDate || initialPickerDate
|
|
404
411
|
},
|
|
405
|
-
elementType:
|
|
412
|
+
elementType: _Calendar.Calendar
|
|
406
413
|
});
|
|
407
|
-
calendarShorthand.onDismiss = (0,
|
|
408
|
-
calendarShorthand.onSelectDate = (0,
|
|
414
|
+
calendarShorthand.onDismiss = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(calendarShorthand.onDismiss, calendarDismissed));
|
|
415
|
+
calendarShorthand.onSelectDate = (0, _reactutilities.useEventCallback)((0, _reactutilities.mergeCallbacks)(calendarShorthand.onSelectDate, calendarDismissed));
|
|
409
416
|
const state = {
|
|
410
417
|
disabled: !!props.disabled,
|
|
411
418
|
inlinePopup,
|
|
412
419
|
components: {
|
|
413
|
-
root:
|
|
414
|
-
calendar:
|
|
420
|
+
root: _reactinput.Input,
|
|
421
|
+
calendar: _Calendar.Calendar,
|
|
415
422
|
popupSurface: 'div'
|
|
416
423
|
},
|
|
417
424
|
calendar: calendarShorthand,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useDatePicker.js"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar } from '../Calendar/Calendar';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { compareDatePart, DayOfWeek, FirstWeekOfYear } from '../../utils';\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, _inputRef_current_focus;\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 =new Date() , 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 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 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 (ev.altKey && !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 root = slot.always(restOfProps, {\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n contentAfter: /*#__PURE__*/ React.createElement(CalendarMonthRegular, {\n onClick: onIconClick\n }),\n readOnly: !allowTextInput,\n role: 'combobox'\n },\n elementType: Input\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 root.root = inputRoot;\n const inputShorthand = slot.always(props.input, {\n elementType: 'input'\n });\n inputShorthand.ref = useMergedRefs(inputShorthand.ref, ref, rootRef);\n root.input = inputShorthand;\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","_inputRef_current_focus","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","inlinePopup","isMonthPickerVisible","mountNode","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","defaultDatePickerStrings","today","underlined","restOfProps","calendar","rootRef","setOpenState","fieldContext","useFieldContext","_fieldContext_required","required","popupSurfaceId","useId","validateTextInput","error","isNaN","getTime","newState","disabled","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","Enter","preventDefault","stopPropagation","Escape","ArrowDown","altKey","onInputFocus","onInputClick","onIconClick","inputAppearance","triggerWrapperRef","popupRef","usePopupPositioning","root","slot","always","defaultProps","appearance","undefined","contentAfter","createElement","CalendarMonthRegular","onClick","readOnly","role","elementType","Input","inputRoot","useMergedRefs","inputShorthand","input","onChange","useEventCallback","mergeCallbacks","onBlur","onKeyDown","onFocus","modalAttributes","useModalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurface","optional","renderByDefault","id","targetDocument","useFluent","useOnClickOutside","element","callback","refs","useOnScrollOutside","calendarShorthand","componentRef","Calendar","onDismiss","components"],"mappings":";;;;+BA8FiBA;;aAAAA;;;6DA9FM;8BACkB;0BAChB;4BACY;uBACuB;0BACnB;4BACnB;gCACoH;4BAC9E;qCACZ;8BACb;qCACC;AACpC,SAASC,kBAAkBC,IAAI,EAAEC,OAAO,EAAEC,OAAO,EAAE;IAC/C,O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MAAM0E,QAAQ;QAC1B9B;QACAmG,YAAY;YACR5C,MAAMa,iBAAK;YACXpD,UAAUiF,kBAAQ;YAClBb,cAAc;QAClB;QACApE,UAAU+E;QACV7F;QACAqD;QACA6B;IACJ;IACAzH,MAAM4F,IAAI,CAACnF,KAAK,GAAGG;IACnB,OAAOZ;AACX"}
|
|
1
|
+
{"version":3,"sources":["useDatePicker.js"],"sourcesContent":["import * as React from 'react';\nimport { ArrowDown, Enter, Escape } from '@fluentui/keyboard-keys';\nimport { Calendar } from '../Calendar/Calendar';\nimport { CalendarMonthRegular } from '@fluentui/react-icons';\nimport { compareDatePart, DayOfWeek, FirstWeekOfYear } from '../../utils';\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, _props;\n (_props_onOpenChange = (_props = 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 var _onSelectDate;\n (_onSelectDate = 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 var _fieldContext;\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 = new Date(), 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 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 = fieldContext) === null || _fieldContext === void 0 ? void 0 : _fieldContext.required) !== null && _fieldContext_required !== void 0 ? _fieldContext_required : props.required;\n const popupSurfaceId = useId('datePicker-popupSurface');\n const validateTextInput = React.useCallback((date = null)=>{\n var _onValidationResult;\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 var _onUserSelectDate;\n if (required) {\n error = 'required-input';\n }\n (_onUserSelectDate = onUserSelectDate) === null || _onUserSelectDate === void 0 ? void 0 : _onUserSelectDate(date);\n }\n } else if (required && !formattedDate) {\n error = 'required-input';\n }\n (_onValidationResult = 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 var _onOpenChange;\n (_onOpenChange = 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 (ev.altKey && !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 root = slot.always(restOfProps, {\n defaultProps: {\n appearance: inputAppearance,\n 'aria-controls': open ? popupSurfaceId : undefined,\n 'aria-expanded': open,\n 'aria-haspopup': 'dialog',\n contentAfter: /*#__PURE__*/ React.createElement(CalendarMonthRegular, {\n onClick: onIconClick\n }),\n readOnly: !allowTextInput,\n role: 'combobox'\n },\n elementType: Input\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 root.root = inputRoot;\n const inputShorthand = slot.always(props.input, {\n elementType: 'input'\n });\n inputShorthand.ref = useMergedRefs(inputShorthand.ref, ref, rootRef);\n root.input = inputShorthand;\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","_props","onOpenChange","allowTextInput","useSelectedDate","formatDate","onSelectDate","value","selectedDate","setSelectedDateState","formattedDate","setFormattedDate","useState","setSelectedDate","newDate","_onSelectDate","defaultFormatDate","toDateString","defaultParseDateFromString","dateStr","Date","parse","ref","_fieldContext","allFocusable","borderless","dateTimeFormatter","disableAutoFocus","firstDayOfWeek","DayOfWeek","Sunday","firstWeekOfYear","FirstWeekOfYear","FirstDay","highlightCurrentMonth","highlightSelectedMonth","initialPickerDate","inlinePopup","isMonthPickerVisible","mountNode","onUserSelectDate","openOnClick","onValidationResult","parseDateFromString","showCloseButton","showGoToToday","showMonthPickerAsOverlay","showWeekNumbers","strings","defaultDatePickerStrings","today","underlined","restOfProps","calendar","rootRef","setOpenState","fieldContext","useFieldContext","_fieldContext_required","required","popupSurfaceId","useId","validateTextInput","_onValidationResult","error","isNaN","getTime","_onUserSelectDate","newState","_onOpenChange","disabled","dismissDatePickerPopup","newlySelectedDate","showDatePickerPopup","calendarDismissed","onInputChange","ev","data","newValue","onInputBlur","onInputKeyDown","key","Enter","preventDefault","stopPropagation","Escape","ArrowDown","altKey","onInputFocus","onInputClick","onIconClick","inputAppearance","triggerWrapperRef","popupRef","usePopupPositioning","root","slot","always","defaultProps","appearance","undefined","contentAfter","createElement","CalendarMonthRegular","onClick","readOnly","role","elementType","Input","inputRoot","useMergedRefs","inputShorthand","input","onChange","useEventCallback","mergeCallbacks","onBlur","onKeyDown","onFocus","modalAttributes","useModalAttributes","trapFocus","alwaysFocusable","legacyTrapFocus","popupSurface","optional","renderByDefault","id","targetDocument","useFluent","useOnClickOutside","element","callback","refs","useOnScrollOutside","calendarShorthand","componentRef","Calendar","onDismiss","components"],"mappings":";;;;+BA+FiBA;;;eAAAA;;;;iEA/FM;8BACkB;0BAChB;4BACY;uBACuB;0BACnB;4BACnB;gCACoH;4BAC9E;qCACZ;8BACb;qCACC;AACpC,SAASC,kBAAkBC,IAAI,EAAEC,OAAO,EAAEC,OAAO;IAC7C,OAAO,CAAC,CAACD,WAAWE,IAAAA,sBAAe,EAACF,SAASD,QAAQ,KAAK,CAAC,CAACE,WAAWC,IAAAA,sBAAe,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;QACA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C,IAAAA,8BAAc,EAACoB,kBAAkBG,SAAS,EAAEhE;IAC3F6D,kBAAkBjI,YAAY,GAAG4G,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACoB,kBAAkBjI,YAAY,EAAEoE;IACjG,MAAM7E,QAAQ;QACVyE,UAAU,CAAC,CAAChF,MAAMgF,QAAQ;QAC1BjC;QACAsG,YAAY;YACR5C,MAAMa,iBAAK;YACXvD,UAAUoF,kBAAQ;YAClBb,cAAc;QAClB;QACAvE,UAAUkF;QACVhG;QACAwD;QACA6B;IACJ;IACA/H,MAAMkG,IAAI,CAACxF,KAAK,GAAGG;IACnB,OAAOb;AACX"}
|
|
@@ -9,8 +9,12 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
datePickerClassNames: ()
|
|
13
|
-
|
|
12
|
+
datePickerClassNames: function() {
|
|
13
|
+
return datePickerClassNames;
|
|
14
|
+
},
|
|
15
|
+
useDatePickerStyles_unstable: function() {
|
|
16
|
+
return useDatePickerStyles_unstable;
|
|
17
|
+
}
|
|
14
18
|
});
|
|
15
19
|
const _react = require("@griffel/react");
|
|
16
20
|
const datePickerClassNames = {
|
|
@@ -18,7 +22,7 @@ const datePickerClassNames = {
|
|
|
18
22
|
calendar: 'fui-DatePicker__calendar',
|
|
19
23
|
popupSurface: 'fui-DatePicker__popupSurface'
|
|
20
24
|
};
|
|
21
|
-
const useStyles = /*#__PURE__*/ (0, _react
|
|
25
|
+
const useStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
22
26
|
base: {
|
|
23
27
|
qhf8xq: "f10pi13n",
|
|
24
28
|
Bceei9c: "f1k6fduh",
|
|
@@ -37,13 +41,13 @@ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
|
37
41
|
".f19qwlmg input{cursor:default;}"
|
|
38
42
|
]
|
|
39
43
|
});
|
|
40
|
-
const usePopupSurfaceClassName = /*#__PURE__*/ (0, _react
|
|
44
|
+
const usePopupSurfaceClassName = /*#__PURE__*/ (0, _react.__resetStyles)("r1ytv1z8", null, [
|
|
41
45
|
".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);}"
|
|
42
46
|
]);
|
|
43
47
|
const useDatePickerStyles_unstable = (state)=>{
|
|
44
48
|
const styles = useStyles();
|
|
45
49
|
const popupSurfaceClassName = usePopupSurfaceClassName();
|
|
46
|
-
const { disabled
|
|
50
|
+
const { disabled } = state;
|
|
47
51
|
state.root.className = (0, _react.mergeClasses)(datePickerClassNames.root, styles.base, disabled && styles.disabled, state.root.className);
|
|
48
52
|
if (state.popupSurface) {
|
|
49
53
|
state.popupSurface.className = (0, _react.mergeClasses)(datePickerClassNames.popupSurface, popupSurfaceClassName, state.popupSurface.className);
|