voyager-ionic-core 8.8.12 → 8.8.17
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/index.js +1 -1
- package/components/ion-accordion.js +1 -1
- package/components/ion-action-sheet.js +1 -1
- package/components/ion-alert.js +1 -1
- package/components/ion-app.js +1 -1
- package/components/ion-back-button.js +1 -1
- package/components/ion-breadcrumb.js +1 -1
- package/components/ion-button.js +1 -1
- package/components/ion-card.js +1 -1
- package/components/ion-checkbox.js +1 -1
- package/components/ion-content.js +1 -1
- package/components/ion-datetime-button.js +1 -1
- package/components/ion-datetime.js +1 -1
- package/components/ion-fab-button.js +1 -1
- package/components/ion-footer.js +1 -1
- package/components/ion-header.js +1 -1
- package/components/ion-img.js +1 -1
- package/components/ion-infinite-scroll.js +1 -1
- package/components/ion-input-otp.js +1 -1
- package/components/ion-input-password-toggle.js +1 -1
- package/components/ion-input.js +1 -1
- package/components/ion-item-options.js +1 -1
- package/components/ion-item-sliding.js +1 -1
- package/components/ion-item.js +1 -1
- package/components/ion-loading.js +1 -1
- package/components/ion-menu-button.js +1 -1
- package/components/ion-menu-toggle.js +1 -1
- package/components/ion-menu.js +1 -1
- package/components/ion-modal.js +1 -1
- package/components/ion-nav.js +1 -1
- package/components/ion-picker-column-option.js +1 -1
- package/components/ion-picker-column.js +1 -1
- package/components/ion-picker-legacy-column.js +1 -1
- package/components/ion-picker-legacy.js +1 -1
- package/components/ion-picker.js +1 -1
- package/components/ion-popover.js +1 -1
- package/components/ion-progress-bar.js +1 -1
- package/components/ion-radio-group.js +1 -1
- package/components/ion-radio.js +1 -1
- package/components/ion-range.js +1 -1
- package/components/ion-refresher-content.js +1 -1
- package/components/ion-refresher.js +1 -1
- package/components/ion-reorder-group.js +1 -1
- package/components/ion-router-outlet.js +1 -1
- package/components/ion-router.js +1 -1
- package/components/ion-searchbar.js +1 -1
- package/components/ion-segment-button.js +1 -1
- package/components/ion-segment.js +1 -1
- package/components/ion-select-modal.js +1 -1
- package/components/ion-select-popover.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/ion-tab-button.js +1 -1
- package/components/ion-tab.js +1 -1
- package/components/ion-textarea.js +1 -1
- package/components/ion-toast.js +1 -1
- package/components/ion-toggle.js +1 -1
- package/components/{p-CtukzcyX.js → p-A3O24YmY.js} +1 -1
- package/components/{p-CU5rbWAW.js → p-ABkNVeU9.js} +1 -1
- package/components/{p-BT_5jSqG.js → p-B-JJgYSG.js} +1 -1
- package/components/p-BB42Mlnr.js +4 -0
- package/components/{p-lE_JGpHD.js → p-BMI53wYL.js} +1 -1
- package/components/p-BkKAANMJ.js +4 -0
- package/components/p-BlIAuGv2.js +4 -0
- package/components/{p-Bth-EzJ0.js → p-Bnsn6KaP.js} +1 -1
- package/components/p-BsBCoGa-.js +4 -0
- package/components/{p-BnqQlm7c.js → p-CQGnMY3n.js} +1 -1
- package/components/{p-DNQI6d-L.js → p-C_hpsif8.js} +1 -1
- package/components/p-Cf2jSDS8.js +4 -0
- package/components/{p-C4t5ymfq.js → p-ChIZKXUu.js} +1 -1
- package/components/p-CkMSOsFF.js +4 -0
- package/components/p-CsNJ1ULL.js +4 -0
- package/components/{p-BsPelv04.js → p-CzCbeKys.js} +1 -1
- package/components/{p-BjfgFSSR.js → p-D-aHdMxW.js} +1 -1
- package/components/p-D0d8qTwj.js +4 -0
- package/components/{p-Baq1XyAy.js → p-D3xo7hqU.js} +1 -1
- package/components/{p-nQi4oKcG.js → p-DCnGU1fF.js} +1 -1
- package/components/p-DGZpx6KJ.js +4 -0
- package/components/p-DGvrK8dD.js +4 -0
- package/components/p-DHTSTb52.js +4 -0
- package/components/{p-BirPFsRD.js → p-DJZp0KTQ.js} +1 -1
- package/components/{p-ijF0iCrA.js → p-DRugphUN.js} +1 -1
- package/components/{p-0NRupjzW.js → p-DV5mPYQS.js} +1 -1
- package/components/{p-C1aScSTo.js → p-DWkAgceV.js} +1 -1
- package/components/{p-DDWp95gH.js → p-KEFO0w3i.js} +1 -1
- package/components/{p-Ciz1-FuE.js → p-Osve4qkc.js} +1 -1
- package/components/{p-dhLYXa7A.js → p-SLS1rDZM.js} +1 -1
- package/components/{p-D5Ubpm7D.js → p-VWbRkLT7.js} +1 -1
- package/components/{p-BTPfOxsU.js → p-aJ6PBUvj.js} +1 -1
- package/components/{p-DnL1c9_X.js → p-oD4kcBRX.js} +1 -1
- package/components/{p-CI3ncNZm.js → p-scxfI1Dd.js} +1 -1
- package/components/p-yzCsOZE2.js +4 -0
- package/dist/cjs/{data-DLTUw-KF.js → format-PxvGiOik.js} +8 -532
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +1 -1
- package/dist/cjs/ion-alert.cjs.entry.js +1 -1
- package/dist/cjs/ion-button_2.cjs.entry.js +7 -3
- package/dist/cjs/ion-checkbox.cjs.entry.js +17 -7
- package/dist/cjs/ion-datetime-button.cjs.entry.js +17 -15
- package/dist/cjs/ion-datetime_3.cjs.entry.js +616 -75
- package/dist/cjs/ion-fab_3.cjs.entry.js +87 -9
- package/dist/cjs/ion-item_8.cjs.entry.js +84 -4
- package/dist/cjs/ion-loading.cjs.entry.js +1 -1
- package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-modal.cjs.entry.js +35 -9
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ion-radio_2.cjs.entry.js +16 -7
- package/dist/cjs/ion-refresher_2.cjs.entry.js +31 -4
- package/dist/cjs/ion-select-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +5 -4
- package/dist/cjs/ion-tab_2.cjs.entry.js +20 -13
- package/dist/cjs/ion-toast.cjs.entry.js +1 -1
- package/dist/cjs/ion-toggle.cjs.entry.js +25 -6
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/item-multiple-inputs-D-gyg57c.js +38 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{overlays-TbKsuC-K.js → overlays-DdtIYQUH.js} +24 -1
- package/dist/collection/components/button/button.js +7 -3
- package/dist/collection/components/checkbox/checkbox.ios.css +18 -0
- package/dist/collection/components/checkbox/checkbox.js +16 -7
- package/dist/collection/components/checkbox/checkbox.md.css +18 -0
- package/dist/collection/components/datetime/datetime.js +51 -6
- package/dist/collection/components/datetime-button/datetime-button.js +8 -7
- package/dist/collection/components/fab-button/fab-button.js +114 -10
- package/dist/collection/components/item/item.ios.css +11 -0
- package/dist/collection/components/item/item.js +85 -4
- package/dist/collection/components/item/item.md.css +11 -0
- package/dist/collection/components/modal/gestures/sheet.js +7 -0
- package/dist/collection/components/modal/gestures/swipe-to-close.js +7 -0
- package/dist/collection/components/modal/modal.ios.css +8 -0
- package/dist/collection/components/modal/modal.js +18 -6
- package/dist/collection/components/modal/modal.md.css +8 -0
- package/dist/collection/components/radio/radio.ios.css +11 -15
- package/dist/collection/components/radio/radio.js +15 -7
- package/dist/collection/components/radio/radio.md.css +11 -11
- package/dist/collection/components/refresher/refresher.js +31 -4
- package/dist/collection/components/select/select.js +4 -3
- package/dist/collection/components/tab/tab.js +20 -13
- package/dist/collection/components/toggle/toggle.ios.css +12 -4
- package/dist/collection/components/toggle/toggle.js +24 -6
- package/dist/collection/components/toggle/toggle.md.css +42 -5
- package/dist/collection/utils/forms/index.js +1 -0
- package/dist/collection/utils/forms/item-multiple-inputs.js +33 -0
- package/dist/collection/utils/overlays.js +24 -1
- package/dist/collection/utils/test/playwright/apply-keyboard-focus.js +25 -0
- package/dist/collection/utils/test/playwright/drag-element.js +15 -0
- package/dist/collection/utils/test/playwright/index.js +1 -0
- package/dist/docs.json +40 -1
- package/dist/esm/{data-DZI70dKr.js → format-CAmvpAez.js} +1 -524
- package/dist/esm/index.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +1 -1
- package/dist/esm/ion-alert.entry.js +1 -1
- package/dist/esm/ion-button_2.entry.js +7 -3
- package/dist/esm/ion-checkbox.entry.js +19 -9
- package/dist/esm/ion-datetime-button.entry.js +9 -7
- package/dist/esm/ion-datetime_3.entry.js +550 -9
- package/dist/esm/ion-fab_3.entry.js +89 -11
- package/dist/esm/ion-item_8.entry.js +84 -4
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu_3.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +35 -9
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ion-radio_2.entry.js +17 -8
- package/dist/esm/ion-refresher_2.entry.js +31 -4
- package/dist/esm/ion-select-modal.entry.js +1 -1
- package/dist/esm/ion-select_3.entry.js +5 -4
- package/dist/esm/ion-tab_2.entry.js +20 -13
- package/dist/esm/ion-toast.entry.js +1 -1
- package/dist/esm/ion-toggle.entry.js +27 -8
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/item-multiple-inputs-DlNuqNJm.js +36 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{overlays-TbiM4mdr.js → overlays-Dg0q2_tJ.js} +25 -2
- package/dist/html.html-data.json +4 -0
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-30bf9737.entry.js → p-0dc33652.entry.js} +1 -1
- package/dist/ionic/p-10e833ef.entry.js +4 -0
- package/dist/ionic/{p-4dc1c33c.entry.js → p-2a05aa64.entry.js} +1 -1
- package/dist/ionic/p-2b204c59.entry.js +4 -0
- package/dist/ionic/p-2fa58e80.entry.js +4 -0
- package/dist/ionic/{p-94f2a736.entry.js → p-34586ead.entry.js} +1 -1
- package/dist/ionic/p-4654ae1c.entry.js +4 -0
- package/dist/ionic/p-4ac4f3d6.entry.js +4 -0
- package/dist/ionic/p-5018dfc8.entry.js +4 -0
- package/dist/ionic/{p-00dbb17e.entry.js → p-5eb8e86d.entry.js} +1 -1
- package/dist/ionic/{p-e847a888.entry.js → p-65ebdf1b.entry.js} +1 -1
- package/dist/ionic/p-7c319341.entry.js +4 -0
- package/dist/ionic/p-829367ed.entry.js +4 -0
- package/dist/ionic/{p-aa5d6b8f.entry.js → p-9f9db3a2.entry.js} +1 -1
- package/dist/ionic/p-C0eMdTCW.js +4 -0
- package/dist/ionic/p-D-3ycHmd.js +4 -0
- package/dist/ionic/p-DqN5EA2O.js +4 -0
- package/dist/ionic/p-aaeedb6b.entry.js +4 -0
- package/dist/ionic/p-bfc9bb0f.entry.js +4 -0
- package/dist/ionic/p-c38b648e.entry.js +4 -0
- package/dist/ionic/{p-3a541154.entry.js → p-ca2ab74d.entry.js} +1 -1
- package/dist/ionic/p-d889ff6d.entry.js +4 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -0
- package/dist/types/components/datetime/datetime.d.ts +8 -0
- package/dist/types/components/fab-button/fab-button.d.ts +15 -0
- package/dist/types/components/item/item.d.ts +19 -0
- package/dist/types/components/radio/radio.d.ts +1 -0
- package/dist/types/components/tab/tab.d.ts +1 -1
- package/dist/types/components/toggle/toggle.d.ts +1 -0
- package/dist/types/components.d.ts +15 -2
- package/dist/types/utils/forms/index.d.ts +1 -0
- package/dist/types/utils/forms/item-multiple-inputs.d.ts +13 -0
- package/dist/types/utils/test/playwright/apply-keyboard-focus.d.ts +16 -0
- package/dist/types/utils/test/playwright/index.d.ts +1 -0
- package/hydrate/index.js +382 -79
- package/hydrate/index.mjs +382 -79
- package/package.json +5 -5
- package/components/p-5bE_Wz4Y.js +0 -4
- package/components/p-B60hm8Qv.js +0 -4
- package/components/p-BAYYcg3o.js +0 -4
- package/components/p-BjoEPDW5.js +0 -4
- package/components/p-C2lKgrXx.js +0 -4
- package/components/p-D7bSXQD3.js +0 -4
- package/components/p-DIE4pXMl.js +0 -4
- package/components/p-W5nO8mX_.js +0 -4
- package/components/p-W9CZ2mWX.js +0 -4
- package/components/p-XlSIJDJ-.js +0 -4
- package/components/p-ryqmO0B-.js +0 -4
- package/dist/ionic/p-0d005398.entry.js +0 -4
- package/dist/ionic/p-1ae21e4c.entry.js +0 -4
- package/dist/ionic/p-2f55dc1a.entry.js +0 -4
- package/dist/ionic/p-3a126bca.entry.js +0 -4
- package/dist/ionic/p-3a7d1e91.entry.js +0 -4
- package/dist/ionic/p-81ea5652.entry.js +0 -4
- package/dist/ionic/p-8c8eee7d.entry.js +0 -4
- package/dist/ionic/p-9a65ac7f.entry.js +0 -4
- package/dist/ionic/p-DAAFkPFT.js +0 -4
- package/dist/ionic/p-a21add2f.entry.js +0 -4
- package/dist/ionic/p-ec090e0a.entry.js +0 -4
- package/dist/ionic/p-fabcce6c.entry.js +0 -4
- package/dist/ionic/p-facfde02.entry.js +0 -4
- package/dist/ionic/p-xOfi7-Zn.js +0 -4
|
@@ -1114,548 +1114,23 @@ const formatValue = (value) => {
|
|
|
1114
1114
|
return Array.isArray(value) ? value.join(',') : value;
|
|
1115
1115
|
};
|
|
1116
1116
|
|
|
1117
|
-
|
|
1118
|
-
* Returns the current date as
|
|
1119
|
-
* an ISO string in the user's
|
|
1120
|
-
* time zone.
|
|
1121
|
-
*/
|
|
1122
|
-
const getToday = () => {
|
|
1123
|
-
/**
|
|
1124
|
-
* ion-datetime intentionally does not
|
|
1125
|
-
* parse time zones/do automatic time zone
|
|
1126
|
-
* conversion when accepting user input.
|
|
1127
|
-
* However when we get today's date string,
|
|
1128
|
-
* we want it formatted relative to the user's
|
|
1129
|
-
* time zone.
|
|
1130
|
-
*
|
|
1131
|
-
* When calling toISOString(), the browser
|
|
1132
|
-
* will convert the date to UTC time by either adding
|
|
1133
|
-
* or subtracting the time zone offset.
|
|
1134
|
-
* To work around this, we need to either add
|
|
1135
|
-
* or subtract the time zone offset to the Date
|
|
1136
|
-
* object prior to calling toISOString().
|
|
1137
|
-
* This allows us to get an ISO string
|
|
1138
|
-
* that is in the user's time zone.
|
|
1139
|
-
*/
|
|
1140
|
-
return removeDateTzOffset(new Date()).toISOString();
|
|
1141
|
-
};
|
|
1142
|
-
const minutes = [
|
|
1143
|
-
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,
|
|
1144
|
-
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,
|
|
1145
|
-
];
|
|
1146
|
-
// h11 hour system uses 0-11. Midnight starts at 0:00am.
|
|
1147
|
-
const hour11 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
1148
|
-
// h12 hour system uses 0-12. Midnight starts at 12:00am.
|
|
1149
|
-
const hour12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
|
|
1150
|
-
// h23 hour system uses 0-23. Midnight starts at 0:00.
|
|
1151
|
-
const 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];
|
|
1152
|
-
// h24 hour system uses 1-24. Midnight starts at 24:00.
|
|
1153
|
-
const 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];
|
|
1154
|
-
/**
|
|
1155
|
-
* Given a locale and a mode,
|
|
1156
|
-
* return an array with formatted days
|
|
1157
|
-
* of the week. iOS should display days
|
|
1158
|
-
* such as "Mon" or "Tue".
|
|
1159
|
-
* MD should display days such as "M"
|
|
1160
|
-
* or "T".
|
|
1161
|
-
*/
|
|
1162
|
-
const getDaysOfWeek = (locale, mode, firstDayOfWeek = 0) => {
|
|
1163
|
-
/**
|
|
1164
|
-
* Nov 1st, 2020 starts on a Sunday.
|
|
1165
|
-
* ion-datetime assumes weeks start on Sunday,
|
|
1166
|
-
* but is configurable via `firstDayOfWeek`.
|
|
1167
|
-
*/
|
|
1168
|
-
const weekdayFormat = mode === 'ios' ? 'short' : 'narrow';
|
|
1169
|
-
const intl = new Intl.DateTimeFormat(locale, { weekday: weekdayFormat });
|
|
1170
|
-
const startDate = new Date('11/01/2020');
|
|
1171
|
-
const daysOfWeek = [];
|
|
1172
|
-
/**
|
|
1173
|
-
* For each day of the week,
|
|
1174
|
-
* get the day name.
|
|
1175
|
-
*/
|
|
1176
|
-
for (let i = firstDayOfWeek; i < firstDayOfWeek + 7; i++) {
|
|
1177
|
-
const currentDate = new Date(startDate);
|
|
1178
|
-
currentDate.setDate(currentDate.getDate() + i);
|
|
1179
|
-
daysOfWeek.push(intl.format(currentDate));
|
|
1180
|
-
}
|
|
1181
|
-
return daysOfWeek;
|
|
1182
|
-
};
|
|
1183
|
-
/**
|
|
1184
|
-
* Returns an array containing all of the
|
|
1185
|
-
* days in a month for a given year. Values are
|
|
1186
|
-
* aligned with a week calendar starting on
|
|
1187
|
-
* the firstDayOfWeek value (Sunday by default)
|
|
1188
|
-
* using null values.
|
|
1189
|
-
*/
|
|
1190
|
-
const getDaysOfMonth = (month, year, firstDayOfWeek, showAdjacentDays = false) => {
|
|
1191
|
-
const numDays = getNumDaysInMonth(month, year);
|
|
1192
|
-
let previousNumDays; //previous month number of days
|
|
1193
|
-
if (month === 1) {
|
|
1194
|
-
// If the current month is January, the previous month should be December of the previous year.
|
|
1195
|
-
previousNumDays = getNumDaysInMonth(12, year - 1);
|
|
1196
|
-
}
|
|
1197
|
-
else {
|
|
1198
|
-
// Otherwise, the previous month should be the current month - 1 of the same year.
|
|
1199
|
-
previousNumDays = getNumDaysInMonth(month - 1, year);
|
|
1200
|
-
}
|
|
1201
|
-
const firstOfMonth = new Date(`${month}/1/${year}`).getDay();
|
|
1202
|
-
/**
|
|
1203
|
-
* To get the first day of the month aligned on the correct
|
|
1204
|
-
* day of the week, we need to determine how many "filler" days
|
|
1205
|
-
* to generate. These filler days as empty/disabled buttons
|
|
1206
|
-
* that fill the space of the days of the week before the first
|
|
1207
|
-
* of the month.
|
|
1208
|
-
*
|
|
1209
|
-
* There are two cases here:
|
|
1210
|
-
*
|
|
1211
|
-
* 1. If firstOfMonth = 4, firstDayOfWeek = 0 then the offset
|
|
1212
|
-
* is (4 - (0 + 1)) = 3. Since the offset loop goes from 0 to 3 inclusive,
|
|
1213
|
-
* this will generate 4 filler days (0, 1, 2, 3), and then day of week 4 will have
|
|
1214
|
-
* the first day of the month.
|
|
1215
|
-
*
|
|
1216
|
-
* 2. If firstOfMonth = 2, firstDayOfWeek = 4 then the offset
|
|
1217
|
-
* is (6 - (4 - 2)) = 4. Since the offset loop goes from 0 to 4 inclusive,
|
|
1218
|
-
* this will generate 5 filler days (0, 1, 2, 3, 4), and then day of week 5 will have
|
|
1219
|
-
* the first day of the month.
|
|
1220
|
-
*/
|
|
1221
|
-
const offset = firstOfMonth >= firstDayOfWeek ? firstOfMonth - (firstDayOfWeek + 1) : 6 - (firstDayOfWeek - firstOfMonth);
|
|
1222
|
-
let days = [];
|
|
1223
|
-
for (let i = 1; i <= numDays; i++) {
|
|
1224
|
-
days.push({ day: i, dayOfWeek: (offset + i) % 7, isAdjacentDay: false });
|
|
1225
|
-
}
|
|
1226
|
-
if (showAdjacentDays) {
|
|
1227
|
-
for (let i = 0; i <= offset; i++) {
|
|
1228
|
-
// Using offset create previous month adjacent day, starting from last day
|
|
1229
|
-
days = [{ day: previousNumDays - i, dayOfWeek: (previousNumDays - i) % 7, isAdjacentDay: true }, ...days];
|
|
1230
|
-
}
|
|
1231
|
-
// Calculate positiveOffset
|
|
1232
|
-
// The calendar will display 42 days (6 rows of 7 columns)
|
|
1233
|
-
// Knowing this the offset is 41 (we start at index 0)
|
|
1234
|
-
// minus (the previous offset + the current month days)
|
|
1235
|
-
const positiveOffset = 41 - (numDays + offset);
|
|
1236
|
-
for (let i = 0; i < positiveOffset; i++) {
|
|
1237
|
-
days.push({ day: i + 1, dayOfWeek: (numDays + offset + i) % 7, isAdjacentDay: true });
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
else {
|
|
1241
|
-
for (let i = 0; i <= offset; i++) {
|
|
1242
|
-
days = [{ day: null, dayOfWeek: null, isAdjacentDay: false }, ...days];
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
return days;
|
|
1246
|
-
};
|
|
1247
|
-
/**
|
|
1248
|
-
* Returns an array of pre-defined hour
|
|
1249
|
-
* values based on the provided hourCycle.
|
|
1250
|
-
*/
|
|
1251
|
-
const getHourData = (hourCycle) => {
|
|
1252
|
-
switch (hourCycle) {
|
|
1253
|
-
case 'h11':
|
|
1254
|
-
return hour11;
|
|
1255
|
-
case 'h12':
|
|
1256
|
-
return hour12;
|
|
1257
|
-
case 'h23':
|
|
1258
|
-
return hour23;
|
|
1259
|
-
case 'h24':
|
|
1260
|
-
return hour24;
|
|
1261
|
-
default:
|
|
1262
|
-
throw new Error(`Invalid hour cycle "${hourCycle}"`);
|
|
1263
|
-
}
|
|
1264
|
-
};
|
|
1265
|
-
/**
|
|
1266
|
-
* Given a local, reference datetime parts and option
|
|
1267
|
-
* max/min bound datetime parts, calculate the acceptable
|
|
1268
|
-
* hour and minute values according to the bounds and locale.
|
|
1269
|
-
*/
|
|
1270
|
-
const generateTime = (locale, refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
|
|
1271
|
-
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
1272
|
-
const use24Hour = is24Hour(computedHourCycle);
|
|
1273
|
-
let processedHours = getHourData(computedHourCycle);
|
|
1274
|
-
let processedMinutes = minutes;
|
|
1275
|
-
let isAMAllowed = true;
|
|
1276
|
-
let isPMAllowed = true;
|
|
1277
|
-
if (hourValues) {
|
|
1278
|
-
processedHours = processedHours.filter((hour) => hourValues.includes(hour));
|
|
1279
|
-
}
|
|
1280
|
-
if (minuteValues) {
|
|
1281
|
-
processedMinutes = processedMinutes.filter((minute) => minuteValues.includes(minute));
|
|
1282
|
-
}
|
|
1283
|
-
if (minParts) {
|
|
1284
|
-
/**
|
|
1285
|
-
* If ref day is the same as the
|
|
1286
|
-
* minimum allowed day, filter hour/minute
|
|
1287
|
-
* values according to min hour and minute.
|
|
1288
|
-
*/
|
|
1289
|
-
if (isSameDay(refParts, minParts)) {
|
|
1290
|
-
/**
|
|
1291
|
-
* Users may not always set the hour/minute for
|
|
1292
|
-
* min value (i.e. 2021-06-02) so we should allow
|
|
1293
|
-
* all hours/minutes in that case.
|
|
1294
|
-
*/
|
|
1295
|
-
if (minParts.hour !== undefined) {
|
|
1296
|
-
processedHours = processedHours.filter((hour) => {
|
|
1297
|
-
const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
|
|
1298
|
-
return (use24Hour ? hour : convertedHour) >= minParts.hour;
|
|
1299
|
-
});
|
|
1300
|
-
isAMAllowed = minParts.hour < 13;
|
|
1301
|
-
}
|
|
1302
|
-
if (minParts.minute !== undefined) {
|
|
1303
|
-
/**
|
|
1304
|
-
* The minimum minute range should not be enforced when
|
|
1305
|
-
* the hour is greater than the min hour.
|
|
1306
|
-
*
|
|
1307
|
-
* For example with a minimum range of 09:30, users
|
|
1308
|
-
* should be able to select 10:00-10:29 and beyond.
|
|
1309
|
-
*/
|
|
1310
|
-
let isPastMinHour = false;
|
|
1311
|
-
if (minParts.hour !== undefined && refParts.hour !== undefined) {
|
|
1312
|
-
if (refParts.hour > minParts.hour) {
|
|
1313
|
-
isPastMinHour = true;
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
processedMinutes = processedMinutes.filter((minute) => {
|
|
1317
|
-
if (isPastMinHour) {
|
|
1318
|
-
return true;
|
|
1319
|
-
}
|
|
1320
|
-
return minute >= minParts.minute;
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
/**
|
|
1324
|
-
* If ref day is before minimum
|
|
1325
|
-
* day do not render any hours/minute values
|
|
1326
|
-
*/
|
|
1327
|
-
}
|
|
1328
|
-
else if (isBefore(refParts, minParts)) {
|
|
1329
|
-
processedHours = [];
|
|
1330
|
-
processedMinutes = [];
|
|
1331
|
-
isAMAllowed = isPMAllowed = false;
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
if (maxParts) {
|
|
1335
|
-
/**
|
|
1336
|
-
* If ref day is the same as the
|
|
1337
|
-
* maximum allowed day, filter hour/minute
|
|
1338
|
-
* values according to max hour and minute.
|
|
1339
|
-
*/
|
|
1340
|
-
if (isSameDay(refParts, maxParts)) {
|
|
1341
|
-
/**
|
|
1342
|
-
* Users may not always set the hour/minute for
|
|
1343
|
-
* max value (i.e. 2021-06-02) so we should allow
|
|
1344
|
-
* all hours/minutes in that case.
|
|
1345
|
-
*/
|
|
1346
|
-
if (maxParts.hour !== undefined) {
|
|
1347
|
-
processedHours = processedHours.filter((hour) => {
|
|
1348
|
-
const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
|
|
1349
|
-
return (use24Hour ? hour : convertedHour) <= maxParts.hour;
|
|
1350
|
-
});
|
|
1351
|
-
isPMAllowed = maxParts.hour >= 12;
|
|
1352
|
-
}
|
|
1353
|
-
if (maxParts.minute !== undefined && refParts.hour === maxParts.hour) {
|
|
1354
|
-
// The available minutes should only be filtered when the hour is the same as the max hour.
|
|
1355
|
-
// For example if the max hour is 10:30 and the current hour is 10:00,
|
|
1356
|
-
// users should be able to select 00-30 minutes.
|
|
1357
|
-
// If the current hour is 09:00, users should be able to select 00-60 minutes.
|
|
1358
|
-
processedMinutes = processedMinutes.filter((minute) => minute <= maxParts.minute);
|
|
1359
|
-
}
|
|
1360
|
-
/**
|
|
1361
|
-
* If ref day is after minimum
|
|
1362
|
-
* day do not render any hours/minute values
|
|
1363
|
-
*/
|
|
1364
|
-
}
|
|
1365
|
-
else if (isAfter(refParts, maxParts)) {
|
|
1366
|
-
processedHours = [];
|
|
1367
|
-
processedMinutes = [];
|
|
1368
|
-
isAMAllowed = isPMAllowed = false;
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
return {
|
|
1372
|
-
hours: processedHours,
|
|
1373
|
-
minutes: processedMinutes,
|
|
1374
|
-
am: isAMAllowed,
|
|
1375
|
-
pm: isPMAllowed,
|
|
1376
|
-
};
|
|
1377
|
-
};
|
|
1378
|
-
/**
|
|
1379
|
-
* Given DatetimeParts, generate the previous,
|
|
1380
|
-
* current, and and next months.
|
|
1381
|
-
*/
|
|
1382
|
-
const generateMonths = (refParts, forcedDate) => {
|
|
1383
|
-
const current = { month: refParts.month, year: refParts.year, day: refParts.day };
|
|
1384
|
-
/**
|
|
1385
|
-
* If we're forcing a month to appear, and it's different from the current month,
|
|
1386
|
-
* ensure it appears by replacing the next or previous month as appropriate.
|
|
1387
|
-
*/
|
|
1388
|
-
if (forcedDate !== undefined && (refParts.month !== forcedDate.month || refParts.year !== forcedDate.year)) {
|
|
1389
|
-
const forced = { month: forcedDate.month, year: forcedDate.year, day: forcedDate.day };
|
|
1390
|
-
const forcedMonthIsBefore = isBefore(forced, current);
|
|
1391
|
-
return forcedMonthIsBefore
|
|
1392
|
-
? [forced, current, getNextMonth(refParts)]
|
|
1393
|
-
: [getPreviousMonth(refParts), current, forced];
|
|
1394
|
-
}
|
|
1395
|
-
return [getPreviousMonth(refParts), current, getNextMonth(refParts)];
|
|
1396
|
-
};
|
|
1397
|
-
const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, formatOptions = {
|
|
1398
|
-
month: 'long',
|
|
1399
|
-
}) => {
|
|
1400
|
-
const { year } = refParts;
|
|
1401
|
-
const months = [];
|
|
1402
|
-
if (monthValues !== undefined) {
|
|
1403
|
-
let processedMonths = monthValues;
|
|
1404
|
-
if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.month) !== undefined) {
|
|
1405
|
-
processedMonths = processedMonths.filter((month) => month <= maxParts.month);
|
|
1406
|
-
}
|
|
1407
|
-
if ((minParts === null || minParts === void 0 ? void 0 : minParts.month) !== undefined) {
|
|
1408
|
-
processedMonths = processedMonths.filter((month) => month >= minParts.month);
|
|
1409
|
-
}
|
|
1410
|
-
processedMonths.forEach((processedMonth) => {
|
|
1411
|
-
const date = new Date(`${processedMonth}/1/${year} GMT+0000`);
|
|
1412
|
-
const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
|
|
1413
|
-
months.push({ text: monthString, value: processedMonth });
|
|
1414
|
-
});
|
|
1415
|
-
}
|
|
1416
|
-
else {
|
|
1417
|
-
const maxMonth = maxParts && maxParts.year === year ? maxParts.month : 12;
|
|
1418
|
-
const minMonth = minParts && minParts.year === year ? minParts.month : 1;
|
|
1419
|
-
for (let i = minMonth; i <= maxMonth; i++) {
|
|
1420
|
-
/**
|
|
1421
|
-
*
|
|
1422
|
-
* There is a bug on iOS 14 where
|
|
1423
|
-
* Intl.DateTimeFormat takes into account
|
|
1424
|
-
* the local timezone offset when formatting dates.
|
|
1425
|
-
*
|
|
1426
|
-
* Forcing the timezone to 'UTC' fixes the issue. However,
|
|
1427
|
-
* we should keep this workaround as it is safer. In the event
|
|
1428
|
-
* this breaks in another browser, we will not be impacted
|
|
1429
|
-
* because all dates will be interpreted in UTC.
|
|
1430
|
-
*
|
|
1431
|
-
* Example:
|
|
1432
|
-
* new Intl.DateTimeFormat('en-US', { month: 'long' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "March"
|
|
1433
|
-
* new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "April"
|
|
1434
|
-
*
|
|
1435
|
-
* In certain timezones, iOS 14 shows the wrong
|
|
1436
|
-
* date for .toUTCString(). To combat this, we
|
|
1437
|
-
* force all of the timezones to GMT+0000 (UTC).
|
|
1438
|
-
*
|
|
1439
|
-
* Example:
|
|
1440
|
-
* Time Zone: Central European Standard Time
|
|
1441
|
-
* new Date('1/1/1992').toUTCString() // "Tue, 31 Dec 1991 23:00:00 GMT"
|
|
1442
|
-
* new Date('1/1/1992 GMT+0000').toUTCString() // "Wed, 01 Jan 1992 00:00:00 GMT"
|
|
1443
|
-
*/
|
|
1444
|
-
const date = new Date(`${i}/1/${year} GMT+0000`);
|
|
1445
|
-
const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
|
|
1446
|
-
months.push({ text: monthString, value: i });
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
return months;
|
|
1450
|
-
};
|
|
1451
|
-
/**
|
|
1452
|
-
* Returns information regarding
|
|
1453
|
-
* selectable dates (i.e 1st, 2nd, 3rd, etc)
|
|
1454
|
-
* within a reference month.
|
|
1455
|
-
* @param locale The locale to format the date with
|
|
1456
|
-
* @param refParts The reference month/year to generate dates for
|
|
1457
|
-
* @param minParts The minimum bound on the date that can be returned
|
|
1458
|
-
* @param maxParts The maximum bound on the date that can be returned
|
|
1459
|
-
* @param dayValues The allowed date values
|
|
1460
|
-
* @returns Date data to be used in ion-picker-column
|
|
1461
|
-
*/
|
|
1462
|
-
const getDayColumnData = (locale, refParts, minParts, maxParts, dayValues, formatOptions = {
|
|
1463
|
-
day: 'numeric',
|
|
1464
|
-
}) => {
|
|
1465
|
-
const { month, year } = refParts;
|
|
1466
|
-
const days = [];
|
|
1467
|
-
/**
|
|
1468
|
-
* If we have max/min bounds that in the same
|
|
1469
|
-
* month/year as the refParts, we should
|
|
1470
|
-
* use the define day as the max/min day.
|
|
1471
|
-
* Otherwise, fallback to the max/min days in a month.
|
|
1472
|
-
*/
|
|
1473
|
-
const numDaysInMonth = getNumDaysInMonth(month, year);
|
|
1474
|
-
const maxDay = (maxParts === null || maxParts === void 0 ? void 0 : maxParts.day) !== null && (maxParts === null || maxParts === void 0 ? void 0 : maxParts.day) !== undefined && maxParts.year === year && maxParts.month === month
|
|
1475
|
-
? maxParts.day
|
|
1476
|
-
: numDaysInMonth;
|
|
1477
|
-
const minDay = (minParts === null || minParts === void 0 ? void 0 : minParts.day) !== null && (minParts === null || minParts === void 0 ? void 0 : minParts.day) !== undefined && minParts.year === year && minParts.month === month
|
|
1478
|
-
? minParts.day
|
|
1479
|
-
: 1;
|
|
1480
|
-
if (dayValues !== undefined) {
|
|
1481
|
-
let processedDays = dayValues;
|
|
1482
|
-
processedDays = processedDays.filter((day) => day >= minDay && day <= maxDay);
|
|
1483
|
-
processedDays.forEach((processedDay) => {
|
|
1484
|
-
const date = new Date(`${month}/${processedDay}/${year} GMT+0000`);
|
|
1485
|
-
const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
|
|
1486
|
-
days.push({ text: dayString, value: processedDay });
|
|
1487
|
-
});
|
|
1488
|
-
}
|
|
1489
|
-
else {
|
|
1490
|
-
for (let i = minDay; i <= maxDay; i++) {
|
|
1491
|
-
const date = new Date(`${month}/${i}/${year} GMT+0000`);
|
|
1492
|
-
const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
|
|
1493
|
-
days.push({ text: dayString, value: i });
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
return days;
|
|
1497
|
-
};
|
|
1498
|
-
const getYearColumnData = (locale, refParts, minParts, maxParts, yearValues) => {
|
|
1499
|
-
var _a, _b;
|
|
1500
|
-
let processedYears = [];
|
|
1501
|
-
if (yearValues !== undefined) {
|
|
1502
|
-
processedYears = yearValues;
|
|
1503
|
-
if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== undefined) {
|
|
1504
|
-
processedYears = processedYears.filter((year) => year <= maxParts.year);
|
|
1505
|
-
}
|
|
1506
|
-
if ((minParts === null || minParts === void 0 ? void 0 : minParts.year) !== undefined) {
|
|
1507
|
-
processedYears = processedYears.filter((year) => year >= minParts.year);
|
|
1508
|
-
}
|
|
1509
|
-
}
|
|
1510
|
-
else {
|
|
1511
|
-
const { year } = refParts;
|
|
1512
|
-
const maxYear = (_a = maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== null && _a !== void 0 ? _a : year;
|
|
1513
|
-
const minYear = (_b = minParts === null || minParts === void 0 ? void 0 : minParts.year) !== null && _b !== void 0 ? _b : year - 100;
|
|
1514
|
-
for (let i = minYear; i <= maxYear; i++) {
|
|
1515
|
-
processedYears.push(i);
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
return processedYears.map((year) => ({
|
|
1519
|
-
text: getYear(locale, { year, month: refParts.month, day: refParts.day }),
|
|
1520
|
-
value: year,
|
|
1521
|
-
}));
|
|
1522
|
-
};
|
|
1523
|
-
/**
|
|
1524
|
-
* Given a starting date and an upper bound,
|
|
1525
|
-
* this functions returns an array of all
|
|
1526
|
-
* month objects in that range.
|
|
1527
|
-
*/
|
|
1528
|
-
const getAllMonthsInRange = (currentParts, maxParts) => {
|
|
1529
|
-
if (currentParts.month === maxParts.month && currentParts.year === maxParts.year) {
|
|
1530
|
-
return [currentParts];
|
|
1531
|
-
}
|
|
1532
|
-
return [currentParts, ...getAllMonthsInRange(getNextMonth(currentParts), maxParts)];
|
|
1533
|
-
};
|
|
1534
|
-
/**
|
|
1535
|
-
* Creates and returns picker items
|
|
1536
|
-
* that represent the days in a month.
|
|
1537
|
-
* Example: "Thu, Jun 2"
|
|
1538
|
-
*/
|
|
1539
|
-
const getCombinedDateColumnData = (locale, todayParts, minParts, maxParts, dayValues, monthValues) => {
|
|
1540
|
-
let items = [];
|
|
1541
|
-
let parts = [];
|
|
1542
|
-
/**
|
|
1543
|
-
* Get all month objects from the min date
|
|
1544
|
-
* to the max date. Note: Do not use getMonthColumnData
|
|
1545
|
-
* as that function only generates dates within a
|
|
1546
|
-
* single year.
|
|
1547
|
-
*/
|
|
1548
|
-
let months = getAllMonthsInRange(minParts, maxParts);
|
|
1549
|
-
/**
|
|
1550
|
-
* Filter out any disallowed month values.
|
|
1551
|
-
*/
|
|
1552
|
-
if (monthValues) {
|
|
1553
|
-
months = months.filter(({ month }) => monthValues.includes(month));
|
|
1554
|
-
}
|
|
1555
|
-
/**
|
|
1556
|
-
* Get all of the days in the month.
|
|
1557
|
-
* From there, generate an array where
|
|
1558
|
-
* each item has the month, date, and day
|
|
1559
|
-
* of work as the text.
|
|
1560
|
-
*/
|
|
1561
|
-
months.forEach((monthObject) => {
|
|
1562
|
-
const referenceMonth = { month: monthObject.month, day: null, year: monthObject.year };
|
|
1563
|
-
const monthDays = getDayColumnData(locale, referenceMonth, minParts, maxParts, dayValues, {
|
|
1564
|
-
month: 'short',
|
|
1565
|
-
day: 'numeric',
|
|
1566
|
-
weekday: 'short',
|
|
1567
|
-
});
|
|
1568
|
-
const dateParts = [];
|
|
1569
|
-
const dateColumnItems = [];
|
|
1570
|
-
monthDays.forEach((dayObject) => {
|
|
1571
|
-
const isToday = isSameDay(Object.assign(Object.assign({}, referenceMonth), { day: dayObject.value }), todayParts);
|
|
1572
|
-
/**
|
|
1573
|
-
* Today's date should read as "Today" (localized)
|
|
1574
|
-
* not the actual date string
|
|
1575
|
-
*/
|
|
1576
|
-
dateColumnItems.push({
|
|
1577
|
-
text: isToday ? getTodayLabel(locale) : dayObject.text,
|
|
1578
|
-
value: `${referenceMonth.year}-${referenceMonth.month}-${dayObject.value}`,
|
|
1579
|
-
});
|
|
1580
|
-
/**
|
|
1581
|
-
* When selecting a date in the wheel picker
|
|
1582
|
-
* we need access to the raw datetime parts data.
|
|
1583
|
-
* The picker column only accepts values of
|
|
1584
|
-
* type string or number, so we need to return
|
|
1585
|
-
* two sets of data: A data set to be passed
|
|
1586
|
-
* to the picker column, and a data set to
|
|
1587
|
-
* be used to reference the raw data when
|
|
1588
|
-
* updating the picker column value.
|
|
1589
|
-
*/
|
|
1590
|
-
dateParts.push({
|
|
1591
|
-
month: referenceMonth.month,
|
|
1592
|
-
year: referenceMonth.year,
|
|
1593
|
-
day: dayObject.value,
|
|
1594
|
-
});
|
|
1595
|
-
});
|
|
1596
|
-
parts = [...parts, ...dateParts];
|
|
1597
|
-
items = [...items, ...dateColumnItems];
|
|
1598
|
-
});
|
|
1599
|
-
return {
|
|
1600
|
-
parts,
|
|
1601
|
-
items,
|
|
1602
|
-
};
|
|
1603
|
-
};
|
|
1604
|
-
const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues) => {
|
|
1605
|
-
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
1606
|
-
const use24Hour = is24Hour(computedHourCycle);
|
|
1607
|
-
const { hours, minutes, am, pm } = generateTime(locale, refParts, computedHourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues);
|
|
1608
|
-
const hoursItems = hours.map((hour) => {
|
|
1609
|
-
return {
|
|
1610
|
-
text: getFormattedHour(hour, computedHourCycle),
|
|
1611
|
-
value: getInternalHourValue(hour, use24Hour, refParts.ampm),
|
|
1612
|
-
};
|
|
1613
|
-
});
|
|
1614
|
-
const minutesItems = minutes.map((minute) => {
|
|
1615
|
-
return {
|
|
1616
|
-
text: addTimePadding(minute),
|
|
1617
|
-
value: minute,
|
|
1618
|
-
};
|
|
1619
|
-
});
|
|
1620
|
-
const dayPeriodItems = [];
|
|
1621
|
-
if (am && !use24Hour) {
|
|
1622
|
-
dayPeriodItems.push({
|
|
1623
|
-
text: getLocalizedDayPeriod(locale, 'am'),
|
|
1624
|
-
value: 'am',
|
|
1625
|
-
});
|
|
1626
|
-
}
|
|
1627
|
-
if (pm && !use24Hour) {
|
|
1628
|
-
dayPeriodItems.push({
|
|
1629
|
-
text: getLocalizedDayPeriod(locale, 'pm'),
|
|
1630
|
-
value: 'pm',
|
|
1631
|
-
});
|
|
1632
|
-
}
|
|
1633
|
-
return {
|
|
1634
|
-
minutesData: minutesItems,
|
|
1635
|
-
hoursData: hoursItems,
|
|
1636
|
-
dayPeriodData: dayPeriodItems,
|
|
1637
|
-
};
|
|
1638
|
-
};
|
|
1639
|
-
|
|
1117
|
+
exports.addTimePadding = addTimePadding;
|
|
1640
1118
|
exports.calculateHourFromAMPM = calculateHourFromAMPM;
|
|
1641
1119
|
exports.clampDate = clampDate;
|
|
1642
1120
|
exports.convertDataToISO = convertDataToISO;
|
|
1643
1121
|
exports.convertToArrayOfNumbers = convertToArrayOfNumbers;
|
|
1644
1122
|
exports.formatValue = formatValue;
|
|
1645
1123
|
exports.generateDayAriaLabel = generateDayAriaLabel;
|
|
1646
|
-
exports.generateMonths = generateMonths;
|
|
1647
1124
|
exports.getClosestValidDate = getClosestValidDate;
|
|
1648
|
-
exports.getCombinedDateColumnData = getCombinedDateColumnData;
|
|
1649
1125
|
exports.getDay = getDay;
|
|
1650
|
-
exports.getDayColumnData = getDayColumnData;
|
|
1651
|
-
exports.getDaysOfMonth = getDaysOfMonth;
|
|
1652
|
-
exports.getDaysOfWeek = getDaysOfWeek;
|
|
1653
1126
|
exports.getEndOfWeek = getEndOfWeek;
|
|
1127
|
+
exports.getFormattedHour = getFormattedHour;
|
|
1654
1128
|
exports.getHourCycle = getHourCycle;
|
|
1129
|
+
exports.getInternalHourValue = getInternalHourValue;
|
|
1655
1130
|
exports.getLocalizedDateTime = getLocalizedDateTime;
|
|
1131
|
+
exports.getLocalizedDayPeriod = getLocalizedDayPeriod;
|
|
1656
1132
|
exports.getLocalizedTime = getLocalizedTime;
|
|
1657
1133
|
exports.getMonthAndYear = getMonthAndYear;
|
|
1658
|
-
exports.getMonthColumnData = getMonthColumnData;
|
|
1659
1134
|
exports.getNextDay = getNextDay;
|
|
1660
1135
|
exports.getNextMonth = getNextMonth;
|
|
1661
1136
|
exports.getNextWeek = getNextWeek;
|
|
@@ -1667,9 +1142,9 @@ exports.getPreviousMonth = getPreviousMonth;
|
|
|
1667
1142
|
exports.getPreviousWeek = getPreviousWeek;
|
|
1668
1143
|
exports.getPreviousYear = getPreviousYear;
|
|
1669
1144
|
exports.getStartOfWeek = getStartOfWeek;
|
|
1670
|
-
exports.
|
|
1671
|
-
exports.
|
|
1672
|
-
exports.
|
|
1145
|
+
exports.getTodayLabel = getTodayLabel;
|
|
1146
|
+
exports.getYear = getYear;
|
|
1147
|
+
exports.is24Hour = is24Hour;
|
|
1673
1148
|
exports.isAfter = isAfter;
|
|
1674
1149
|
exports.isBefore = isBefore;
|
|
1675
1150
|
exports.isLocaleDayPeriodRTL = isLocaleDayPeriodRTL;
|
|
@@ -1679,5 +1154,6 @@ exports.parseAmPm = parseAmPm;
|
|
|
1679
1154
|
exports.parseDate = parseDate;
|
|
1680
1155
|
exports.parseMaxParts = parseMaxParts;
|
|
1681
1156
|
exports.parseMinParts = parseMinParts;
|
|
1157
|
+
exports.removeDateTzOffset = removeDateTzOffset;
|
|
1682
1158
|
exports.validateParts = validateParts;
|
|
1683
1159
|
exports.warnIfValueOutOfBounds = warnIfValueOutOfBounds;
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -15,7 +15,7 @@ var index$2 = require('./index-Ct7gcRif.js');
|
|
|
15
15
|
var config = require('./config-xninhj0J.js');
|
|
16
16
|
var theme = require('./theme-CeDs6Hcv.js');
|
|
17
17
|
var index$3 = require('./index-aC4x3Fk3.js');
|
|
18
|
-
var overlays = require('./overlays-
|
|
18
|
+
var overlays = require('./overlays-DdtIYQUH.js');
|
|
19
19
|
require('./index-DkNv4J_i.js');
|
|
20
20
|
require('./gesture-controller-dtqlP_q4.js');
|
|
21
21
|
require('./hardware-back-button-iUuF_76h.js');
|
|
@@ -7,7 +7,7 @@ var index = require('./index-Ct7gcRif.js');
|
|
|
7
7
|
var buttonActive = require('./button-active-0mPOKmV2.js');
|
|
8
8
|
var helpers = require('./helpers-Cv23MFHM.js');
|
|
9
9
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
10
|
-
var overlays = require('./overlays-
|
|
10
|
+
var overlays = require('./overlays-DdtIYQUH.js');
|
|
11
11
|
var theme = require('./theme-CeDs6Hcv.js');
|
|
12
12
|
var ionicGlobal = require('./ionic-global-B-cA6LkY.js');
|
|
13
13
|
var animation = require('./animation-BJq0kcy2.js');
|
|
@@ -8,7 +8,7 @@ var config = require('./config-xninhj0J.js');
|
|
|
8
8
|
var buttonActive = require('./button-active-0mPOKmV2.js');
|
|
9
9
|
var helpers = require('./helpers-Cv23MFHM.js');
|
|
10
10
|
var lockController = require('./lock-controller-aDB9wrEf.js');
|
|
11
|
-
var overlays = require('./overlays-
|
|
11
|
+
var overlays = require('./overlays-DdtIYQUH.js');
|
|
12
12
|
var theme = require('./theme-CeDs6Hcv.js');
|
|
13
13
|
var ionicGlobal = require('./ionic-global-B-cA6LkY.js');
|
|
14
14
|
var animation = require('./animation-BJq0kcy2.js');
|
|
@@ -110,9 +110,13 @@ const Button = class {
|
|
|
110
110
|
const { formButtonEl } = this;
|
|
111
111
|
/**
|
|
112
112
|
* If the form already has a rendered form button
|
|
113
|
-
* then do not append a new one again.
|
|
113
|
+
* then do not append a new one again. Sync the
|
|
114
|
+
* disabled state and type if it changes after button
|
|
115
|
+
* creation (e.g., runtime property updates).
|
|
114
116
|
*/
|
|
115
117
|
if (formButtonEl !== null && formEl.contains(formButtonEl)) {
|
|
118
|
+
formButtonEl.disabled = this.disabled;
|
|
119
|
+
formButtonEl.type = this.type;
|
|
116
120
|
return;
|
|
117
121
|
}
|
|
118
122
|
// Create a hidden native button inside of the form
|
|
@@ -228,7 +232,7 @@ const Button = class {
|
|
|
228
232
|
{
|
|
229
233
|
type !== 'button' && this.renderHiddenButton();
|
|
230
234
|
}
|
|
231
|
-
return (index.h(index.Host, { key: '
|
|
235
|
+
return (index.h(index.Host, { key: '82c71b8cbf3bb51e443f4aa99c375bf5be6b8dc7', onClick: this.handleClick, "aria-disabled": disabled ? 'true' : null, class: theme.createColorClasses(color, {
|
|
232
236
|
[mode]: true,
|
|
233
237
|
[buttonType]: true,
|
|
234
238
|
[`${buttonType}-${expand}`]: expand !== undefined,
|
|
@@ -243,7 +247,7 @@ const Button = class {
|
|
|
243
247
|
'button-disabled': disabled,
|
|
244
248
|
'ion-activatable': true,
|
|
245
249
|
'ion-focusable': true,
|
|
246
|
-
}) }, index.h(TagType, Object.assign({ key: '
|
|
250
|
+
}) }, index.h(TagType, Object.assign({ key: '53f4cb366bac796ab38f609e858bc1a55fce7641' }, attrs, { class: "button-native", part: "native", disabled: disabled, onFocus: this.onFocus, onBlur: this.onBlur }, inheritedAttributes), index.h("span", { key: '40e127fc11c889e77b8bf02e8714f0dea83bfce7', class: "button-inner" }, index.h("slot", { key: 'e11c8c86d3f0894658a8999129425c9c111f5540', name: "icon-only", onSlotchange: this.slotChanged }), index.h("slot", { key: '105ea9259ea17036359e6fe7eced8b267ab8e0f6', name: "start" }), index.h("slot", { key: '0d7b0966e328a5b10b0562dacbd638dfd08d92af' }), index.h("slot", { key: 'c542b40685802464d69f57ecc0a7c3465d24a417', name: "end" })), mode === 'md' && index.h("ion-ripple-effect", { key: '46df4cbeb057b0a8daab92226121d8bbb8c0ee07', type: this.rippleType }))));
|
|
247
251
|
}
|
|
248
252
|
get el() { return index.getElement(this); }
|
|
249
253
|
static get watchers() { return {
|