@ionic/core 7.7.2 → 7.7.3-dev.11709155072.15a455bf
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/components/data.js +23 -38
- package/components/ion-datetime-button.js +11 -10
- package/components/ion-datetime.js +69 -7
- package/components/ion-searchbar.js +34 -5
- package/dist/cjs/{data-a5109f09.js → data-4487a815.js} +22 -39
- package/dist/cjs/ion-datetime-button.cjs.entry.js +11 -10
- package/dist/cjs/ion-datetime_3.cjs.entry.js +66 -7
- package/dist/cjs/ion-searchbar.cjs.entry.js +28 -4
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/datetime/datetime.js +50 -7
- package/dist/collection/components/datetime/test/basic/datetime.e2e.js +77 -0
- package/dist/collection/components/datetime/test/format.spec.js +65 -15
- package/dist/collection/components/datetime/utils/format.js +24 -37
- package/dist/collection/components/datetime/utils/validate.js +45 -0
- package/dist/collection/components/datetime-button/datetime-button.js +11 -10
- package/dist/collection/components/datetime-button/test/basic/datetime-button.e2e.js +65 -0
- package/dist/collection/components/searchbar/searchbar.js +85 -5
- package/dist/collection/components/searchbar/test/searchbar.spec.js +20 -2
- package/dist/docs.json +114 -1
- package/dist/esm/{data-0f3ab200.js → data-bb424ba8.js} +23 -38
- package/dist/esm/ion-datetime-button.entry.js +11 -10
- package/dist/esm/ion-datetime_3.entry.js +66 -7
- package/dist/esm/ion-searchbar.entry.js +29 -5
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/data-bb424ba8.js +4 -0
- package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-searchbar.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/html.html-data.json +12 -0
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-0b34d3a7.system.js +1 -1
- package/dist/ionic/p-2d95cfc5.entry.js +4 -0
- package/dist/ionic/p-33e20df5.entry.js +4 -0
- package/dist/ionic/p-3789920e.js +4 -0
- package/dist/ionic/p-6af3eaf8.system.entry.js +4 -0
- package/dist/ionic/p-8a1b0abb.system.js +4 -0
- package/dist/ionic/p-9f207856.entry.js +4 -0
- package/dist/ionic/p-b18b2148.system.entry.js +4 -0
- package/dist/ionic/p-e9b9a128.system.entry.js +4 -0
- package/dist/types/components/datetime/datetime-interface.d.ts +10 -0
- package/dist/types/components/datetime/datetime.d.ts +9 -1
- package/dist/types/components/datetime/utils/format.d.ts +7 -13
- package/dist/types/components/datetime/utils/validate.d.ts +8 -0
- package/dist/types/components/searchbar/searchbar.d.ts +24 -0
- package/dist/types/components.d.ts +34 -2
- package/hydrate/index.js +127 -56
- package/package.json +1 -1
- package/dist/esm-es5/data-0f3ab200.js +0 -4
- package/dist/ionic/p-0e23c289.system.entry.js +0 -4
- package/dist/ionic/p-2327064c.entry.js +0 -4
- package/dist/ionic/p-23c73017.entry.js +0 -4
- package/dist/ionic/p-68ba8e77.system.entry.js +0 -4
- package/dist/ionic/p-7330c044.system.js +0 -4
- package/dist/ionic/p-a6e465f5.entry.js +0 -4
- package/dist/ionic/p-e81bf09e.system.entry.js +0 -4
- package/dist/ionic/p-f7dce541.js +0 -4
package/hydrate/index.js
CHANGED
|
@@ -15913,7 +15913,25 @@ const getFormattedDayPeriod = (dayPeriod) => {
|
|
|
15913
15913
|
}
|
|
15914
15914
|
return dayPeriod.toUpperCase();
|
|
15915
15915
|
};
|
|
15916
|
-
|
|
15916
|
+
/**
|
|
15917
|
+
* Including time zone options may lead to the rendered text showing a
|
|
15918
|
+
* different time from what was selected in the Datetime, which could cause
|
|
15919
|
+
* confusion.
|
|
15920
|
+
*/
|
|
15921
|
+
const stripTimeZone = (formatOptions) => {
|
|
15922
|
+
return Object.assign(Object.assign({}, formatOptions), {
|
|
15923
|
+
/**
|
|
15924
|
+
* Setting the time zone to UTC ensures that the value shown is always the
|
|
15925
|
+
* same as what was selected and safeguards against older Safari bugs with
|
|
15926
|
+
* Intl.DateTimeFormat.
|
|
15927
|
+
*/
|
|
15928
|
+
timeZone: 'UTC',
|
|
15929
|
+
/**
|
|
15930
|
+
* We do not want to display the time zone name
|
|
15931
|
+
*/
|
|
15932
|
+
timeZoneName: undefined });
|
|
15933
|
+
};
|
|
15934
|
+
const getLocalizedTime = (locale, refParts, hourCycle, formatOptions = { hour: 'numeric', minute: 'numeric' }) => {
|
|
15917
15935
|
const timeParts = {
|
|
15918
15936
|
hour: refParts.hour,
|
|
15919
15937
|
minute: refParts.minute,
|
|
@@ -15921,28 +15939,12 @@ const getLocalizedTime = (locale, refParts, hourCycle) => {
|
|
|
15921
15939
|
if (timeParts.hour === undefined || timeParts.minute === undefined) {
|
|
15922
15940
|
return 'Invalid Time';
|
|
15923
15941
|
}
|
|
15924
|
-
return new Intl.DateTimeFormat(locale, {
|
|
15925
|
-
hour: 'numeric',
|
|
15926
|
-
minute: 'numeric',
|
|
15927
|
-
/**
|
|
15928
|
-
* Setting the timeZone to UTC prevents
|
|
15929
|
-
* new Intl.DatetimeFormat from subtracting
|
|
15930
|
-
* the user's current timezone offset
|
|
15931
|
-
* when formatting the time.
|
|
15932
|
-
*/
|
|
15933
|
-
timeZone: 'UTC',
|
|
15942
|
+
return new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, stripTimeZone(formatOptions)), {
|
|
15934
15943
|
/**
|
|
15935
15944
|
* We use hourCycle here instead of hour12 due to:
|
|
15936
15945
|
* https://bugs.chromium.org/p/chromium/issues/detail?id=1347316&q=hour12&can=2
|
|
15937
15946
|
*/
|
|
15938
|
-
hourCycle
|
|
15939
|
-
/**
|
|
15940
|
-
* Setting Z at the end indicates that this
|
|
15941
|
-
* date string is in the UTC time zone. This
|
|
15942
|
-
* prevents new Date from adding the time zone
|
|
15943
|
-
* offset when getting the ISO string.
|
|
15944
|
-
*/
|
|
15945
|
-
}).format(new Date(convertDataToISO(Object.assign({
|
|
15947
|
+
hourCycle })).format(new Date(convertDataToISO(Object.assign({
|
|
15946
15948
|
/**
|
|
15947
15949
|
* JS uses a simplified ISO 8601 format which allows for
|
|
15948
15950
|
* date-only formats and date-time formats, but not
|
|
@@ -16028,14 +16030,6 @@ const generateDayAriaLabel = (locale, today, refParts) => {
|
|
|
16028
16030
|
*/
|
|
16029
16031
|
return today ? `Today, ${labelString}` : labelString;
|
|
16030
16032
|
};
|
|
16031
|
-
/**
|
|
16032
|
-
* Gets the day of the week, month, and day
|
|
16033
|
-
* Used for the header in MD mode.
|
|
16034
|
-
*/
|
|
16035
|
-
const getMonthAndDay = (locale, refParts) => {
|
|
16036
|
-
const date = getNormalizedDate(refParts);
|
|
16037
|
-
return new Intl.DateTimeFormat(locale, { weekday: 'short', month: 'short', day: 'numeric', timeZone: 'UTC' }).format(date);
|
|
16038
|
-
};
|
|
16039
16033
|
/**
|
|
16040
16034
|
* Given a locale and a date object,
|
|
16041
16035
|
* return a formatted string that includes
|
|
@@ -16046,15 +16040,6 @@ const getMonthAndYear = (locale, refParts) => {
|
|
|
16046
16040
|
const date = getNormalizedDate(refParts);
|
|
16047
16041
|
return new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(date);
|
|
16048
16042
|
};
|
|
16049
|
-
/**
|
|
16050
|
-
* Given a locale and a date object,
|
|
16051
|
-
* return a formatted string that includes
|
|
16052
|
-
* the short month, numeric day, and full year.
|
|
16053
|
-
* Example: Apr 22, 2021
|
|
16054
|
-
*/
|
|
16055
|
-
const getMonthDayAndYear = (locale, refParts) => {
|
|
16056
|
-
return getLocalizedDateTime(locale, refParts, { month: 'short', day: 'numeric', year: 'numeric' });
|
|
16057
|
-
};
|
|
16058
16043
|
/**
|
|
16059
16044
|
* Given a locale and a date object,
|
|
16060
16045
|
* return a formatted string that includes
|
|
@@ -16104,7 +16089,7 @@ const getNormalizedDate = (refParts) => {
|
|
|
16104
16089
|
*/
|
|
16105
16090
|
const getLocalizedDateTime = (locale, refParts, options) => {
|
|
16106
16091
|
const date = getNormalizedDate(refParts);
|
|
16107
|
-
return getDateTimeFormat(locale, options).format(date);
|
|
16092
|
+
return getDateTimeFormat(locale, stripTimeZone(options)).format(date);
|
|
16108
16093
|
};
|
|
16109
16094
|
/**
|
|
16110
16095
|
* Given a locale, DatetimeParts, and options
|
|
@@ -16870,6 +16855,48 @@ const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
|
|
|
16870
16855
|
return undefined;
|
|
16871
16856
|
};
|
|
16872
16857
|
|
|
16858
|
+
/**
|
|
16859
|
+
* If a time zone is provided in the format options, the rendered text could
|
|
16860
|
+
* differ from what was selected in the Datetime, which could cause
|
|
16861
|
+
* confusion.
|
|
16862
|
+
*/
|
|
16863
|
+
const warnIfTimeZoneProvided = (el, formatOptions) => {
|
|
16864
|
+
var _a, _b, _c, _d;
|
|
16865
|
+
if (((_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _a === void 0 ? void 0 : _a.timeZone) ||
|
|
16866
|
+
((_b = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _b === void 0 ? void 0 : _b.timeZoneName) ||
|
|
16867
|
+
((_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _c === void 0 ? void 0 : _c.timeZone) ||
|
|
16868
|
+
((_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _d === void 0 ? void 0 : _d.timeZoneName)) {
|
|
16869
|
+
printIonWarning('Datetime: "timeZone" and "timeZoneName" are not supported in "formatOptions".', el);
|
|
16870
|
+
}
|
|
16871
|
+
};
|
|
16872
|
+
const checkForPresentationFormatMismatch = (el, presentation, formatOptions) => {
|
|
16873
|
+
// formatOptions is not required
|
|
16874
|
+
if (!formatOptions)
|
|
16875
|
+
return;
|
|
16876
|
+
// If formatOptions is provided, the date and/or time objects are required, depending on the presentation
|
|
16877
|
+
switch (presentation) {
|
|
16878
|
+
case 'date':
|
|
16879
|
+
case 'month-year':
|
|
16880
|
+
case 'month':
|
|
16881
|
+
case 'year':
|
|
16882
|
+
if (formatOptions.date === undefined) {
|
|
16883
|
+
printIonWarning(`Datetime: The '${presentation}' presentation requires a date object in formatOptions.`, el);
|
|
16884
|
+
}
|
|
16885
|
+
break;
|
|
16886
|
+
case 'time':
|
|
16887
|
+
if (formatOptions.time === undefined) {
|
|
16888
|
+
printIonWarning(`Datetime: The 'time' presentation requires a time object in formatOptions.`, el);
|
|
16889
|
+
}
|
|
16890
|
+
break;
|
|
16891
|
+
case 'date-time':
|
|
16892
|
+
case 'time-date':
|
|
16893
|
+
if (formatOptions.date === undefined && formatOptions.time === undefined) {
|
|
16894
|
+
printIonWarning(`Datetime: The '${presentation}' presentation requires either a date or time object (or both) in formatOptions.`, el);
|
|
16895
|
+
}
|
|
16896
|
+
break;
|
|
16897
|
+
}
|
|
16898
|
+
};
|
|
16899
|
+
|
|
16873
16900
|
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%}";
|
|
16874
16901
|
var IonDatetimeIosStyle0 = datetimeIosCss;
|
|
16875
16902
|
|
|
@@ -17518,6 +17545,7 @@ class Datetime {
|
|
|
17518
17545
|
this.color = 'primary';
|
|
17519
17546
|
this.name = this.inputId;
|
|
17520
17547
|
this.disabled = false;
|
|
17548
|
+
this.formatOptions = undefined;
|
|
17521
17549
|
this.readonly = false;
|
|
17522
17550
|
this.isDateEnabled = undefined;
|
|
17523
17551
|
this.min = undefined;
|
|
@@ -17545,6 +17573,11 @@ class Datetime {
|
|
|
17545
17573
|
this.size = 'fixed';
|
|
17546
17574
|
this.preferWheel = false;
|
|
17547
17575
|
}
|
|
17576
|
+
formatOptionsChanged() {
|
|
17577
|
+
const { el, formatOptions, presentation } = this;
|
|
17578
|
+
checkForPresentationFormatMismatch(el, presentation, formatOptions);
|
|
17579
|
+
warnIfTimeZoneProvided(el, formatOptions);
|
|
17580
|
+
}
|
|
17548
17581
|
disabledChanged() {
|
|
17549
17582
|
this.emitStyle();
|
|
17550
17583
|
}
|
|
@@ -17554,6 +17587,10 @@ class Datetime {
|
|
|
17554
17587
|
maxChanged() {
|
|
17555
17588
|
this.processMaxParts();
|
|
17556
17589
|
}
|
|
17590
|
+
presentationChanged() {
|
|
17591
|
+
const { el, formatOptions, presentation } = this;
|
|
17592
|
+
checkForPresentationFormatMismatch(el, presentation, formatOptions);
|
|
17593
|
+
}
|
|
17557
17594
|
get isGridStyle() {
|
|
17558
17595
|
const { presentation, preferWheel } = this;
|
|
17559
17596
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
@@ -17789,7 +17826,7 @@ class Datetime {
|
|
|
17789
17826
|
});
|
|
17790
17827
|
}
|
|
17791
17828
|
componentWillLoad() {
|
|
17792
|
-
const { el, highlightedDates, multiple, presentation, preferWheel } = this;
|
|
17829
|
+
const { el, formatOptions, highlightedDates, multiple, presentation, preferWheel } = this;
|
|
17793
17830
|
if (multiple) {
|
|
17794
17831
|
if (presentation !== 'date') {
|
|
17795
17832
|
printIonWarning('Multiple date selection is only supported for presentation="date".', el);
|
|
@@ -17806,6 +17843,10 @@ class Datetime {
|
|
|
17806
17843
|
printIonWarning('The highlightedDates property is not supported with preferWheel="true".', el);
|
|
17807
17844
|
}
|
|
17808
17845
|
}
|
|
17846
|
+
if (formatOptions) {
|
|
17847
|
+
checkForPresentationFormatMismatch(el, presentation, formatOptions);
|
|
17848
|
+
warnIfTimeZoneProvided(el, formatOptions);
|
|
17849
|
+
}
|
|
17809
17850
|
const hourValues = (this.parsedHourValues = convertToArrayOfNumbers(this.hourValues));
|
|
17810
17851
|
const minuteValues = (this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues));
|
|
17811
17852
|
const monthValues = (this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues));
|
|
@@ -18313,7 +18354,7 @@ class Datetime {
|
|
|
18313
18354
|
return hAsync("slot", { name: "time-label" }, "Time");
|
|
18314
18355
|
}
|
|
18315
18356
|
renderTimeOverlay() {
|
|
18316
|
-
const { disabled, hourCycle, isTimePopoverOpen, locale } = this;
|
|
18357
|
+
const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
|
|
18317
18358
|
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
18318
18359
|
const activePart = this.getActivePartsWithFallback();
|
|
18319
18360
|
return [
|
|
@@ -18333,7 +18374,7 @@ class Datetime {
|
|
|
18333
18374
|
await popoverRef.onWillDismiss();
|
|
18334
18375
|
this.isTimePopoverOpen = false;
|
|
18335
18376
|
}
|
|
18336
|
-
} }, getLocalizedTime(locale, activePart, computedHourCycle)),
|
|
18377
|
+
} }, getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
|
|
18337
18378
|
hAsync("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
|
|
18338
18379
|
/**
|
|
18339
18380
|
* Intersection Observers do not consistently fire between Blink and Webkit
|
|
@@ -18356,7 +18397,8 @@ class Datetime {
|
|
|
18356
18397
|
];
|
|
18357
18398
|
}
|
|
18358
18399
|
getHeaderSelectedDateText() {
|
|
18359
|
-
|
|
18400
|
+
var _a;
|
|
18401
|
+
const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
|
|
18360
18402
|
const isArray = Array.isArray(activeParts);
|
|
18361
18403
|
let headerText;
|
|
18362
18404
|
if (multiple && isArray && activeParts.length !== 1) {
|
|
@@ -18372,7 +18414,7 @@ class Datetime {
|
|
|
18372
18414
|
}
|
|
18373
18415
|
else {
|
|
18374
18416
|
// for exactly 1 day selected (multiple set or not), show a formatted version of that
|
|
18375
|
-
headerText =
|
|
18417
|
+
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' });
|
|
18376
18418
|
}
|
|
18377
18419
|
return headerText;
|
|
18378
18420
|
}
|
|
@@ -18461,7 +18503,7 @@ class Datetime {
|
|
|
18461
18503
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
18462
18504
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
18463
18505
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
18464
|
-
return (hAsync(Host, { key: '
|
|
18506
|
+
return (hAsync(Host, { key: 'b12b07aebad0a686f93f70dbe29bd039b4c4104f', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses$1(color, {
|
|
18465
18507
|
[mode]: true,
|
|
18466
18508
|
['datetime-readonly']: readonly,
|
|
18467
18509
|
['datetime-disabled']: disabled,
|
|
@@ -18475,9 +18517,11 @@ class Datetime {
|
|
|
18475
18517
|
}
|
|
18476
18518
|
get el() { return getElement(this); }
|
|
18477
18519
|
static get watchers() { return {
|
|
18520
|
+
"formatOptions": ["formatOptionsChanged"],
|
|
18478
18521
|
"disabled": ["disabledChanged"],
|
|
18479
18522
|
"min": ["minChanged"],
|
|
18480
18523
|
"max": ["maxChanged"],
|
|
18524
|
+
"presentation": ["presentationChanged"],
|
|
18481
18525
|
"yearValues": ["yearValuesChanged"],
|
|
18482
18526
|
"monthValues": ["monthValuesChanged"],
|
|
18483
18527
|
"dayValues": ["dayValuesChanged"],
|
|
@@ -18496,6 +18540,7 @@ class Datetime {
|
|
|
18496
18540
|
"color": [1],
|
|
18497
18541
|
"name": [1],
|
|
18498
18542
|
"disabled": [4],
|
|
18543
|
+
"formatOptions": [16],
|
|
18499
18544
|
"readonly": [4],
|
|
18500
18545
|
"isDateEnabled": [16],
|
|
18501
18546
|
"min": [1025],
|
|
@@ -18578,11 +18623,12 @@ class DatetimeButton {
|
|
|
18578
18623
|
* to the locale specified on ion-datetime.
|
|
18579
18624
|
*/
|
|
18580
18625
|
this.setDateTimeText = () => {
|
|
18626
|
+
var _a, _b, _c, _d, _e;
|
|
18581
18627
|
const { datetimeEl, datetimePresentation } = this;
|
|
18582
18628
|
if (!datetimeEl) {
|
|
18583
18629
|
return;
|
|
18584
18630
|
}
|
|
18585
|
-
const { value, locale, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
|
|
18631
|
+
const { value, locale, formatOptions, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
|
|
18586
18632
|
const parsedValues = this.getParsedDateValues(value);
|
|
18587
18633
|
/**
|
|
18588
18634
|
* Both ion-datetime and ion-datetime-button default
|
|
@@ -18605,8 +18651,8 @@ class DatetimeButton {
|
|
|
18605
18651
|
switch (datetimePresentation) {
|
|
18606
18652
|
case 'date-time':
|
|
18607
18653
|
case 'time-date':
|
|
18608
|
-
const dateText =
|
|
18609
|
-
const timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
|
|
18654
|
+
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' });
|
|
18655
|
+
const timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time);
|
|
18610
18656
|
if (preferWheel) {
|
|
18611
18657
|
this.dateText = `${dateText} ${timeText}`;
|
|
18612
18658
|
}
|
|
@@ -18629,20 +18675,20 @@ class DatetimeButton {
|
|
|
18629
18675
|
this.dateText = headerText;
|
|
18630
18676
|
}
|
|
18631
18677
|
else {
|
|
18632
|
-
this.dateText =
|
|
18678
|
+
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' });
|
|
18633
18679
|
}
|
|
18634
18680
|
break;
|
|
18635
18681
|
case 'time':
|
|
18636
|
-
this.timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
|
|
18682
|
+
this.timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time);
|
|
18637
18683
|
break;
|
|
18638
18684
|
case 'month-year':
|
|
18639
|
-
this.dateText =
|
|
18685
|
+
this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _c !== void 0 ? _c : { month: 'long', year: 'numeric' });
|
|
18640
18686
|
break;
|
|
18641
18687
|
case 'month':
|
|
18642
|
-
this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, { month: 'long' });
|
|
18688
|
+
this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) !== null && _d !== void 0 ? _d : { month: 'long' });
|
|
18643
18689
|
break;
|
|
18644
18690
|
case 'year':
|
|
18645
|
-
this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, { year: 'numeric' });
|
|
18691
|
+
this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, (_e = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) !== null && _e !== void 0 ? _e : { year: 'numeric' });
|
|
18646
18692
|
break;
|
|
18647
18693
|
}
|
|
18648
18694
|
};
|
|
@@ -18871,7 +18917,7 @@ class DatetimeButton {
|
|
|
18871
18917
|
render() {
|
|
18872
18918
|
const { color, dateText, timeText, selectedButton, datetimeActive, disabled } = this;
|
|
18873
18919
|
const mode = getIonMode$1(this);
|
|
18874
|
-
return (hAsync(Host, { key: '
|
|
18920
|
+
return (hAsync(Host, { key: '861a08f4a239de771875aee9b505e06ac7064b32', class: createColorClasses$1(color, {
|
|
18875
18921
|
[mode]: true,
|
|
18876
18922
|
[`${selectedButton}-active`]: datetimeActive,
|
|
18877
18923
|
['datetime-button-disabled']: disabled,
|
|
@@ -33356,6 +33402,7 @@ class Searchbar {
|
|
|
33356
33402
|
this.isCancelVisible = false;
|
|
33357
33403
|
this.shouldAlignLeft = true;
|
|
33358
33404
|
this.inputId = `ion-searchbar-${searchbarIds++}`;
|
|
33405
|
+
this.inheritedAttributes = {};
|
|
33359
33406
|
/**
|
|
33360
33407
|
* Clears the input field and triggers the control change.
|
|
33361
33408
|
*/
|
|
@@ -33456,6 +33503,7 @@ class Searchbar {
|
|
|
33456
33503
|
this.noAnimate = true;
|
|
33457
33504
|
this.color = undefined;
|
|
33458
33505
|
this.animated = false;
|
|
33506
|
+
this.autocapitalize = 'off';
|
|
33459
33507
|
this.autocomplete = 'off';
|
|
33460
33508
|
this.autocorrect = 'off';
|
|
33461
33509
|
this.cancelButtonIcon = config.get('backButtonIcon', arrowBackSharp);
|
|
@@ -33465,6 +33513,8 @@ class Searchbar {
|
|
|
33465
33513
|
this.disabled = false;
|
|
33466
33514
|
this.inputmode = undefined;
|
|
33467
33515
|
this.enterkeyhint = undefined;
|
|
33516
|
+
this.maxlength = undefined;
|
|
33517
|
+
this.minlength = undefined;
|
|
33468
33518
|
this.name = this.inputId;
|
|
33469
33519
|
this.placeholder = 'Search';
|
|
33470
33520
|
this.searchIcon = undefined;
|
|
@@ -33474,6 +33524,19 @@ class Searchbar {
|
|
|
33474
33524
|
this.type = 'search';
|
|
33475
33525
|
this.value = '';
|
|
33476
33526
|
}
|
|
33527
|
+
/**
|
|
33528
|
+
* lang and dir are globally enumerated attributes.
|
|
33529
|
+
* As a result, creating these as properties
|
|
33530
|
+
* can have unintended side effects. Instead, we
|
|
33531
|
+
* listen for attribute changes and inherit them
|
|
33532
|
+
* to the inner `<input>` element.
|
|
33533
|
+
*/
|
|
33534
|
+
onLangChanged(newValue) {
|
|
33535
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { lang: newValue });
|
|
33536
|
+
}
|
|
33537
|
+
onDirChanged(newValue) {
|
|
33538
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { dir: newValue });
|
|
33539
|
+
}
|
|
33477
33540
|
debounceChanged() {
|
|
33478
33541
|
const { ionInput, debounce, originalIonInput } = this;
|
|
33479
33542
|
/**
|
|
@@ -33497,6 +33560,9 @@ class Searchbar {
|
|
|
33497
33560
|
connectedCallback() {
|
|
33498
33561
|
this.emitStyle();
|
|
33499
33562
|
}
|
|
33563
|
+
componentWillLoad() {
|
|
33564
|
+
this.inheritedAttributes = Object.assign({}, inheritAttributes$1(this.el, ['lang', 'dir']));
|
|
33565
|
+
}
|
|
33500
33566
|
componentDidLoad() {
|
|
33501
33567
|
this.originalIonInput = this.ionInput;
|
|
33502
33568
|
this.positionElements();
|
|
@@ -33695,8 +33761,8 @@ class Searchbar {
|
|
|
33695
33761
|
const clearIcon = this.clearIcon || (mode === 'ios' ? closeCircle : closeSharp);
|
|
33696
33762
|
const searchIcon = this.searchIcon || (mode === 'ios' ? searchOutline : searchSharp);
|
|
33697
33763
|
const shouldShowCancelButton = this.shouldShowCancelButton();
|
|
33698
|
-
const cancelButton = this.showCancelButton !== 'never' && (hAsync("button", { key: '
|
|
33699
|
-
return (hAsync(Host, { key: '
|
|
33764
|
+
const cancelButton = this.showCancelButton !== 'never' && (hAsync("button", { key: '03b26a060f593a58bdfc797e3eaf9b263bbf8470', "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: 'a16c2629a28b56e82ca4577bd501a88e12b230ab', "aria-hidden": "true" }, mode === 'md' ? (hAsync("ion-icon", { "aria-hidden": "true", mode: mode, icon: this.cancelButtonIcon, lazy: false })) : (cancelButtonText))));
|
|
33765
|
+
return (hAsync(Host, { key: '674742947c051c5ee772324622392587ae7cd5df', role: "search", "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses$1(this.color, {
|
|
33700
33766
|
[mode]: true,
|
|
33701
33767
|
'searchbar-animated': animated,
|
|
33702
33768
|
'searchbar-disabled': this.disabled,
|
|
@@ -33706,17 +33772,19 @@ class Searchbar {
|
|
|
33706
33772
|
'searchbar-has-focus': this.focused,
|
|
33707
33773
|
'searchbar-should-show-clear': this.shouldShowClearButton(),
|
|
33708
33774
|
'searchbar-should-show-cancel': this.shouldShowCancelButton(),
|
|
33709
|
-
}) }, hAsync("div", { key: '
|
|
33775
|
+
}) }, hAsync("div", { key: 'ec5fea18a88dfa2ce610c9722e5165c1249dc352', class: "searchbar-input-container" }, hAsync("input", Object.assign({ key: '2720f15eb47f12efa0ab4973972bcbf72bd2851e', "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: '5ec9de02e3e96bade39a83ba3289a161fd456405', "aria-hidden": "true", mode: mode, icon: searchIcon, lazy: false, class: "searchbar-search-icon" }), hAsync("button", { key: '2e46a26c91ad88189e94614bdc348aab24601e0f', "aria-label": "reset", type: "button", "no-blur": true, class: "searchbar-clear-button", onPointerDown: (ev) => {
|
|
33710
33776
|
/**
|
|
33711
33777
|
* This prevents mobile browsers from
|
|
33712
33778
|
* blurring the input when the clear
|
|
33713
33779
|
* button is activated.
|
|
33714
33780
|
*/
|
|
33715
33781
|
ev.preventDefault();
|
|
33716
|
-
}, onClick: () => this.onClearInput(true) }, hAsync("ion-icon", { key: '
|
|
33782
|
+
}, onClick: () => this.onClearInput(true) }, hAsync("ion-icon", { key: 'bba9aed921fbd9894b5899d39be1e32f2094763b', "aria-hidden": "true", mode: mode, icon: clearIcon, lazy: false, class: "searchbar-clear-icon" }))), mode === 'ios' && cancelButton));
|
|
33717
33783
|
}
|
|
33718
33784
|
get el() { return getElement(this); }
|
|
33719
33785
|
static get watchers() { return {
|
|
33786
|
+
"lang": ["onLangChanged"],
|
|
33787
|
+
"dir": ["onDirChanged"],
|
|
33720
33788
|
"debounce": ["debounceChanged"],
|
|
33721
33789
|
"value": ["valueChanged"],
|
|
33722
33790
|
"showCancelButton": ["showCancelButtonChanged"]
|
|
@@ -33731,6 +33799,7 @@ class Searchbar {
|
|
|
33731
33799
|
"$members$": {
|
|
33732
33800
|
"color": [513],
|
|
33733
33801
|
"animated": [4],
|
|
33802
|
+
"autocapitalize": [1],
|
|
33734
33803
|
"autocomplete": [1],
|
|
33735
33804
|
"autocorrect": [1],
|
|
33736
33805
|
"cancelButtonIcon": [1, "cancel-button-icon"],
|
|
@@ -33740,6 +33809,8 @@ class Searchbar {
|
|
|
33740
33809
|
"disabled": [4],
|
|
33741
33810
|
"inputmode": [1],
|
|
33742
33811
|
"enterkeyhint": [1],
|
|
33812
|
+
"maxlength": [2],
|
|
33813
|
+
"minlength": [2],
|
|
33743
33814
|
"name": [1],
|
|
33744
33815
|
"placeholder": [1],
|
|
33745
33816
|
"searchIcon": [1, "search-icon"],
|
package/package.json
CHANGED
|
@@ -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};
|