@fluentui/react-timepicker-compat 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,26 @@
1
1
  # Change Log - @fluentui/react-timepicker-compat
2
2
 
3
- This log was last generated on Fri, 15 Mar 2024 21:37:57 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 18 Mar 2024 19:44:52 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [0.2.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-timepicker-compat_v0.2.4)
8
+
9
+ Mon, 18 Mar 2024 19:44:52 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-timepicker-compat_v0.2.3..@fluentui/react-timepicker-compat_v0.2.4)
11
+
12
+ ### Patches
13
+
14
+ - Bump @fluentui/react-combobox to v9.9.3 ([PR #30803](https://github.com/microsoft/fluentui/pull/30803) by beachball)
15
+ - Bump @fluentui/react-field to v9.1.58 ([PR #30803](https://github.com/microsoft/fluentui/pull/30803) by beachball)
16
+ - Bump @fluentui/react-jsx-runtime to v9.0.34 ([PR #30803](https://github.com/microsoft/fluentui/pull/30803) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v9.15.2 ([PR #30803](https://github.com/microsoft/fluentui/pull/30803) by beachball)
18
+ - Bump @fluentui/react-theme to v9.1.19 ([PR #30803](https://github.com/microsoft/fluentui/pull/30803) by beachball)
19
+ - Bump @fluentui/react-utilities to v9.18.5 ([PR #30803](https://github.com/microsoft/fluentui/pull/30803) by beachball)
20
+
7
21
  ## [0.2.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-timepicker-compat_v0.2.3)
8
22
 
9
- Fri, 15 Mar 2024 21:37:57 GMT
23
+ Fri, 15 Mar 2024 21:43:49 GMT
10
24
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-timepicker-compat_v0.2.2..@fluentui/react-timepicker-compat_v0.2.3)
11
25
 
12
26
  ### Patches
@@ -12,23 +12,23 @@ _export(exports, {
12
12
  dateToKey: function() {
13
13
  return dateToKey;
14
14
  },
15
+ keyToDate: function() {
16
+ return keyToDate;
17
+ },
15
18
  formatDateToTimeString: function() {
16
19
  return formatDateToTimeString;
17
20
  },
18
- getDateEndAnchor: function() {
19
- return getDateEndAnchor;
20
- },
21
- getDateFromTimeString: function() {
22
- return getDateFromTimeString;
23
- },
24
21
  getDateStartAnchor: function() {
25
22
  return getDateStartAnchor;
26
23
  },
24
+ getDateEndAnchor: function() {
25
+ return getDateEndAnchor;
26
+ },
27
27
  getTimesBetween: function() {
28
28
  return getTimesBetween;
29
29
  },
30
- keyToDate: function() {
31
- return keyToDate;
30
+ getDateFromTimeString: function() {
31
+ return getDateFromTimeString;
32
32
  }
33
33
  });
34
34
  function isValidDate(date) {
@@ -1 +1 @@
1
- {"version":3,"sources":["timeMath.js"],"sourcesContent":["function isValidDate(date) {\n return !isNaN(date.getTime());\n}\n/**\n * Converts a Date object to a string key.\n */ export function dateToKey(date) {\n if (!date) {\n return '';\n }\n if (!isValidDate(date)) {\n return 'invalid';\n }\n return date.toISOString();\n}\n/**\n * Converts a string key back to a Date object.\n * Returns undefined for keys that don't represent valid dates.\n */ export function keyToDate(key) {\n if (key === '' || key === 'invalid') {\n return null;\n }\n const date = new Date(key);\n return isValidDate(date) ? date : null;\n}\n/**\n * Formats a Date object into a time string based on provided options.\n *\n * @param date - The Date object to be formatted.\n * @param options - Formatting options. It has two properties:\n * 1. hourCycle (default: undefined): Determines if the time format should be 12-hour or 24-hour.\n * 2. showSeconds (default: false): Determines if the seconds should be included in the formatted string.\n * @returns Formatted time string based on the given options.\n *\n * @example\n * const date = new Date(2023, 9, 6, 23, 45, 12);\n * formatDateToTimeString(date); // Returns \"23:45\" in CET\n * formatDateToTimeString(date, \\{ showSeconds: true \\}); // Returns \"23:45:12\" in CET\n * formatDateToTimeString(date, \\{ hourCycle: 'h12', showSeconds: true \\}); // Returns \"11:45:12 PM\" in CET\n */ export function formatDateToTimeString(date, { hourCycle, showSeconds } = {}) {\n return date.toLocaleTimeString(undefined, {\n hour: 'numeric',\n hourCycle,\n minute: '2-digit',\n second: showSeconds ? '2-digit' : undefined\n });\n}\n/**\n * Get the start date anchor based on the provided parameters.\n * @example\n * const date = new Date(2023, 9, 6); // October 6, 2023\n * getStartAnchorDate(date, 5); // Returns a date for October 6, 2023, 05:00:00\n */ export function getDateStartAnchor(dateAnchor, startHour) {\n const startDate = new Date(dateAnchor);\n startDate.setHours(startHour, 0, 0, 0);\n return startDate;\n}\n/**\n * Get the end date anchor based on the provided parameters.\n * @example\n * const date = new Date(2023, 9, 6); // October 6, 2023\n * getEndAnchorDate(date, 5, 10); // Returns a date for October 6, 2023, 10:00:00\n * getEndAnchorDate(date, 10, 5); // Returns a date for October 7, 2023, 05:00:00 (next day due to hour conditions)\n */ export function getDateEndAnchor(dateAnchor, startHour, endHour) {\n const endDate = new Date(dateAnchor);\n if (startHour > endHour || endHour === 24) {\n endDate.setDate(endDate.getDate() + 1);\n }\n endDate.setHours(endHour === 24 ? 0 : endHour, 0, 0, 0);\n return endDate;\n}\n/**\n * Generates an array of Date objects between two given Date anchors.\n *\n * @param dateStartAnchor - The starting Date anchor.\n * @param dateEndAnchor - The ending Date anchor.\n * @param increment - The minute increment between each Date in the resulting array.\n * @returns - An array of Date objects.\n *\n * @example\n * const start = new Date(2023, 0, 1, 10, 0); // Jan 1, 2023 10:00:00 AM\n * const end = new Date(2023, 0, 1, 11, 0); // Jan 1, 2023 11:00:00 AM\n * getTimesBetween(start, end, 15); // Returns array with Dates [10:00, 10:15, 10:30, 10:45]\n */ export function getTimesBetween(dateStartAnchor, dateEndAnchor, increment) {\n if (increment <= 0) {\n // eslint-disable-next-line no-console\n console.error('Increment value should be a positive number.');\n return [];\n }\n const result = [];\n const startDate = new Date(dateStartAnchor);\n while(startDate < dateEndAnchor){\n result.push(new Date(startDate));\n startDate.setMinutes(startDate.getMinutes() + increment);\n }\n return result;\n}\nconst REGEX_SHOW_SECONDS_HOUR_12 = /^((1[0-2]|0?[0-9]):([0-5][0-9]):([0-5][0-9])\\s([AaPp][Mm]))$/;\nconst REGEX_HIDE_SECONDS_HOUR_12 = /^((1[0-2]|0?[0-9]):[0-5][0-9]\\s([AaPp][Mm]))$/;\nconst REGEX_SHOW_SECONDS_HOUR_24 = /^([0-1]?[0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9]$/;\nconst REGEX_HIDE_SECONDS_HOUR_24 = /^([0-1]?[0-9]|2[0-4]):[0-5][0-9]$/;\n/**\n * Calculates a new date from the user-selected time string based on anchor dates.\n * Returns an object containing a date if the provided time string is valid, and an optional string indicating the type of error.\n *\n * @param time - The time string to be parsed (e.g., \"2:30 PM\", \"15:45:20\").\n * @param dateStartAnchor - The start anchor date.\n * @param dateEndAnchor - The end anchor date.\n * @param timeFormatOptions - format options for the provided time string.\n * @returns An object with either a 'date' or an 'errorType'.\n *\n * @example\n * Input: time=\"2:30 PM\", dateStartAnchor=2023-10-06T12:00:00Z, dateEndAnchor=2023-10-07T12:00:00Z, options={hourCycle: 'h12', showSeconds: false}\n * Output: { date: 2023-10-06T14:30:00Z }\n *\n * Input: time=\"25:30\"\n * Output: { errorType: 'invalid-input' }\n *\n * Input: time=\"1:30 AM\", dateStartAnchor=2023-10-06T03:00:00Z, dateEndAnchor=2023-10-07T03:00:00Z, options={hourCycle: 'h12', showSeconds: false}\n * Output: { date: 2023-10-07T01:30:00Z, errorType: 'out-of-bounds' }\n */ export function getDateFromTimeString(time, dateStartAnchor, dateEndAnchor, timeFormatOptions) {\n if (!time) {\n return {\n date: null,\n errorType: 'required-input'\n };\n }\n const { hourCycle, showSeconds } = timeFormatOptions;\n const hour12 = hourCycle === 'h11' || hourCycle === 'h12';\n // Determine the regex based on format\n const regex = hour12 ? showSeconds ? REGEX_SHOW_SECONDS_HOUR_12 : REGEX_HIDE_SECONDS_HOUR_12 : showSeconds ? REGEX_SHOW_SECONDS_HOUR_24 : REGEX_HIDE_SECONDS_HOUR_24;\n if (!regex.test(time)) {\n return {\n date: null,\n errorType: 'invalid-input'\n };\n }\n const timeParts = /^(\\d\\d?):(\\d\\d):?(\\d\\d)? ?([ap]m)?/i.exec(time);\n if (!timeParts) {\n return {\n date: null,\n errorType: 'invalid-input'\n };\n }\n const [, selectedHours, minutes, seconds, amPm] = timeParts;\n let hours = selectedHours;\n // Adjust for 12-hour time format if needed\n if (hour12 && amPm) {\n if (amPm.toLowerCase() === 'pm' && +hours !== 12) {\n hours = (+hours + 12).toString();\n } else if (amPm.toLowerCase() === 'am' && +hours === 12) {\n hours = '0';\n }\n }\n const adjustedDate = new Date(dateStartAnchor);\n adjustedDate.setHours(+hours, +minutes, seconds ? +seconds : 0);\n // Adjust to the next day if the selected time is before the anchor time\n if (adjustedDate < dateStartAnchor) {\n adjustedDate.setDate(adjustedDate.getDate() + 1);\n }\n if (adjustedDate >= dateEndAnchor) {\n return {\n date: adjustedDate,\n errorType: 'out-of-bounds'\n };\n }\n return {\n date: adjustedDate\n };\n}\n"],"names":["dateToKey","formatDateToTimeString","getDateEndAnchor","getDateFromTimeString","getDateStartAnchor","getTimesBetween","keyToDate","isValidDate","date","isNaN","getTime","toISOString","key","Date","hourCycle","showSeconds","toLocaleTimeString","undefined","hour","minute","second","dateAnchor","startHour","startDate","setHours","endHour","endDate","setDate","getDate","dateStartAnchor","dateEndAnchor","increment","console","error","result","push","setMinutes","getMinutes","REGEX_SHOW_SECONDS_HOUR_12","REGEX_HIDE_SECONDS_HOUR_12","REGEX_SHOW_SECONDS_HOUR_24","REGEX_HIDE_SECONDS_HOUR_24","time","timeFormatOptions","errorType","hour12","regex","test","timeParts","exec","selectedHours","minutes","seconds","amPm","hours","toLowerCase","toString","adjustedDate"],"mappings":";;;;;;;;;;;IAKoBA,SAAS;eAATA;;IAiCAC,sBAAsB;eAAtBA;;IAwBAC,gBAAgB;eAAhBA;;IAyDAC,qBAAqB;e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;IAC7D,wEAAwE;IACxE,IAAIK,eAAe5B,iBAAiB;QAChC4B,aAAa9B,OAAO,CAAC8B,aAAa7B,OAAO,KAAK;IAClD;IACA,IAAI6B,gBAAgB3B,eAAe;QAC/B,OAAO;YACHtB,MAAMiD;YACNb,WAAW;QACf;IACJ;IACA,OAAO;QACHpC,MAAMiD;IACV;AACJ"}
1
+ {"version":3,"sources":["timeMath.js"],"sourcesContent":["function isValidDate(date) {\n return !isNaN(date.getTime());\n}\n/**\n * Converts a Date object to a string key.\n */ export function dateToKey(date) {\n if (!date) {\n return '';\n }\n if (!isValidDate(date)) {\n return 'invalid';\n }\n return date.toISOString();\n}\n/**\n * Converts a string key back to a Date object.\n * Returns undefined for keys that don't represent valid dates.\n */ export function keyToDate(key) {\n if (key === '' || key === 'invalid') {\n return null;\n }\n const date = new Date(key);\n return isValidDate(date) ? date : null;\n}\n/**\n * Formats a Date object into a time string based on provided options.\n *\n * @param date - The Date object to be formatted.\n * @param options - Formatting options. It has two properties:\n * 1. hourCycle (default: undefined): Determines if the time format should be 12-hour or 24-hour.\n * 2. showSeconds (default: false): Determines if the seconds should be included in the formatted string.\n * @returns Formatted time string based on the given options.\n *\n * @example\n * const date = new Date(2023, 9, 6, 23, 45, 12);\n * formatDateToTimeString(date); // Returns \"23:45\" in CET\n * formatDateToTimeString(date, \\{ showSeconds: true \\}); // Returns \"23:45:12\" in CET\n * formatDateToTimeString(date, \\{ hourCycle: 'h12', showSeconds: true \\}); // Returns \"11:45:12 PM\" in CET\n */ export function formatDateToTimeString(date, { hourCycle, showSeconds } = {}) {\n return date.toLocaleTimeString(undefined, {\n hour: 'numeric',\n hourCycle,\n minute: '2-digit',\n second: showSeconds ? '2-digit' : undefined\n });\n}\n/**\n * Get the start date anchor based on the provided parameters.\n * @example\n * const date = new Date(2023, 9, 6); // October 6, 2023\n * getStartAnchorDate(date, 5); // Returns a date for October 6, 2023, 05:00:00\n */ export function getDateStartAnchor(dateAnchor, startHour) {\n const startDate = new Date(dateAnchor);\n startDate.setHours(startHour, 0, 0, 0);\n return startDate;\n}\n/**\n * Get the end date anchor based on the provided parameters.\n * @example\n * const date = new Date(2023, 9, 6); // October 6, 2023\n * getEndAnchorDate(date, 5, 10); // Returns a date for October 6, 2023, 10:00:00\n * getEndAnchorDate(date, 10, 5); // Returns a date for October 7, 2023, 05:00:00 (next day due to hour conditions)\n */ export function getDateEndAnchor(dateAnchor, startHour, endHour) {\n const endDate = new Date(dateAnchor);\n if (startHour > endHour || endHour === 24) {\n endDate.setDate(endDate.getDate() + 1);\n }\n endDate.setHours(endHour === 24 ? 0 : endHour, 0, 0, 0);\n return endDate;\n}\n/**\n * Generates an array of Date objects between two given Date anchors.\n *\n * @param dateStartAnchor - The starting Date anchor.\n * @param dateEndAnchor - The ending Date anchor.\n * @param increment - The minute increment between each Date in the resulting array.\n * @returns - An array of Date objects.\n *\n * @example\n * const start = new Date(2023, 0, 1, 10, 0); // Jan 1, 2023 10:00:00 AM\n * const end = new Date(2023, 0, 1, 11, 0); // Jan 1, 2023 11:00:00 AM\n * getTimesBetween(start, end, 15); // Returns array with Dates [10:00, 10:15, 10:30, 10:45]\n */ export function getTimesBetween(dateStartAnchor, dateEndAnchor, increment) {\n if (increment <= 0) {\n // eslint-disable-next-line no-console\n console.error('Increment value should be a positive number.');\n return [];\n }\n const result = [];\n const startDate = new Date(dateStartAnchor);\n while(startDate < dateEndAnchor){\n result.push(new Date(startDate));\n startDate.setMinutes(startDate.getMinutes() + increment);\n }\n return result;\n}\nconst REGEX_SHOW_SECONDS_HOUR_12 = /^((1[0-2]|0?[0-9]):([0-5][0-9]):([0-5][0-9])\\s([AaPp][Mm]))$/;\nconst REGEX_HIDE_SECONDS_HOUR_12 = /^((1[0-2]|0?[0-9]):[0-5][0-9]\\s([AaPp][Mm]))$/;\nconst REGEX_SHOW_SECONDS_HOUR_24 = /^([0-1]?[0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9]$/;\nconst REGEX_HIDE_SECONDS_HOUR_24 = /^([0-1]?[0-9]|2[0-4]):[0-5][0-9]$/;\n/**\n * Calculates a new date from the user-selected time string based on anchor dates.\n * Returns an object containing a date if the provided time string is valid, and an optional string indicating the type of error.\n *\n * @param time - The time string to be parsed (e.g., \"2:30 PM\", \"15:45:20\").\n * @param dateStartAnchor - The start anchor date.\n * @param dateEndAnchor - The end anchor date.\n * @param timeFormatOptions - format options for the provided time string.\n * @returns An object with either a 'date' or an 'errorType'.\n *\n * @example\n * Input: time=\"2:30 PM\", dateStartAnchor=2023-10-06T12:00:00Z, dateEndAnchor=2023-10-07T12:00:00Z, options={hourCycle: 'h12', showSeconds: false}\n * Output: { date: 2023-10-06T14:30:00Z }\n *\n * Input: time=\"25:30\"\n * Output: { errorType: 'invalid-input' }\n *\n * Input: time=\"1:30 AM\", dateStartAnchor=2023-10-06T03:00:00Z, dateEndAnchor=2023-10-07T03:00:00Z, options={hourCycle: 'h12', showSeconds: false}\n * Output: { date: 2023-10-07T01:30:00Z, errorType: 'out-of-bounds' }\n */ export function getDateFromTimeString(time, dateStartAnchor, dateEndAnchor, timeFormatOptions) {\n if (!time) {\n return {\n date: null,\n errorType: 'required-input'\n };\n }\n const { hourCycle, showSeconds } = timeFormatOptions;\n const hour12 = hourCycle === 'h11' || hourCycle === 'h12';\n // Determine the regex based on format\n const regex = hour12 ? showSeconds ? REGEX_SHOW_SECONDS_HOUR_12 : REGEX_HIDE_SECONDS_HOUR_12 : showSeconds ? REGEX_SHOW_SECONDS_HOUR_24 : REGEX_HIDE_SECONDS_HOUR_24;\n if (!regex.test(time)) {\n return {\n date: null,\n errorType: 'invalid-input'\n };\n }\n const timeParts = /^(\\d\\d?):(\\d\\d):?(\\d\\d)? ?([ap]m)?/i.exec(time);\n if (!timeParts) {\n return {\n date: null,\n errorType: 'invalid-input'\n };\n }\n const [, selectedHours, minutes, seconds, amPm] = timeParts;\n let hours = selectedHours;\n // Adjust for 12-hour time format if needed\n if (hour12 && amPm) {\n if (amPm.toLowerCase() === 'pm' && +hours !== 12) {\n hours = (+hours + 12).toString();\n } else if (amPm.toLowerCase() === 'am' && +hours === 12) {\n hours = '0';\n }\n }\n const adjustedDate = new Date(dateStartAnchor);\n adjustedDate.setHours(+hours, +minutes, seconds ? +seconds : 0);\n // Adjust to the next day if the selected time is before the anchor time\n if (adjustedDate < dateStartAnchor) {\n adjustedDate.setDate(adjustedDate.getDate() + 1);\n }\n if (adjustedDate >= dateEndAnchor) {\n return {\n date: adjustedDate,\n errorType: 'out-of-bounds'\n };\n }\n return {\n date: adjustedDate\n };\n}\n"],"names":["dateToKey","keyToDate","formatDateToTimeString","getDateStartAnchor","getDateEndAnchor","getTimesBetween","getDateFromTimeString","isValidDate","date","isNaN","getTime","toISOString","key","Date","hourCycle","showSeconds","toLocaleTimeString","undefined","hour","minute","second","dateAnchor","startHour","startDate","setHours","endHour","endDate","setDate","getDate","dateStartAnchor","dateEndAnchor","increment","console","error","result","push","setMinutes","getMinutes","REGEX_SHOW_SECONDS_HOUR_12","REGEX_HIDE_SECONDS_HOUR_12","REGEX_SHOW_SECONDS_HOUR_24","REGEX_HIDE_SECONDS_HOUR_24","time","timeFormatOptions","errorType","hour12","regex","test","timeParts","exec","selectedHours","minutes","seconds","amPm","hours","toLowerCase","toString","adjustedDate"],"mappings":";;;;;;;;;;;IAKoBA,SAAS;eAATA;;IAYAC,SAAS;eAATA;;IAqBAC,sBAAsB;eAAtBA;;IAaAC,kBAAkB;eAAlBA;;IAWAC,gBAAgB;eAAhBA;;IAoBAC,eAAe;eAAfA;;IAqCAC,qBAAqB;eAArBA;;;AAvHpB,SAASC,YAAYC,IAAI;IACrB,OAAO,CAACC,MAAMD,KAAKE,OAAO;AAC9B;AAGW,SAASV,UAAUQ,IAAI;IAC9B,IAAI,CAACA,MAAM;QACP,OAAO;IACX;IACA,IAAI,CAACD,YAAYC,OAAO;QACpB,OAAO;IACX;IACA,OAAOA,KAAKG,WAAW;AAC3B;AAIW,SAASV,UAAUW,GAAG;IAC7B,IAAIA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C7F,IAAI,CAACD,MAAM;QACP,OAAO;YACHlC,MAAM;YACNoC,WAAW;QACf;IACJ;IACA,MAAM,EAAE9B,SAAS,EAAEC,WAAW,EAAE,GAAG4B;IACnC,MAAME,SAAS/B,cAAc,SAASA,cAAc;IACpD,sCAAsC;IACtC,MAAMgC,QAAQD,SAAS9B,cAAcuB,6BAA6BC,6BAA6BxB,cAAcyB,6BAA6BC;IAC1I,IAAI,CAACK,MAAMC,IAAI,CAACL,OAAO;QACnB,OAAO;YACHlC,MAAM;YACNoC,WAAW;QACf;IACJ;IACA,MAAMI,YAAY,sCAAsCC,IAAI,CAACP;IAC7D,IAAI,CAACM,WAAW;QACZ,OAAO;YACHxC,MAAM;YACNoC,WAAW;QACf;IACJ;IACA,MAAM,GAAGM,eAAeC,SAASC,SAASC,KAAK,GAAGL;IAClD,IAAIM,QAAQJ;IACZ,2CAA2C;IAC3C,IAAIL,UAAUQ,MAAM;QAChB,IAAIA,KAAKE,WAAW,OAAO,QAAQ,CAACD,UAAU,IAAI;YAC9CA,QAAQ,AAAC,CAAA,CAACA,QAAQ,EAAC,EAAGE,QAAQ;QAClC,OAAO,IAAIH,KAAKE,WAAW,OAAO,QAAQ,CAACD,UAAU,IAAI;YACrDA,QAAQ;QACZ;IACJ;IACA,MAAMG,eAAe,IAAI5C,KAAKgB;IAC9B4B,aAAajC,QAAQ,CAAC,CAAC8B,OAAO,CAACH,SAASC,UAAU,CAACA,UAAU;IAC7D,wEAAwE;IACxE,IAAIK,eAAe5B,iBAAiB;QAChC4B,aAAa9B,OAAO,CAAC8B,aAAa7B,OAAO,KAAK;IAClD;IACA,IAAI6B,gBAAgB3B,eAAe;QAC/B,OAAO;YACHtB,MAAMiD;YACNb,WAAW;QACf;IACJ;IACA,OAAO;QACHpC,MAAMiD;IACV;AACJ"}
@@ -12,9 +12,6 @@ _export(exports, {
12
12
  TimePicker: function() {
13
13
  return _TimePicker.TimePicker;
14
14
  },
15
- formatDateToTimeString: function() {
16
- return _TimePicker.formatDateToTimeString;
17
- },
18
15
  timePickerClassNames: function() {
19
16
  return _TimePicker.timePickerClassNames;
20
17
  },
@@ -23,6 +20,9 @@ _export(exports, {
23
20
  },
24
21
  useTimePicker_unstable: function() {
25
22
  return _TimePicker.useTimePicker_unstable;
23
+ },
24
+ formatDateToTimeString: function() {
25
+ return _TimePicker.formatDateToTimeString;
26
26
  }
27
27
  });
28
28
  const _TimePicker = require("./TimePicker");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export { TimePicker, timePickerClassNames, useTimePickerStyles_unstable, useTimePicker_unstable, formatDateToTimeString } from './TimePicker';\n"],"names":["TimePicker","formatDateToTimeString","timePickerClassNames","useTimePickerStyles_unstable","useTimePicker_unstable"],"mappings":";;;;;;;;;;;IAASA,UAAU;eAAVA,sBAAU;;IAA8EC,sBAAsB;eAAtBA,kCAAsB;;IAAlGC,oBAAoB;eAApBA,gCAAoB;;IAAEC,4BAA4B;eAA5BA,wCAA4B;;IAAEC,sBAAsB;eAAtBA,kCAAsB;;;4BAAgC"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export { TimePicker, timePickerClassNames, useTimePickerStyles_unstable, useTimePicker_unstable, formatDateToTimeString } from './TimePicker';\n"],"names":["TimePicker","timePickerClassNames","useTimePickerStyles_unstable","useTimePicker_unstable","formatDateToTimeString"],"mappings":";;;;;;;;;;;IAASA,UAAU;eAAVA,sBAAU;;IAAEC,oBAAoB;eAApBA,gCAAoB;;IAAEC,4BAA4B;eAA5BA,wCAA4B;;IAAEC,sBAAsB;eAAtBA,kCAAsB;;IAAEC,sBAAsB;eAAtBA,kCAAsB;;;4BAAQ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-timepicker-compat",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Fluent UI TimePicker Compat Component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -40,12 +40,12 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@fluentui/keyboard-keys": "^9.0.7",
43
- "@fluentui/react-combobox": "^9.9.2",
44
- "@fluentui/react-field": "^9.1.57",
45
- "@fluentui/react-jsx-runtime": "^9.0.33",
46
- "@fluentui/react-shared-contexts": "^9.15.1",
47
- "@fluentui/react-theme": "^9.1.18",
48
- "@fluentui/react-utilities": "^9.18.4",
43
+ "@fluentui/react-combobox": "^9.9.3",
44
+ "@fluentui/react-field": "^9.1.58",
45
+ "@fluentui/react-jsx-runtime": "^9.0.34",
46
+ "@fluentui/react-shared-contexts": "^9.15.2",
47
+ "@fluentui/react-theme": "^9.1.19",
48
+ "@fluentui/react-utilities": "^9.18.5",
49
49
  "@griffel/react": "^1.5.14",
50
50
  "@swc/helpers": "^0.5.1"
51
51
  },