@ionic/core 8.8.20-dev.11791573097.1f843ab0 → 8.8.20-dev.11792194859.16be5d7f

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/components/ion-datetime-button.js +1 -1
  2. package/components/ion-datetime.js +1 -1
  3. package/components/{p-BE21dB_a.js → p-Bpr3edV8.js} +1 -1
  4. package/dist/cjs/ion-datetime-button.cjs.entry.js +28 -10
  5. package/dist/cjs/ion-datetime_3.cjs.entry.js +354 -30
  6. package/dist/cjs/ionic.cjs.js +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/components/datetime/datetime.ionic.css +144 -1
  9. package/dist/collection/components/datetime/datetime.ios.css +118 -0
  10. package/dist/collection/components/datetime/datetime.js +407 -27
  11. package/dist/collection/components/datetime/datetime.md.css +117 -0
  12. package/dist/collection/components/datetime/utils/state.js +18 -1
  13. package/dist/collection/components/datetime-button/datetime-button.js +28 -10
  14. package/dist/docs.json +151 -1
  15. package/dist/esm/{format-2WlZcMvG.js → format-BNGmd1mx.js} +1 -1
  16. package/dist/esm/ion-datetime-button.entry.js +29 -11
  17. package/dist/esm/ion-datetime_3.entry.js +355 -31
  18. package/dist/esm/ionic.js +1 -1
  19. package/dist/esm/loader.js +1 -1
  20. package/dist/html.html-data.json +20 -0
  21. package/dist/ionic/ionic.esm.js +1 -1
  22. package/dist/ionic/p-4aa6153d.entry.js +4 -0
  23. package/dist/ionic/p-4f2e482f.entry.js +4 -0
  24. package/dist/ionic/{p-7k7Q1A38.js → p-CrgdPEJR.js} +1 -1
  25. package/dist/types/components/datetime/datetime-interface.d.ts +4 -0
  26. package/dist/types/components/datetime/datetime.d.ts +66 -2
  27. package/dist/types/components/datetime/utils/state.d.ts +5 -2
  28. package/dist/types/components.d.ts +33 -0
  29. package/hydrate/index.js +390 -40
  30. package/hydrate/index.mjs +390 -40
  31. package/package.json +1 -1
  32. package/dist/ionic/p-3a4f9b8a.entry.js +0 -4
  33. package/dist/ionic/p-f6768728.entry.js +0 -4
@@ -1,6 +1,6 @@
1
1
  import type { ComponentInterface, EventEmitter } from '../../stencil-public-runtime';
2
2
  import type { Color, StyleEventDetail } from '../../interface';
3
- import type { DatetimePresentation, DatetimeChangeEventDetail, DatetimeParts, TitleSelectedDatesFormatter, DatetimeHighlight, DatetimeHighlightCallback, DatetimeHourCycle, FormatOptions } from './datetime-interface';
3
+ import type { DatetimePresentation, DatetimeChangeEventDetail, DatetimeParts, DatetimeRangeParts, TitleSelectedDatesFormatter, DatetimeHighlight, DatetimeHighlightCallback, DatetimeHourCycle, FormatOptions } from './datetime-interface';
4
4
  /**
5
5
  * @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
6
6
  * @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
@@ -32,6 +32,11 @@ import type { DatetimePresentation, DatetimeChangeEventDetail, DatetimeParts, Ti
32
32
  * @part calendar-day today - The calendar day that contains the current day.
33
33
  * @part calendar-day disabled - The calendar day that is disabled.
34
34
  *
35
+ * @part range-start - The calendar day button that is the start of a range selection.
36
+ * @part range-end - The calendar day button that is the end of a range selection.
37
+ * @part range-selection - The calendar day button that is part of a range selection (includes start and end).
38
+ * @part range-track - The calendar day wrapper element whose ::before pseudo-element draws the range highlight track.
39
+ *
35
40
  * @part datetime-header - The datetime header contains the content for the `title` slot and the selected date.
36
41
  * @part datetime-title - The element that contains the `title` slot content.
37
42
  * @part datetime-selected-date - The element that contains the selected date.
@@ -67,7 +72,7 @@ export declare class Datetime implements ComponentInterface {
67
72
  private prevPresentation;
68
73
  private resolveForceDateScrolling?;
69
74
  showMonthAndYear: boolean;
70
- activeParts: DatetimeParts | DatetimeParts[];
75
+ activeParts: DatetimeParts | DatetimeParts[] | DatetimeRangeParts;
71
76
  workingParts: DatetimeParts;
72
77
  el: HTMLIonDatetimeElement;
73
78
  isTimePopoverOpen: boolean;
@@ -157,6 +162,16 @@ export declare class Datetime implements ComponentInterface {
157
162
  presentation: DatetimePresentation;
158
163
  protected presentationChanged(): void;
159
164
  private get isGridStyle();
165
+ private get isMultipleMode();
166
+ private get isRangeMode();
167
+ /**
168
+ * Type guard: returns true if the given activeParts is a DatetimeRangeParts object.
169
+ */
170
+ private isRangeParts;
171
+ /**
172
+ * Returns the current range parts if in range mode, or undefined otherwise.
173
+ */
174
+ private get rangeParts();
160
175
  /**
161
176
  * The text to display on the picker's cancel button.
162
177
  */
@@ -240,8 +255,31 @@ export declare class Datetime implements ComponentInterface {
240
255
  /**
241
256
  * If `true`, multiple dates can be selected at once. Only
242
257
  * applies to `presentation="date"` and `preferWheel="false"`.
258
+ *
259
+ * @deprecated Use `selectionMode="multiple"` instead.
243
260
  */
244
261
  multiple: boolean;
262
+ /**
263
+ * Controls the date selection behavior.
264
+ * `'multiple'` enables selecting multiple individual dates.
265
+ * `'range'` enables selecting a start and end date range.
266
+ * When unset, single-date selection is used.
267
+ *
268
+ * Range selection only works with `presentation="date"` and `preferWheel="false"`.
269
+ */
270
+ selectionMode?: 'multiple' | 'range';
271
+ /**
272
+ * The text shown in the datetime header when the start of the range
273
+ * is empty, also used by screen readers to announce the start date.
274
+ * Only applies when `selectionMode="range"`.
275
+ */
276
+ startDateLabel: string;
277
+ /**
278
+ * The text shown in the datetime header when the end of the range
279
+ * is empty, also used by screen readers to announce the end date.
280
+ * Only applies when `selectionMode="range"`.
281
+ */
282
+ endDateLabel: string;
245
283
  /**
246
284
  * Used to apply custom text and background colors to specific dates.
247
285
  *
@@ -401,7 +439,23 @@ export declare class Datetime implements ComponentInterface {
401
439
  private getActivePart;
402
440
  private closeParentOverlay;
403
441
  private setWorkingParts;
442
+ /**
443
+ * Checks whether the span from start to end contains any disabled day.
444
+ * Used by range mode to prevent selecting across disabled dates.
445
+ */
446
+ private rangeContainsDisabledDate;
404
447
  private setActiveParts;
448
+ /**
449
+ * Handles range selection logic when a day is clicked.
450
+ *
451
+ * Creating a new range: first click sets start, second sets end.
452
+ * Modifying an existing range:
453
+ * - Before range → new start
454
+ * - Within range → new end
455
+ * - After range → new end
456
+ * If the resulting span contains a disabled date, start a new range instead.
457
+ */
458
+ private setActivePartsRange;
405
459
  private get isCalendarPicker();
406
460
  private initializeKeyboardListeners;
407
461
  private focusWorkingDay;
@@ -476,6 +530,16 @@ export declare class Datetime implements ComponentInterface {
476
530
  private renderTimeLabel;
477
531
  private renderTimeOverlay;
478
532
  private getHeaderSelectedDateText;
533
+ /**
534
+ * Returns the formatted range header text.
535
+ * Shows "Start date - End date" with placeholders from startDateLabel/endDateLabel.
536
+ */
537
+ private getRangeHeaderText;
538
+ /**
539
+ * Returns the current range value as an ISO string array for
540
+ * titleSelectedDatesFormatter and ionChange.
541
+ */
542
+ private getRangeValueArray;
479
543
  private renderHeader;
480
544
  /**
481
545
  * Render time picker inside of datetime.
@@ -1,4 +1,4 @@
1
- import type { DatetimeHighlight, DatetimeHighlightCallback, DatetimeHighlightStyle, DatetimeParts } from '../datetime-interface';
1
+ import type { DatetimeHighlight, DatetimeHighlightCallback, DatetimeHighlightStyle, DatetimeParts, DatetimeRangeParts } from '../datetime-interface';
2
2
  export declare const isYearDisabled: (refYear: number, minParts?: DatetimeParts, maxParts?: DatetimeParts) => boolean;
3
3
  /**
4
4
  * Returns true if a given day should
@@ -10,10 +10,13 @@ export declare const isDayDisabled: (refParts: DatetimeParts, minParts?: Datetim
10
10
  * Given a locale, a date, the selected date(s), and today's date,
11
11
  * generate the state for a given calendar day button.
12
12
  */
13
- export declare const getCalendarDayState: (locale: string, refParts: DatetimeParts, activeParts: DatetimeParts | DatetimeParts[], todayParts: DatetimeParts, minParts?: DatetimeParts, maxParts?: DatetimeParts, dayValues?: number[]) => {
13
+ export declare const getCalendarDayState: (locale: string, refParts: DatetimeParts, activeParts: DatetimeParts | DatetimeParts[], todayParts: DatetimeParts, minParts?: DatetimeParts, maxParts?: DatetimeParts, dayValues?: number[], rangeParts?: DatetimeRangeParts) => {
14
14
  disabled: boolean;
15
15
  isActive: boolean;
16
16
  isToday: boolean;
17
+ isRangeStart: boolean;
18
+ isRangeEnd: boolean;
19
+ isInRange: boolean;
17
20
  ariaSelected: string | null;
18
21
  ariaLabel: string | null;
19
22
  text: string | null;
@@ -1165,6 +1165,11 @@ export namespace Components {
1165
1165
  * @default 'Done'
1166
1166
  */
1167
1167
  "doneText": string;
1168
+ /**
1169
+ * The text shown in the datetime header when the end of the range is empty, also used by screen readers to announce the end date. Only applies when `selectionMode="range"`.
1170
+ * @default 'End date'
1171
+ */
1172
+ "endDateLabel": string;
1168
1173
  /**
1169
1174
  * The first day of the week to use for `ion-datetime`. The default value is `0` and represents Sunday.
1170
1175
  * @default 0
@@ -1221,6 +1226,7 @@ export namespace Components {
1221
1226
  "monthValues"?: number[] | number | string;
1222
1227
  /**
1223
1228
  * If `true`, multiple dates can be selected at once. Only applies to `presentation="date"` and `preferWheel="false"`.
1229
+ * @deprecated Use `selectionMode="multiple"` instead.
1224
1230
  * @default false
1225
1231
  */
1226
1232
  "multiple": boolean;
@@ -1249,6 +1255,10 @@ export namespace Components {
1249
1255
  * @param startDate A valid [ISO-8601 string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format) to reset the datetime state to.
1250
1256
  */
1251
1257
  "reset": (startDate?: string) => Promise<void>;
1258
+ /**
1259
+ * Controls the date selection behavior. `'multiple'` enables selecting multiple individual dates. `'range'` enables selecting a start and end date range. When unset, single-date selection is used. Range selection only works with `presentation="date"` and `preferWheel="false"`.
1260
+ */
1261
+ "selectionMode"?: 'multiple' | 'range';
1252
1262
  /**
1253
1263
  * If `true`, the datetime calendar displays a six-week (42-day) layout, including days from the previous and next months to fill the grid. These adjacent days are selectable unless disabled.
1254
1264
  * @default false
@@ -1279,6 +1289,11 @@ export namespace Components {
1279
1289
  * @default 'fixed'
1280
1290
  */
1281
1291
  "size": 'cover' | 'fixed';
1292
+ /**
1293
+ * The text shown in the datetime header when the start of the range is empty, also used by screen readers to announce the start date. Only applies when `selectionMode="range"`.
1294
+ * @default 'Start date'
1295
+ */
1296
+ "startDateLabel": string;
1282
1297
  /**
1283
1298
  * The theme determines the visual appearance of the component.
1284
1299
  */
@@ -7210,6 +7225,11 @@ declare namespace LocalJSX {
7210
7225
  * @default 'Done'
7211
7226
  */
7212
7227
  "doneText"?: string;
7228
+ /**
7229
+ * The text shown in the datetime header when the end of the range is empty, also used by screen readers to announce the end date. Only applies when `selectionMode="range"`.
7230
+ * @default 'End date'
7231
+ */
7232
+ "endDateLabel"?: string;
7213
7233
  /**
7214
7234
  * The first day of the week to use for `ion-datetime`. The default value is `0` and represents Sunday.
7215
7235
  * @default 0
@@ -7262,6 +7282,7 @@ declare namespace LocalJSX {
7262
7282
  "monthValues"?: number[] | number | string;
7263
7283
  /**
7264
7284
  * If `true`, multiple dates can be selected at once. Only applies to `presentation="date"` and `preferWheel="false"`.
7285
+ * @deprecated Use `selectionMode="multiple"` instead.
7265
7286
  * @default false
7266
7287
  */
7267
7288
  "multiple"?: boolean;
@@ -7301,6 +7322,10 @@ declare namespace LocalJSX {
7301
7322
  * @default false
7302
7323
  */
7303
7324
  "readonly"?: boolean;
7325
+ /**
7326
+ * Controls the date selection behavior. `'multiple'` enables selecting multiple individual dates. `'range'` enables selecting a start and end date range. When unset, single-date selection is used. Range selection only works with `presentation="date"` and `preferWheel="false"`.
7327
+ */
7328
+ "selectionMode"?: 'multiple' | 'range';
7304
7329
  /**
7305
7330
  * If `true`, the datetime calendar displays a six-week (42-day) layout, including days from the previous and next months to fill the grid. These adjacent days are selectable unless disabled.
7306
7331
  * @default false
@@ -7331,6 +7356,11 @@ declare namespace LocalJSX {
7331
7356
  * @default 'fixed'
7332
7357
  */
7333
7358
  "size"?: 'cover' | 'fixed';
7359
+ /**
7360
+ * The text shown in the datetime header when the start of the range is empty, also used by screen readers to announce the start date. Only applies when `selectionMode="range"`.
7361
+ * @default 'Start date'
7362
+ */
7363
+ "startDateLabel"?: string;
7334
7364
  /**
7335
7365
  * The theme determines the visual appearance of the component.
7336
7366
  */
@@ -10815,6 +10845,9 @@ declare namespace LocalJSX {
10815
10845
  "locale": string;
10816
10846
  "firstDayOfWeek": number;
10817
10847
  "multiple": boolean;
10848
+ "selectionMode": 'multiple' | 'range';
10849
+ "startDateLabel": string;
10850
+ "endDateLabel": string;
10818
10851
  "value": string | string[] | null;
10819
10852
  "showDefaultTitle": boolean;
10820
10853
  "showDefaultButtons": boolean;