@ionic/core 8.5.8-dev.11748388365.11ad9dfe → 8.5.8-dev.11748450896.16232653
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/button.js +5 -23
- package/components/ion-datetime.js +51 -27
- package/components/ion-input-password-toggle.js +2 -2
- package/components/ion-searchbar.js +4 -4
- package/components/modal.js +82 -159
- package/components/picker-column2.js +3 -3
- package/css/core.css +1 -1
- package/css/core.css.map +1 -1
- package/css/ionic.bundle.css +1 -1
- package/css/ionic.bundle.css.map +1 -1
- package/dist/cjs/ion-button_2.cjs.entry.js +3 -19
- package/dist/cjs/ion-datetime_3.cjs.entry.js +54 -30
- package/dist/cjs/ion-input-password-toggle.cjs.entry.js +2 -2
- package/dist/cjs/ion-modal.cjs.entry.js +82 -159
- package/dist/cjs/ion-searchbar.cjs.entry.js +4 -4
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/button/button.js +3 -23
- package/dist/collection/components/datetime/datetime.js +51 -27
- package/dist/collection/components/input-password-toggle/input-password-toggle.js +2 -2
- package/dist/collection/components/modal/animations/ios.enter.js +1 -41
- package/dist/collection/components/modal/animations/ios.leave.js +2 -24
- package/dist/collection/components/modal/animations/md.enter.js +1 -41
- package/dist/collection/components/modal/animations/md.leave.js +2 -24
- package/dist/collection/components/modal/gestures/sheet.js +76 -29
- package/dist/collection/components/picker-legacy-column/picker-column.js +3 -3
- package/dist/collection/components/searchbar/searchbar.js +5 -5
- package/dist/docs.json +2 -2
- package/dist/esm/ion-button_2.entry.js +4 -20
- package/dist/esm/ion-datetime_3.entry.js +54 -30
- package/dist/esm/ion-input-password-toggle.entry.js +2 -2
- package/dist/esm/ion-modal.entry.js +82 -159
- package/dist/esm/ion-searchbar.entry.js +4 -4
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ion-button_2.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-input-password-toggle.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-searchbar.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/html.html-data.json +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-3cee5d7c.system.entry.js → p-50cb2e8b.system.entry.js} +2 -2
- package/dist/ionic/p-57957c0f.entry.js +4 -0
- package/dist/ionic/p-6b8530f5.system.entry.js +4 -0
- package/dist/ionic/{p-3ec227cd.system.entry.js → p-7611ede3.system.entry.js} +1 -1
- package/dist/ionic/{p-e7f732ef.entry.js → p-891553d8.entry.js} +1 -1
- package/dist/ionic/{p-ffa2125f.entry.js → p-a835aca8.entry.js} +1 -1
- package/dist/ionic/p-b1e199b2.entry.js +4 -0
- package/dist/ionic/p-b5432d15.entry.js +4 -0
- package/dist/ionic/p-c1b7d311.system.entry.js +4 -0
- package/dist/ionic/p-f2367bf2.system.entry.js +4 -0
- package/dist/ionic/p-f725bf9e.system.js +2 -2
- package/dist/types/components/button/button.d.ts +0 -11
- package/dist/types/components/searchbar/searchbar.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/hydrate/index.js +145 -213
- package/hydrate/index.mjs +145 -213
- package/package.json +2 -2
- package/dist/ionic/p-12914457.entry.js +0 -4
- package/dist/ionic/p-3d2b2787.system.entry.js +0 -4
- package/dist/ionic/p-4090ce24.entry.js +0 -4
- package/dist/ionic/p-8b8b4530.system.entry.js +0 -4
- package/dist/ionic/p-94a18d00.entry.js +0 -4
- package/dist/ionic/p-cec902a0.system.entry.js +0 -4
|
@@ -35,6 +35,9 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
35
35
|
let offset = 0;
|
|
36
36
|
let canDismissBlocksGesture = false;
|
|
37
37
|
let cachedScrollEl = null;
|
|
38
|
+
let cachedFooterEl = null;
|
|
39
|
+
let cachedFooterYPosition = null;
|
|
40
|
+
let currentFooterState = null;
|
|
38
41
|
const canDismissMaxStep = 0.95;
|
|
39
42
|
const maxBreakpoint = breakpoints[breakpoints.length - 1];
|
|
40
43
|
const minBreakpoint = breakpoints[0];
|
|
@@ -64,29 +67,59 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
64
67
|
baseEl.classList.add(FOCUS_TRAP_DISABLE_CLASS);
|
|
65
68
|
};
|
|
66
69
|
/**
|
|
67
|
-
* Toggles the
|
|
68
|
-
*
|
|
70
|
+
* Toggles the footer to an absolute position while moving to prevent
|
|
71
|
+
* it from shaking while the sheet is being dragged.
|
|
72
|
+
* @param footer Whether the footer is in a moving or stationary position.
|
|
69
73
|
*/
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
const swapFooterPosition = (newPosition) => {
|
|
75
|
+
if (!cachedFooterEl) {
|
|
76
|
+
cachedFooterEl = baseEl.querySelector('ion-footer');
|
|
77
|
+
if (!cachedFooterEl) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
74
80
|
}
|
|
75
|
-
const clonedFooter = wrapperEl.nextElementSibling;
|
|
76
|
-
const footerToHide = footer === 'original' ? clonedFooter : originalFooter;
|
|
77
|
-
const footerToShow = footer === 'original' ? originalFooter : clonedFooter;
|
|
78
|
-
footerToShow.style.removeProperty('display');
|
|
79
|
-
footerToShow.removeAttribute('aria-hidden');
|
|
80
81
|
const page = baseEl.querySelector('.ion-page');
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
currentFooterState = newPosition;
|
|
83
|
+
if (newPosition === 'stationary') {
|
|
84
|
+
// Reset positioning styles to allow normal document flow
|
|
85
|
+
cachedFooterEl.classList.remove('modal-footer-moving');
|
|
86
|
+
cachedFooterEl.style.removeProperty('position');
|
|
87
|
+
cachedFooterEl.style.removeProperty('width');
|
|
88
|
+
cachedFooterEl.style.removeProperty('height');
|
|
89
|
+
cachedFooterEl.style.removeProperty('top');
|
|
90
|
+
cachedFooterEl.style.removeProperty('left');
|
|
91
|
+
page === null || page === void 0 ? void 0 : page.style.removeProperty('padding-bottom');
|
|
92
|
+
// Move to page
|
|
93
|
+
page === null || page === void 0 ? void 0 : page.appendChild(cachedFooterEl);
|
|
83
94
|
}
|
|
84
95
|
else {
|
|
85
|
-
|
|
86
|
-
|
|
96
|
+
// Get both the footer and document body positions
|
|
97
|
+
const cachedFooterElRect = cachedFooterEl.getBoundingClientRect();
|
|
98
|
+
const bodyRect = document.body.getBoundingClientRect();
|
|
99
|
+
// Add padding to the parent element to prevent content from being hidden
|
|
100
|
+
// when the footer is positioned absolutely. This has to be done before we
|
|
101
|
+
// make the footer absolutely positioned or we may accidentally cause the
|
|
102
|
+
// sheet to scroll.
|
|
103
|
+
const footerHeight = cachedFooterEl.clientHeight;
|
|
104
|
+
page === null || page === void 0 ? void 0 : page.style.setProperty('padding-bottom', `${footerHeight}px`);
|
|
105
|
+
// Apply positioning styles to keep footer at bottom
|
|
106
|
+
cachedFooterEl.classList.add('modal-footer-moving');
|
|
107
|
+
// Calculate absolute position relative to body
|
|
108
|
+
// We need to subtract the body's offsetTop to get true position within document.body
|
|
109
|
+
const absoluteTop = cachedFooterElRect.top - bodyRect.top;
|
|
110
|
+
const absoluteLeft = cachedFooterElRect.left - bodyRect.left;
|
|
111
|
+
// Capture the footer's current dimensions and hard code them during the drag
|
|
112
|
+
cachedFooterEl.style.setProperty('position', 'absolute');
|
|
113
|
+
cachedFooterEl.style.setProperty('width', `${cachedFooterEl.clientWidth}px`);
|
|
114
|
+
cachedFooterEl.style.setProperty('height', `${cachedFooterEl.clientHeight}px`);
|
|
115
|
+
cachedFooterEl.style.setProperty('top', `${absoluteTop}px`);
|
|
116
|
+
cachedFooterEl.style.setProperty('left', `${absoluteLeft}px`);
|
|
117
|
+
// Also cache the footer Y position, which we use to determine if the
|
|
118
|
+
// sheet has been moved below the footer. When that happens, we need to swap
|
|
119
|
+
// the position back so it will collapse correctly.
|
|
120
|
+
cachedFooterYPosition = absoluteTop;
|
|
121
|
+
document.body.appendChild(cachedFooterEl);
|
|
87
122
|
}
|
|
88
|
-
footerToHide.style.setProperty('display', 'none');
|
|
89
|
-
footerToHide.setAttribute('aria-hidden', 'true');
|
|
90
123
|
};
|
|
91
124
|
/**
|
|
92
125
|
* After the entering animation completes,
|
|
@@ -180,12 +213,11 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
180
213
|
}
|
|
181
214
|
/**
|
|
182
215
|
* If expandToScroll is disabled, we need to swap
|
|
183
|
-
* the footer
|
|
184
|
-
*
|
|
185
|
-
* and doesn't stay on the screen after the modal is gone.
|
|
216
|
+
* the footer position to moving so that it doesn't shake
|
|
217
|
+
* while the sheet is being dragged.
|
|
186
218
|
*/
|
|
187
219
|
if (!expandToScroll) {
|
|
188
|
-
|
|
220
|
+
swapFooterPosition('moving');
|
|
189
221
|
}
|
|
190
222
|
/**
|
|
191
223
|
* If we are pulling down, then it is possible we are pulling on the content.
|
|
@@ -204,6 +236,21 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
204
236
|
animation.progressStart(true, 1 - currentBreakpoint);
|
|
205
237
|
};
|
|
206
238
|
const onMove = (detail) => {
|
|
239
|
+
/**
|
|
240
|
+
* If `expandToScroll` is disabled, we need to see if we're currently below
|
|
241
|
+
* the footer element and the footer is in a stationary position. If so,
|
|
242
|
+
* we need to make the stationary the original position so that the footer
|
|
243
|
+
* collapses with the sheet.
|
|
244
|
+
*/
|
|
245
|
+
if (!expandToScroll && cachedFooterYPosition !== null && currentFooterState !== null) {
|
|
246
|
+
// Check if we need to swap the footer position
|
|
247
|
+
if (detail.currentY >= cachedFooterYPosition && currentFooterState === 'moving') {
|
|
248
|
+
swapFooterPosition('stationary');
|
|
249
|
+
}
|
|
250
|
+
else if (detail.currentY < cachedFooterYPosition && currentFooterState === 'stationary') {
|
|
251
|
+
swapFooterPosition('moving');
|
|
252
|
+
}
|
|
253
|
+
}
|
|
207
254
|
/**
|
|
208
255
|
* If `expandToScroll` is disabled, and an upwards swipe gesture is done within
|
|
209
256
|
* the scrollable content, we should not allow the swipe gesture to continue.
|
|
@@ -337,14 +384,6 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
337
384
|
* snapping animation completes.
|
|
338
385
|
*/
|
|
339
386
|
gesture.enable(false);
|
|
340
|
-
/**
|
|
341
|
-
* If expandToScroll is disabled, we need to swap
|
|
342
|
-
* the footer visibility to the cloned one so the footer
|
|
343
|
-
* doesn't flicker when the sheet's height is animated.
|
|
344
|
-
*/
|
|
345
|
-
if (!expandToScroll && shouldRemainOpen) {
|
|
346
|
-
swapFooterVisibility('cloned');
|
|
347
|
-
}
|
|
348
387
|
if (shouldPreventDismiss) {
|
|
349
388
|
handleCanDismiss(baseEl, animation);
|
|
350
389
|
}
|
|
@@ -361,6 +400,14 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
361
400
|
if (contentEl && (snapToBreakpoint === breakpoints[breakpoints.length - 1] || !expandToScroll)) {
|
|
362
401
|
contentEl.scrollY = true;
|
|
363
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* If expandToScroll is disabled, we need to swap
|
|
405
|
+
* the footer position to stationary so that it
|
|
406
|
+
* will act as it would by default
|
|
407
|
+
*/
|
|
408
|
+
if (!expandToScroll) {
|
|
409
|
+
swapFooterPosition('stationary');
|
|
410
|
+
}
|
|
364
411
|
return new Promise((resolve) => {
|
|
365
412
|
animation
|
|
366
413
|
.onFinish(() => {
|
|
@@ -328,7 +328,7 @@ export class PickerColumnCmp {
|
|
|
328
328
|
const colEl = this.optsEl;
|
|
329
329
|
if (colEl) {
|
|
330
330
|
// DOM READ
|
|
331
|
-
// We perfom a DOM read over a rendered item, this needs to happen after the first render or after the column has changed
|
|
331
|
+
// We perfom a DOM read over a rendered item, this needs to happen after the first render or after the the column has changed
|
|
332
332
|
this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
|
|
333
333
|
}
|
|
334
334
|
this.refresh(forceRefresh, animated);
|
|
@@ -336,9 +336,9 @@ export class PickerColumnCmp {
|
|
|
336
336
|
render() {
|
|
337
337
|
const col = this.col;
|
|
338
338
|
const mode = getIonMode(this);
|
|
339
|
-
return (h(Host, { key: '
|
|
339
|
+
return (h(Host, { key: '88a3c9397c9ac92dd814074c8ae6ecf8e3420a2c', class: Object.assign({ [mode]: true, 'picker-col': true, 'picker-opts-left': this.col.align === 'left', 'picker-opts-right': this.col.align === 'right' }, getClassMap(col.cssClass)), style: {
|
|
340
340
|
'max-width': this.col.columnWidth,
|
|
341
|
-
} }, col.prefix && (h("div", { key: '
|
|
341
|
+
} }, col.prefix && (h("div", { key: '4491a705d15337e6f45f3cf6fd21af5242474729', class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), h("div", { key: 'b0dd4b7a7a4c1edc4b73e7fb134ac85264072365', class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: (el) => (this.optsEl = el) }, col.options.map((o, index) => (h("button", { "aria-label": o.ariaLabel, class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index }, o.text)))), col.suffix && (h("div", { key: 'c16419ce6481d60fc3ba6b8d102a4edf0ede02aa', class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
|
|
342
342
|
}
|
|
343
343
|
static get is() { return "ion-picker-legacy-column"; }
|
|
344
344
|
static get originalStyleUrls() {
|
|
@@ -378,8 +378,8 @@ export class Searchbar {
|
|
|
378
378
|
const clearIcon = this.clearIcon || (mode === 'ios' ? closeCircle : closeSharp);
|
|
379
379
|
const searchIcon = this.searchIcon || (mode === 'ios' ? searchOutline : searchSharp);
|
|
380
380
|
const shouldShowCancelButton = this.shouldShowCancelButton();
|
|
381
|
-
const cancelButton = this.showCancelButton !== 'never' && (h("button", { key: '
|
|
382
|
-
return (h(Host, { key: '
|
|
381
|
+
const cancelButton = this.showCancelButton !== 'never' && (h("button", { key: '989f3e84c472ada6e66dd9b249d0d268bf17ce26', "aria-label": cancelButtonText, "aria-hidden": shouldShowCancelButton ? undefined : 'true', type: "button", tabIndex: mode === 'ios' && !shouldShowCancelButton ? -1 : undefined, onMouseDown: this.onCancelSearchbar, onTouchStart: this.onCancelSearchbar, class: "searchbar-cancel-button" }, h("div", { key: '7d335d4fde33822dc79d26b748ba2e98db7494bb', "aria-hidden": "true" }, mode === 'md' ? (h("ion-icon", { "aria-hidden": "true", mode: mode, icon: this.cancelButtonIcon, lazy: false })) : (cancelButtonText))));
|
|
382
|
+
return (h(Host, { key: 'd1a1972725e949fb102c91487aaa7b9d10c2d718', role: "search", "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses(this.color, {
|
|
383
383
|
[mode]: true,
|
|
384
384
|
'searchbar-animated': animated,
|
|
385
385
|
'searchbar-disabled': this.disabled,
|
|
@@ -389,14 +389,14 @@ export class Searchbar {
|
|
|
389
389
|
'searchbar-has-focus': this.focused,
|
|
390
390
|
'searchbar-should-show-clear': this.shouldShowClearButton(),
|
|
391
391
|
'searchbar-should-show-cancel': this.shouldShowCancelButton(),
|
|
392
|
-
}) }, h("div", { key: '
|
|
392
|
+
}) }, h("div", { key: 'add53640b2994cb6b2bf02792dafe51aba6b1684', class: "searchbar-input-container" }, h("input", Object.assign({ key: '160cc36459a4a652e7f41ccd14dcdc782278779e', "aria-label": "search text", disabled: this.disabled, ref: (el) => (this.nativeInput = el), class: "searchbar-input", inputMode: this.inputmode, enterKeyHint: this.enterkeyhint, name: this.name, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, minLength: this.minlength, maxLength: this.maxlength, placeholder: this.placeholder, type: this.type, value: this.getValue(), autoCapitalize: autocapitalize === 'default' ? undefined : autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, spellcheck: this.spellcheck }, this.inheritedAttributes)), mode === 'md' && cancelButton, h("ion-icon", { key: '8825fd13af0d2dea451ccc0e00ae7b5021dc01c4', "aria-hidden": "true", mode: mode, icon: searchIcon, lazy: false, class: "searchbar-search-icon" }), h("button", { key: '8a7b56da278b9ca5c4f5a4ee9c01924fd5ae29d8', "aria-label": "reset", type: "button", "no-blur": true, class: "searchbar-clear-button", onPointerDown: (ev) => {
|
|
393
393
|
/**
|
|
394
394
|
* This prevents mobile browsers from
|
|
395
395
|
* blurring the input when the clear
|
|
396
396
|
* button is activated.
|
|
397
397
|
*/
|
|
398
398
|
ev.preventDefault();
|
|
399
|
-
}, onClick: () => this.onClearInput(true) }, h("ion-icon", { key: '
|
|
399
|
+
}, onClick: () => this.onClearInput(true) }, h("ion-icon", { key: '24c55274516ab012d8c25f03525c6cdb9409e52f', "aria-hidden": "true", mode: mode, icon: clearIcon, lazy: false, class: "searchbar-clear-icon" }))), mode === 'ios' && cancelButton));
|
|
400
400
|
}
|
|
401
401
|
static get is() { return "ion-searchbar"; }
|
|
402
402
|
static get encapsulation() { return "scoped"; }
|
|
@@ -545,7 +545,7 @@ export class Searchbar {
|
|
|
545
545
|
"optional": false,
|
|
546
546
|
"docs": {
|
|
547
547
|
"tags": [],
|
|
548
|
-
"text": "Set the cancel button text. Only applies to `ios` mode."
|
|
548
|
+
"text": "Set the the cancel button text. Only applies to `ios` mode."
|
|
549
549
|
},
|
|
550
550
|
"attribute": "cancel-button-text",
|
|
551
551
|
"reflect": false,
|
package/dist/docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2025-05-
|
|
2
|
+
"timestamp": "2025-05-28T16:50:15",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.20.0",
|
|
@@ -25567,7 +25567,7 @@
|
|
|
25567
25567
|
"mutable": false,
|
|
25568
25568
|
"attr": "cancel-button-text",
|
|
25569
25569
|
"reflectToAttr": false,
|
|
25570
|
-
"docs": "Set the cancel button text. Only applies to `ios` mode.",
|
|
25570
|
+
"docs": "Set the the cancel button text. Only applies to `ios` mode.",
|
|
25571
25571
|
"docsTags": [],
|
|
25572
25572
|
"default": "'Cancel'",
|
|
25573
25573
|
"values": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import { j as getAssetPath, r as registerInstance, c as createEvent,
|
|
4
|
+
import { j as getAssetPath, r as registerInstance, c as createEvent, h, e as Host, f as getElement } from './index-527b9e34.js';
|
|
5
5
|
import { m as hasShadowDom, i as inheritAriaAttributes } from './helpers-d94bc8ad.js';
|
|
6
6
|
import { p as printIonWarning } from './index-cfd9c1f2.js';
|
|
7
7
|
import { o as openURL, c as createColorClasses$1, h as hostContext } from './theme-01f3f29c.js';
|
|
@@ -206,20 +206,6 @@ const Button = class {
|
|
|
206
206
|
this.formButtonEl.disabled = disabled;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
/**
|
|
210
|
-
* This component is used within the `ion-input-password-toggle` component
|
|
211
|
-
* to toggle the visibility of the password input.
|
|
212
|
-
* These attributes need to update based on the state of the password input.
|
|
213
|
-
* Otherwise, the values will be stale.
|
|
214
|
-
*
|
|
215
|
-
* @param newValue
|
|
216
|
-
* @param _oldValue
|
|
217
|
-
* @param propName
|
|
218
|
-
*/
|
|
219
|
-
onAriaChanged(newValue, _oldValue, propName) {
|
|
220
|
-
this.inheritedAttributes = Object.assign(Object.assign({}, this.inheritedAttributes), { [propName]: newValue });
|
|
221
|
-
forceUpdate(this);
|
|
222
|
-
}
|
|
223
209
|
/**
|
|
224
210
|
* This is responsible for rendering a hidden native
|
|
225
211
|
* button element inside the associated form. This allows
|
|
@@ -357,7 +343,7 @@ const Button = class {
|
|
|
357
343
|
{
|
|
358
344
|
type !== 'button' && this.renderHiddenButton();
|
|
359
345
|
}
|
|
360
|
-
return (h(Host, { key: '
|
|
346
|
+
return (h(Host, { key: 'e213b0bb76b3f90f883b1a0ea463bb86c2df69c3', onClick: this.handleClick, "aria-disabled": disabled ? 'true' : null, class: createColorClasses$1(color, {
|
|
361
347
|
[mode]: true,
|
|
362
348
|
[buttonType]: true,
|
|
363
349
|
[`${buttonType}-${expand}`]: expand !== undefined,
|
|
@@ -372,13 +358,11 @@ const Button = class {
|
|
|
372
358
|
'button-disabled': disabled,
|
|
373
359
|
'ion-activatable': true,
|
|
374
360
|
'ion-focusable': true,
|
|
375
|
-
}) }, h(TagType, Object.assign({ key: '
|
|
361
|
+
}) }, h(TagType, Object.assign({ key: 'b7c2a46fb994024841219316f4089335fa463d84' }, attrs, { class: "button-native", part: "native", disabled: disabled, onFocus: this.onFocus, onBlur: this.onBlur }, inheritedAttributes), h("span", { key: '3e07a5c9f86836f9fbaefc6c617bdde6eb6f70cd', class: "button-inner" }, h("slot", { key: '41c08ae09aed16faaa57707d229ff75d97f0731c', name: "icon-only", onSlotchange: this.slotChanged }), h("slot", { key: 'ab8b749e4572884cc04970a7594466b4a24c886e', name: "start" }), h("slot", { key: '397f7ff48ea45e82029414be95d29ae86e12c3a9' }), h("slot", { key: '9a5627713002e8be3738d392b616f6e951b70e12', name: "end" })), mode === 'md' && h("ion-ripple-effect", { key: '105566543ceda102474edab7ca8a44c7e71af589', type: this.rippleType }))));
|
|
376
362
|
}
|
|
377
363
|
get el() { return getElement(this); }
|
|
378
364
|
static get watchers() { return {
|
|
379
|
-
"disabled": ["disabledChanged"]
|
|
380
|
-
"aria-checked": ["onAriaChanged"],
|
|
381
|
-
"aria-label": ["onAriaChanged"]
|
|
365
|
+
"disabled": ["disabledChanged"]
|
|
382
366
|
}; }
|
|
383
367
|
};
|
|
384
368
|
Button.style = {
|
|
@@ -683,18 +683,19 @@ const Datetime = class {
|
|
|
683
683
|
warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
|
|
684
684
|
}
|
|
685
685
|
/**
|
|
686
|
-
* If there are multiple values, clamp to
|
|
687
|
-
*
|
|
688
|
-
*
|
|
686
|
+
* If there are multiple values, pick an arbitrary one to clamp to. This way,
|
|
687
|
+
* if the values are across months, we always show at least one of them. Note
|
|
688
|
+
* that the values don't necessarily have to be in order.
|
|
689
689
|
*/
|
|
690
|
-
const singleValue = Array.isArray(valueToProcess) ? valueToProcess[
|
|
690
|
+
const singleValue = Array.isArray(valueToProcess) ? valueToProcess[0] : valueToProcess;
|
|
691
691
|
const targetValue = clampDate(singleValue, minParts, maxParts);
|
|
692
692
|
const { month, day, year, hour, minute } = targetValue;
|
|
693
693
|
const ampm = parseAmPm(hour);
|
|
694
694
|
/**
|
|
695
|
-
* Since `activeParts` indicates a value that
|
|
696
|
-
*
|
|
697
|
-
*
|
|
695
|
+
* Since `activeParts` indicates a value that
|
|
696
|
+
* been explicitly selected either by the
|
|
697
|
+
* user or the app, only update `activeParts`
|
|
698
|
+
* if the `value` property is set.
|
|
698
699
|
*/
|
|
699
700
|
if (hasValue) {
|
|
700
701
|
if (Array.isArray(valueToProcess)) {
|
|
@@ -719,28 +720,51 @@ const Datetime = class {
|
|
|
719
720
|
*/
|
|
720
721
|
this.activeParts = [];
|
|
721
722
|
}
|
|
723
|
+
/**
|
|
724
|
+
* Only animate if:
|
|
725
|
+
* 1. We're using grid style (wheel style pickers should just jump to new value)
|
|
726
|
+
* 2. The month and/or year actually changed, and both are defined (otherwise there's nothing to animate to)
|
|
727
|
+
* 3. The calendar body is visible (prevents animation when in collapsed datetime-button, for example)
|
|
728
|
+
* 4. The month/year picker is not open (since you wouldn't see the animation anyway)
|
|
729
|
+
*/
|
|
722
730
|
const didChangeMonth = (month !== undefined && month !== workingParts.month) || (year !== undefined && year !== workingParts.year);
|
|
723
731
|
const bodyIsVisible = el.classList.contains('datetime-ready');
|
|
724
732
|
const { isGridStyle, showMonthAndYear } = this;
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
733
|
+
let areAllSelectedDatesInSameMonth = true;
|
|
734
|
+
if (Array.isArray(valueToProcess)) {
|
|
735
|
+
const firstMonth = valueToProcess[0].month;
|
|
736
|
+
for (const date of valueToProcess) {
|
|
737
|
+
if (date.month !== firstMonth) {
|
|
738
|
+
areAllSelectedDatesInSameMonth = false;
|
|
739
|
+
break;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
734
742
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
743
|
+
/**
|
|
744
|
+
* If there is more than one date selected
|
|
745
|
+
* and the dates aren't all in the same month,
|
|
746
|
+
* then we should neither animate to the date
|
|
747
|
+
* nor update the working parts because we do
|
|
748
|
+
* not know which date the user wants to view.
|
|
749
|
+
*/
|
|
750
|
+
if (areAllSelectedDatesInSameMonth) {
|
|
751
|
+
if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
|
|
752
|
+
this.animateToDate(targetValue);
|
|
753
|
+
}
|
|
754
|
+
else {
|
|
755
|
+
/**
|
|
756
|
+
* We only need to do this if we didn't just animate to a new month,
|
|
757
|
+
* since that calls prevMonth/nextMonth which calls setWorkingParts for us.
|
|
758
|
+
*/
|
|
759
|
+
this.setWorkingParts({
|
|
760
|
+
month,
|
|
761
|
+
day,
|
|
762
|
+
year,
|
|
763
|
+
hour,
|
|
764
|
+
minute,
|
|
765
|
+
ampm,
|
|
766
|
+
});
|
|
767
|
+
}
|
|
744
768
|
}
|
|
745
769
|
};
|
|
746
770
|
this.animateToDate = async (targetValue) => {
|
|
@@ -1735,7 +1759,7 @@ const Datetime = class {
|
|
|
1735
1759
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1736
1760
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1737
1761
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
1738
|
-
return (h(Host, { key: '
|
|
1762
|
+
return (h(Host, { key: 'c3dfea8f46fcbcef38eb9e8a69b1b46a4e4b82fd', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
|
|
1739
1763
|
[mode]: true,
|
|
1740
1764
|
['datetime-readonly']: readonly,
|
|
1741
1765
|
['datetime-disabled']: disabled,
|
|
@@ -1745,7 +1769,7 @@ const Datetime = class {
|
|
|
1745
1769
|
[`datetime-size-${size}`]: true,
|
|
1746
1770
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1747
1771
|
[`datetime-grid`]: isGridStyle,
|
|
1748
|
-
})) }, h("div", { key: '
|
|
1772
|
+
})) }, h("div", { key: '75c91243cf6a51f44b83d7cf7d8c0c96bfd3c83f', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1749
1773
|
}
|
|
1750
1774
|
get el() { return getElement(this); }
|
|
1751
1775
|
static get watchers() { return {
|
|
@@ -2355,7 +2379,7 @@ const PickerColumnCmp = class {
|
|
|
2355
2379
|
const colEl = this.optsEl;
|
|
2356
2380
|
if (colEl) {
|
|
2357
2381
|
// DOM READ
|
|
2358
|
-
// We perfom a DOM read over a rendered item, this needs to happen after the first render or after the column has changed
|
|
2382
|
+
// We perfom a DOM read over a rendered item, this needs to happen after the first render or after the the column has changed
|
|
2359
2383
|
this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
|
|
2360
2384
|
}
|
|
2361
2385
|
this.refresh(forceRefresh, animated);
|
|
@@ -2363,9 +2387,9 @@ const PickerColumnCmp = class {
|
|
|
2363
2387
|
render() {
|
|
2364
2388
|
const col = this.col;
|
|
2365
2389
|
const mode = getIonMode(this);
|
|
2366
|
-
return (h(Host, { key: '
|
|
2390
|
+
return (h(Host, { key: '88a3c9397c9ac92dd814074c8ae6ecf8e3420a2c', class: Object.assign({ [mode]: true, 'picker-col': true, 'picker-opts-left': this.col.align === 'left', 'picker-opts-right': this.col.align === 'right' }, getClassMap(col.cssClass)), style: {
|
|
2367
2391
|
'max-width': this.col.columnWidth,
|
|
2368
|
-
} }, col.prefix && (h("div", { key: '
|
|
2392
|
+
} }, col.prefix && (h("div", { key: '4491a705d15337e6f45f3cf6fd21af5242474729', class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), h("div", { key: 'b0dd4b7a7a4c1edc4b73e7fb134ac85264072365', class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: (el) => (this.optsEl = el) }, col.options.map((o, index) => (h("button", { "aria-label": o.ariaLabel, class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index }, o.text)))), col.suffix && (h("div", { key: 'c16419ce6481d60fc3ba6b8d102a4edf0ede02aa', class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
|
|
2369
2393
|
}
|
|
2370
2394
|
get el() { return getElement(this); }
|
|
2371
2395
|
static get watchers() { return {
|
|
@@ -67,14 +67,14 @@ const InputPasswordToggle = class {
|
|
|
67
67
|
const isPasswordVisible = type === 'text';
|
|
68
68
|
return (h(Host, { key: '1a28e078c83e74c72d8bb8189ece93ec2e3fa3d0', class: createColorClasses(color, {
|
|
69
69
|
[mode]: true,
|
|
70
|
-
}) }, h("ion-button", { key: '
|
|
70
|
+
}) }, h("ion-button", { key: '039d1bab764093bb6fe4a34299b0872abda087fd', mode: mode, color: color, fill: "clear", shape: "round", "aria-checked": isPasswordVisible ? 'true' : 'false', "aria-label": "show password", role: "switch", type: "button", onPointerDown: (ev) => {
|
|
71
71
|
/**
|
|
72
72
|
* This prevents mobile browsers from
|
|
73
73
|
* blurring the input when the password toggle
|
|
74
74
|
* button is activated.
|
|
75
75
|
*/
|
|
76
76
|
ev.preventDefault();
|
|
77
|
-
}, onClick: this.togglePasswordVisibility }, h("ion-icon", { key: '
|
|
77
|
+
}, onClick: this.togglePasswordVisibility }, h("ion-icon", { key: '26477ee97b808c3d79944bf5e33d4e05f1ae0b3f', slot: "icon-only", "aria-hidden": "true", icon: isPasswordVisible ? hidePasswordIcon : showPasswordIcon }))));
|
|
78
78
|
}
|
|
79
79
|
get el() { return getElement(this); }
|
|
80
80
|
static get watchers() { return {
|