@ionic/core 7.7.5 → 7.8.1-nightly.20240314
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/components/picker-column-internal.js +8 -4
- 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-picker-column-internal.cjs.entry.js +8 -4
- 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/alert/test/a11y/alert.e2e.js +4 -0
- 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/picker-column-internal/picker-column-internal.js +8 -4
- package/dist/collection/components/searchbar/searchbar.js +84 -5
- package/dist/collection/components/searchbar/test/searchbar.spec.js +20 -2
- package/dist/collection/components/toggle/toggle.js +1 -1
- package/dist/docs.json +114 -2
- 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-picker-column-internal.entry.js +8 -4
- 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-picker-column-internal.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 +13 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-2b77099e.system.entry.js +4 -0
- package/dist/ionic/p-3789920e.js +4 -0
- package/dist/ionic/p-4abb3f9e.entry.js +4 -0
- package/dist/ionic/p-60c9fd9e.system.js +1 -1
- package/dist/ionic/p-8a1b0abb.system.js +4 -0
- package/dist/ionic/p-8a5c2121.entry.js +4 -0
- package/dist/ionic/p-a722d78f.system.entry.js +4 -0
- package/dist/ionic/p-bc56a728.entry.js +4 -0
- package/dist/ionic/{p-0e7c8334.system.entry.js → p-c2a9829c.system.entry.js} +1 -1
- package/dist/ionic/p-cfd31f45.system.entry.js +4 -0
- package/dist/ionic/p-e02681a6.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 +38 -0
- package/dist/types/components/toggle/toggle.d.ts +1 -1
- package/dist/types/components.d.ts +36 -4
- package/hydrate/index.js +135 -60
- package/package.json +1 -1
- package/dist/esm-es5/data-0f3ab200.js +0 -4
- package/dist/ionic/p-6f5b32c7.system.entry.js +0 -4
- package/dist/ionic/p-7330c044.system.js +0 -4
- package/dist/ionic/p-76afa95f.entry.js +0 -4
- package/dist/ionic/p-81f18ed1.system.entry.js +0 -4
- package/dist/ionic/p-c05202a7.entry.js +0 -4
- package/dist/ionic/p-c67c9644.entry.js +0 -4
- package/dist/ionic/p-e447e552.entry.js +0 -4
- package/dist/ionic/p-ef269a56.system.entry.js +0 -4
- package/dist/ionic/p-f7dce541.js +0 -4
package/hydrate/index.js
CHANGED
|
@@ -16029,7 +16029,25 @@ const getFormattedDayPeriod = (dayPeriod) => {
|
|
|
16029
16029
|
}
|
|
16030
16030
|
return dayPeriod.toUpperCase();
|
|
16031
16031
|
};
|
|
16032
|
-
|
|
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
|
-
|
|
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 =
|
|
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: '
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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: '
|
|
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,
|
|
@@ -27746,7 +27792,11 @@ class PickerColumnInternal {
|
|
|
27746
27792
|
*/
|
|
27747
27793
|
componentWillLoad() {
|
|
27748
27794
|
const visibleCallback = (entries) => {
|
|
27749
|
-
|
|
27795
|
+
/**
|
|
27796
|
+
* Browsers will sometimes group multiple IO events into a single callback.
|
|
27797
|
+
* As a result, we want to grab the last/most recent event in case there are multiple events.
|
|
27798
|
+
*/
|
|
27799
|
+
const ev = entries[entries.length - 1];
|
|
27750
27800
|
if (ev.isIntersecting) {
|
|
27751
27801
|
const { activeItem, el } = this;
|
|
27752
27802
|
this.isColumnVisible = true;
|
|
@@ -27835,18 +27885,18 @@ class PickerColumnInternal {
|
|
|
27835
27885
|
* the attribute can be moved to datetime.tsx and set on every
|
|
27836
27886
|
* instance of ion-picker-column-internal there instead.
|
|
27837
27887
|
*/
|
|
27838
|
-
return (hAsync(Host, { key: '
|
|
27888
|
+
return (hAsync(Host, { key: '2cf182b9d88219e7ab1feb66c90992c4b9bc6b8e', exportparts: `${PICKER_ITEM_PART}, ${PICKER_ITEM_ACTIVE_PART}`, disabled: pickerDisabled, tabindex: pickerDisabled ? null : 0, class: createColorClasses$1(color, {
|
|
27839
27889
|
[mode]: true,
|
|
27840
27890
|
['picker-column-active']: isActive,
|
|
27841
27891
|
['picker-column-numeric-input']: numericInput,
|
|
27842
|
-
}) }, hAsync("div", { key: '
|
|
27892
|
+
}) }, hAsync("div", { key: '86fa9a1464c03dd25fbe4880b91a597228e0b9c6', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { key: '3bcc466879ea06355c4132d1b7dd469f5aeb193b', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { key: '3aa4e3a12f2fa7d05692c1758648817b19fa6e12', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), items.map((item, index) => {
|
|
27843
27893
|
const isItemDisabled = pickerDisabled || item.disabled || false;
|
|
27844
27894
|
return (hAsync("button", { tabindex: "-1", class: {
|
|
27845
27895
|
'picker-item': true,
|
|
27846
27896
|
}, "data-value": item.value, "data-index": index, onClick: (ev) => {
|
|
27847
27897
|
this.centerPickerItemInView(ev.target, true);
|
|
27848
27898
|
}, disabled: isItemDisabled, part: PICKER_ITEM_PART }, item.text));
|
|
27849
|
-
}), hAsync("div", { key: '
|
|
27899
|
+
}), hAsync("div", { key: '0400a6791070b947db3ca692cf780190f7798d88', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { key: '48c4c5e7d2534fd394a3cf6f608eb9998e795bcc', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), hAsync("div", { key: '2881a12b028923f6e6f140ed963de8646cadf0aa', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0")));
|
|
27850
27900
|
}
|
|
27851
27901
|
get el() { return getElement(this); }
|
|
27852
27902
|
static get watchers() { return {
|
|
@@ -33609,6 +33659,7 @@ class Searchbar {
|
|
|
33609
33659
|
this.isCancelVisible = false;
|
|
33610
33660
|
this.shouldAlignLeft = true;
|
|
33611
33661
|
this.inputId = `ion-searchbar-${searchbarIds++}`;
|
|
33662
|
+
this.inheritedAttributes = {};
|
|
33612
33663
|
/**
|
|
33613
33664
|
* Clears the input field and triggers the control change.
|
|
33614
33665
|
*/
|
|
@@ -33709,6 +33760,7 @@ class Searchbar {
|
|
|
33709
33760
|
this.noAnimate = true;
|
|
33710
33761
|
this.color = undefined;
|
|
33711
33762
|
this.animated = false;
|
|
33763
|
+
this.autocapitalize = undefined;
|
|
33712
33764
|
this.autocomplete = 'off';
|
|
33713
33765
|
this.autocorrect = 'off';
|
|
33714
33766
|
this.cancelButtonIcon = config.get('backButtonIcon', arrowBackSharp);
|
|
@@ -33718,6 +33770,8 @@ class Searchbar {
|
|
|
33718
33770
|
this.disabled = false;
|
|
33719
33771
|
this.inputmode = undefined;
|
|
33720
33772
|
this.enterkeyhint = undefined;
|
|
33773
|
+
this.maxlength = undefined;
|
|
33774
|
+
this.minlength = undefined;
|
|
33721
33775
|
this.name = this.inputId;
|
|
33722
33776
|
this.placeholder = 'Search';
|
|
33723
33777
|
this.searchIcon = undefined;
|
|
@@ -33727,6 +33781,19 @@ class Searchbar {
|
|
|
33727
33781
|
this.type = 'search';
|
|
33728
33782
|
this.value = '';
|
|
33729
33783
|
}
|
|
33784
|
+
/**
|
|
33785
|
+
* lang and dir are globally enumerated attributes.
|
|
33786
|
+
* As a result, creating these as properties
|
|
33787
|
+
* can have unintended side effects. Instead, we
|
|
33788
|
+
* listen for attribute changes and inherit them
|
|
33789
|
+
* to the inner `<input>` element.
|
|
33790
|
+
*/
|
|
33791
|
+
onLangChanged(newValue) {
|
|
33792
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { lang: newValue });
|
|
33793
|
+
}
|
|
33794
|
+
onDirChanged(newValue) {
|
|
33795
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { dir: newValue });
|
|
33796
|
+
}
|
|
33730
33797
|
debounceChanged() {
|
|
33731
33798
|
const { ionInput, debounce, originalIonInput } = this;
|
|
33732
33799
|
/**
|
|
@@ -33750,6 +33817,9 @@ class Searchbar {
|
|
|
33750
33817
|
connectedCallback() {
|
|
33751
33818
|
this.emitStyle();
|
|
33752
33819
|
}
|
|
33820
|
+
componentWillLoad() {
|
|
33821
|
+
this.inheritedAttributes = Object.assign({}, inheritAttributes$1(this.el, ['lang', 'dir']));
|
|
33822
|
+
}
|
|
33753
33823
|
componentDidLoad() {
|
|
33754
33824
|
this.originalIonInput = this.ionInput;
|
|
33755
33825
|
this.positionElements();
|
|
@@ -33948,8 +34018,8 @@ class Searchbar {
|
|
|
33948
34018
|
const clearIcon = this.clearIcon || (mode === 'ios' ? closeCircle : closeSharp);
|
|
33949
34019
|
const searchIcon = this.searchIcon || (mode === 'ios' ? searchOutline : searchSharp);
|
|
33950
34020
|
const shouldShowCancelButton = this.shouldShowCancelButton();
|
|
33951
|
-
const cancelButton = this.showCancelButton !== 'never' && (hAsync("button", { key: '
|
|
33952
|
-
return (hAsync(Host, { key: '
|
|
34021
|
+
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))));
|
|
34022
|
+
return (hAsync(Host, { key: '2cf545c40874bc4a19b6af022f5ec41b3a913495', role: "search", "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses$1(this.color, {
|
|
33953
34023
|
[mode]: true,
|
|
33954
34024
|
'searchbar-animated': animated,
|
|
33955
34025
|
'searchbar-disabled': this.disabled,
|
|
@@ -33959,17 +34029,19 @@ class Searchbar {
|
|
|
33959
34029
|
'searchbar-has-focus': this.focused,
|
|
33960
34030
|
'searchbar-should-show-clear': this.shouldShowClearButton(),
|
|
33961
34031
|
'searchbar-should-show-cancel': this.shouldShowCancelButton(),
|
|
33962
|
-
}) }, hAsync("div", { key: '
|
|
34032
|
+
}) }, 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
34033
|
/**
|
|
33964
34034
|
* This prevents mobile browsers from
|
|
33965
34035
|
* blurring the input when the clear
|
|
33966
34036
|
* button is activated.
|
|
33967
34037
|
*/
|
|
33968
34038
|
ev.preventDefault();
|
|
33969
|
-
}, onClick: () => this.onClearInput(true) }, hAsync("ion-icon", { key: '
|
|
34039
|
+
}, 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
34040
|
}
|
|
33971
34041
|
get el() { return getElement(this); }
|
|
33972
34042
|
static get watchers() { return {
|
|
34043
|
+
"lang": ["onLangChanged"],
|
|
34044
|
+
"dir": ["onDirChanged"],
|
|
33973
34045
|
"debounce": ["debounceChanged"],
|
|
33974
34046
|
"value": ["valueChanged"],
|
|
33975
34047
|
"showCancelButton": ["showCancelButtonChanged"]
|
|
@@ -33984,6 +34056,7 @@ class Searchbar {
|
|
|
33984
34056
|
"$members$": {
|
|
33985
34057
|
"color": [513],
|
|
33986
34058
|
"animated": [4],
|
|
34059
|
+
"autocapitalize": [1],
|
|
33987
34060
|
"autocomplete": [1],
|
|
33988
34061
|
"autocorrect": [1],
|
|
33989
34062
|
"cancelButtonIcon": [1, "cancel-button-icon"],
|
|
@@ -33993,6 +34066,8 @@ class Searchbar {
|
|
|
33993
34066
|
"disabled": [4],
|
|
33994
34067
|
"inputmode": [1],
|
|
33995
34068
|
"enterkeyhint": [1],
|
|
34069
|
+
"maxlength": [2],
|
|
34070
|
+
"minlength": [2],
|
|
33996
34071
|
"name": [1],
|
|
33997
34072
|
"placeholder": [1],
|
|
33998
34073
|
"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};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function o(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i["throw"](e))}catch(e){a(e)}}function c(e){e.done?n(e.value):r(e.value).then(o,s)}c((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(n=0)),n)try{if(i=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1];a=s;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(s);break}if(a[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
|
|
2
|
-
/*!
|
|
3
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/System.register(["./p-36cd9903.system.js","./p-5fc8d5ef.system.js","./p-ff4b7e40.system.js","./p-4609d030.system.js","./p-10ce62b0.system.js","./p-7330c044.system.js"],(function(e){"use strict";var t,n,i,r,a,o,s,c,u,d,f,l,p,m,h,b;return{setters:[function(e){t=e.r;n=e.h;i=e.H;r=e.f},function(e){a=e.a;o=e.c},function(e){s=e.a},function(e){c=e.c},function(e){u=e.b},function(e){d=e.s;f=e.x;l=e.L;p=e.S;m=e.J;h=e.M;b=e.T}],execute:function(){var v=":host{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host button{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;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px;margin-top:0px;margin-bottom:0px;position:relative;-webkit-transition:150ms color ease-in-out;transition:150ms color ease-in-out;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:1rem;cursor:pointer;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host(.time-active) #time-button,:host(.date-active) #date-button{color:var(--ion-color-base)}:host(.datetime-button-disabled){pointer-events:none}:host(.datetime-button-disabled) button{opacity:0.4}";var x=v;var w=":host{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host button{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;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px;margin-top:0px;margin-bottom:0px;position:relative;-webkit-transition:150ms color ease-in-out;transition:150ms color ease-in-out;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:1rem;cursor:pointer;overflow:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host(.time-active) #time-button,:host(.date-active) #date-button{color:var(--ion-color-base)}:host(.datetime-button-disabled){pointer-events:none}:host(.datetime-button-disabled) button{opacity:0.4}";var g=w;var y=e("ion_datetime_button",function(){function e(e){var n=this;t(this,e);this.datetimeEl=null;this.overlayEl=null;this.getParsedDateValues=function(e){if(e===undefined||e===null){return[]}if(Array.isArray(e)){return e}return[e]};this.setDateTimeText=function(){var e=n,t=e.datetimeEl,i=e.datetimePresentation;if(!t){return}var r=t.value,a=t.locale,o=t.hourCycle,c=t.preferWheel,u=t.multiple,v=t.titleSelectedDatesFormatter;var x=n.getParsedDateValues(r);var w=d(x.length>0?x:[f()]);if(!w){return}var g=w[0];var y=l(a,o);n.dateText=n.timeText=undefined;switch(i){case"date-time":case"time-date":var k=b(a,g);var _=h(a,g,y);if(c){n.dateText="".concat(k," ").concat(_)}else{n.dateText=k;n.timeText=_}break;case"date":if(u&&x.length!==1){var j="".concat(x.length," days");if(v!==undefined){try{j=v(x)}catch(e){s("Exception in provided `titleSelectedDatesFormatter`: ",e)}}n.dateText=j}else{n.dateText=b(a,g)}break;case"time":n.timeText=h(a,g,y);break;case"month-year":n.dateText=m(a,g);break;case"month":n.dateText=p(a,g,{month:"long"});break;case"year":n.dateText=p(a,g,{year:"numeric"});break}};this.waitForDatetimeChanges=function(){return __awaiter(n,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.datetimeEl;if(!e){return[2,Promise.resolve()]}return[2,new Promise((function(t){a(e,"ionRender",t,{once:true})}))]}))}))};this.handleDateClick=function(e){return __awaiter(n,void 0,void 0,(function(){var t,n,i,r,a;return __generator(this,(function(o){t=this,n=t.datetimeEl,i=t.datetimePresentation;if(!n){return[2]}r=false;switch(i){case"date-time":case"time-date":a=n.presentation!=="date";if(!n.preferWheel&&a){n.presentation="date";r=true}break}this.selectedButton="date";this.presentOverlay(e,r,this.dateTargetEl);return[2]}))}))};this.handleTimeClick=function(e){var t=n,i=t.datetimeEl,r=t.datetimePresentation;if(!i){return}var a=false;switch(r){case"date-time":case"time-date":var o=i.presentation!=="time";if(o){i.presentation="time";a=true}break}n.selectedButton="time";n.presentOverlay(e,a,n.timeTargetEl)};this.presentOverlay=function(e,t,i){return __awaiter(n,void 0,void 0,(function(){var n;return __generator(this,(function(r){switch(r.label){case 0:n=this.overlayEl;if(!n){return[2]}if(!(n.tagName==="ION-POPOVER"))return[3,3];if(!t)return[3,2];return[4,this.waitForDatetimeChanges()];case 1:r.sent();r.label=2;case 2:n.present(Object.assign(Object.assign({},e),{detail:{ionShadowTarget:i}}));return[3,4];case 3:n.present();r.label=4;case 4:return[2]}}))}))};this.datetimePresentation="date-time";this.dateText=undefined;this.timeText=undefined;this.datetimeActive=false;this.selectedButton=undefined;this.color="primary";this.disabled=false;this.datetime=undefined}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,i;var r=this;return __generator(this,(function(c){e=this.datetime;if(!e){s("An ID associated with an ion-datetime instance is required for ion-datetime-button to function properly.",this.el);return[2]}t=this.datetimeEl=document.getElementById(e);if(!t){s("No ion-datetime instance found for ID '".concat(e,"'."),this.el);return[2]}if(t.tagName!=="ION-DATETIME"){s("Expected an ion-datetime instance for ID '".concat(e,"' but received '").concat(t.tagName.toLowerCase(),"' instead."),t);return[2]}n=new IntersectionObserver((function(e){var t=e[0];r.datetimeActive=t.isIntersecting}),{threshold:.01});n.observe(t);i=this.overlayEl=t.closest("ion-modal, ion-popover");if(i){i.classList.add("ion-datetime-button-overlay")}o(t,(function(){var e=r.datetimePresentation=t.presentation||"date-time";r.setDateTimeText();a(t,"ionValueChange",r.setDateTimeText);switch(e){case"date-time":case"date":case"month-year":case"month":case"year":r.selectedButton="date";break;case"time-date":case"time":r.selectedButton="time";break}}));return[2]}))}))};e.prototype.render=function(){var e;var t=this;var r=this,a=r.color,o=r.dateText,s=r.timeText,d=r.selectedButton,f=r.datetimeActive,l=r.disabled;var p=u(this);return n(i,{key:"36fe34d4225940611d74bdef5b954d54749d2dca",class:c(a,(e={},e[p]=true,e["".concat(d,"-active")]=f,e["datetime-button-disabled"]=l,e))},o&&n("button",{class:"ion-activatable",id:"date-button","aria-expanded":f?"true":"false",onClick:this.handleDateClick,disabled:l,part:"native",ref:function(e){return t.dateTargetEl=e}},n("slot",{name:"date-target"},o),p==="md"&&n("ion-ripple-effect",null)),s&&n("button",{class:"ion-activatable",id:"time-button","aria-expanded":f?"true":"false",onClick:this.handleTimeClick,disabled:l,part:"native",ref:function(e){return t.timeTargetEl=e}},n("slot",{name:"time-target"},s),p==="md"&&n("ion-ripple-effect",null)))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());y.style={ios:x,md:g}}}}));
|