@ionic/core 9.0.11-dev.11793736984.1580a194 → 9.0.11-dev.11793792571.1765ff65
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/ion-badge.js +1 -1
- package/components/ion-button.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-input-password-toggle.js +1 -1
- package/components/ion-item-option.js +1 -1
- package/components/ion-select-modal.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/{p-B7ExaLVL.js → p-BCQSEpww.js} +1 -1
- package/components/p-Da8LCPwo.js +4 -0
- package/components/p-DirxxGzo.js +4 -0
- package/components/{p-BCYVFy50.js → p-py1vB-7U.js} +1 -1
- package/css/ionic/bundle.ionic.css +1 -1
- package/css/ionic/bundle.ionic.css.map +1 -1
- package/css/ionic/core.ionic.css +1 -1
- package/css/ionic/core.ionic.css.map +1 -1
- package/dist/cjs/ion-app_8.cjs.entry.js +13 -5
- package/dist/cjs/ion-avatar_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-button_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime-button.cjs.entry.js +6 -33
- package/dist/cjs/ion-datetime.cjs.entry.js +36 -353
- package/dist/cjs/ion-item-option_3.cjs.entry.js +1 -1
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/badge/badge.ionic.css +1 -1
- package/dist/collection/components/button/button.ionic.css +1 -1
- package/dist/collection/components/content/content.ionic.css +352 -0
- package/dist/collection/components/content/{content.css → content.ios.css} +65 -41
- package/dist/collection/components/content/content.js +9 -5
- package/dist/collection/components/content/content.md.css +347 -0
- package/dist/collection/components/datetime/datetime.ionic.css +5 -187
- package/dist/collection/components/datetime/datetime.ios.css +2 -142
- package/dist/collection/components/datetime/datetime.js +33 -406
- package/dist/collection/components/datetime/datetime.md.css +0 -128
- package/dist/collection/components/datetime/utils/state.js +1 -18
- package/dist/collection/components/datetime-button/datetime-button.js +6 -34
- package/dist/collection/components/item-option/item-option.ionic.css +1 -1
- package/dist/docs.json +127 -160
- package/dist/esm/{format-DUHrIiJq.js → format-NT7iHsbA.js} +1 -1
- package/dist/esm/ion-app_8.entry.js +13 -5
- package/dist/esm/ion-avatar_3.entry.js +1 -1
- package/dist/esm/ion-button_2.entry.js +1 -1
- package/dist/esm/ion-datetime-button.entry.js +7 -34
- package/dist/esm/ion-datetime.entry.js +37 -354
- package/dist/esm/ion-item-option_3.entry.js +1 -1
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/html.html-data.json +0 -20
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-0743a26a.entry.js +4 -0
- package/dist/ionic/p-1d709b26.entry.js +4 -0
- package/dist/ionic/p-39e3be74.entry.js +4 -0
- package/dist/ionic/p-6e4ee264.entry.js +4 -0
- package/dist/ionic/{p-CaOPF8Xt.js → p-BtccSO5J.js} +1 -1
- package/dist/ionic/p-ad46d2fd.entry.js +4 -0
- package/dist/ionic/{p-8231e914.entry.js → p-b51eb274.entry.js} +1 -1
- package/dist/types/components/datetime/datetime-interface.d.ts +0 -4
- package/dist/types/components/datetime/datetime.d.ts +2 -71
- package/dist/types/components/datetime/utils/state.d.ts +2 -5
- package/dist/types/components.d.ts +0 -33
- package/hydrate/index.js +59 -403
- package/hydrate/index.mjs +59 -403
- package/package.json +1 -1
- package/components/p-ByE0slik.js +0 -4
- package/components/p-DktrWeJE.js +0 -4
- package/dist/ionic/p-41680415.entry.js +0 -4
- package/dist/ionic/p-5e094639.entry.js +0 -4
- package/dist/ionic/p-a52cba2f.entry.js +0 -4
- package/dist/ionic/p-b30b468d.entry.js +0 -4
- package/dist/ionic/p-ceca04fb.entry.js +0 -4
|
@@ -349,116 +349,11 @@
|
|
|
349
349
|
|
|
350
350
|
:host .calendar-day-wrapper {
|
|
351
351
|
display: flex;
|
|
352
|
-
position: relative;
|
|
353
352
|
align-items: center;
|
|
354
353
|
justify-content: center;
|
|
355
354
|
min-width: 0;
|
|
356
355
|
min-height: 0;
|
|
357
356
|
overflow: visible;
|
|
358
|
-
/**
|
|
359
|
-
* Create a stacking context so the range track
|
|
360
|
-
* (::before with z-index: -1) stays behind the
|
|
361
|
-
* day button but above the host background.
|
|
362
|
-
*/
|
|
363
|
-
z-index: 0;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* The focus ring can extend past the cell, so lift the focused day
|
|
368
|
-
* above the following days, whose range track would otherwise cover it.
|
|
369
|
-
*/
|
|
370
|
-
:host .calendar-day-wrapper:focus-within {
|
|
371
|
-
z-index: 1;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* Each day in the range draws its own piece of the track with a
|
|
376
|
-
* ::before. In-range days fill the cell, while the start and end
|
|
377
|
-
* caps cover the half between the pill center and the next day.
|
|
378
|
-
*
|
|
379
|
-
* Grid columns are `1fr`, so cell edges land on fractional pixels
|
|
380
|
-
* and a cell's track can fall a hairline short of its neighbor's.
|
|
381
|
-
* Each day therefore extends 1px toward the next day in the range,
|
|
382
|
-
* which the next day paints over except inside such a gap.
|
|
383
|
-
*
|
|
384
|
-
* @prop --range-background: The background color of the range selection track.
|
|
385
|
-
*/
|
|
386
|
-
:host .calendar-day-wrapper-in-range::before,
|
|
387
|
-
:host .calendar-day-wrapper-range-start::before,
|
|
388
|
-
:host .calendar-day-wrapper-range-end::before {
|
|
389
|
-
position: absolute;
|
|
390
|
-
top: 50%;
|
|
391
|
-
inset-inline-start: 0;
|
|
392
|
-
inset-inline-end: 0;
|
|
393
|
-
height: var(--range-track-height);
|
|
394
|
-
transform: translateY(-50%);
|
|
395
|
-
/**
|
|
396
|
-
* `--range-background` is translucent by default, so it is layered
|
|
397
|
-
* over the datetime background to paint an opaque track. Where two
|
|
398
|
-
* days overlap, the color stays the same instead of doubling up
|
|
399
|
-
* into a darker line.
|
|
400
|
-
*/
|
|
401
|
-
background: linear-gradient(var(--range-background), var(--range-background)), linear-gradient(var(--background), var(--background));
|
|
402
|
-
content: "";
|
|
403
|
-
z-index: -1;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
:host .calendar-day-wrapper-range-start::before {
|
|
407
|
-
inset-inline-start: 50%;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
:host .calendar-day-wrapper-range-end::before {
|
|
411
|
-
inset-inline-end: 50%;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Only extend toward a day that draws the track as well. The last
|
|
416
|
-
* day of a week is followed by the next row, and the next day is
|
|
417
|
-
* unpainted when it ends the selection or is disabled inside the
|
|
418
|
-
* range, so extending there would leave a 1px nub.
|
|
419
|
-
*/
|
|
420
|
-
:host .calendar-day-wrapper-in-range:not(:nth-child(7n)):has(+ .calendar-day-wrapper-in-range)::before,
|
|
421
|
-
:host .calendar-day-wrapper-in-range:not(:nth-child(7n)):has(+ .calendar-day-wrapper-range-end)::before,
|
|
422
|
-
:host .calendar-day-wrapper-range-start:not(:nth-child(7n)):has(+ .calendar-day-wrapper-in-range)::before,
|
|
423
|
-
:host .calendar-day-wrapper-range-start:not(:nth-child(7n)):has(+ .calendar-day-wrapper-range-end)::before {
|
|
424
|
-
inset-inline-end: -1px;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* A range that continues onto the next week runs the track
|
|
429
|
-
* through the grid padding to the edge of the calendar.
|
|
430
|
-
*/
|
|
431
|
-
:host .calendar-day-wrapper-in-range:nth-child(7n)::before,
|
|
432
|
-
:host .calendar-day-wrapper-range-start:nth-child(7n)::before {
|
|
433
|
-
inset-inline-end: calc(var(--range-track-edge-overflow, 0px) * -1);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
:host .calendar-day-wrapper-in-range:nth-child(7n+1)::before,
|
|
437
|
-
:host .calendar-day-wrapper-range-end:nth-child(7n+1)::before {
|
|
438
|
-
inset-inline-start: calc(var(--range-track-edge-overflow, 0px) * -1);
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* When a single day is both the start and end of the range,
|
|
443
|
-
* do not show a track since there is nothing to connect.
|
|
444
|
-
*/
|
|
445
|
-
:host .calendar-day-wrapper-range-start.calendar-day-wrapper-range-end::before {
|
|
446
|
-
display: none;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* When the component is disabled, fade the whole grid once instead of
|
|
451
|
-
* fading each day. Fading a day makes it its own compositing group, so
|
|
452
|
-
* the 1px that each day extends toward the next would be painted twice
|
|
453
|
-
* and read as a darker seam. The day buttons drop their own disabled
|
|
454
|
-
* opacity so the grid is the only thing applying it.
|
|
455
|
-
*/
|
|
456
|
-
:host(.datetime-disabled.datetime-range) .calendar-month-grid {
|
|
457
|
-
opacity: 0.4;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
:host(.datetime-disabled.datetime-range) .calendar-month-grid .calendar-day[disabled] {
|
|
461
|
-
opacity: 1;
|
|
462
357
|
}
|
|
463
358
|
|
|
464
359
|
/**
|
|
@@ -1005,29 +900,6 @@ ion-picker {
|
|
|
1005
900
|
color: var(--ion-color-step-500, var(--ion-text-color-step-500, gray));
|
|
1006
901
|
}
|
|
1007
902
|
|
|
1008
|
-
:host {
|
|
1009
|
-
--range-background: rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.12);
|
|
1010
|
-
--range-track-height: 42px;
|
|
1011
|
-
--range-track-edge-overflow: 10px;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
:host(.ion-color) {
|
|
1015
|
-
--range-background: rgba(var(--ion-color-base-rgb), 0.12);
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
:host .calendar-day.calendar-day-range-start,
|
|
1019
|
-
:host .calendar-day.calendar-day-range-end {
|
|
1020
|
-
border-radius: 50%;
|
|
1021
|
-
background: var(--ion-color-primary, #0054e9);
|
|
1022
|
-
color: var(--ion-color-primary-contrast, #fff);
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
:host(.ion-color) .calendar-day.calendar-day-range-start,
|
|
1026
|
-
:host(.ion-color) .calendar-day.calendar-day-range-end {
|
|
1027
|
-
background: var(--ion-color-base);
|
|
1028
|
-
color: var(--ion-color-contrast);
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
903
|
:host .datetime-time {
|
|
1032
904
|
-webkit-padding-start: 16px;
|
|
1033
905
|
padding-inline-start: 16px;
|
|
@@ -74,7 +74,7 @@ export const isDayDisabled = (refParts, minParts, maxParts, dayValues) => {
|
|
|
74
74
|
* Given a locale, a date, the selected date(s), and today's date,
|
|
75
75
|
* generate the state for a given calendar day button.
|
|
76
76
|
*/
|
|
77
|
-
export const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts, maxParts, dayValues
|
|
77
|
+
export const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts, maxParts, dayValues) => {
|
|
78
78
|
/**
|
|
79
79
|
* activeParts signals what day(s) are currently selected in the datetime.
|
|
80
80
|
* If multiple="true", this will be an array, but the logic in this util
|
|
@@ -90,20 +90,6 @@ export const getCalendarDayState = (locale, refParts, activeParts, todayParts, m
|
|
|
90
90
|
const isActive = activePartsArray.find((parts) => isSameDay(refParts, parts)) !== undefined;
|
|
91
91
|
const isToday = isSameDay(refParts, todayParts);
|
|
92
92
|
const disabled = isDayDisabled(refParts, minParts, maxParts, dayValues);
|
|
93
|
-
/**
|
|
94
|
-
* Range state: determine if this day is the range start, end, or in between.
|
|
95
|
-
*/
|
|
96
|
-
let isRangeStart = false;
|
|
97
|
-
let isRangeEnd = false;
|
|
98
|
-
let isInRange = false;
|
|
99
|
-
if (rangeParts) {
|
|
100
|
-
const { start, end } = rangeParts;
|
|
101
|
-
isRangeStart = isSameDay(refParts, start);
|
|
102
|
-
if (end) {
|
|
103
|
-
isRangeEnd = isSameDay(refParts, end);
|
|
104
|
-
isInRange = !disabled && !isRangeStart && !isRangeEnd && isAfter(refParts, start) && isBefore(refParts, end);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
93
|
/**
|
|
108
94
|
* Note that we always return one object regardless of whether activeParts
|
|
109
95
|
* was an array, since we pare down to one value for isActive.
|
|
@@ -112,9 +98,6 @@ export const getCalendarDayState = (locale, refParts, activeParts, todayParts, m
|
|
|
112
98
|
disabled,
|
|
113
99
|
isActive,
|
|
114
100
|
isToday,
|
|
115
|
-
isRangeStart,
|
|
116
|
-
isRangeEnd,
|
|
117
|
-
isInRange,
|
|
118
101
|
ariaSelected: isActive ? 'true' : null,
|
|
119
102
|
ariaLabel: generateDayAriaLabel(locale, isToday, refParts),
|
|
120
103
|
text: refParts.day != null ? getDay(locale, refParts) : null,
|
|
@@ -6,7 +6,6 @@ import { componentOnReady, addEventListener } from "../../utils/helpers";
|
|
|
6
6
|
import { printIonError } from "../../utils/logging/index";
|
|
7
7
|
import { createColorClasses } from "../../utils/theme";
|
|
8
8
|
import { getIonTheme } from "../../global/ionic-global";
|
|
9
|
-
import { isAfter } from "../datetime/utils/comparison";
|
|
10
9
|
import { getLocalizedDateTime, getLocalizedTime } from "../datetime/utils/format";
|
|
11
10
|
import { getHourCycle } from "../datetime/utils/helpers";
|
|
12
11
|
import { parseDate } from "../datetime/utils/parse";
|
|
@@ -54,7 +53,7 @@ export class DatetimeButton {
|
|
|
54
53
|
if (!datetimeEl) {
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
|
-
const { value, locale, formatOptions, hourCycle, preferWheel, multiple,
|
|
56
|
+
const { value, locale, formatOptions, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
|
|
58
57
|
const parsedValues = this.getParsedDateValues(value);
|
|
59
58
|
/**
|
|
60
59
|
* Both ion-datetime and ion-datetime-button default to today's date and
|
|
@@ -66,8 +65,6 @@ export class DatetimeButton {
|
|
|
66
65
|
if (!parsedDatetimes) {
|
|
67
66
|
return;
|
|
68
67
|
}
|
|
69
|
-
const isRangeMode = selectionMode === 'range';
|
|
70
|
-
const isMultipleMode = selectionMode === 'multiple' || (selectionMode === undefined && multiple);
|
|
71
68
|
/**
|
|
72
69
|
* If developers incorrectly use multiple="true"
|
|
73
70
|
* with non "date" datetimes, then just select
|
|
@@ -77,12 +74,11 @@ export class DatetimeButton {
|
|
|
77
74
|
*/
|
|
78
75
|
const firstParsedDatetime = parsedDatetimes[0];
|
|
79
76
|
const computedHourCycle = getHourCycle(locale, hourCycle);
|
|
80
|
-
const dateFormatOptions = formatOptions?.date ?? { month: 'short', day: 'numeric', year: 'numeric' };
|
|
81
77
|
this.dateText = this.timeText = undefined;
|
|
82
78
|
switch (datetimePresentation) {
|
|
83
79
|
case 'date-time':
|
|
84
80
|
case 'time-date':
|
|
85
|
-
const dateText = getLocalizedDateTime(locale, firstParsedDatetime,
|
|
81
|
+
const dateText = getLocalizedDateTime(locale, firstParsedDatetime, formatOptions?.date ?? { month: 'short', day: 'numeric', year: 'numeric' });
|
|
86
82
|
const timeText = getLocalizedTime(locale, firstParsedDatetime, computedHourCycle, formatOptions?.time);
|
|
87
83
|
if (preferWheel) {
|
|
88
84
|
this.dateText = `${dateText} ${timeText}`;
|
|
@@ -93,31 +89,7 @@ export class DatetimeButton {
|
|
|
93
89
|
}
|
|
94
90
|
break;
|
|
95
91
|
case 'date':
|
|
96
|
-
if (
|
|
97
|
-
/**
|
|
98
|
-
* Use the first and last entries in date order, matching
|
|
99
|
-
* how ion-datetime reads a range value.
|
|
100
|
-
*/
|
|
101
|
-
let startIndex = 0;
|
|
102
|
-
let endIndex = parsedValues.length - 1;
|
|
103
|
-
if (isAfter(parsedDatetimes[startIndex], parsedDatetimes[endIndex])) {
|
|
104
|
-
[startIndex, endIndex] = [endIndex, startIndex];
|
|
105
|
-
}
|
|
106
|
-
const rangeValues = [parsedValues[startIndex], parsedValues[endIndex]];
|
|
107
|
-
const startDate = getLocalizedDateTime(locale, parsedDatetimes[startIndex], dateFormatOptions);
|
|
108
|
-
const endDate = getLocalizedDateTime(locale, parsedDatetimes[endIndex], dateFormatOptions);
|
|
109
|
-
let rangeText = `${startDate} - ${endDate}`;
|
|
110
|
-
if (titleSelectedDatesFormatter !== undefined) {
|
|
111
|
-
try {
|
|
112
|
-
rangeText = titleSelectedDatesFormatter(rangeValues);
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
115
|
-
printIonError('[ion-datetime-button] - Exception in provided `titleSelectedDatesFormatter`:', e);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
this.dateText = rangeText;
|
|
119
|
-
}
|
|
120
|
-
else if (isMultipleMode && parsedValues.length !== 1) {
|
|
92
|
+
if (multiple && parsedValues.length !== 1) {
|
|
121
93
|
let headerText = `${parsedValues.length} days`; // default/fallback for multiple selection
|
|
122
94
|
if (titleSelectedDatesFormatter !== undefined) {
|
|
123
95
|
try {
|
|
@@ -130,7 +102,7 @@ export class DatetimeButton {
|
|
|
130
102
|
this.dateText = headerText;
|
|
131
103
|
}
|
|
132
104
|
else {
|
|
133
|
-
this.dateText = getLocalizedDateTime(locale, firstParsedDatetime,
|
|
105
|
+
this.dateText = getLocalizedDateTime(locale, firstParsedDatetime, formatOptions?.date ?? { month: 'short', day: 'numeric', year: 'numeric' });
|
|
134
106
|
}
|
|
135
107
|
break;
|
|
136
108
|
case 'time':
|
|
@@ -367,11 +339,11 @@ export class DatetimeButton {
|
|
|
367
339
|
render() {
|
|
368
340
|
const { color, dateText, timeText, selectedButton, datetimeActive, disabled } = this;
|
|
369
341
|
const theme = getIonTheme(this);
|
|
370
|
-
return (h(Host, { key: '
|
|
342
|
+
return (h(Host, { key: '73ba9456313d46e63db37c48b23b38e8e1f88ec6', class: createColorClasses(color, {
|
|
371
343
|
[theme]: true,
|
|
372
344
|
[`${selectedButton}-active`]: datetimeActive,
|
|
373
345
|
['datetime-button-disabled']: disabled,
|
|
374
|
-
}) }, dateText && (h("button", { key: '
|
|
346
|
+
}) }, dateText && (h("button", { key: '51f70f2d08823ccd399976c09152c278e0ef108e', class: "ion-activatable", id: "date-button", "aria-expanded": datetimeActive ? 'true' : 'false', onClick: this.handleDateClick, disabled: disabled, part: "native", ref: (el) => (this.dateTargetEl = el) }, h("slot", { key: '8422d6ca39d3bdecbefe6686afb9c2bcdb271a54', name: "date-target" }, dateText), theme === 'md' && h("ion-ripple-effect", { key: 'f4c1c9c6bcdf772eb326371b9ab3795f7fbc0848' }))), timeText && (h("button", { key: '709a8bc9d0231bfc3c580bcca9065ccc66f4b7da', class: "ion-activatable", id: "time-button", "aria-expanded": datetimeActive ? 'true' : 'false', onClick: this.handleTimeClick, disabled: disabled, part: "native", ref: (el) => (this.timeTargetEl = el) }, h("slot", { key: '2860f54f5a73aa3a42397a1a72619d6369a79025', name: "time-target" }, timeText), theme === 'md' && h("ion-ripple-effect", { key: '306f594bffa84fea1f5e2528cab5ee56c0364e34' })))));
|
|
375
347
|
}
|
|
376
348
|
static get is() { return "ion-datetime-button"; }
|
|
377
349
|
static get encapsulation() { return "shadow"; }
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
:host(.item-option-bold) {
|
|
264
264
|
--background: var(--ion-color-primary, var(--token-bg-primary-base-default, var(--token-semantics-primary-base, var(--token-semantics-primary-700, var(--token-primitives-blue-700, #105cef)))));
|
|
265
265
|
--background-activated: var(--ion-color-primary-shade, var(--token-bg-primary-base-press, var(--token-semantics-primary-900, var(--token-primitives-blue-900, #0d4bc3))));
|
|
266
|
-
--color: var(--ion-color-primary-contrast, var(--token-text-
|
|
266
|
+
--color: var(--ion-color-primary-contrast, var(--token-text-light, var(--token-primitives-base-white, #ffffff)));
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
:host(.item-option-bold.ion-color) {
|