@ionic/core 9.0.11-dev.11793889755.165fa328 → 9.0.11-dev.11793890855.1bf6a6e5
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-accordion.js +1 -1
- package/components/ion-datetime-button.js +1 -1
- package/components/ion-datetime.js +1 -1
- package/components/{p-BCQSEpww.js → p-B7ExaLVL.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-accordion_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-datetime-button.cjs.entry.js +33 -6
- package/dist/cjs/ion-datetime.cjs.entry.js +339 -37
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion.ionic.css +11 -6
- package/dist/collection/components/datetime/datetime.ionic.css +211 -5
- package/dist/collection/components/datetime/datetime.ios.css +164 -0
- package/dist/collection/components/datetime/datetime.js +394 -36
- package/dist/collection/components/datetime/datetime.md.css +152 -0
- package/dist/collection/components/datetime/utils/state.js +18 -1
- package/dist/collection/components/datetime-button/datetime-button.js +34 -6
- package/dist/docs.json +153 -3
- package/dist/esm/{format-NT7iHsbA.js → format-DUHrIiJq.js} +1 -1
- package/dist/esm/ion-accordion_2.entry.js +1 -1
- package/dist/esm/ion-datetime-button.entry.js +34 -7
- package/dist/esm/ion-datetime.entry.js +340 -38
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/html.html-data.json +21 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-0f694e87.entry.js → p-8b107444.entry.js} +1 -1
- package/dist/ionic/{p-BtccSO5J.js → p-CaOPF8Xt.js} +1 -1
- package/dist/ionic/p-ceca04fb.entry.js +4 -0
- package/dist/ionic/p-ec99dc1f.entry.js +4 -0
- package/dist/types/components/datetime/datetime-interface.d.ts +4 -0
- package/dist/types/components/datetime/datetime.d.ts +73 -6
- package/dist/types/components/datetime/utils/state.d.ts +5 -2
- package/dist/types/components.d.ts +37 -4
- package/hydrate/index.js +381 -44
- package/hydrate/index.mjs +381 -44
- package/package.json +1 -1
- package/dist/ionic/p-0743a26a.entry.js +0 -4
- package/dist/ionic/p-ad46d2fd.entry.js +0 -4
|
@@ -12,7 +12,7 @@ require('./index-DkNv4J_i.js');
|
|
|
12
12
|
require('./focus-visible-DGPRKkcx.js');
|
|
13
13
|
require('./dir-Bma_9Lqh.js');
|
|
14
14
|
|
|
15
|
-
const accordionIonicCss = () => `:host{display:block;position:relative;width:100%;overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}:host{position:relative}:host::after{-webkit-margin-start:var(--token-space-400, var(--token-scale-400, 16px));margin-inline-start:var(--token-space-400, var(--token-scale-400, 16px));-webkit-margin-end:var(--token-space-400, var(--token-scale-400, 16px));margin-inline-end:var(--token-space-400, var(--token-scale-400, 16px));right:0;left:0;bottom:0;display:block;position:absolute;height:var(--token-border-size-025, var(--token-scale-025, 1px));background-color:var(--token-border-default, var(--token-primitives-neutral-400, #d0d7df));content:"";z-index:3}:host(.accordion-last)::after{display:none}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}::slotted(ion-item[slot=header]){--border-radius:inherit;--color:var(--token-text-default, var(--token-primitives-neutral-1200, #242528));--border-width:var(--token-border-size-0, var(--token-scale-0, 0px));--inner-border-width:var(--token-scale-0, 0px);--min-height:var(--token-scale-700, 28px);--padding-top:var(--token-space-300, var(--token-scale-300, 12px));--padding-end:var(--token-space-400, var(--token-scale-400, 16px));--padding-bottom:var(--token-space-300, var(--token-scale-300, 12px));--padding-start:var(--token-space-400, var(--token-scale-400, 16px));--background-activated:var(--token-bg-neutral-subtlest-press, var(--token-primitives-neutral-200, #ebeef2));font-family:var(--token-font-family, -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol");font-size:var(--token-font-size-450, 1.125rem);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-0, 0);line-height:1.555556}#content-wrapper{-webkit-padding-start:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-start:var(--token-space-400, var(--token-scale-400, 16px));-webkit-padding-end:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-end:var(--token-space-400, var(--token-scale-400, 16px));padding-top:var(--token-space-300, var(--token-scale-300, 12px));padding-bottom:var(--token-space-300, var(--token-scale-300, 12px));font-family:var(--token-font-family, -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol");font-size:var(--token-font-size-350, 0.875rem);font-weight:var(--token-font-weight-regular, 400);letter-spacing:var(--token-font-letter-spacing-0, 0);line-height:1.714286;color:var(--token-text-default, var(--token-primitives-neutral-1200, #242528))}:host(.accordion-disabled)
|
|
15
|
+
const accordionIonicCss = () => `:host{display:block;position:relative;width:100%;overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}:host{position:relative}:host::after{-webkit-margin-start:var(--token-space-400, var(--token-scale-400, 16px));margin-inline-start:var(--token-space-400, var(--token-scale-400, 16px));-webkit-margin-end:var(--token-space-400, var(--token-scale-400, 16px));margin-inline-end:var(--token-space-400, var(--token-scale-400, 16px));right:0;left:0;bottom:0;display:block;position:absolute;height:var(--token-border-size-025, var(--token-scale-025, 1px));background-color:var(--token-border-default, var(--token-primitives-neutral-400, #d0d7df));content:"";z-index:3}:host(.accordion-last)::after{display:none}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}::slotted(ion-item[slot=header]){--border-radius:inherit;--color:var(--token-text-default, var(--token-primitives-neutral-1200, #242528));--border-width:var(--token-border-size-0, var(--token-scale-0, 0px));--inner-border-width:var(--token-scale-0, 0px);--min-height:var(--token-scale-700, 28px);--padding-top:var(--token-space-300, var(--token-scale-300, 12px));--padding-end:var(--token-space-400, var(--token-scale-400, 16px));--padding-bottom:var(--token-space-300, var(--token-scale-300, 12px));--padding-start:var(--token-space-400, var(--token-scale-400, 16px));--background-activated:var(--token-bg-neutral-subtlest-press, var(--token-primitives-neutral-200, #ebeef2));font-family:var(--token-font-family, -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol");font-size:var(--token-font-size-450, 1.125rem);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-0, 0);line-height:1.555556}#content-wrapper{-webkit-padding-start:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-start:var(--token-space-400, var(--token-scale-400, 16px));-webkit-padding-end:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-end:var(--token-space-400, var(--token-scale-400, 16px));padding-top:var(--token-space-300, var(--token-scale-300, 12px));padding-bottom:var(--token-space-300, var(--token-scale-300, 12px));font-family:var(--token-font-family, -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol");font-size:var(--token-font-size-350, 0.875rem);font-weight:var(--token-font-weight-regular, 400);letter-spacing:var(--token-font-letter-spacing-0, 0);line-height:1.714286;color:var(--token-text-default, var(--token-primitives-neutral-1200, #242528))}:host(.accordion-disabled)::before{border-radius:inherit;right:0;left:0;top:0;bottom:0;position:absolute;background-color:var(--token-state-disabled, rgba(255, 255, 255, 0.6));content:"";pointer-events:none;z-index:2}`;
|
|
16
16
|
|
|
17
17
|
const accordionIosCss = () => `:host{display:block;position:relative;width:100%;overflow:hidden;z-index:0}:host(.accordion-expanding) ::slotted(ion-item[slot=header]),:host(.accordion-expanded) ::slotted(ion-item[slot=header]){--border-width:0px}#content{overflow:hidden;will-change:max-height}:host(.accordion-collapsing) #content{max-height:0 !important}:host(.accordion-collapsed) #content{display:none}:host(.accordion-expanding) #content{max-height:0}:host(.accordion-expanding) #content-wrapper{overflow:auto}:host(.accordion-disabled) #header,:host(.accordion-readonly) #header,:host(.accordion-disabled) #content,:host(.accordion-readonly) #content{pointer-events:none}@media (prefers-reduced-motion: reduce){:host,#content{-webkit-transition:none !important;transition:none !important}}:host{background-color:var(--ion-background-color, #ffffff)}:host(.accordion-animated){-webkit-transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:all 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-animated) #content{-webkit-transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1);transition:max-height 300ms cubic-bezier(0.25, 0.8, 0.5, 1)}:host(.accordion-disabled) #header,:host(.accordion-disabled) #content{opacity:0.4}:host(.accordion-next) ::slotted(ion-item[slot=header]){--border-width:0.55px 0px 0.55px 0px}`;
|
|
18
18
|
|
|
@@ -54,7 +54,7 @@ const DatetimeButton = class {
|
|
|
54
54
|
if (!datetimeEl) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
const { value, locale, formatOptions, hourCycle, preferWheel, multiple, titleSelectedDatesFormatter } = datetimeEl;
|
|
57
|
+
const { value, locale, formatOptions, hourCycle, preferWheel, multiple, selectionMode, titleSelectedDatesFormatter, } = datetimeEl;
|
|
58
58
|
const parsedValues = this.getParsedDateValues(value);
|
|
59
59
|
/**
|
|
60
60
|
* Both ion-datetime and ion-datetime-button default to today's date and
|
|
@@ -66,6 +66,8 @@ const DatetimeButton = class {
|
|
|
66
66
|
if (!parsedDatetimes) {
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
+
const isRangeMode = selectionMode === 'range';
|
|
70
|
+
const isMultipleMode = selectionMode === 'multiple' || (selectionMode === undefined && multiple);
|
|
69
71
|
/**
|
|
70
72
|
* If developers incorrectly use multiple="true"
|
|
71
73
|
* with non "date" datetimes, then just select
|
|
@@ -75,11 +77,12 @@ const DatetimeButton = class {
|
|
|
75
77
|
*/
|
|
76
78
|
const firstParsedDatetime = parsedDatetimes[0];
|
|
77
79
|
const computedHourCycle = format.getHourCycle(locale, hourCycle);
|
|
80
|
+
const dateFormatOptions = formatOptions?.date ?? { month: 'short', day: 'numeric', year: 'numeric' };
|
|
78
81
|
this.dateText = this.timeText = undefined;
|
|
79
82
|
switch (datetimePresentation) {
|
|
80
83
|
case 'date-time':
|
|
81
84
|
case 'time-date':
|
|
82
|
-
const dateText = format.getLocalizedDateTime(locale, firstParsedDatetime,
|
|
85
|
+
const dateText = format.getLocalizedDateTime(locale, firstParsedDatetime, dateFormatOptions);
|
|
83
86
|
const timeText = format.getLocalizedTime(locale, firstParsedDatetime, computedHourCycle, formatOptions?.time);
|
|
84
87
|
if (preferWheel) {
|
|
85
88
|
this.dateText = `${dateText} ${timeText}`;
|
|
@@ -90,7 +93,31 @@ const DatetimeButton = class {
|
|
|
90
93
|
}
|
|
91
94
|
break;
|
|
92
95
|
case 'date':
|
|
93
|
-
if (
|
|
96
|
+
if (isRangeMode && parsedValues.length >= 2) {
|
|
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 (format.isAfter(parsedDatetimes[startIndex], parsedDatetimes[endIndex])) {
|
|
104
|
+
[startIndex, endIndex] = [endIndex, startIndex];
|
|
105
|
+
}
|
|
106
|
+
const rangeValues = [parsedValues[startIndex], parsedValues[endIndex]];
|
|
107
|
+
const startDate = format.getLocalizedDateTime(locale, parsedDatetimes[startIndex], dateFormatOptions);
|
|
108
|
+
const endDate = format.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
|
+
index.printIonError('[ion-datetime-button] - Exception in provided `titleSelectedDatesFormatter`:', e);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
this.dateText = rangeText;
|
|
119
|
+
}
|
|
120
|
+
else if (isMultipleMode && parsedValues.length !== 1) {
|
|
94
121
|
let headerText = `${parsedValues.length} days`; // default/fallback for multiple selection
|
|
95
122
|
if (titleSelectedDatesFormatter !== undefined) {
|
|
96
123
|
try {
|
|
@@ -103,7 +130,7 @@ const DatetimeButton = class {
|
|
|
103
130
|
this.dateText = headerText;
|
|
104
131
|
}
|
|
105
132
|
else {
|
|
106
|
-
this.dateText = format.getLocalizedDateTime(locale, firstParsedDatetime,
|
|
133
|
+
this.dateText = format.getLocalizedDateTime(locale, firstParsedDatetime, dateFormatOptions);
|
|
107
134
|
}
|
|
108
135
|
break;
|
|
109
136
|
case 'time':
|
|
@@ -340,11 +367,11 @@ const DatetimeButton = class {
|
|
|
340
367
|
render() {
|
|
341
368
|
const { color, dateText, timeText, selectedButton, datetimeActive, disabled } = this;
|
|
342
369
|
const theme$1 = ionicGlobal.getIonTheme(this);
|
|
343
|
-
return (index.h(index.Host, { key: '
|
|
370
|
+
return (index.h(index.Host, { key: 'e022c5c280d4f889c1ba7ca3e96b38063c5add30', class: theme.createColorClasses(color, {
|
|
344
371
|
[theme$1]: true,
|
|
345
372
|
[`${selectedButton}-active`]: datetimeActive,
|
|
346
373
|
['datetime-button-disabled']: disabled,
|
|
347
|
-
}) }, dateText && (index.h("button", { key: '
|
|
374
|
+
}) }, dateText && (index.h("button", { key: 'b1267d98cefbce7666b0cafa083c42f3116e2398', class: "ion-activatable", id: "date-button", "aria-expanded": datetimeActive ? 'true' : 'false', onClick: this.handleDateClick, disabled: disabled, part: "native", ref: (el) => (this.dateTargetEl = el) }, index.h("slot", { key: '3fdfa6adf73ee1e35cdb7f318f1d1ddcf4ab4d7b', name: "date-target" }, dateText), theme$1 === 'md' && index.h("ion-ripple-effect", { key: 'a832d63c77fffe8d7e0d28827bbb469726373d1e' }))), timeText && (index.h("button", { key: 'c589bdf2b8221609713f0d3554494dd08a1f2e5b', class: "ion-activatable", id: "time-button", "aria-expanded": datetimeActive ? 'true' : 'false', onClick: this.handleTimeClick, disabled: disabled, part: "native", ref: (el) => (this.timeTargetEl = el) }, index.h("slot", { key: '10769ddadf7933d78744facaaa153bb413ff484a', name: "time-target" }, timeText), theme$1 === 'md' && index.h("ion-ripple-effect", { key: '7832de031919ddfb312528b45a3dc8e1c20edea6' })))));
|
|
348
375
|
}
|
|
349
376
|
get el() { return index.getElement(this); }
|
|
350
377
|
};
|