@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
|
@@ -834,7 +834,25 @@ const getFormattedDayPeriod = (dayPeriod) => {
|
|
|
834
834
|
}
|
|
835
835
|
return dayPeriod.toUpperCase();
|
|
836
836
|
};
|
|
837
|
-
|
|
837
|
+
/**
|
|
838
|
+
* Including time zone options may lead to the rendered text showing a
|
|
839
|
+
* different time from what was selected in the Datetime, which could cause
|
|
840
|
+
* confusion.
|
|
841
|
+
*/
|
|
842
|
+
const stripTimeZone = (formatOptions) => {
|
|
843
|
+
return Object.assign(Object.assign({}, formatOptions), {
|
|
844
|
+
/**
|
|
845
|
+
* Setting the time zone to UTC ensures that the value shown is always the
|
|
846
|
+
* same as what was selected and safeguards against older Safari bugs with
|
|
847
|
+
* Intl.DateTimeFormat.
|
|
848
|
+
*/
|
|
849
|
+
timeZone: 'UTC',
|
|
850
|
+
/**
|
|
851
|
+
* We do not want to display the time zone name
|
|
852
|
+
*/
|
|
853
|
+
timeZoneName: undefined });
|
|
854
|
+
};
|
|
855
|
+
const getLocalizedTime = (locale, refParts, hourCycle, formatOptions = { hour: 'numeric', minute: 'numeric' }) => {
|
|
838
856
|
const timeParts = {
|
|
839
857
|
hour: refParts.hour,
|
|
840
858
|
minute: refParts.minute,
|
|
@@ -842,28 +860,12 @@ const getLocalizedTime = (locale, refParts, hourCycle) => {
|
|
|
842
860
|
if (timeParts.hour === undefined || timeParts.minute === undefined) {
|
|
843
861
|
return 'Invalid Time';
|
|
844
862
|
}
|
|
845
|
-
return new Intl.DateTimeFormat(locale, {
|
|
846
|
-
hour: 'numeric',
|
|
847
|
-
minute: 'numeric',
|
|
848
|
-
/**
|
|
849
|
-
* Setting the timeZone to UTC prevents
|
|
850
|
-
* new Intl.DatetimeFormat from subtracting
|
|
851
|
-
* the user's current timezone offset
|
|
852
|
-
* when formatting the time.
|
|
853
|
-
*/
|
|
854
|
-
timeZone: 'UTC',
|
|
863
|
+
return new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, stripTimeZone(formatOptions)), {
|
|
855
864
|
/**
|
|
856
865
|
* We use hourCycle here instead of hour12 due to:
|
|
857
866
|
* https://bugs.chromium.org/p/chromium/issues/detail?id=1347316&q=hour12&can=2
|
|
858
867
|
*/
|
|
859
|
-
hourCycle
|
|
860
|
-
/**
|
|
861
|
-
* Setting Z at the end indicates that this
|
|
862
|
-
* date string is in the UTC time zone. This
|
|
863
|
-
* prevents new Date from adding the time zone
|
|
864
|
-
* offset when getting the ISO string.
|
|
865
|
-
*/
|
|
866
|
-
}).format(new Date(convertDataToISO(Object.assign({
|
|
868
|
+
hourCycle })).format(new Date(convertDataToISO(Object.assign({
|
|
867
869
|
/**
|
|
868
870
|
* JS uses a simplified ISO 8601 format which allows for
|
|
869
871
|
* date-only formats and date-time formats, but not
|
|
@@ -949,14 +951,6 @@ const generateDayAriaLabel = (locale, today, refParts) => {
|
|
|
949
951
|
*/
|
|
950
952
|
return today ? `Today, ${labelString}` : labelString;
|
|
951
953
|
};
|
|
952
|
-
/**
|
|
953
|
-
* Gets the day of the week, month, and day
|
|
954
|
-
* Used for the header in MD mode.
|
|
955
|
-
*/
|
|
956
|
-
const getMonthAndDay = (locale, refParts) => {
|
|
957
|
-
const date = getNormalizedDate(refParts);
|
|
958
|
-
return new Intl.DateTimeFormat(locale, { weekday: 'short', month: 'short', day: 'numeric', timeZone: 'UTC' }).format(date);
|
|
959
|
-
};
|
|
960
954
|
/**
|
|
961
955
|
* Given a locale and a date object,
|
|
962
956
|
* return a formatted string that includes
|
|
@@ -967,15 +961,6 @@ const getMonthAndYear = (locale, refParts) => {
|
|
|
967
961
|
const date = getNormalizedDate(refParts);
|
|
968
962
|
return new Intl.DateTimeFormat(locale, { month: 'long', year: 'numeric', timeZone: 'UTC' }).format(date);
|
|
969
963
|
};
|
|
970
|
-
/**
|
|
971
|
-
* Given a locale and a date object,
|
|
972
|
-
* return a formatted string that includes
|
|
973
|
-
* the short month, numeric day, and full year.
|
|
974
|
-
* Example: Apr 22, 2021
|
|
975
|
-
*/
|
|
976
|
-
const getMonthDayAndYear = (locale, refParts) => {
|
|
977
|
-
return getLocalizedDateTime(locale, refParts, { month: 'short', day: 'numeric', year: 'numeric' });
|
|
978
|
-
};
|
|
979
964
|
/**
|
|
980
965
|
* Given a locale and a date object,
|
|
981
966
|
* return a formatted string that includes
|
|
@@ -1025,7 +1010,7 @@ const getNormalizedDate = (refParts) => {
|
|
|
1025
1010
|
*/
|
|
1026
1011
|
const getLocalizedDateTime = (locale, refParts, options) => {
|
|
1027
1012
|
const date = getNormalizedDate(refParts);
|
|
1028
|
-
return getDateTimeFormat(locale, options).format(date);
|
|
1013
|
+
return getDateTimeFormat(locale, stripTimeZone(options)).format(date);
|
|
1029
1014
|
};
|
|
1030
1015
|
/**
|
|
1031
1016
|
* Given a locale, DatetimeParts, and options
|
|
@@ -1641,10 +1626,8 @@ exports.getEndOfWeek = getEndOfWeek;
|
|
|
1641
1626
|
exports.getHourCycle = getHourCycle;
|
|
1642
1627
|
exports.getLocalizedDateTime = getLocalizedDateTime;
|
|
1643
1628
|
exports.getLocalizedTime = getLocalizedTime;
|
|
1644
|
-
exports.getMonthAndDay = getMonthAndDay;
|
|
1645
1629
|
exports.getMonthAndYear = getMonthAndYear;
|
|
1646
1630
|
exports.getMonthColumnData = getMonthColumnData;
|
|
1647
|
-
exports.getMonthDayAndYear = getMonthDayAndYear;
|
|
1648
1631
|
exports.getNextDay = getNextDay;
|
|
1649
1632
|
exports.getNextMonth = getNextMonth;
|
|
1650
1633
|
exports.getNextWeek = getNextWeek;
|
|
@@ -10,7 +10,7 @@ const helpers = require('./helpers-da4c0ed1.js');
|
|
|
10
10
|
const index$1 = require('./index-5915f9b3.js');
|
|
11
11
|
const theme = require('./theme-d1c573d2.js');
|
|
12
12
|
const ionicGlobal = require('./ionic-global-34d0d04a.js');
|
|
13
|
-
const data = require('./data-
|
|
13
|
+
const data = require('./data-4487a815.js');
|
|
14
14
|
|
|
15
15
|
const iosDatetimeButtonCss = ":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}";
|
|
16
16
|
const IonDatetimeButtonIosStyle0 = iosDatetimeButtonCss;
|
|
@@ -44,11 +44,12 @@ const DatetimeButton = class {
|
|
|
44
44
|
* to the locale specified on ion-datetime.
|
|
45
45
|
*/
|
|
46
46
|
this.setDateTimeText = () => {
|
|
47
|
+
var _a, _b, _c, _d, _e;
|
|
47
48
|
const { datetimeEl, datetimePresentation } = this;
|
|
48
49
|
if (!datetimeEl) {
|
|
49
50
|
return;
|
|
50
51
|
}
|
|
51
|
-
const { value, locale, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
|
|
52
|
+
const { value, locale, formatOptions, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
|
|
52
53
|
const parsedValues = this.getParsedDateValues(value);
|
|
53
54
|
/**
|
|
54
55
|
* Both ion-datetime and ion-datetime-button default
|
|
@@ -71,8 +72,8 @@ const DatetimeButton = class {
|
|
|
71
72
|
switch (datetimePresentation) {
|
|
72
73
|
case 'date-time':
|
|
73
74
|
case 'time-date':
|
|
74
|
-
const dateText = data.
|
|
75
|
-
const timeText = data.getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
|
|
75
|
+
const dateText = data.getLocalizedDateTime(locale, firstParsedDatetime, (_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _a !== void 0 ? _a : { month: 'short', day: 'numeric', year: 'numeric' });
|
|
76
|
+
const timeText = data.getLocalizedTime(locale, firstParsedDatetime, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time);
|
|
76
77
|
if (preferWheel) {
|
|
77
78
|
this.dateText = `${dateText} ${timeText}`;
|
|
78
79
|
}
|
|
@@ -95,20 +96,20 @@ const DatetimeButton = class {
|
|
|
95
96
|
this.dateText = headerText;
|
|
96
97
|
}
|
|
97
98
|
else {
|
|
98
|
-
this.dateText = data.
|
|
99
|
+
this.dateText = data.getLocalizedDateTime(locale, firstParsedDatetime, (_b = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _b !== void 0 ? _b : { month: 'short', day: 'numeric', year: 'numeric' });
|
|
99
100
|
}
|
|
100
101
|
break;
|
|
101
102
|
case 'time':
|
|
102
|
-
this.timeText = data.getLocalizedTime(locale, firstParsedDatetime, computedHourCycle);
|
|
103
|
+
this.timeText = data.getLocalizedTime(locale, firstParsedDatetime, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time);
|
|
103
104
|
break;
|
|
104
105
|
case 'month-year':
|
|
105
|
-
this.dateText = data.
|
|
106
|
+
this.dateText = data.getLocalizedDateTime(locale, firstParsedDatetime, (_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _c !== void 0 ? _c : { month: 'long', year: 'numeric' });
|
|
106
107
|
break;
|
|
107
108
|
case 'month':
|
|
108
|
-
this.dateText = data.getLocalizedDateTime(locale, firstParsedDatetime, { month: 'long' });
|
|
109
|
+
this.dateText = data.getLocalizedDateTime(locale, firstParsedDatetime, (_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) !== null && _d !== void 0 ? _d : { month: 'long' });
|
|
109
110
|
break;
|
|
110
111
|
case 'year':
|
|
111
|
-
this.dateText = data.getLocalizedDateTime(locale, firstParsedDatetime, { year: 'numeric' });
|
|
112
|
+
this.dateText = data.getLocalizedDateTime(locale, firstParsedDatetime, (_e = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) !== null && _e !== void 0 ? _e : { year: 'numeric' });
|
|
112
113
|
break;
|
|
113
114
|
}
|
|
114
115
|
};
|
|
@@ -337,7 +338,7 @@ const DatetimeButton = class {
|
|
|
337
338
|
render() {
|
|
338
339
|
const { color, dateText, timeText, selectedButton, datetimeActive, disabled } = this;
|
|
339
340
|
const mode = ionicGlobal.getIonMode(this);
|
|
340
|
-
return (index.h(index.Host, { key: '
|
|
341
|
+
return (index.h(index.Host, { key: '861a08f4a239de771875aee9b505e06ac7064b32', class: theme.createColorClasses(color, {
|
|
341
342
|
[mode]: true,
|
|
342
343
|
[`${selectedButton}-active`]: datetimeActive,
|
|
343
344
|
['datetime-button-disabled']: disabled,
|
|
@@ -13,7 +13,7 @@ const dir = require('./dir-94c21456.js');
|
|
|
13
13
|
const theme = require('./theme-d1c573d2.js');
|
|
14
14
|
const index$2 = require('./index-f52c6d38.js');
|
|
15
15
|
const ionicGlobal = require('./ionic-global-34d0d04a.js');
|
|
16
|
-
const data = require('./data-
|
|
16
|
+
const data = require('./data-4487a815.js');
|
|
17
17
|
const lockController = require('./lock-controller-6585a42a.js');
|
|
18
18
|
const overlays = require('./overlays-d32575f9.js');
|
|
19
19
|
const animation = require('./animation-c2840aea.js');
|
|
@@ -190,6 +190,48 @@ const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
|
|
|
190
190
|
return undefined;
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
+
/**
|
|
194
|
+
* If a time zone is provided in the format options, the rendered text could
|
|
195
|
+
* differ from what was selected in the Datetime, which could cause
|
|
196
|
+
* confusion.
|
|
197
|
+
*/
|
|
198
|
+
const warnIfTimeZoneProvided = (el, formatOptions) => {
|
|
199
|
+
var _a, _b, _c, _d;
|
|
200
|
+
if (((_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _a === void 0 ? void 0 : _a.timeZone) ||
|
|
201
|
+
((_b = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _b === void 0 ? void 0 : _b.timeZoneName) ||
|
|
202
|
+
((_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _c === void 0 ? void 0 : _c.timeZone) ||
|
|
203
|
+
((_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _d === void 0 ? void 0 : _d.timeZoneName)) {
|
|
204
|
+
index.printIonWarning('Datetime: "timeZone" and "timeZoneName" are not supported in "formatOptions".', el);
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
const checkForPresentationFormatMismatch = (el, presentation, formatOptions) => {
|
|
208
|
+
// formatOptions is not required
|
|
209
|
+
if (!formatOptions)
|
|
210
|
+
return;
|
|
211
|
+
// If formatOptions is provided, the date and/or time objects are required, depending on the presentation
|
|
212
|
+
switch (presentation) {
|
|
213
|
+
case 'date':
|
|
214
|
+
case 'month-year':
|
|
215
|
+
case 'month':
|
|
216
|
+
case 'year':
|
|
217
|
+
if (formatOptions.date === undefined) {
|
|
218
|
+
index.printIonWarning(`Datetime: The '${presentation}' presentation requires a date object in formatOptions.`, el);
|
|
219
|
+
}
|
|
220
|
+
break;
|
|
221
|
+
case 'time':
|
|
222
|
+
if (formatOptions.time === undefined) {
|
|
223
|
+
index.printIonWarning(`Datetime: The 'time' presentation requires a time object in formatOptions.`, el);
|
|
224
|
+
}
|
|
225
|
+
break;
|
|
226
|
+
case 'date-time':
|
|
227
|
+
case 'time-date':
|
|
228
|
+
if (formatOptions.date === undefined && formatOptions.time === undefined) {
|
|
229
|
+
index.printIonWarning(`Datetime: The '${presentation}' presentation requires either a date or time object (or both) in formatOptions.`, el);
|
|
230
|
+
}
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
193
235
|
const datetimeIosCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{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{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,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{left:-99999px}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){:host(.show-month-and-year:dir(rtl)) .calendar-next-prev,:host(.show-month-and-year:dir(rtl)) .calendar-days-of-week,:host(.show-month-and-year:dir(rtl)) .calendar-body,:host(.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,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:auto}:host .calendar-action-buttons ion-item ion-icon{-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{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-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{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{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{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{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{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]{pointer-events:none;opacity:0.4}.calendar-day: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{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{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{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--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)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{-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{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}:host .calendar-action-buttons ion-item{--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,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:0}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{-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{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}.calendar-day{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{width:auto;height:auto;overflow:initial}.calendar-day{border-radius:32px}}:host .calendar-body .calendar-month .calendar-month-grid{-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{-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{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}.calendar-day.calendar-day-active{background:rgba(var(--ion-color-base-rgb), 0.2)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host .datetime-time{-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{font-weight:600}:host .datetime-buttons{-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),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}";
|
|
194
236
|
const IonDatetimeIosStyle0 = datetimeIosCss;
|
|
195
237
|
|
|
@@ -814,6 +856,7 @@ const Datetime = class {
|
|
|
814
856
|
this.color = 'primary';
|
|
815
857
|
this.name = this.inputId;
|
|
816
858
|
this.disabled = false;
|
|
859
|
+
this.formatOptions = undefined;
|
|
817
860
|
this.readonly = false;
|
|
818
861
|
this.isDateEnabled = undefined;
|
|
819
862
|
this.min = undefined;
|
|
@@ -841,6 +884,11 @@ const Datetime = class {
|
|
|
841
884
|
this.size = 'fixed';
|
|
842
885
|
this.preferWheel = false;
|
|
843
886
|
}
|
|
887
|
+
formatOptionsChanged() {
|
|
888
|
+
const { el, formatOptions, presentation } = this;
|
|
889
|
+
checkForPresentationFormatMismatch(el, presentation, formatOptions);
|
|
890
|
+
warnIfTimeZoneProvided(el, formatOptions);
|
|
891
|
+
}
|
|
844
892
|
disabledChanged() {
|
|
845
893
|
this.emitStyle();
|
|
846
894
|
}
|
|
@@ -850,6 +898,10 @@ const Datetime = class {
|
|
|
850
898
|
maxChanged() {
|
|
851
899
|
this.processMaxParts();
|
|
852
900
|
}
|
|
901
|
+
presentationChanged() {
|
|
902
|
+
const { el, formatOptions, presentation } = this;
|
|
903
|
+
checkForPresentationFormatMismatch(el, presentation, formatOptions);
|
|
904
|
+
}
|
|
853
905
|
get isGridStyle() {
|
|
854
906
|
const { presentation, preferWheel } = this;
|
|
855
907
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
@@ -1085,7 +1137,7 @@ const Datetime = class {
|
|
|
1085
1137
|
});
|
|
1086
1138
|
}
|
|
1087
1139
|
componentWillLoad() {
|
|
1088
|
-
const { el, highlightedDates, multiple, presentation, preferWheel } = this;
|
|
1140
|
+
const { el, formatOptions, highlightedDates, multiple, presentation, preferWheel } = this;
|
|
1089
1141
|
if (multiple) {
|
|
1090
1142
|
if (presentation !== 'date') {
|
|
1091
1143
|
index.printIonWarning('Multiple date selection is only supported for presentation="date".', el);
|
|
@@ -1102,6 +1154,10 @@ const Datetime = class {
|
|
|
1102
1154
|
index.printIonWarning('The highlightedDates property is not supported with preferWheel="true".', el);
|
|
1103
1155
|
}
|
|
1104
1156
|
}
|
|
1157
|
+
if (formatOptions) {
|
|
1158
|
+
checkForPresentationFormatMismatch(el, presentation, formatOptions);
|
|
1159
|
+
warnIfTimeZoneProvided(el, formatOptions);
|
|
1160
|
+
}
|
|
1105
1161
|
const hourValues = (this.parsedHourValues = data.convertToArrayOfNumbers(this.hourValues));
|
|
1106
1162
|
const minuteValues = (this.parsedMinuteValues = data.convertToArrayOfNumbers(this.minuteValues));
|
|
1107
1163
|
const monthValues = (this.parsedMonthValues = data.convertToArrayOfNumbers(this.monthValues));
|
|
@@ -1609,7 +1665,7 @@ const Datetime = class {
|
|
|
1609
1665
|
return index$1.h("slot", { name: "time-label" }, "Time");
|
|
1610
1666
|
}
|
|
1611
1667
|
renderTimeOverlay() {
|
|
1612
|
-
const { disabled, hourCycle, isTimePopoverOpen, locale } = this;
|
|
1668
|
+
const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
|
|
1613
1669
|
const computedHourCycle = data.getHourCycle(locale, hourCycle);
|
|
1614
1670
|
const activePart = this.getActivePartsWithFallback();
|
|
1615
1671
|
return [
|
|
@@ -1629,7 +1685,7 @@ const Datetime = class {
|
|
|
1629
1685
|
await popoverRef.onWillDismiss();
|
|
1630
1686
|
this.isTimePopoverOpen = false;
|
|
1631
1687
|
}
|
|
1632
|
-
} }, data.getLocalizedTime(locale, activePart, computedHourCycle)),
|
|
1688
|
+
} }, data.getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
|
|
1633
1689
|
index$1.h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
|
|
1634
1690
|
/**
|
|
1635
1691
|
* Intersection Observers do not consistently fire between Blink and Webkit
|
|
@@ -1652,7 +1708,8 @@ const Datetime = class {
|
|
|
1652
1708
|
];
|
|
1653
1709
|
}
|
|
1654
1710
|
getHeaderSelectedDateText() {
|
|
1655
|
-
|
|
1711
|
+
var _a;
|
|
1712
|
+
const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
|
|
1656
1713
|
const isArray = Array.isArray(activeParts);
|
|
1657
1714
|
let headerText;
|
|
1658
1715
|
if (multiple && isArray && activeParts.length !== 1) {
|
|
@@ -1668,7 +1725,7 @@ const Datetime = class {
|
|
|
1668
1725
|
}
|
|
1669
1726
|
else {
|
|
1670
1727
|
// for exactly 1 day selected (multiple set or not), show a formatted version of that
|
|
1671
|
-
headerText = data.
|
|
1728
|
+
headerText = data.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' });
|
|
1672
1729
|
}
|
|
1673
1730
|
return headerText;
|
|
1674
1731
|
}
|
|
@@ -1757,7 +1814,7 @@ const Datetime = class {
|
|
|
1757
1814
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1758
1815
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1759
1816
|
helpers.renderHiddenInput(true, el, name, data.formatValue(value), disabled);
|
|
1760
|
-
return (index$1.h(index$1.Host, { key: '
|
|
1817
|
+
return (index$1.h(index$1.Host, { key: 'b12b07aebad0a686f93f70dbe29bd039b4c4104f', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, theme.createColorClasses(color, {
|
|
1761
1818
|
[mode]: true,
|
|
1762
1819
|
['datetime-readonly']: readonly,
|
|
1763
1820
|
['datetime-disabled']: disabled,
|
|
@@ -1771,9 +1828,11 @@ const Datetime = class {
|
|
|
1771
1828
|
}
|
|
1772
1829
|
get el() { return index$1.getElement(this); }
|
|
1773
1830
|
static get watchers() { return {
|
|
1831
|
+
"formatOptions": ["formatOptionsChanged"],
|
|
1774
1832
|
"disabled": ["disabledChanged"],
|
|
1775
1833
|
"min": ["minChanged"],
|
|
1776
1834
|
"max": ["maxChanged"],
|
|
1835
|
+
"presentation": ["presentationChanged"],
|
|
1777
1836
|
"yearValues": ["yearValuesChanged"],
|
|
1778
1837
|
"monthValues": ["monthValuesChanged"],
|
|
1779
1838
|
"dayValues": ["dayValuesChanged"],
|
|
@@ -254,7 +254,11 @@ const PickerColumnInternal = class {
|
|
|
254
254
|
*/
|
|
255
255
|
componentWillLoad() {
|
|
256
256
|
const visibleCallback = (entries) => {
|
|
257
|
-
|
|
257
|
+
/**
|
|
258
|
+
* Browsers will sometimes group multiple IO events into a single callback.
|
|
259
|
+
* As a result, we want to grab the last/most recent event in case there are multiple events.
|
|
260
|
+
*/
|
|
261
|
+
const ev = entries[entries.length - 1];
|
|
258
262
|
if (ev.isIntersecting) {
|
|
259
263
|
const { activeItem, el } = this;
|
|
260
264
|
this.isColumnVisible = true;
|
|
@@ -343,18 +347,18 @@ const PickerColumnInternal = class {
|
|
|
343
347
|
* the attribute can be moved to datetime.tsx and set on every
|
|
344
348
|
* instance of ion-picker-column-internal there instead.
|
|
345
349
|
*/
|
|
346
|
-
return (index.h(index.Host, { key: '
|
|
350
|
+
return (index.h(index.Host, { key: '2cf182b9d88219e7ab1feb66c90992c4b9bc6b8e', exportparts: `${PICKER_ITEM_PART}, ${PICKER_ITEM_ACTIVE_PART}`, disabled: pickerDisabled, tabindex: pickerDisabled ? null : 0, class: theme.createColorClasses(color, {
|
|
347
351
|
[mode]: true,
|
|
348
352
|
['picker-column-active']: isActive,
|
|
349
353
|
['picker-column-numeric-input']: numericInput,
|
|
350
|
-
}) }, index.h("div", { key: '
|
|
354
|
+
}) }, index.h("div", { key: '86fa9a1464c03dd25fbe4880b91a597228e0b9c6', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '3bcc466879ea06355c4132d1b7dd469f5aeb193b', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '3aa4e3a12f2fa7d05692c1758648817b19fa6e12', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), items.map((item, index$1) => {
|
|
351
355
|
const isItemDisabled = pickerDisabled || item.disabled || false;
|
|
352
356
|
return (index.h("button", { tabindex: "-1", class: {
|
|
353
357
|
'picker-item': true,
|
|
354
358
|
}, "data-value": item.value, "data-index": index$1, onClick: (ev) => {
|
|
355
359
|
this.centerPickerItemInView(ev.target, true);
|
|
356
360
|
}, disabled: isItemDisabled, part: PICKER_ITEM_PART }, item.text));
|
|
357
|
-
}), index.h("div", { key: '
|
|
361
|
+
}), index.h("div", { key: '0400a6791070b947db3ca692cf780190f7798d88', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '48c4c5e7d2534fd394a3cf6f608eb9998e795bcc', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0"), index.h("div", { key: '2881a12b028923f6e6f140ed963de8646cadf0aa', class: "picker-item picker-item-empty", "aria-hidden": "true" }, "\u00A0")));
|
|
358
362
|
}
|
|
359
363
|
get el() { return index.getElement(this); }
|
|
360
364
|
static get watchers() { return {
|
|
@@ -31,6 +31,7 @@ const Searchbar = class {
|
|
|
31
31
|
this.isCancelVisible = false;
|
|
32
32
|
this.shouldAlignLeft = true;
|
|
33
33
|
this.inputId = `ion-searchbar-${searchbarIds++}`;
|
|
34
|
+
this.inheritedAttributes = {};
|
|
34
35
|
/**
|
|
35
36
|
* Clears the input field and triggers the control change.
|
|
36
37
|
*/
|
|
@@ -131,6 +132,7 @@ const Searchbar = class {
|
|
|
131
132
|
this.noAnimate = true;
|
|
132
133
|
this.color = undefined;
|
|
133
134
|
this.animated = false;
|
|
135
|
+
this.autocapitalize = undefined;
|
|
134
136
|
this.autocomplete = 'off';
|
|
135
137
|
this.autocorrect = 'off';
|
|
136
138
|
this.cancelButtonIcon = ionicGlobal.config.get('backButtonIcon', index$1.arrowBackSharp);
|
|
@@ -140,6 +142,8 @@ const Searchbar = class {
|
|
|
140
142
|
this.disabled = false;
|
|
141
143
|
this.inputmode = undefined;
|
|
142
144
|
this.enterkeyhint = undefined;
|
|
145
|
+
this.maxlength = undefined;
|
|
146
|
+
this.minlength = undefined;
|
|
143
147
|
this.name = this.inputId;
|
|
144
148
|
this.placeholder = 'Search';
|
|
145
149
|
this.searchIcon = undefined;
|
|
@@ -149,6 +153,21 @@ const Searchbar = class {
|
|
|
149
153
|
this.type = 'search';
|
|
150
154
|
this.value = '';
|
|
151
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* lang and dir are globally enumerated attributes.
|
|
158
|
+
* As a result, creating these as properties
|
|
159
|
+
* can have unintended side effects. Instead, we
|
|
160
|
+
* listen for attribute changes and inherit them
|
|
161
|
+
* to the inner `<input>` element.
|
|
162
|
+
*/
|
|
163
|
+
onLangChanged(newValue) {
|
|
164
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { lang: newValue });
|
|
165
|
+
index.forceUpdate(this);
|
|
166
|
+
}
|
|
167
|
+
onDirChanged(newValue) {
|
|
168
|
+
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { dir: newValue });
|
|
169
|
+
index.forceUpdate(this);
|
|
170
|
+
}
|
|
152
171
|
debounceChanged() {
|
|
153
172
|
const { ionInput, debounce, originalIonInput } = this;
|
|
154
173
|
/**
|
|
@@ -173,6 +192,9 @@ const Searchbar = class {
|
|
|
173
192
|
connectedCallback() {
|
|
174
193
|
this.emitStyle();
|
|
175
194
|
}
|
|
195
|
+
componentWillLoad() {
|
|
196
|
+
this.inheritedAttributes = Object.assign({}, helpers.inheritAttributes(this.el, ['lang', 'dir']));
|
|
197
|
+
}
|
|
176
198
|
componentDidLoad() {
|
|
177
199
|
this.originalIonInput = this.ionInput;
|
|
178
200
|
this.positionElements();
|
|
@@ -371,8 +393,8 @@ const Searchbar = class {
|
|
|
371
393
|
const clearIcon = this.clearIcon || (mode === 'ios' ? index$1.closeCircle : index$1.closeSharp);
|
|
372
394
|
const searchIcon = this.searchIcon || (mode === 'ios' ? index$1.searchOutline : index$1.searchSharp);
|
|
373
395
|
const shouldShowCancelButton = this.shouldShowCancelButton();
|
|
374
|
-
const cancelButton = this.showCancelButton !== 'never' && (index.h("button", { key: '
|
|
375
|
-
return (index.h(index.Host, { key: '
|
|
396
|
+
const cancelButton = this.showCancelButton !== 'never' && (index.h("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" }, index.h("div", { key: '25ae47914baa4b7e0281efb2b296d1799a56c764', "aria-hidden": "true" }, mode === 'md' ? (index.h("ion-icon", { "aria-hidden": "true", mode: mode, icon: this.cancelButtonIcon, lazy: false })) : (cancelButtonText))));
|
|
397
|
+
return (index.h(index.Host, { key: '2cf545c40874bc4a19b6af022f5ec41b3a913495', role: "search", "aria-disabled": this.disabled ? 'true' : null, class: theme.createColorClasses(this.color, {
|
|
376
398
|
[mode]: true,
|
|
377
399
|
'searchbar-animated': animated,
|
|
378
400
|
'searchbar-disabled': this.disabled,
|
|
@@ -382,17 +404,19 @@ const Searchbar = class {
|
|
|
382
404
|
'searchbar-has-focus': this.focused,
|
|
383
405
|
'searchbar-should-show-clear': this.shouldShowClearButton(),
|
|
384
406
|
'searchbar-should-show-cancel': this.shouldShowCancelButton(),
|
|
385
|
-
}) }, index.h("div", { key: '
|
|
407
|
+
}) }, index.h("div", { key: '9cf49297278839bbe6e2ef9936de337daa53c08d', class: "searchbar-input-container" }, index.h("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, index.h("ion-icon", { key: '67c593ca842551d9e99e8239115cc7b43261b542', "aria-hidden": "true", mode: mode, icon: searchIcon, lazy: false, class: "searchbar-search-icon" }), index.h("button", { key: '6901c3f6c74cce2d3b7e46fbff85ee6e6399bdb1', "aria-label": "reset", type: "button", "no-blur": true, class: "searchbar-clear-button", onPointerDown: (ev) => {
|
|
386
408
|
/**
|
|
387
409
|
* This prevents mobile browsers from
|
|
388
410
|
* blurring the input when the clear
|
|
389
411
|
* button is activated.
|
|
390
412
|
*/
|
|
391
413
|
ev.preventDefault();
|
|
392
|
-
}, onClick: () => this.onClearInput(true) }, index.h("ion-icon", { key: '
|
|
414
|
+
}, onClick: () => this.onClearInput(true) }, index.h("ion-icon", { key: 'abd45fb79ee807cf8352aa7bf5b0342f2d686227', "aria-hidden": "true", mode: mode, icon: clearIcon, lazy: false, class: "searchbar-clear-icon" }))), mode === 'ios' && cancelButton));
|
|
393
415
|
}
|
|
394
416
|
get el() { return index.getElement(this); }
|
|
395
417
|
static get watchers() { return {
|
|
418
|
+
"lang": ["onLangChanged"],
|
|
419
|
+
"dir": ["onDirChanged"],
|
|
396
420
|
"debounce": ["debounceChanged"],
|
|
397
421
|
"value": ["valueChanged"],
|
|
398
422
|
"showCancelButton": ["showCancelButtonChanged"]
|