@ionic/core 7.7.5 → 7.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/components/data.js +23 -38
  2. package/components/ion-datetime-button.js +11 -10
  3. package/components/ion-datetime.js +69 -7
  4. package/components/ion-searchbar.js +34 -5
  5. package/dist/cjs/{data-a5109f09.js → data-4487a815.js} +22 -39
  6. package/dist/cjs/ion-datetime-button.cjs.entry.js +11 -10
  7. package/dist/cjs/ion-datetime_3.cjs.entry.js +66 -7
  8. package/dist/cjs/ion-searchbar.cjs.entry.js +28 -4
  9. package/dist/cjs/ionic.cjs.js +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/collection/components/datetime/datetime.js +50 -7
  12. package/dist/collection/components/datetime/test/basic/datetime.e2e.js +77 -0
  13. package/dist/collection/components/datetime/test/format.spec.js +65 -15
  14. package/dist/collection/components/datetime/utils/format.js +24 -37
  15. package/dist/collection/components/datetime/utils/validate.js +45 -0
  16. package/dist/collection/components/datetime-button/datetime-button.js +11 -10
  17. package/dist/collection/components/datetime-button/test/basic/datetime-button.e2e.js +65 -0
  18. package/dist/collection/components/searchbar/searchbar.js +84 -5
  19. package/dist/collection/components/searchbar/test/searchbar.spec.js +20 -2
  20. package/dist/docs.json +113 -1
  21. package/dist/esm/{data-0f3ab200.js → data-bb424ba8.js} +23 -38
  22. package/dist/esm/ion-datetime-button.entry.js +11 -10
  23. package/dist/esm/ion-datetime_3.entry.js +66 -7
  24. package/dist/esm/ion-searchbar.entry.js +29 -5
  25. package/dist/esm/ionic.js +1 -1
  26. package/dist/esm/loader.js +1 -1
  27. package/dist/esm-es5/data-bb424ba8.js +4 -0
  28. package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
  29. package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
  30. package/dist/esm-es5/ion-searchbar.entry.js +1 -1
  31. package/dist/esm-es5/ionic.js +1 -1
  32. package/dist/esm-es5/loader.js +1 -1
  33. package/dist/html.html-data.json +12 -0
  34. package/dist/ionic/ionic.esm.js +1 -1
  35. package/dist/ionic/p-2b77099e.system.entry.js +4 -0
  36. package/dist/ionic/p-3789920e.js +4 -0
  37. package/dist/ionic/p-4abb3f9e.entry.js +4 -0
  38. package/dist/ionic/p-60c9fd9e.system.js +1 -1
  39. package/dist/ionic/p-8a1b0abb.system.js +4 -0
  40. package/dist/ionic/p-a722d78f.system.entry.js +4 -0
  41. package/dist/ionic/p-bc56a728.entry.js +4 -0
  42. package/dist/ionic/p-cfd31f45.system.entry.js +4 -0
  43. package/dist/ionic/p-e02681a6.entry.js +4 -0
  44. package/dist/types/components/datetime/datetime-interface.d.ts +10 -0
  45. package/dist/types/components/datetime/datetime.d.ts +9 -1
  46. package/dist/types/components/datetime/utils/format.d.ts +7 -13
  47. package/dist/types/components/datetime/utils/validate.d.ts +8 -0
  48. package/dist/types/components/searchbar/searchbar.d.ts +38 -0
  49. package/dist/types/components.d.ts +34 -2
  50. package/hydrate/index.js +127 -56
  51. package/package.json +1 -1
  52. package/dist/esm-es5/data-0f3ab200.js +0 -4
  53. package/dist/ionic/p-6f5b32c7.system.entry.js +0 -4
  54. package/dist/ionic/p-7330c044.system.js +0 -4
  55. package/dist/ionic/p-76afa95f.entry.js +0 -4
  56. package/dist/ionic/p-81f18ed1.system.entry.js +0 -4
  57. package/dist/ionic/p-c67c9644.entry.js +0 -4
  58. package/dist/ionic/p-e447e552.entry.js +0 -4
  59. package/dist/ionic/p-ef269a56.system.entry.js +0 -4
  60. package/dist/ionic/p-f7dce541.js +0 -4
@@ -15,7 +15,7 @@ import { RouteID, RouterDirection, RouterEventDetail, RouteWrite } from "./compo
15
15
  import { BreadcrumbCollapsedClickEventDetail } from "./components/breadcrumb/breadcrumb-interface";
16
16
  import { CheckboxChangeEventDetail } from "./components/checkbox/checkbox-interface";
17
17
  import { ScrollBaseDetail, ScrollDetail } from "./components/content/content-interface";
18
- import { DatetimeChangeEventDetail, DatetimeHighlight, DatetimeHighlightCallback, DatetimeHourCycle, DatetimePresentation, TitleSelectedDatesFormatter } from "./components/datetime/datetime-interface";
18
+ import { DatetimeChangeEventDetail, DatetimeHighlight, DatetimeHighlightCallback, DatetimeHourCycle, DatetimePresentation, FormatOptions, TitleSelectedDatesFormatter } from "./components/datetime/datetime-interface";
19
19
  import { SpinnerTypes } from "./components/spinner/spinner-configs";
20
20
  import { InputChangeEventDetail, InputInputEventDetail } from "./components/input/input-interface";
21
21
  import { CounterFormatter } from "./components/item/item-interface";
@@ -51,7 +51,7 @@ export { RouteID, RouterDirection, RouterEventDetail, RouteWrite } from "./compo
51
51
  export { BreadcrumbCollapsedClickEventDetail } from "./components/breadcrumb/breadcrumb-interface";
52
52
  export { CheckboxChangeEventDetail } from "./components/checkbox/checkbox-interface";
53
53
  export { ScrollBaseDetail, ScrollDetail } from "./components/content/content-interface";
54
- export { DatetimeChangeEventDetail, DatetimeHighlight, DatetimeHighlightCallback, DatetimeHourCycle, DatetimePresentation, TitleSelectedDatesFormatter } from "./components/datetime/datetime-interface";
54
+ export { DatetimeChangeEventDetail, DatetimeHighlight, DatetimeHighlightCallback, DatetimeHourCycle, DatetimePresentation, FormatOptions, TitleSelectedDatesFormatter } from "./components/datetime/datetime-interface";
55
55
  export { SpinnerTypes } from "./components/spinner/spinner-configs";
56
56
  export { InputChangeEventDetail, InputInputEventDetail } from "./components/input/input-interface";
57
57
  export { CounterFormatter } from "./components/item/item-interface";
@@ -858,6 +858,10 @@ export namespace Components {
858
858
  * The first day of the week to use for `ion-datetime`. The default value is `0` and represents Sunday.
859
859
  */
860
860
  "firstDayOfWeek": number;
861
+ /**
862
+ * Formatting options for dates and times. Should include a 'date' and/or 'time' object, each of which is of type [Intl.DateTimeFormatOptions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options).
863
+ */
864
+ "formatOptions"?: FormatOptions;
861
865
  /**
862
866
  * Used to apply custom text and background colors to specific dates. Can be either an array of objects containing ISO strings and colors, or a callback that receives an ISO string and returns the colors. Only applies to the `date`, `date-time`, and `time-date` presentations, with `preferWheel="false"`.
863
867
  */
@@ -2548,6 +2552,10 @@ export namespace Components {
2548
2552
  * If `true`, enable searchbar animation.
2549
2553
  */
2550
2554
  "animated": boolean;
2555
+ /**
2556
+ * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user. Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
2557
+ */
2558
+ "autocapitalize": string;
2551
2559
  /**
2552
2560
  * Set the input's autocomplete property.
2553
2561
  */
@@ -2592,6 +2600,14 @@ export namespace Components {
2592
2600
  * A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`.
2593
2601
  */
2594
2602
  "inputmode"?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
2603
+ /**
2604
+ * This attribute specifies the maximum number of characters that the user can enter.
2605
+ */
2606
+ "maxlength"?: number;
2607
+ /**
2608
+ * This attribute specifies the minimum number of characters that the user can enter.
2609
+ */
2610
+ "minlength"?: number;
2595
2611
  /**
2596
2612
  * The mode determines which platform styles to use.
2597
2613
  */
@@ -5520,6 +5536,10 @@ declare namespace LocalJSX {
5520
5536
  * The first day of the week to use for `ion-datetime`. The default value is `0` and represents Sunday.
5521
5537
  */
5522
5538
  "firstDayOfWeek"?: number;
5539
+ /**
5540
+ * Formatting options for dates and times. Should include a 'date' and/or 'time' object, each of which is of type [Intl.DateTimeFormatOptions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat#options).
5541
+ */
5542
+ "formatOptions"?: FormatOptions;
5523
5543
  /**
5524
5544
  * Used to apply custom text and background colors to specific dates. Can be either an array of objects containing ISO strings and colors, or a callback that receives an ISO string and returns the colors. Only applies to the `date`, `date-time`, and `time-date` presentations, with `preferWheel="false"`.
5525
5545
  */
@@ -7156,6 +7176,10 @@ declare namespace LocalJSX {
7156
7176
  * If `true`, enable searchbar animation.
7157
7177
  */
7158
7178
  "animated"?: boolean;
7179
+ /**
7180
+ * Indicates whether and how the text value should be automatically capitalized as it is entered/edited by the user. Available options: `"off"`, `"none"`, `"on"`, `"sentences"`, `"words"`, `"characters"`.
7181
+ */
7182
+ "autocapitalize": string;
7159
7183
  /**
7160
7184
  * Set the input's autocomplete property.
7161
7185
  */
@@ -7196,6 +7220,14 @@ declare namespace LocalJSX {
7196
7220
  * A hint to the browser for which keyboard to display. Possible values: `"none"`, `"text"`, `"tel"`, `"url"`, `"email"`, `"numeric"`, `"decimal"`, and `"search"`.
7197
7221
  */
7198
7222
  "inputmode"?: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
7223
+ /**
7224
+ * This attribute specifies the maximum number of characters that the user can enter.
7225
+ */
7226
+ "maxlength"?: number;
7227
+ /**
7228
+ * This attribute specifies the minimum number of characters that the user can enter.
7229
+ */
7230
+ "minlength"?: number;
7199
7231
  /**
7200
7232
  * The mode determines which platform styles to use.
7201
7233
  */
package/hydrate/index.js CHANGED
@@ -16029,7 +16029,25 @@ const getFormattedDayPeriod = (dayPeriod) => {
16029
16029
  }
16030
16030
  return dayPeriod.toUpperCase();
16031
16031
  };
16032
- const getLocalizedTime = (locale, refParts, hourCycle) => {
16032
+ /**
16033
+ * Including time zone options may lead to the rendered text showing a
16034
+ * different time from what was selected in the Datetime, which could cause
16035
+ * confusion.
16036
+ */
16037
+ const stripTimeZone = (formatOptions) => {
16038
+ return Object.assign(Object.assign({}, formatOptions), {
16039
+ /**
16040
+ * Setting the time zone to UTC ensures that the value shown is always the
16041
+ * same as what was selected and safeguards against older Safari bugs with
16042
+ * Intl.DateTimeFormat.
16043
+ */
16044
+ timeZone: 'UTC',
16045
+ /**
16046
+ * We do not want to display the time zone name
16047
+ */
16048
+ timeZoneName: undefined });
16049
+ };
16050
+ const getLocalizedTime = (locale, refParts, hourCycle, formatOptions = { hour: 'numeric', minute: 'numeric' }) => {
16033
16051
  const timeParts = {
16034
16052
  hour: refParts.hour,
16035
16053
  minute: refParts.minute,
@@ -16037,28 +16055,12 @@ const getLocalizedTime = (locale, refParts, hourCycle) => {
16037
16055
  if (timeParts.hour === undefined || timeParts.minute === undefined) {
16038
16056
  return 'Invalid Time';
16039
16057
  }
16040
- return new Intl.DateTimeFormat(locale, {
16041
- hour: 'numeric',
16042
- minute: 'numeric',
16043
- /**
16044
- * Setting the timeZone to UTC prevents
16045
- * new Intl.DatetimeFormat from subtracting
16046
- * the user's current timezone offset
16047
- * when formatting the time.
16048
- */
16049
- timeZone: 'UTC',
16058
+ return new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, stripTimeZone(formatOptions)), {
16050
16059
  /**
16051
16060
  * We use hourCycle here instead of hour12 due to:
16052
16061
  * https://bugs.chromium.org/p/chromium/issues/detail?id=1347316&q=hour12&can=2
16053
16062
  */
16054
- hourCycle,
16055
- /**
16056
- * Setting Z at the end indicates that this
16057
- * date string is in the UTC time zone. This
16058
- * prevents new Date from adding the time zone
16059
- * offset when getting the ISO string.
16060
- */
16061
- }).format(new Date(convertDataToISO(Object.assign({
16063
+ hourCycle })).format(new Date(convertDataToISO(Object.assign({
16062
16064
  /**
16063
16065
  * JS uses a simplified ISO 8601 format which allows for
16064
16066
  * date-only formats and date-time formats, but not
@@ -16144,14 +16146,6 @@ const generateDayAriaLabel = (locale, today, refParts) => {
16144
16146
  */
16145
16147
  return today ? `Today, ${labelString}` : labelString;
16146
16148
  };
16147
- /**
16148
- * Gets the day of the week, month, and day
16149
- * Used for the header in MD mode.
16150
- */
16151
- const getMonthAndDay = (locale, refParts) => {
16152
- const date = getNormalizedDate(refParts);
16153
- return new Intl.DateTimeFormat(locale, { weekday: 'short', month: 'short', day: 'numeric', timeZone: 'UTC' }).format(date);
16154
- };
16155
16149
  /**
16156
16150
  * Given a locale and a date object,
16157
16151
  * return a formatted string that includes
@@ -16162,15 +16156,6 @@ const getMonthAndYear = (locale, refParts) => {
16162
16156
  const date = getNormalizedDate(refParts);
16163
16157
  return new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(date);
16164
16158
  };
16165
- /**
16166
- * Given a locale and a date object,
16167
- * return a formatted string that includes
16168
- * the short month, numeric day, and full year.
16169
- * Example: Apr 22, 2021
16170
- */
16171
- const getMonthDayAndYear = (locale, refParts) => {
16172
- return getLocalizedDateTime(locale, refParts, { month: 'short', day: 'numeric', year: 'numeric' });
16173
- };
16174
16159
  /**
16175
16160
  * Given a locale and a date object,
16176
16161
  * return a formatted string that includes
@@ -16220,7 +16205,7 @@ const getNormalizedDate = (refParts) => {
16220
16205
  */
16221
16206
  const getLocalizedDateTime = (locale, refParts, options) => {
16222
16207
  const date = getNormalizedDate(refParts);
16223
- return getDateTimeFormat(locale, options).format(date);
16208
+ return getDateTimeFormat(locale, stripTimeZone(options)).format(date);
16224
16209
  };
16225
16210
  /**
16226
16211
  * Given a locale, DatetimeParts, and options
@@ -16986,6 +16971,48 @@ const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
16986
16971
  return undefined;
16987
16972
  };
16988
16973
 
16974
+ /**
16975
+ * If a time zone is provided in the format options, the rendered text could
16976
+ * differ from what was selected in the Datetime, which could cause
16977
+ * confusion.
16978
+ */
16979
+ const warnIfTimeZoneProvided = (el, formatOptions) => {
16980
+ var _a, _b, _c, _d;
16981
+ if (((_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _a === void 0 ? void 0 : _a.timeZone) ||
16982
+ ((_b = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _b === void 0 ? void 0 : _b.timeZoneName) ||
16983
+ ((_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _c === void 0 ? void 0 : _c.timeZone) ||
16984
+ ((_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _d === void 0 ? void 0 : _d.timeZoneName)) {
16985
+ printIonWarning('Datetime: "timeZone" and "timeZoneName" are not supported in "formatOptions".', el);
16986
+ }
16987
+ };
16988
+ const checkForPresentationFormatMismatch = (el, presentation, formatOptions) => {
16989
+ // formatOptions is not required
16990
+ if (!formatOptions)
16991
+ return;
16992
+ // If formatOptions is provided, the date and/or time objects are required, depending on the presentation
16993
+ switch (presentation) {
16994
+ case 'date':
16995
+ case 'month-year':
16996
+ case 'month':
16997
+ case 'year':
16998
+ if (formatOptions.date === undefined) {
16999
+ printIonWarning(`Datetime: The '${presentation}' presentation requires a date object in formatOptions.`, el);
17000
+ }
17001
+ break;
17002
+ case 'time':
17003
+ if (formatOptions.time === undefined) {
17004
+ printIonWarning(`Datetime: The 'time' presentation requires a time object in formatOptions.`, el);
17005
+ }
17006
+ break;
17007
+ case 'date-time':
17008
+ case 'time-date':
17009
+ if (formatOptions.date === undefined && formatOptions.time === undefined) {
17010
+ printIonWarning(`Datetime: The '${presentation}' presentation requires either a date or time object (or both) in formatOptions.`, el);
17011
+ }
17012
+ break;
17013
+ }
17014
+ };
17015
+
16989
17016
  const datetimeIosCss = "/*!@:host*/.sc-ion-datetime-ios-h{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}/*!@ion-picker-column-internal*/ion-picker-column-internal.sc-ion-datetime-ios{min-width:26px}/*!@:host(.datetime-size-fixed)*/.datetime-size-fixed.sc-ion-datetime-ios-h{width:auto;height:auto}/*!@:host(.datetime-size-fixed:not(.datetime-prefer-wheel))*/.datetime-size-fixed.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel){max-width:350px}/*!@:host(.datetime-size-fixed.datetime-prefer-wheel)*/.datetime-size-fixed.datetime-prefer-wheel.sc-ion-datetime-ios-h{min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}/*!@:host(.datetime-size-cover)*/.datetime-size-cover.sc-ion-datetime-ios-h{width:100%}/*!@:host .calendar-body,\n:host .datetime-year*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{opacity:0}/*!@:host(:not(.datetime-ready)) .datetime-year*/.sc-ion-datetime-ios-h:not(.datetime-ready) .datetime-year.sc-ion-datetime-ios{position:absolute;pointer-events:none}/*!@:host(.datetime-ready) .calendar-body*/.datetime-ready.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios{opacity:1}/*!@:host(.datetime-ready) .datetime-year*/.datetime-ready.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{display:none;opacity:1}/*!@:host .wheel-order-year-first .day-column*/.sc-ion-datetime-ios-h .wheel-order-year-first.sc-ion-datetime-ios .day-column.sc-ion-datetime-ios{-ms-flex-order:3;order:3;text-align:end}/*!@:host .wheel-order-year-first .month-column*/.sc-ion-datetime-ios-h .wheel-order-year-first.sc-ion-datetime-ios .month-column.sc-ion-datetime-ios{-ms-flex-order:2;order:2;text-align:end}/*!@:host .wheel-order-year-first .year-column*/.sc-ion-datetime-ios-h .wheel-order-year-first.sc-ion-datetime-ios .year-column.sc-ion-datetime-ios{-ms-flex-order:1;order:1;text-align:start}/*!@:host .datetime-calendar,\n:host .datetime-year*/.sc-ion-datetime-ios-h .datetime-calendar.sc-ion-datetime-ios,.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}/*!@:host(.show-month-and-year) .datetime-year*/.show-month-and-year.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{display:-ms-flexbox;display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){/*!@:host(.show-month-and-year) .calendar-next-prev,\n :host(.show-month-and-year) .calendar-days-of-week,\n :host(.show-month-and-year) .calendar-body,\n :host(.show-month-and-year) .datetime-time*/.show-month-and-year.sc-ion-datetime-ios-h .calendar-next-prev.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{position:absolute;visibility:hidden;pointer-events:none}/*!@@supports (inset-inline-start: 0)*/@supports .sc-ion-datetime-ios (inset-inline-start.sc-ion-datetime-ios: 0).sc-ion-datetime-ios{.sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h.show-month-and-year .datetime-time{inset-inline-start:-99999px}}/*!@@supports not (inset-inline-start: 0)*/@supports .sc-ion-datetime-ios not.sc-ion-datetime-ios (inset-inline-start.sc-ion-datetime-ios: 0).sc-ion-datetime-ios{.sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h.show-month-and-year .datetime-time{left:-99999px}.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .calendar-next-prev,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .calendar-next-prev,.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .calendar-days-of-week,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .calendar-days-of-week,.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .calendar-body,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .calendar-body,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .calendar-body,.sc-ion-datetime-ios-h[dir=rtl].sc-ion-datetime-ios-h.show-month-and-year .datetime-time,[dir=rtl] .sc-ion-datetime-ios-h.sc-ion-datetime-ios-h.show-month-and-year .datetime-time,.sc-ion-datetime-ios-h[dir=rtl].show-month-and-year .datetime-time,[dir=rtl] .sc-ion-datetime-ios-h.show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .calendar-next-prev,.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .calendar-days-of-week,.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .calendar-body,.sc-ion-datetime-ios-h.show-month-and-year:dir(rtl) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){/*!@:host(.show-month-and-year) .calendar-next-prev,\n :host(.show-month-and-year) .calendar-days-of-week,\n :host(.show-month-and-year) .calendar-body,\n :host(.show-month-and-year) .datetime-time*/.show-month-and-year.sc-ion-datetime-ios-h .calendar-next-prev.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.show-month-and-year.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{display:none}}/*!@:host(.month-year-picker-open) .datetime-footer*/.month-year-picker-open.sc-ion-datetime-ios-h .datetime-footer.sc-ion-datetime-ios{display:none}/*!@:host(.datetime-disabled)*/.datetime-disabled.sc-ion-datetime-ios-h{pointer-events:none}/*!@:host(.datetime-disabled) .calendar-days-of-week,\n:host(.datetime-disabled) .datetime-time*/.datetime-disabled.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios,.datetime-disabled.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{opacity:0.4}/*!@:host(.datetime-readonly)*/.datetime-readonly.sc-ion-datetime-ios-h{pointer-events:none}/*!@:host(.datetime-readonly) .calendar-action-buttons,\n:host(.datetime-readonly) .calendar-body,\n:host(.datetime-readonly) .datetime-year*/.datetime-readonly.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios,.datetime-readonly.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios,.datetime-readonly.sc-ion-datetime-ios-h .datetime-year.sc-ion-datetime-ios{pointer-events:initial}/*!@:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),\n:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]*/.datetime-readonly.sc-ion-datetime-ios-h .calendar-day[disabled].sc-ion-datetime-ios:not(.calendar-day-constrained),.datetime-readonly.sc-ion-datetime-ios-h .datetime-action-buttons.sc-ion-datetime-ios ion-button[disabled].sc-ion-datetime-ios{opacity:1}/*!@:host .datetime-header .datetime-title*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios .datetime-title.sc-ion-datetime-ios{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}/*!@:host .datetime-action-buttons.has-clear-button*/.sc-ion-datetime-ios-h .datetime-action-buttons.has-clear-button.sc-ion-datetime-ios{width:100%}/*!@:host .datetime-action-buttons ion-buttons*/.sc-ion-datetime-ios-h .datetime-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@.datetime-action-buttons .datetime-action-buttons-container*/.datetime-action-buttons.sc-ion-datetime-ios .datetime-action-buttons-container.sc-ion-datetime-ios{display:-ms-flexbox;display:flex}/*!@:host .calendar-action-buttons*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@:host .calendar-action-buttons ion-item,\n:host .calendar-action-buttons ion-button*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-item.sc-ion-datetime-ios,.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-button.sc-ion-datetime-ios{--background:translucent}/*!@:host .calendar-action-buttons ion-item ion-label*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-item.sc-ion-datetime-ios ion-label.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:auto}/*!@:host .calendar-action-buttons ion-item ion-icon*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-item.sc-ion-datetime-ios ion-icon.sc-ion-datetime-ios{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}/*!@:host .calendar-days-of-week*/.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-ios .day-of-week.sc-ion-datetime-ios{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}/*!@:host .calendar-body*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}/*!@:host .calendar-body .calendar-month*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}/*!@:host .calendar-body .calendar-month-disabled*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month-disabled.sc-ion-datetime-ios{scroll-snap-align:none}/*!@:host .calendar-body::-webkit-scrollbar*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios::-webkit-scrollbar{display:none}/*!@:host .calendar-body .calendar-month-grid*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month-grid.sc-ion-datetime-ios{display:grid;grid-template-columns:repeat(7, 1fr)}/*!@:host .calendar-day-wrapper*/.sc-ion-datetime-ios-h .calendar-day-wrapper.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-ios{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}/*!@:host .calendar-day[disabled]*/.sc-ion-datetime-ios-h .calendar-day[disabled].sc-ion-datetime-ios{pointer-events:none;opacity:0.4}/*!@.calendar-day:focus*/.calendar-day.sc-ion-datetime-ios:focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}/*!@:host .datetime-time*/.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}/*!@:host(.datetime-presentation-time) .datetime-time*/.datetime-presentation-time.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}/*!@:host ion-popover*/.sc-ion-datetime-ios-h ion-popover.sc-ion-datetime-ios{--height:200px}/*!@:host .time-header*/.sc-ion-datetime-ios-h .time-header.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}/*!@:host .time-body*/.sc-ion-datetime-ios-h .time-body.sc-ion-datetime-ios{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}/*!@:host .time-body-active*/.sc-ion-datetime-ios-h .time-body-active.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@:host(.in-item)*/.in-item.sc-ion-datetime-ios-h{position:static}/*!@:host(.show-month-and-year) .calendar-action-buttons ion-item*/.show-month-and-year.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-item.sc-ion-datetime-ios{--color:var(--ion-color-base)}/*!@:host*/.sc-ion-datetime-ios-h{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #666666)}/*!@:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),\n:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),\n:host(.datetime-presentation-date:not(.datetime-prefer-wheel))*/.datetime-presentation-date-time.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel),.datetime-presentation-time-date.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel),.datetime-presentation-date.sc-ion-datetime-ios-h:not(.datetime-prefer-wheel){min-height:350px}/*!@:host .datetime-header*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, #cccccc);font-size:min(0.875rem, 22.4px)}/*!@:host .datetime-header .datetime-title*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios .datetime-title.sc-ion-datetime-ios{color:var(--title-color)}/*!@:host .datetime-header .datetime-selected-date*/.sc-ion-datetime-ios-h .datetime-header.sc-ion-datetime-ios .datetime-selected-date.sc-ion-datetime-ios{margin-top:10px}/*!@:host .calendar-action-buttons ion-item*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-item.sc-ion-datetime-ios{--padding-start:16px;--background-hover:transparent;--background-activated:transparent;font-size:min(1rem, 25.6px);font-weight:600}/*!@:host .calendar-action-buttons ion-item ion-icon,\n:host .calendar-action-buttons ion-buttons ion-button*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-item.sc-ion-datetime-ios ion-icon.sc-ion-datetime-ios,.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios ion-button.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@:host .calendar-action-buttons ion-buttons*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:0}/*!@:host .calendar-action-buttons ion-buttons ion-button*/.sc-ion-datetime-ios-h .calendar-action-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios ion-button.sc-ion-datetime-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}/*!@:host .calendar-days-of-week*/.sc-ion-datetime-ios-h .calendar-days-of-week.sc-ion-datetime-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, #b3b3b3);font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-ios .day-of-week.sc-ion-datetime-ios{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-ios{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){/*!@.calendar-days-of-week .day-of-week*/.calendar-days-of-week.sc-ion-datetime-ios .day-of-week.sc-ion-datetime-ios{width:auto;height:auto;overflow:initial}/*!@.calendar-day*/.calendar-day.sc-ion-datetime-ios{border-radius:32px}}/*!@:host .calendar-body .calendar-month .calendar-month-grid*/.sc-ion-datetime-ios-h .calendar-body.sc-ion-datetime-ios .calendar-month.sc-ion-datetime-ios .calendar-month-grid.sc-ion-datetime-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}/*!@:host .calendar-day-wrapper*/.sc-ion-datetime-ios-h .calendar-day-wrapper.sc-ion-datetime-ios{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}/*!@:host .calendar-day*/.sc-ion-datetime-ios-h .calendar-day.sc-ion-datetime-ios{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}/*!@.calendar-day.calendar-day-active*/.calendar-day.calendar-day-active.sc-ion-datetime-ios{background:rgba(var(--ion-color-base-rgb), 0.2)}/*!@:host .calendar-day.calendar-day-today*/.sc-ion-datetime-ios-h .calendar-day.calendar-day-today.sc-ion-datetime-ios{color:var(--ion-color-base)}/*!@:host .calendar-day.calendar-day-active*/.sc-ion-datetime-ios-h .calendar-day.calendar-day-active.sc-ion-datetime-ios{color:var(--ion-color-base);font-weight:600}/*!@:host .calendar-day.calendar-day-today.calendar-day-active*/.sc-ion-datetime-ios-h .calendar-day.calendar-day-today.calendar-day-active.sc-ion-datetime-ios{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host .datetime-time*/.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}/*!@:host .datetime-time .time-header*/.sc-ion-datetime-ios-h .datetime-time.sc-ion-datetime-ios .time-header.sc-ion-datetime-ios{font-weight:600}/*!@:host .datetime-buttons*/.sc-ion-datetime-ios-h .datetime-buttons.sc-ion-datetime-ios{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, #cccccc)}/*!@:host .datetime-buttons ::slotted(ion-buttons),\n:host .datetime-buttons ion-buttons*/.sc-ion-datetime-ios-h .datetime-buttons .sc-ion-datetime-ios-s>ion-buttons,.sc-ion-datetime-ios-h .datetime-buttons.sc-ion-datetime-ios ion-buttons.sc-ion-datetime-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}/*!@:host .datetime-action-buttons*/.sc-ion-datetime-ios-h .datetime-action-buttons.sc-ion-datetime-ios{width:100%}";
16990
17017
  var IonDatetimeIosStyle0 = datetimeIosCss;
16991
17018
 
@@ -17634,6 +17661,7 @@ class Datetime {
17634
17661
  this.color = 'primary';
17635
17662
  this.name = this.inputId;
17636
17663
  this.disabled = false;
17664
+ this.formatOptions = undefined;
17637
17665
  this.readonly = false;
17638
17666
  this.isDateEnabled = undefined;
17639
17667
  this.min = undefined;
@@ -17661,6 +17689,11 @@ class Datetime {
17661
17689
  this.size = 'fixed';
17662
17690
  this.preferWheel = false;
17663
17691
  }
17692
+ formatOptionsChanged() {
17693
+ const { el, formatOptions, presentation } = this;
17694
+ checkForPresentationFormatMismatch(el, presentation, formatOptions);
17695
+ warnIfTimeZoneProvided(el, formatOptions);
17696
+ }
17664
17697
  disabledChanged() {
17665
17698
  this.emitStyle();
17666
17699
  }
@@ -17670,6 +17703,10 @@ class Datetime {
17670
17703
  maxChanged() {
17671
17704
  this.processMaxParts();
17672
17705
  }
17706
+ presentationChanged() {
17707
+ const { el, formatOptions, presentation } = this;
17708
+ checkForPresentationFormatMismatch(el, presentation, formatOptions);
17709
+ }
17673
17710
  get isGridStyle() {
17674
17711
  const { presentation, preferWheel } = this;
17675
17712
  const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
@@ -17905,7 +17942,7 @@ class Datetime {
17905
17942
  });
17906
17943
  }
17907
17944
  componentWillLoad() {
17908
- const { el, highlightedDates, multiple, presentation, preferWheel } = this;
17945
+ const { el, formatOptions, highlightedDates, multiple, presentation, preferWheel } = this;
17909
17946
  if (multiple) {
17910
17947
  if (presentation !== 'date') {
17911
17948
  printIonWarning('Multiple date selection is only supported for presentation="date".', el);
@@ -17922,6 +17959,10 @@ class Datetime {
17922
17959
  printIonWarning('The highlightedDates property is not supported with preferWheel="true".', el);
17923
17960
  }
17924
17961
  }
17962
+ if (formatOptions) {
17963
+ checkForPresentationFormatMismatch(el, presentation, formatOptions);
17964
+ warnIfTimeZoneProvided(el, formatOptions);
17965
+ }
17925
17966
  const hourValues = (this.parsedHourValues = convertToArrayOfNumbers(this.hourValues));
17926
17967
  const minuteValues = (this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues));
17927
17968
  const monthValues = (this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues));
@@ -18429,7 +18470,7 @@ class Datetime {
18429
18470
  return hAsync("slot", { name: "time-label" }, "Time");
18430
18471
  }
18431
18472
  renderTimeOverlay() {
18432
- const { disabled, hourCycle, isTimePopoverOpen, locale } = this;
18473
+ const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
18433
18474
  const computedHourCycle = getHourCycle(locale, hourCycle);
18434
18475
  const activePart = this.getActivePartsWithFallback();
18435
18476
  return [
@@ -18449,7 +18490,7 @@ class Datetime {
18449
18490
  await popoverRef.onWillDismiss();
18450
18491
  this.isTimePopoverOpen = false;
18451
18492
  }
18452
- } }, getLocalizedTime(locale, activePart, computedHourCycle)),
18493
+ } }, getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
18453
18494
  hAsync("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
18454
18495
  /**
18455
18496
  * Intersection Observers do not consistently fire between Blink and Webkit
@@ -18472,7 +18513,8 @@ class Datetime {
18472
18513
  ];
18473
18514
  }
18474
18515
  getHeaderSelectedDateText() {
18475
- const { activeParts, multiple, titleSelectedDatesFormatter } = this;
18516
+ var _a;
18517
+ const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
18476
18518
  const isArray = Array.isArray(activeParts);
18477
18519
  let headerText;
18478
18520
  if (multiple && isArray && activeParts.length !== 1) {
@@ -18488,7 +18530,7 @@ class Datetime {
18488
18530
  }
18489
18531
  else {
18490
18532
  // for exactly 1 day selected (multiple set or not), show a formatted version of that
18491
- headerText = getMonthAndDay(this.locale, this.getActivePartsWithFallback());
18533
+ headerText = getLocalizedDateTime(this.locale, this.getActivePartsWithFallback(), (_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _a !== void 0 ? _a : { weekday: 'short', month: 'short', day: 'numeric' });
18492
18534
  }
18493
18535
  return headerText;
18494
18536
  }
@@ -18577,7 +18619,7 @@ class Datetime {
18577
18619
  const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
18578
18620
  const hasWheelVariant = hasDatePresentation && preferWheel;
18579
18621
  renderHiddenInput(true, el, name, formatValue(value), disabled);
18580
- return (hAsync(Host, { key: 'b00545b7bbba3ccf35d53c1eec4f1614fb830c11', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses$1(color, {
18622
+ return (hAsync(Host, { key: 'b12b07aebad0a686f93f70dbe29bd039b4c4104f', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses$1(color, {
18581
18623
  [mode]: true,
18582
18624
  ['datetime-readonly']: readonly,
18583
18625
  ['datetime-disabled']: disabled,
@@ -18591,9 +18633,11 @@ class Datetime {
18591
18633
  }
18592
18634
  get el() { return getElement(this); }
18593
18635
  static get watchers() { return {
18636
+ "formatOptions": ["formatOptionsChanged"],
18594
18637
  "disabled": ["disabledChanged"],
18595
18638
  "min": ["minChanged"],
18596
18639
  "max": ["maxChanged"],
18640
+ "presentation": ["presentationChanged"],
18597
18641
  "yearValues": ["yearValuesChanged"],
18598
18642
  "monthValues": ["monthValuesChanged"],
18599
18643
  "dayValues": ["dayValuesChanged"],
@@ -18612,6 +18656,7 @@ class Datetime {
18612
18656
  "color": [1],
18613
18657
  "name": [1],
18614
18658
  "disabled": [4],
18659
+ "formatOptions": [16],
18615
18660
  "readonly": [4],
18616
18661
  "isDateEnabled": [16],
18617
18662
  "min": [1025],
@@ -18694,11 +18739,12 @@ class DatetimeButton {
18694
18739
  * to the locale specified on ion-datetime.
18695
18740
  */
18696
18741
  this.setDateTimeText = () => {
18742
+ var _a, _b, _c, _d, _e;
18697
18743
  const { datetimeEl, datetimePresentation } = this;
18698
18744
  if (!datetimeEl) {
18699
18745
  return;
18700
18746
  }
18701
- const { value, locale, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
18747
+ const { value, locale, formatOptions, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
18702
18748
  const parsedValues = this.getParsedDateValues(value);
18703
18749
  /**
18704
18750
  * Both ion-datetime and ion-datetime-button default
@@ -18721,8 +18767,8 @@ class DatetimeButton {
18721
18767
  switch (datetimePresentation) {
18722
18768
  case 'date-time':
18723
18769
  case 'time-date':
18724
- const dateText = getMonthDayAndYear(locale, firstParsedDatetime);
18725
- const timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
18770
+ const dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _a !== void 0 ? _a : { month: 'short', day: 'numeric', year: 'numeric' });
18771
+ const timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time);
18726
18772
  if (preferWheel) {
18727
18773
  this.dateText = `${dateText} ${timeText}`;
18728
18774
  }
@@ -18745,20 +18791,20 @@ class DatetimeButton {
18745
18791
  this.dateText = headerText;
18746
18792
  }
18747
18793
  else {
18748
- this.dateText = getMonthDayAndYear(locale, firstParsedDatetime);
18794
+ this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_b = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _b !== void 0 ? _b : { month: 'short', day: 'numeric', year: 'numeric' });
18749
18795
  }
18750
18796
  break;
18751
18797
  case 'time':
18752
- this.timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
18798
+ this.timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time);
18753
18799
  break;
18754
18800
  case 'month-year':
18755
- this.dateText = getMonthAndYear(locale, firstParsedDatetime);
18801
+ this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _c !== void 0 ? _c : { month: 'long', year: 'numeric' });
18756
18802
  break;
18757
18803
  case 'month':
18758
- this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, { month: 'long' });
18804
+ this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) !== null && _d !== void 0 ? _d : { month: 'long' });
18759
18805
  break;
18760
18806
  case 'year':
18761
- this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, { year: 'numeric' });
18807
+ this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_e = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) !== null && _e !== void 0 ? _e : { year: 'numeric' });
18762
18808
  break;
18763
18809
  }
18764
18810
  };
@@ -18987,7 +19033,7 @@ class DatetimeButton {
18987
19033
  render() {
18988
19034
  const { color, dateText, timeText, selectedButton, datetimeActive, disabled } = this;
18989
19035
  const mode = getIonMode$1(this);
18990
- return (hAsync(Host, { key: '36fe34d4225940611d74bdef5b954d54749d2dca', class: createColorClasses$1(color, {
19036
+ return (hAsync(Host, { key: '861a08f4a239de771875aee9b505e06ac7064b32', class: createColorClasses$1(color, {
18991
19037
  [mode]: true,
18992
19038
  [`${selectedButton}-active`]: datetimeActive,
18993
19039
  ['datetime-button-disabled']: disabled,
@@ -33609,6 +33655,7 @@ class Searchbar {
33609
33655
  this.isCancelVisible = false;
33610
33656
  this.shouldAlignLeft = true;
33611
33657
  this.inputId = `ion-searchbar-${searchbarIds++}`;
33658
+ this.inheritedAttributes = {};
33612
33659
  /**
33613
33660
  * Clears the input field and triggers the control change.
33614
33661
  */
@@ -33709,6 +33756,7 @@ class Searchbar {
33709
33756
  this.noAnimate = true;
33710
33757
  this.color = undefined;
33711
33758
  this.animated = false;
33759
+ this.autocapitalize = undefined;
33712
33760
  this.autocomplete = 'off';
33713
33761
  this.autocorrect = 'off';
33714
33762
  this.cancelButtonIcon = config.get('backButtonIcon', arrowBackSharp);
@@ -33718,6 +33766,8 @@ class Searchbar {
33718
33766
  this.disabled = false;
33719
33767
  this.inputmode = undefined;
33720
33768
  this.enterkeyhint = undefined;
33769
+ this.maxlength = undefined;
33770
+ this.minlength = undefined;
33721
33771
  this.name = this.inputId;
33722
33772
  this.placeholder = 'Search';
33723
33773
  this.searchIcon = undefined;
@@ -33727,6 +33777,19 @@ class Searchbar {
33727
33777
  this.type = 'search';
33728
33778
  this.value = '';
33729
33779
  }
33780
+ /**
33781
+ * lang and dir are globally enumerated attributes.
33782
+ * As a result, creating these as properties
33783
+ * can have unintended side effects. Instead, we
33784
+ * listen for attribute changes and inherit them
33785
+ * to the inner `<input>` element.
33786
+ */
33787
+ onLangChanged(newValue) {
33788
+ this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { lang: newValue });
33789
+ }
33790
+ onDirChanged(newValue) {
33791
+ this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { dir: newValue });
33792
+ }
33730
33793
  debounceChanged() {
33731
33794
  const { ionInput, debounce, originalIonInput } = this;
33732
33795
  /**
@@ -33750,6 +33813,9 @@ class Searchbar {
33750
33813
  connectedCallback() {
33751
33814
  this.emitStyle();
33752
33815
  }
33816
+ componentWillLoad() {
33817
+ this.inheritedAttributes = Object.assign({}, inheritAttributes$1(this.el, ['lang', 'dir']));
33818
+ }
33753
33819
  componentDidLoad() {
33754
33820
  this.originalIonInput = this.ionInput;
33755
33821
  this.positionElements();
@@ -33948,8 +34014,8 @@ class Searchbar {
33948
34014
  const clearIcon = this.clearIcon || (mode === 'ios' ? closeCircle : closeSharp);
33949
34015
  const searchIcon = this.searchIcon || (mode === 'ios' ? searchOutline : searchSharp);
33950
34016
  const shouldShowCancelButton = this.shouldShowCancelButton();
33951
- const cancelButton = this.showCancelButton !== 'never' && (hAsync("button", { key: '1de9b9bc6bad708bafcf4d31fa82838355120486', "aria-label": cancelButtonText, "aria-hidden": shouldShowCancelButton ? undefined : 'true', type: "button", tabIndex: mode === 'ios' && !shouldShowCancelButton ? -1 : undefined, onMouseDown: this.onCancelSearchbar, onTouchStart: this.onCancelSearchbar, class: "searchbar-cancel-button" }, hAsync("div", { key: 'e5178016e17104a80732edbae73c0dfc264bfe52', "aria-hidden": "true" }, mode === 'md' ? (hAsync("ion-icon", { "aria-hidden": "true", mode: mode, icon: this.cancelButtonIcon, lazy: false })) : (cancelButtonText))));
33952
- return (hAsync(Host, { key: '2c88a7b6ec7f33ada7dae560881210d7a8800f76', role: "search", "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses$1(this.color, {
34017
+ const cancelButton = this.showCancelButton !== 'never' && (hAsync("button", { key: '1a68689b5c14cde6e071c4095457146b9ac2e7ab', "aria-label": cancelButtonText, "aria-hidden": shouldShowCancelButton ? undefined : 'true', type: "button", tabIndex: mode === 'ios' && !shouldShowCancelButton ? -1 : undefined, onMouseDown: this.onCancelSearchbar, onTouchStart: this.onCancelSearchbar, class: "searchbar-cancel-button" }, hAsync("div", { key: '25ae47914baa4b7e0281efb2b296d1799a56c764', "aria-hidden": "true" }, mode === 'md' ? (hAsync("ion-icon", { "aria-hidden": "true", mode: mode, icon: this.cancelButtonIcon, lazy: false })) : (cancelButtonText))));
34018
+ return (hAsync(Host, { key: '2cf545c40874bc4a19b6af022f5ec41b3a913495', role: "search", "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses$1(this.color, {
33953
34019
  [mode]: true,
33954
34020
  'searchbar-animated': animated,
33955
34021
  'searchbar-disabled': this.disabled,
@@ -33959,17 +34025,19 @@ class Searchbar {
33959
34025
  'searchbar-has-focus': this.focused,
33960
34026
  'searchbar-should-show-clear': this.shouldShowClearButton(),
33961
34027
  'searchbar-should-show-cancel': this.shouldShowCancelButton(),
33962
- }) }, hAsync("div", { key: '8e914264a99453748a2bf370943e4047a0a587fb', class: "searchbar-input-container" }, hAsync("input", { key: 'd772f3e8d42301e50fbd6c9deb332fbdf3c435ac', "aria-label": "search text", disabled: this.disabled, ref: (el) => (this.nativeInput = el), class: "searchbar-input", inputMode: this.inputmode, enterKeyHint: this.enterkeyhint, name: this.name, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, placeholder: this.placeholder, type: this.type, value: this.getValue(), autoComplete: this.autocomplete, autoCorrect: this.autocorrect, spellcheck: this.spellcheck }), mode === 'md' && cancelButton, hAsync("ion-icon", { key: '8d9b461c2c34729b1bb562c227868cf817a353bc', "aria-hidden": "true", mode: mode, icon: searchIcon, lazy: false, class: "searchbar-search-icon" }), hAsync("button", { key: 'bcc39be721f4b825af31aae4dfb3058722d889a8', "aria-label": "reset", type: "button", "no-blur": true, class: "searchbar-clear-button", onPointerDown: (ev) => {
34028
+ }) }, hAsync("div", { key: '9cf49297278839bbe6e2ef9936de337daa53c08d', class: "searchbar-input-container" }, hAsync("input", Object.assign({ key: 'bae5db413a302e116012251746d599030f7158ce', "aria-label": "search text", disabled: this.disabled, ref: (el) => (this.nativeInput = el), class: "searchbar-input", inputMode: this.inputmode, enterKeyHint: this.enterkeyhint, name: this.name, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, minLength: this.minlength, maxLength: this.maxlength, placeholder: this.placeholder, type: this.type, value: this.getValue(), autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, spellcheck: this.spellcheck }, this.inheritedAttributes)), mode === 'md' && cancelButton, hAsync("ion-icon", { key: '67c593ca842551d9e99e8239115cc7b43261b542', "aria-hidden": "true", mode: mode, icon: searchIcon, lazy: false, class: "searchbar-search-icon" }), hAsync("button", { key: '6901c3f6c74cce2d3b7e46fbff85ee6e6399bdb1', "aria-label": "reset", type: "button", "no-blur": true, class: "searchbar-clear-button", onPointerDown: (ev) => {
33963
34029
  /**
33964
34030
  * This prevents mobile browsers from
33965
34031
  * blurring the input when the clear
33966
34032
  * button is activated.
33967
34033
  */
33968
34034
  ev.preventDefault();
33969
- }, onClick: () => this.onClearInput(true) }, hAsync("ion-icon", { key: '9a6478e1f1482aa6e62c88bd96cd19cacbfb8d60', "aria-hidden": "true", mode: mode, icon: clearIcon, lazy: false, class: "searchbar-clear-icon" }))), mode === 'ios' && cancelButton));
34035
+ }, onClick: () => this.onClearInput(true) }, hAsync("ion-icon", { key: 'abd45fb79ee807cf8352aa7bf5b0342f2d686227', "aria-hidden": "true", mode: mode, icon: clearIcon, lazy: false, class: "searchbar-clear-icon" }))), mode === 'ios' && cancelButton));
33970
34036
  }
33971
34037
  get el() { return getElement(this); }
33972
34038
  static get watchers() { return {
34039
+ "lang": ["onLangChanged"],
34040
+ "dir": ["onDirChanged"],
33973
34041
  "debounce": ["debounceChanged"],
33974
34042
  "value": ["valueChanged"],
33975
34043
  "showCancelButton": ["showCancelButtonChanged"]
@@ -33984,6 +34052,7 @@ class Searchbar {
33984
34052
  "$members$": {
33985
34053
  "color": [513],
33986
34054
  "animated": [4],
34055
+ "autocapitalize": [1],
33987
34056
  "autocomplete": [1],
33988
34057
  "autocorrect": [1],
33989
34058
  "cancelButtonIcon": [1, "cancel-button-icon"],
@@ -33993,6 +34062,8 @@ class Searchbar {
33993
34062
  "disabled": [4],
33994
34063
  "inputmode": [1],
33995
34064
  "enterkeyhint": [1],
34065
+ "maxlength": [2],
34066
+ "minlength": [2],
33996
34067
  "name": [1],
33997
34068
  "placeholder": [1],
33998
34069
  "searchIcon": [1, "search-icon"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/core",
3
- "version": "7.7.5",
3
+ "version": "7.8.0",
4
4
  "description": "Base components for Ionic",
5
5
  "keywords": [
6
6
  "ionic",
@@ -1,4 +0,0 @@
1
- import{__spreadArray}from"tslib";
2
- /*!
3
- * (C) Ionic http://ionicframework.com - MIT License
4
- */import{p as printIonWarning}from"./index-9b0d46f4.js";var isSameDay=function(e,r){return e.month===r.month&&e.day===r.day&&e.year===r.year};var isBefore=function(e,r){return!!(e.year<r.year||e.year===r.year&&e.month<r.month||e.year===r.year&&e.month===r.month&&e.day!==null&&e.day<r.day)};var isAfter=function(e,r){return!!(e.year>r.year||e.year===r.year&&e.month>r.month||e.year===r.year&&e.month===r.month&&e.day!==null&&e.day>r.day)};var warnIfValueOutOfBounds=function(e,r,n){var a=Array.isArray(e)?e:[e];for(var t=0,i=a;t<i.length;t++){var u=i[t];if(r!==undefined&&isBefore(u,r)||n!==undefined&&isAfter(u,n)){printIonWarning("The value provided to ion-datetime is out of bounds.\n\n"+"Min: ".concat(JSON.stringify(r),"\n")+"Max: ".concat(JSON.stringify(n),"\n")+"Value: ".concat(JSON.stringify(e)));break}}};var isLeapYear=function(e){return e%4===0&&e%100!==0||e%400===0};var getHourCycle=function(e,r){if(r!==undefined){return r}var n=new Intl.DateTimeFormat(e,{hour:"numeric"});var a=n.resolvedOptions();if(a.hourCycle!==undefined){return a.hourCycle}var t=new Date("5/18/2021 00:00");var i=n.formatToParts(t);var u=i.find((function(e){return e.type==="hour"}));if(!u){throw new Error("Hour value not found from DateTimeFormat")}switch(u.value){case"0":return"h11";case"12":return"h12";case"00":return"h23";case"24":return"h24";default:throw new Error('Invalid hour cycle "'.concat(r,'"'))}};var is24Hour=function(e){return e==="h23"||e==="h24"};var getNumDaysInMonth=function(e,r){return e===4||e===6||e===9||e===11?30:e===2?isLeapYear(r)?29:28:31};var isMonthFirstLocale=function(e,r){if(r===void 0){r={month:"numeric",year:"numeric"}}var n=new Intl.DateTimeFormat(e,r).formatToParts(new Date);return n[0].type==="month"};var isLocaleDayPeriodRTL=function(e){var r=new Intl.DateTimeFormat(e,{hour:"numeric"}).formatToParts(new Date);return r[0].type==="dayPeriod"};var ISO_8601_REGEXP=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;var TIME_REGEXP=/^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;var convertToArrayOfNumbers=function(e){if(e===undefined){return}var r=e;if(typeof e==="string"){r=e.replace(/\[|\]|\s/g,"").split(",")}var n;if(Array.isArray(r)){n=r.map((function(e){return parseInt(e,10)})).filter(isFinite)}else{n=[r]}return n};var getPartsFromCalendarDay=function(e){return{month:parseInt(e.getAttribute("data-month"),10),day:parseInt(e.getAttribute("data-day"),10),year:parseInt(e.getAttribute("data-year"),10),dayOfWeek:parseInt(e.getAttribute("data-day-of-week"),10)}};function parseDate(e){if(Array.isArray(e)){var r=[];for(var n=0,a=e;n<a.length;n++){var t=a[n];var i=parseDate(t);if(!i){return undefined}r.push(i)}return r}var u=null;if(e!=null&&e!==""){u=TIME_REGEXP.exec(e);if(u){u.unshift(undefined,undefined);u[2]=u[3]=undefined}else{u=ISO_8601_REGEXP.exec(e)}}if(u===null){printIonWarning("Unable to parse date string: ".concat(e,". Please provide a valid ISO 8601 datetime string."));return undefined}for(var o=1;o<8;o++){u[o]=u[o]!==undefined?parseInt(u[o],10):undefined}return{year:u[1],month:u[2],day:u[3],hour:u[4],minute:u[5],ampm:u[4]<12?"am":"pm"}}var clampDate=function(e,r,n){if(r&&isBefore(e,r)){return r}else if(n&&isAfter(e,n)){return n}return e};var parseAmPm=function(e){return e>=12?"pm":"am"};var parseMaxParts=function(e,r){var n=parseDate(e);if(n===undefined){return}var a=n.month,t=n.day,i=n.year,u=n.hour,o=n.minute;var d=i!==null&&i!==void 0?i:r.year;var f=a!==null&&a!==void 0?a:12;return{month:f,day:t!==null&&t!==void 0?t:getNumDaysInMonth(f,d),year:d,hour:u!==null&&u!==void 0?u:23,minute:o!==null&&o!==void 0?o:59}};var parseMinParts=function(e,r){var n=parseDate(e);if(n===undefined){return}var a=n.month,t=n.day,i=n.year,u=n.hour,o=n.minute;return{month:a!==null&&a!==void 0?a:1,day:t!==null&&t!==void 0?t:1,year:i!==null&&i!==void 0?i:r.year,hour:u!==null&&u!==void 0?u:0,minute:o!==null&&o!==void 0?o:0}};var twoDigit=function(e){return("0"+(e!==undefined?Math.abs(e):"0")).slice(-2)};var fourDigit=function(e){return("000"+(e!==undefined?Math.abs(e):"0")).slice(-4)};function convertDataToISO(e){if(Array.isArray(e)){return e.map((function(e){return convertDataToISO(e)}))}var r="";if(e.year!==undefined){r=fourDigit(e.year);if(e.month!==undefined){r+="-"+twoDigit(e.month);if(e.day!==undefined){r+="-"+twoDigit(e.day);if(e.hour!==undefined){r+="T".concat(twoDigit(e.hour),":").concat(twoDigit(e.minute),":00")}}}}else if(e.hour!==undefined){r=twoDigit(e.hour)+":"+twoDigit(e.minute)}return r}var convert12HourTo24Hour=function(e,r){if(r===undefined){return e}if(r==="am"){if(e===12){return 0}return e}if(e===12){return 12}return e+12};var getStartOfWeek=function(e){var r=e.dayOfWeek;if(r===null||r===undefined){throw new Error("No day of week provided")}return subtractDays(e,r)};var getEndOfWeek=function(e){var r=e.dayOfWeek;if(r===null||r===undefined){throw new Error("No day of week provided")}return addDays(e,6-r)};var getNextDay=function(e){return addDays(e,1)};var getPreviousDay=function(e){return subtractDays(e,1)};var getPreviousWeek=function(e){return subtractDays(e,7)};var getNextWeek=function(e){return addDays(e,7)};var subtractDays=function(e,r){var n=e.month,a=e.day,t=e.year;if(a===null){throw new Error("No day provided")}var i={month:n,day:a,year:t};i.day=a-r;if(i.day<1){i.month-=1}if(i.month<1){i.month=12;i.year-=1}if(i.day<1){var u=getNumDaysInMonth(i.month,i.year);i.day=u+i.day}return i};var addDays=function(e,r){var n=e.month,a=e.day,t=e.year;if(a===null){throw new Error("No day provided")}var i={month:n,day:a,year:t};var u=getNumDaysInMonth(n,t);i.day=a+r;if(i.day>u){i.day-=u;i.month+=1}if(i.month>12){i.month=1;i.year+=1}return i};var getPreviousMonth=function(e){var r=e.month===1?12:e.month-1;var n=e.month===1?e.year-1:e.year;var a=getNumDaysInMonth(r,n);var t=a<e.day?a:e.day;return{month:r,year:n,day:t}};var getNextMonth=function(e){var r=e.month===12?1:e.month+1;var n=e.month===12?e.year+1:e.year;var a=getNumDaysInMonth(r,n);var t=a<e.day?a:e.day;return{month:r,year:n,day:t}};var changeYear=function(e,r){var n=e.month;var a=e.year+r;var t=getNumDaysInMonth(n,a);var i=t<e.day?t:e.day;return{month:n,year:a,day:i}};var getPreviousYear=function(e){return changeYear(e,-1)};var getNextYear=function(e){return changeYear(e,1)};var getInternalHourValue=function(e,r,n){if(r){return e}return convert12HourTo24Hour(e,n)};var calculateHourFromAMPM=function(e,r){var n=e.ampm,a=e.hour;var t=a;if(n==="am"&&r==="pm"){t=convert12HourTo24Hour(t,"pm")}else if(n==="pm"&&r==="am"){t=Math.abs(t-12)}return t};var validateParts=function(e,r,n){var a=e.month,t=e.day,i=e.year;var u=clampDate(Object.assign({},e),r,n);var o=getNumDaysInMonth(a,i);if(t!==null&&o<t){u.day=o}if(r!==undefined&&isSameDay(u,r)){if(u.hour!==undefined&&r.hour!==undefined){if(u.hour<r.hour){u.hour=r.hour;u.minute=r.minute}else if(u.hour===r.hour&&u.minute!==undefined&&r.minute!==undefined&&u.minute<r.minute){u.minute=r.minute}}}if(n!==undefined&&isSameDay(e,n)){if(u.hour!==undefined&&n.hour!==undefined){if(u.hour>n.hour){u.hour=n.hour;u.minute=n.minute}else if(u.hour===n.hour&&u.minute!==undefined&&n.minute!==undefined&&u.minute>n.minute){u.minute=n.minute}}}return u};var getClosestValidDate=function(e){var r=e.refParts,n=e.monthValues,a=e.dayValues,t=e.yearValues,i=e.hourValues,u=e.minuteValues,o=e.minParts,d=e.maxParts;var f=r.hour,v=r.minute,s=r.day,l=r.month,c=r.year;var m=Object.assign(Object.assign({},r),{dayOfWeek:undefined});if(t!==undefined){var y=t.filter((function(e){if(o!==undefined&&e<o.year){return false}if(d!==undefined&&e>d.year){return false}return true}));m.year=findClosestValue(c,y)}if(n!==undefined){var g=n.filter((function(e){if(o!==undefined&&m.year===o.year&&e<o.month){return false}if(d!==undefined&&m.year===d.year&&e>d.month){return false}return true}));m.month=findClosestValue(l,g)}if(s!==null&&a!==undefined){var D=a.filter((function(e){if(o!==undefined&&isBefore(Object.assign(Object.assign({},m),{day:e}),o)){return false}if(d!==undefined&&isAfter(Object.assign(Object.assign({},m),{day:e}),d)){return false}return true}));m.day=findClosestValue(s,D)}if(f!==undefined&&i!==undefined){var h=i.filter((function(e){if((o===null||o===void 0?void 0:o.hour)!==undefined&&isSameDay(m,o)&&e<o.hour){return false}if((d===null||d===void 0?void 0:d.hour)!==undefined&&isSameDay(m,d)&&e>d.hour){return false}return true}));m.hour=findClosestValue(f,h);m.ampm=parseAmPm(m.hour)}if(v!==undefined&&u!==undefined){var T=u.filter((function(e){if((o===null||o===void 0?void 0:o.minute)!==undefined&&isSameDay(m,o)&&m.hour===o.hour&&e<o.minute){return false}if((d===null||d===void 0?void 0:d.minute)!==undefined&&isSameDay(m,d)&&m.hour===d.hour&&e>d.minute){return false}return true}));m.minute=findClosestValue(v,T)}return m};var findClosestValue=function(e,r){var n=r[0];var a=Math.abs(n-e);for(var t=1;t<r.length;t++){var i=r[t];var u=Math.abs(i-e);if(u<a){n=i;a=u}}return n};var getFormattedDayPeriod=function(e){if(e===undefined){return""}return e.toUpperCase()};var getLocalizedTime=function(e,r,n){var a={hour:r.hour,minute:r.minute};if(a.hour===undefined||a.minute===undefined){return"Invalid Time"}return new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric",timeZone:"UTC",hourCycle:n}).format(new Date(convertDataToISO(Object.assign({year:2023,day:1,month:1},a))+"Z"))};var addTimePadding=function(e){var r=e.toString();if(r.length>1){return r}return"0".concat(r)};var getFormattedHour=function(e,r){if(e===0){switch(r){case"h11":return"0";case"h12":return"12";case"h23":return"00";case"h24":return"24";default:throw new Error('Invalid hour cycle "'.concat(r,'"'))}}var n=is24Hour(r);if(n){return addTimePadding(e)}return e.toString()};var generateDayAriaLabel=function(e,r,n){if(n.day===null){return null}var a=getNormalizedDate(n);var t=new Intl.DateTimeFormat(e,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}).format(a);return r?"Today, ".concat(t):t};var getMonthAndDay=function(e,r){var n=getNormalizedDate(r);return new Intl.DateTimeFormat(e,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(n)};var getMonthAndYear=function(e,r){var n=getNormalizedDate(r);return new Intl.DateTimeFormat(e,{month:"long",year:"numeric",timeZone:"UTC"}).format(n)};var getMonthDayAndYear=function(e,r){return getLocalizedDateTime(e,r,{month:"short",day:"numeric",year:"numeric"})};var getDay=function(e,r){return getLocalizedDateTimeParts(e,r,{day:"numeric"}).find((function(e){return e.type==="day"})).value};var getYear=function(e,r){return getLocalizedDateTime(e,r,{year:"numeric"})};var getNormalizedDate=function(e){var r,n,a;var t=e.hour!==undefined&&e.minute!==undefined?" ".concat(e.hour,":").concat(e.minute):"";return new Date("".concat((r=e.month)!==null&&r!==void 0?r:1,"/").concat((n=e.day)!==null&&n!==void 0?n:1,"/").concat((a=e.year)!==null&&a!==void 0?a:2023).concat(t," GMT+0000"))};var getLocalizedDateTime=function(e,r,n){var a=getNormalizedDate(r);return getDateTimeFormat(e,n).format(a)};var getLocalizedDateTimeParts=function(e,r,n){var a=getNormalizedDate(r);return getDateTimeFormat(e,n).formatToParts(a)};var getDateTimeFormat=function(e,r){return new Intl.DateTimeFormat(e,Object.assign(Object.assign({},r),{timeZone:"UTC"}))};var getTodayLabel=function(e){if("RelativeTimeFormat"in Intl){var r=new Intl.RelativeTimeFormat(e,{numeric:"auto"}).format(0,"day");return r.charAt(0).toUpperCase()+r.slice(1)}else{return"Today"}};var removeDateTzOffset=function(e){var r=e.getTimezoneOffset();e.setMinutes(e.getMinutes()-r);return e};var DATE_AM=removeDateTzOffset(new Date("2022T01:00"));var DATE_PM=removeDateTzOffset(new Date("2022T13:00"));var getLocalizedDayPeriod=function(e,r){var n=r==="am"?DATE_AM:DATE_PM;var a=new Intl.DateTimeFormat(e,{hour:"numeric",timeZone:"UTC"}).formatToParts(n).find((function(e){return e.type==="dayPeriod"}));if(a){return a.value}return getFormattedDayPeriod(r)};var formatValue=function(e){return Array.isArray(e)?e.join(","):e};var getToday=function(){return removeDateTzOffset(new Date).toISOString()};var minutes=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59];var hour11=[0,1,2,3,4,5,6,7,8,9,10,11];var hour12=[0,1,2,3,4,5,6,7,8,9,10,11];var hour23=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23];var hour24=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,0];var getDaysOfWeek=function(e,r,n){if(n===void 0){n=0}var a=r==="ios"?"short":"narrow";var t=new Intl.DateTimeFormat(e,{weekday:a});var i=new Date("11/01/2020");var u=[];for(var o=n;o<n+7;o++){var d=new Date(i);d.setDate(d.getDate()+o);u.push(t.format(d))}return u};var getDaysOfMonth=function(e,r,n){var a=getNumDaysInMonth(e,r);var t=new Date("".concat(e,"/1/").concat(r)).getDay();var i=t>=n?t-(n+1):6-(n-t);var u=[];for(var o=1;o<=a;o++){u.push({day:o,dayOfWeek:(i+o)%7})}for(var o=0;o<=i;o++){u=__spreadArray([{day:null,dayOfWeek:null}],u,true)}return u};var getHourData=function(e){switch(e){case"h11":return hour11;case"h12":return hour12;case"h23":return hour23;case"h24":return hour24;default:throw new Error('Invalid hour cycle "'.concat(e,'"'))}};var generateTime=function(e,r,n,a,t,i,u){if(n===void 0){n="h12"}var o=getHourCycle(e,n);var d=is24Hour(o);var f=getHourData(o);var v=minutes;var s=true;var l=true;if(i){f=f.filter((function(e){return i.includes(e)}))}if(u){v=v.filter((function(e){return u.includes(e)}))}if(a){if(isSameDay(r,a)){if(a.hour!==undefined){f=f.filter((function(e){var n=r.ampm==="pm"?(e+12)%24:e;return(d?e:n)>=a.hour}));s=a.hour<13}if(a.minute!==undefined){var c=false;if(a.hour!==undefined&&r.hour!==undefined){if(r.hour>a.hour){c=true}}v=v.filter((function(e){if(c){return true}return e>=a.minute}))}}else if(isBefore(r,a)){f=[];v=[];s=l=false}}if(t){if(isSameDay(r,t)){if(t.hour!==undefined){f=f.filter((function(e){var n=r.ampm==="pm"?(e+12)%24:e;return(d?e:n)<=t.hour}));l=t.hour>=12}if(t.minute!==undefined&&r.hour===t.hour){v=v.filter((function(e){return e<=t.minute}))}}else if(isAfter(r,t)){f=[];v=[];s=l=false}}return{hours:f,minutes:v,am:s,pm:l}};var generateMonths=function(e,r){var n={month:e.month,year:e.year,day:e.day};if(r!==undefined&&(e.month!==r.month||e.year!==r.year)){var a={month:r.month,year:r.year,day:r.day};var t=isBefore(a,n);return t?[a,n,getNextMonth(e)]:[getPreviousMonth(e),n,a]}return[getPreviousMonth(e),n,getNextMonth(e)]};var getMonthColumnData=function(e,r,n,a,t,i){if(i===void 0){i={month:"long"}}var u=r.year;var o=[];if(t!==undefined){var d=t;if((a===null||a===void 0?void 0:a.month)!==undefined){d=d.filter((function(e){return e<=a.month}))}if((n===null||n===void 0?void 0:n.month)!==undefined){d=d.filter((function(e){return e>=n.month}))}d.forEach((function(r){var n=new Date("".concat(r,"/1/").concat(u," GMT+0000"));var a=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},i),{timeZone:"UTC"})).format(n);o.push({text:a,value:r})}))}else{var f=a&&a.year===u?a.month:12;var v=n&&n.year===u?n.month:1;for(var s=v;s<=f;s++){var l=new Date("".concat(s,"/1/").concat(u," GMT+0000"));var c=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},i),{timeZone:"UTC"})).format(l);o.push({text:c,value:s})}}return o};var getDayColumnData=function(e,r,n,a,t,i){if(i===void 0){i={day:"numeric"}}var u=r.month,o=r.year;var d=[];var f=getNumDaysInMonth(u,o);var v=(a===null||a===void 0?void 0:a.day)!==null&&(a===null||a===void 0?void 0:a.day)!==undefined&&a.year===o&&a.month===u?a.day:f;var s=(n===null||n===void 0?void 0:n.day)!==null&&(n===null||n===void 0?void 0:n.day)!==undefined&&n.year===o&&n.month===u?n.day:1;if(t!==undefined){var l=t;l=l.filter((function(e){return e>=s&&e<=v}));l.forEach((function(r){var n=new Date("".concat(u,"/").concat(r,"/").concat(o," GMT+0000"));var a=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},i),{timeZone:"UTC"})).format(n);d.push({text:a,value:r})}))}else{for(var c=s;c<=v;c++){var m=new Date("".concat(u,"/").concat(c,"/").concat(o," GMT+0000"));var y=new Intl.DateTimeFormat(e,Object.assign(Object.assign({},i),{timeZone:"UTC"})).format(m);d.push({text:y,value:c})}}return d};var getYearColumnData=function(e,r,n,a,t){var i,u;var o=[];if(t!==undefined){o=t;if((a===null||a===void 0?void 0:a.year)!==undefined){o=o.filter((function(e){return e<=a.year}))}if((n===null||n===void 0?void 0:n.year)!==undefined){o=o.filter((function(e){return e>=n.year}))}}else{var d=r.year;var f=(i=a===null||a===void 0?void 0:a.year)!==null&&i!==void 0?i:d;var v=(u=n===null||n===void 0?void 0:n.year)!==null&&u!==void 0?u:d-100;for(var s=v;s<=f;s++){o.push(s)}}return o.map((function(n){return{text:getYear(e,{year:n,month:r.month,day:r.day}),value:n}}))};var getAllMonthsInRange=function(e,r){if(e.month===r.month&&e.year===r.year){return[e]}return __spreadArray([e],getAllMonthsInRange(getNextMonth(e),r),true)};var getCombinedDateColumnData=function(e,r,n,a,t,i){var u=[];var o=[];var d=getAllMonthsInRange(n,a);if(i){d=d.filter((function(e){var r=e.month;return i.includes(r)}))}d.forEach((function(i){var d={month:i.month,day:null,year:i.year};var f=getDayColumnData(e,d,n,a,t,{month:"short",day:"numeric",weekday:"short"});var v=[];var s=[];f.forEach((function(n){var a=isSameDay(Object.assign(Object.assign({},d),{day:n.value}),r);s.push({text:a?getTodayLabel(e):n.text,value:"".concat(d.year,"-").concat(d.month,"-").concat(n.value)});v.push({month:d.month,year:d.year,day:n.value})}));o=__spreadArray(__spreadArray([],o,true),v,true);u=__spreadArray(__spreadArray([],u,true),s,true)}));return{parts:o,items:u}};var getTimeColumnsData=function(e,r,n,a,t,i,u){var o=getHourCycle(e,n);var d=is24Hour(o);var f=generateTime(e,r,o,a,t,i,u),v=f.hours,s=f.minutes,l=f.am,c=f.pm;var m=v.map((function(e){return{text:getFormattedHour(e,o),value:getInternalHourValue(e,d,r.ampm)}}));var y=s.map((function(e){return{text:addTimePadding(e),value:e}}));var g=[];if(l&&!d){g.push({text:getLocalizedDayPeriod(e,"am"),value:"am"})}if(c&&!d){g.push({text:getLocalizedDayPeriod(e,"pm"),value:"pm"})}return{minutesData:y,hoursData:m,dayPeriodData:g}};export{getNumDaysInMonth as A,getCombinedDateColumnData as B,getMonthColumnData as C,getDayColumnData as D,getYearColumnData as E,isMonthFirstLocale as F,getTimeColumnsData as G,isLocaleDayPeriodRTL as H,getDaysOfWeek as I,getMonthAndYear as J,getDaysOfMonth as K,getHourCycle as L,getLocalizedTime as M,getMonthAndDay as N,formatValue as O,clampDate as P,parseAmPm as Q,calculateHourFromAMPM as R,getLocalizedDateTime as S,getMonthDayAndYear as T,getDay as a,isAfter as b,isSameDay as c,getPreviousMonth as d,getNextMonth as e,getPartsFromCalendarDay as f,generateDayAriaLabel as g,getNextYear as h,isBefore as i,getPreviousYear as j,getEndOfWeek as k,getStartOfWeek as l,getPreviousDay as m,getNextDay as n,getPreviousWeek as o,getNextWeek as p,parseMinParts as q,parseMaxParts as r,parseDate as s,convertToArrayOfNumbers as t,convertDataToISO as u,validateParts as v,warnIfValueOutOfBounds as w,getToday as x,getClosestValidDate as y,generateMonths as z};