@ionic/core 8.7.17-dev.11771359170.1fda0949 → 8.7.17-dev.11771870864.19b2cde1
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-datetime.js +5 -5
- package/components/ion-segment-view.js +11 -5
- package/components/ion-select.js +3 -3
- package/components/ion-textarea.js +4 -4
- package/components/modal.js +206 -43
- package/dist/cjs/ion-datetime_3.cjs.entry.js +5 -5
- package/dist/cjs/ion-modal.cjs.entry.js +206 -43
- package/dist/cjs/ion-segment-view.cjs.entry.js +10 -5
- package/dist/cjs/ion-select_3.cjs.entry.js +3 -3
- package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/datetime/datetime.js +5 -12
- package/dist/collection/components/modal/gestures/sheet.js +108 -11
- package/dist/collection/components/modal/gestures/swipe-to-close.js +54 -1
- package/dist/collection/components/modal/modal.js +98 -31
- package/dist/collection/components/segment-view/segment-view.ios.css +2 -1
- package/dist/collection/components/segment-view/segment-view.js +28 -3
- package/dist/collection/components/segment-view/segment-view.md.css +2 -1
- package/dist/collection/components/select/select.js +6 -3
- package/dist/collection/components/textarea/textarea.js +4 -4
- package/dist/docs.json +115 -51
- package/dist/esm/ion-datetime_3.entry.js +5 -5
- package/dist/esm/ion-modal.entry.js +206 -43
- package/dist/esm/ion-segment-view.entry.js +10 -5
- package/dist/esm/ion-select_3.entry.js +3 -3
- package/dist/esm/ion-textarea.entry.js +2 -2
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/html.html-data.json +4 -0
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-0f418a37.entry.js +4 -0
- package/dist/ionic/p-1838bed5.entry.js +4 -0
- package/dist/ionic/p-29721c43.entry.js +4 -0
- package/dist/ionic/p-9a2d390d.entry.js +4 -0
- package/dist/ionic/{p-c19f63d0.entry.js → p-e1d1f3cc.entry.js} +1 -1
- package/dist/types/components/datetime/datetime.d.ts +0 -7
- package/dist/types/components/modal/gestures/sheet.d.ts +2 -2
- package/dist/types/components/modal/gestures/swipe-to-close.d.ts +2 -2
- package/dist/types/components/modal/modal-interface.d.ts +7 -0
- package/dist/types/components/modal/modal.d.ts +17 -1
- package/dist/types/components/segment-view/segment-view.d.ts +4 -0
- package/dist/types/components/select/select.d.ts +3 -0
- package/dist/types/components.d.ts +27 -2
- package/hydrate/index.js +233 -68
- package/hydrate/index.mjs +233 -68
- package/package.json +1 -1
- package/dist/ionic/p-020af078.entry.js +0 -4
- package/dist/ionic/p-88367362.entry.js +0 -4
- package/dist/ionic/p-91840a80.entry.js +0 -4
- package/dist/ionic/p-9dcc3ae4.entry.js +0 -4
package/hydrate/index.mjs
CHANGED
|
@@ -12878,21 +12878,14 @@ const datetimeMdCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:colu
|
|
|
12878
12878
|
* layout with `presentation="date-time"` or `"time-date"`.
|
|
12879
12879
|
* @part time-button active - The time picker button when the picker is open.
|
|
12880
12880
|
*
|
|
12881
|
-
* @part calendar-header - The calendar header manages the date navigation controls (month/year picker and prev/next buttons) and the days of the week when using a grid style layout.
|
|
12882
12881
|
* @part month-year-button - The button that opens the month/year picker when
|
|
12883
12882
|
* using a grid style layout.
|
|
12884
|
-
* @part prev-next-buttons - The buttons used to navigate to the next or previous month when using a grid style layout.
|
|
12885
|
-
* @part prev-button - The button used to navigate to the previous month when using a grid style layout.
|
|
12886
|
-
* @part next-button - The button used to navigate to the next month when using a grid style layout.
|
|
12887
|
-
* @part days-of-week - The container for the day-of-the-week header (both weekdays and weekends) when using a grid style layout.
|
|
12888
12883
|
*
|
|
12889
12884
|
* @part calendar-day - The individual buttons that display a day inside of the datetime
|
|
12890
12885
|
* calendar.
|
|
12891
12886
|
* @part calendar-day active - The currently selected calendar day.
|
|
12892
12887
|
* @part calendar-day today - The calendar day that contains the current day.
|
|
12893
12888
|
* @part calendar-day disabled - The calendar day that is disabled.
|
|
12894
|
-
*
|
|
12895
|
-
* @part datetime-header - The datetime header contains the content for the `title` slot and the selected date.
|
|
12896
12889
|
*/
|
|
12897
12890
|
class Datetime {
|
|
12898
12891
|
constructor(hostRef) {
|
|
@@ -14234,11 +14227,11 @@ class Datetime {
|
|
|
14234
14227
|
const nextMonthDisabled = disabled || isNextMonthDisabled(this.workingParts, this.maxParts);
|
|
14235
14228
|
// don't use the inheritAttributes util because it removes dir from the host, and we still need that
|
|
14236
14229
|
const hostDir = this.el.getAttribute('dir') || undefined;
|
|
14237
|
-
return (hAsync("div", { class: "calendar-header"
|
|
14230
|
+
return (hAsync("div", { class: "calendar-header" }, hAsync("div", { class: "calendar-action-buttons" }, hAsync("div", { class: "calendar-month-year" }, hAsync("button", { class: {
|
|
14238
14231
|
'calendar-month-year-toggle': true,
|
|
14239
14232
|
'ion-activatable': true,
|
|
14240
14233
|
'ion-focusable': true,
|
|
14241
|
-
}, part: "month-year-button", disabled: disabled, "aria-label": this.showMonthAndYear ? 'Hide year picker' : 'Show year picker', onClick: () => this.toggleMonthAndYearView() }, hAsync("span", { id: "toggle-wrapper" }, getMonthAndYear(this.locale, this.workingParts), hAsync("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })), mode === 'md' && hAsync("ion-ripple-effect", null))), hAsync("div", { class: "calendar-next-prev" }, hAsync("ion-buttons", null, hAsync("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth()
|
|
14234
|
+
}, part: "month-year-button", disabled: disabled, "aria-label": this.showMonthAndYear ? 'Hide year picker' : 'Show year picker', onClick: () => this.toggleMonthAndYearView() }, hAsync("span", { id: "toggle-wrapper" }, getMonthAndYear(this.locale, this.workingParts), hAsync("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })), mode === 'md' && hAsync("ion-ripple-effect", null))), hAsync("div", { class: "calendar-next-prev" }, hAsync("ion-buttons", null, hAsync("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth() }, hAsync("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronBack, lazy: false, flipRtl: true })), hAsync("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth() }, hAsync("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronForward, lazy: false, flipRtl: true }))))), hAsync("div", { class: "calendar-days-of-week", "aria-hidden": "true" }, getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
|
|
14242
14235
|
return hAsync("div", { class: "day-of-week" }, d);
|
|
14243
14236
|
}))));
|
|
14244
14237
|
}
|
|
@@ -14470,7 +14463,7 @@ class Datetime {
|
|
|
14470
14463
|
if (!hasSlottedTitle && !this.showDefaultTitle) {
|
|
14471
14464
|
return;
|
|
14472
14465
|
}
|
|
14473
|
-
return (hAsync("div", { class: "datetime-header"
|
|
14466
|
+
return (hAsync("div", { class: "datetime-header" }, hAsync("div", { class: "datetime-title" }, hAsync("slot", { name: "title" }, "Select Date")), showExpandedHeader && hAsync("div", { class: "datetime-selected-date" }, this.getHeaderSelectedDateText())));
|
|
14474
14467
|
}
|
|
14475
14468
|
/**
|
|
14476
14469
|
* Render time picker inside of datetime.
|
|
@@ -14550,7 +14543,7 @@ class Datetime {
|
|
|
14550
14543
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
14551
14544
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
14552
14545
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
14553
|
-
return (hAsync(Host, { key: '
|
|
14546
|
+
return (hAsync(Host, { key: '19e20c9b6b5f9467e91a2567b6dc7d9d38b56cc3', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses$1(color, {
|
|
14554
14547
|
[mode]: true,
|
|
14555
14548
|
['datetime-readonly']: readonly,
|
|
14556
14549
|
['datetime-disabled']: disabled,
|
|
@@ -14560,7 +14553,7 @@ class Datetime {
|
|
|
14560
14553
|
[`datetime-size-${size}`]: true,
|
|
14561
14554
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
14562
14555
|
[`datetime-grid`]: isGridStyle,
|
|
14563
|
-
})) }, hAsync("div", { key: '
|
|
14556
|
+
})) }, hAsync("div", { key: 'e31b5ef76cd6262dafd39f2d21980887880ec32e', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
14564
14557
|
}
|
|
14565
14558
|
get el() { return getElement(this); }
|
|
14566
14559
|
static get watchers() { return {
|
|
@@ -21541,7 +21534,7 @@ const calculateSpringStep = (t) => {
|
|
|
21541
21534
|
const SwipeToCloseDefaults = {
|
|
21542
21535
|
MIN_PRESENTING_SCALE: 0.915,
|
|
21543
21536
|
};
|
|
21544
|
-
const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) => {
|
|
21537
|
+
const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss, onDragStart, onDragMove, onDragEnd) => {
|
|
21545
21538
|
/**
|
|
21546
21539
|
* The step value at which a card modal
|
|
21547
21540
|
* is eligible for dismissing via gesture.
|
|
@@ -21651,6 +21644,7 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
21651
21644
|
disableContentScrollY(contentEl);
|
|
21652
21645
|
}
|
|
21653
21646
|
animation.progressStart(true, isOpen ? 1 : 0);
|
|
21647
|
+
onDragStart();
|
|
21654
21648
|
};
|
|
21655
21649
|
const onMove = (detail) => {
|
|
21656
21650
|
const { deltaY } = detail;
|
|
@@ -21718,6 +21712,13 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
21718
21712
|
setCardStatusBarDark();
|
|
21719
21713
|
}
|
|
21720
21714
|
lastStep = clampedStep;
|
|
21715
|
+
const eventDetail = {
|
|
21716
|
+
currentY: detail.currentY,
|
|
21717
|
+
deltaY: detail.deltaY,
|
|
21718
|
+
velocityY: detail.velocityY,
|
|
21719
|
+
progress: calculateProgress(el, detail.deltaY),
|
|
21720
|
+
};
|
|
21721
|
+
onDragMove(eventDetail);
|
|
21721
21722
|
};
|
|
21722
21723
|
const onEnd = (detail) => {
|
|
21723
21724
|
const velocity = detail.velocityY;
|
|
@@ -21776,6 +21777,13 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
21776
21777
|
else if (shouldComplete) {
|
|
21777
21778
|
onDismiss();
|
|
21778
21779
|
}
|
|
21780
|
+
const eventDetail = {
|
|
21781
|
+
currentY: detail.currentY,
|
|
21782
|
+
deltaY: detail.deltaY,
|
|
21783
|
+
velocityY: detail.velocityY,
|
|
21784
|
+
progress: calculateProgress(el, detail.deltaY),
|
|
21785
|
+
};
|
|
21786
|
+
onDragEnd(eventDetail);
|
|
21779
21787
|
};
|
|
21780
21788
|
const gesture = createGesture({
|
|
21781
21789
|
el,
|
|
@@ -21793,6 +21801,44 @@ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) =>
|
|
|
21793
21801
|
const computeDuration = (remaining, velocity) => {
|
|
21794
21802
|
return clamp(400, remaining / Math.abs(velocity * 1.1), 500);
|
|
21795
21803
|
};
|
|
21804
|
+
/**
|
|
21805
|
+
* Calculates the progress of the swipe gesture.
|
|
21806
|
+
*
|
|
21807
|
+
* The progress is a value between 0 and 1 that represents how far
|
|
21808
|
+
* the swipe has progressed towards closing the modal.
|
|
21809
|
+
*
|
|
21810
|
+
* A value closer to 1 means the modal is closer to being opened,
|
|
21811
|
+
* while a value closer to 0 means the modal is closer to being closed.
|
|
21812
|
+
*
|
|
21813
|
+
* @param el The modal
|
|
21814
|
+
* @param deltaY The change in Y position (positive when dragging down, negative when dragging up)
|
|
21815
|
+
* @returns The progress of the swipe gesture
|
|
21816
|
+
*/
|
|
21817
|
+
const calculateProgress = (el, deltaY) => {
|
|
21818
|
+
const windowHeight = window.innerHeight;
|
|
21819
|
+
// Position when fully open
|
|
21820
|
+
const modalTop = el.getBoundingClientRect().top;
|
|
21821
|
+
/**
|
|
21822
|
+
* The distance between the top of the modal and the bottom of the screen
|
|
21823
|
+
* is the total distance the modal needs to travel to be fully closed.
|
|
21824
|
+
*/
|
|
21825
|
+
const totalDistance = windowHeight - modalTop;
|
|
21826
|
+
/**
|
|
21827
|
+
* The pull percentage is how far the user has swiped compared to the total
|
|
21828
|
+
* distance needed to close the modal.
|
|
21829
|
+
*/
|
|
21830
|
+
const pullPercentage = deltaY / totalDistance;
|
|
21831
|
+
/**
|
|
21832
|
+
* The progress is the inverse of the pull percentage because
|
|
21833
|
+
* when the user starts swiping up, the progress should be close to 1,
|
|
21834
|
+
* and when the user has swiped all the way down, the progress should be
|
|
21835
|
+
* close to 0.
|
|
21836
|
+
*/
|
|
21837
|
+
const progress = 1 - pullPercentage;
|
|
21838
|
+
// Round to the nearest thousandth to avoid returning very small decimal
|
|
21839
|
+
const roundedProgress = Math.round(progress * 1000) / 1000;
|
|
21840
|
+
return Math.max(0, Math.min(1, roundedProgress));
|
|
21841
|
+
};
|
|
21796
21842
|
|
|
21797
21843
|
const createSheetEnterAnimation = (opts) => {
|
|
21798
21844
|
const { currentBreakpoint, backdropBreakpoint, expandToScroll } = opts;
|
|
@@ -22241,7 +22287,7 @@ const mdLeaveAnimation$2 = (baseEl, opts) => {
|
|
|
22241
22287
|
return baseAnimation;
|
|
22242
22288
|
};
|
|
22243
22289
|
|
|
22244
|
-
const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
|
|
22290
|
+
const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange, onDragStart, onDragMove, onDragEnd) => {
|
|
22245
22291
|
// Defaults for the sheet swipe animation
|
|
22246
22292
|
const defaultBackdrop = [
|
|
22247
22293
|
{ offset: 0, opacity: 'var(--backdrop-opacity)' },
|
|
@@ -22504,6 +22550,7 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
22504
22550
|
baseEl.focus();
|
|
22505
22551
|
});
|
|
22506
22552
|
animation.progressStart(true, 1 - currentBreakpoint);
|
|
22553
|
+
onDragStart();
|
|
22507
22554
|
};
|
|
22508
22555
|
const onMove = (detail) => {
|
|
22509
22556
|
/**
|
|
@@ -22572,6 +22619,15 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
22572
22619
|
: step;
|
|
22573
22620
|
offset = clamp(0.0001, processedStep, maxStep);
|
|
22574
22621
|
animation.progressStep(offset);
|
|
22622
|
+
const closest = calculateClosestBreakpoint(detail.velocityY, detail.deltaY);
|
|
22623
|
+
const eventDetail = {
|
|
22624
|
+
currentY: detail.currentY,
|
|
22625
|
+
deltaY: detail.deltaY,
|
|
22626
|
+
velocityY: detail.velocityY,
|
|
22627
|
+
progress: calculateProgress(detail.currentY),
|
|
22628
|
+
currentBreakpoint: closest,
|
|
22629
|
+
};
|
|
22630
|
+
onDragMove(eventDetail);
|
|
22575
22631
|
};
|
|
22576
22632
|
const onEnd = (detail) => {
|
|
22577
22633
|
/**
|
|
@@ -22590,16 +22646,7 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
22590
22646
|
swapFooterPosition('stationary');
|
|
22591
22647
|
return;
|
|
22592
22648
|
}
|
|
22593
|
-
|
|
22594
|
-
* When the gesture releases, we need to determine
|
|
22595
|
-
* the closest breakpoint to snap to.
|
|
22596
|
-
*/
|
|
22597
|
-
const velocity = detail.velocityY;
|
|
22598
|
-
const threshold = (detail.deltaY + velocity * 350) / height;
|
|
22599
|
-
const diff = currentBreakpoint - threshold;
|
|
22600
|
-
const closest = breakpoints.reduce((a, b) => {
|
|
22601
|
-
return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;
|
|
22602
|
-
});
|
|
22649
|
+
const closest = calculateClosestBreakpoint(detail.velocityY, detail.deltaY);
|
|
22603
22650
|
moveSheetToBreakpoint({
|
|
22604
22651
|
breakpoint: closest,
|
|
22605
22652
|
breakpointOffset: offset,
|
|
@@ -22610,6 +22657,14 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
22610
22657
|
*/
|
|
22611
22658
|
animated: true,
|
|
22612
22659
|
});
|
|
22660
|
+
const eventDetail = {
|
|
22661
|
+
currentY: detail.currentY,
|
|
22662
|
+
deltaY: detail.deltaY,
|
|
22663
|
+
velocityY: detail.velocityY,
|
|
22664
|
+
progress: calculateProgress(detail.currentY),
|
|
22665
|
+
currentBreakpoint: closest,
|
|
22666
|
+
};
|
|
22667
|
+
onDragEnd(eventDetail);
|
|
22613
22668
|
};
|
|
22614
22669
|
const moveSheetToBreakpoint = (options) => {
|
|
22615
22670
|
const { breakpoint, canDismiss, breakpointOffset, animated } = options;
|
|
@@ -22749,6 +22804,94 @@ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, ba
|
|
|
22749
22804
|
.progressEnd(1, 0, animated ? 500 : 0);
|
|
22750
22805
|
});
|
|
22751
22806
|
};
|
|
22807
|
+
/**
|
|
22808
|
+
* Calculates the closest breakpoint based on the current velocity and deltaY.
|
|
22809
|
+
* This determines where the sheet should snap to when the user releases the
|
|
22810
|
+
* gesture.
|
|
22811
|
+
*
|
|
22812
|
+
* @param velocityY The current velocity of the gesture in the Y direction.
|
|
22813
|
+
* @param deltaY The change in Y position since the gesture started.
|
|
22814
|
+
* @returns The closest breakpoint value.
|
|
22815
|
+
*/
|
|
22816
|
+
const calculateClosestBreakpoint = (velocityY, deltaY) => {
|
|
22817
|
+
const threshold = (deltaY + velocityY * 350) / height;
|
|
22818
|
+
const diff = currentBreakpoint - threshold;
|
|
22819
|
+
const closest = breakpoints.reduce((a, b) => {
|
|
22820
|
+
return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;
|
|
22821
|
+
});
|
|
22822
|
+
return closest;
|
|
22823
|
+
};
|
|
22824
|
+
/**
|
|
22825
|
+
* Calculates the progress of the swipe gesture.
|
|
22826
|
+
*
|
|
22827
|
+
* The progress is a value between 0 and 1 that represents how far
|
|
22828
|
+
* the swipe has progressed towards closing the modal.
|
|
22829
|
+
*
|
|
22830
|
+
* A value closer to 1 means the modal is closer to being opened,
|
|
22831
|
+
* while a value closer to 0 means the modal is closer to being closed.
|
|
22832
|
+
*
|
|
22833
|
+
* @param currentY The current Y position of the gesture
|
|
22834
|
+
* @returns The progress of the sheet gesture
|
|
22835
|
+
*/
|
|
22836
|
+
const calculateProgress = (currentY) => {
|
|
22837
|
+
const minBreakpoint = breakpoints[0];
|
|
22838
|
+
const maxBreakpoint = breakpoints[breakpoints.length - 1];
|
|
22839
|
+
// Convert breakpoints to pixel Y coordinates
|
|
22840
|
+
/**
|
|
22841
|
+
* The lowest point the sheet can be dragged to aka the point at which
|
|
22842
|
+
* the sheet is fully closed.
|
|
22843
|
+
*/
|
|
22844
|
+
const maxY = convertBreakpointToY(minBreakpoint);
|
|
22845
|
+
/**
|
|
22846
|
+
* The highest point the sheet can be dragged to aka the point at which
|
|
22847
|
+
* the sheet is fully open.
|
|
22848
|
+
*/
|
|
22849
|
+
const minY = convertBreakpointToY(maxBreakpoint);
|
|
22850
|
+
// The total distance between the fully open and fully closed positions.
|
|
22851
|
+
const totalDistance = maxY - minY;
|
|
22852
|
+
// The distance from the current position to the fully closed position.
|
|
22853
|
+
const distanceFromBottom = maxY - currentY;
|
|
22854
|
+
/**
|
|
22855
|
+
* The progress represents how far the sheet is from the bottom relative
|
|
22856
|
+
* to the total distance. When the user starts swiping up, the progress
|
|
22857
|
+
* should be close to 1, and when the user has swiped all the way down,
|
|
22858
|
+
* the progress should be close to 0.
|
|
22859
|
+
*/
|
|
22860
|
+
const progress = distanceFromBottom / totalDistance;
|
|
22861
|
+
// Round to the nearest thousandth to avoid returning very small decimal
|
|
22862
|
+
const roundedProgress = Math.round(progress * 1000) / 1000;
|
|
22863
|
+
return Math.max(0, Math.min(1, roundedProgress));
|
|
22864
|
+
};
|
|
22865
|
+
/**
|
|
22866
|
+
* Converts a breakpoint value (0 to 1) into a pixel Y coordinate
|
|
22867
|
+
* on the screen.
|
|
22868
|
+
*
|
|
22869
|
+
* @param breakpoint The breakpoint value (e.g., 0.5 for half-open)
|
|
22870
|
+
* @returns The pixel Y coordinate on the screen
|
|
22871
|
+
*/
|
|
22872
|
+
const convertBreakpointToY = (breakpoint) => {
|
|
22873
|
+
const rect = baseEl.getBoundingClientRect();
|
|
22874
|
+
const modalHeight = rect.height;
|
|
22875
|
+
// The bottom of the screen.
|
|
22876
|
+
const viewportBottom = window.innerHeight;
|
|
22877
|
+
/**
|
|
22878
|
+
* The active height is how much of the modal is actually showing
|
|
22879
|
+
* on the screen for this specific breakpoint.
|
|
22880
|
+
*/
|
|
22881
|
+
const activeHeight = modalHeight * breakpoint;
|
|
22882
|
+
/**
|
|
22883
|
+
* To find the Y coordinate, start at the bottom of the screen
|
|
22884
|
+
* and move up by the active height of the modal.
|
|
22885
|
+
*
|
|
22886
|
+
* A breakpoint of 1.0 means the active height is the full modal height
|
|
22887
|
+
* (fully open). A breakpoint of 0.0 means the active height is 0
|
|
22888
|
+
* (fully closed).
|
|
22889
|
+
*
|
|
22890
|
+
* Since screen Y coordinates get smaller as you go up, we subtract the
|
|
22891
|
+
* active height from the viewport bottom.
|
|
22892
|
+
*/
|
|
22893
|
+
return viewportBottom - activeHeight;
|
|
22894
|
+
};
|
|
22752
22895
|
const gesture = createGesture({
|
|
22753
22896
|
el: wrapperEl,
|
|
22754
22897
|
gestureName: 'modalSheet',
|
|
@@ -22793,6 +22936,9 @@ class Modal {
|
|
|
22793
22936
|
this.willDismissShorthand = createEvent(this, "willDismiss", 7);
|
|
22794
22937
|
this.didDismissShorthand = createEvent(this, "didDismiss", 7);
|
|
22795
22938
|
this.ionMount = createEvent(this, "ionMount", 7);
|
|
22939
|
+
this.ionDragStart = createEvent(this, "ionDragStart", 7);
|
|
22940
|
+
this.ionDragMove = createEvent(this, "ionDragMove", 7);
|
|
22941
|
+
this.ionDragEnd = createEvent(this, "ionDragEnd", 7);
|
|
22796
22942
|
this.lockController = createLockController();
|
|
22797
22943
|
this.triggerController = createTriggerController();
|
|
22798
22944
|
this.coreDelegate = CoreDelegate();
|
|
@@ -23260,32 +23406,7 @@ class Modal {
|
|
|
23260
23406
|
return;
|
|
23261
23407
|
}
|
|
23262
23408
|
const statusBarStyle = (_a = this.statusBarStyle) !== null && _a !== void 0 ? _a : Style.Default;
|
|
23263
|
-
this.gesture = createSwipeToCloseGesture(el, ani, statusBarStyle, () =>
|
|
23264
|
-
/**
|
|
23265
|
-
* While the gesture animation is finishing
|
|
23266
|
-
* it is possible for a user to tap the backdrop.
|
|
23267
|
-
* This would result in the dismiss animation
|
|
23268
|
-
* being played again. Typically this is avoided
|
|
23269
|
-
* by setting `presented = false` on the overlay
|
|
23270
|
-
* component; however, we cannot do that here as
|
|
23271
|
-
* that would prevent the element from being
|
|
23272
|
-
* removed from the DOM.
|
|
23273
|
-
*/
|
|
23274
|
-
this.gestureAnimationDismissing = true;
|
|
23275
|
-
/**
|
|
23276
|
-
* Reset the status bar style as the dismiss animation
|
|
23277
|
-
* starts otherwise the status bar will be the wrong
|
|
23278
|
-
* color for the duration of the dismiss animation.
|
|
23279
|
-
* The dismiss method does this as well, but
|
|
23280
|
-
* in this case it's only called once the animation
|
|
23281
|
-
* has finished.
|
|
23282
|
-
*/
|
|
23283
|
-
setCardStatusBarDefault(this.statusBarStyle);
|
|
23284
|
-
this.animation.onFinish(async () => {
|
|
23285
|
-
await this.dismiss(undefined, GESTURE);
|
|
23286
|
-
this.gestureAnimationDismissing = false;
|
|
23287
|
-
});
|
|
23288
|
-
});
|
|
23409
|
+
this.gesture = createSwipeToCloseGesture(el, ani, statusBarStyle, () => this.cardOnDismiss(), () => this.onDragStart(), (detail) => this.onDragMove(detail), (detail) => this.onDragEnd(detail));
|
|
23289
23410
|
this.gesture.enable(true);
|
|
23290
23411
|
}
|
|
23291
23412
|
initSheetGesture() {
|
|
@@ -23306,7 +23427,7 @@ class Modal {
|
|
|
23306
23427
|
this.currentBreakpoint = breakpoint;
|
|
23307
23428
|
this.ionBreakpointDidChange.emit({ breakpoint });
|
|
23308
23429
|
}
|
|
23309
|
-
});
|
|
23430
|
+
}, () => this.onDragStart(), (detail) => this.onDragMove(detail), (detail) => this.onDragEnd(detail));
|
|
23310
23431
|
this.gesture = gesture;
|
|
23311
23432
|
this.moveSheetToBreakpoint = moveSheetToBreakpoint;
|
|
23312
23433
|
this.gesture.enable(true);
|
|
@@ -23403,6 +23524,32 @@ class Modal {
|
|
|
23403
23524
|
this.gestureAnimationDismissing = false;
|
|
23404
23525
|
});
|
|
23405
23526
|
}
|
|
23527
|
+
cardOnDismiss() {
|
|
23528
|
+
/**
|
|
23529
|
+
* While the gesture animation is finishing
|
|
23530
|
+
* it is possible for a user to tap the backdrop.
|
|
23531
|
+
* This would result in the dismiss animation
|
|
23532
|
+
* being played again. Typically this is avoided
|
|
23533
|
+
* by setting `presented = false` on the overlay
|
|
23534
|
+
* component; however, we cannot do that here as
|
|
23535
|
+
* that would prevent the element from being
|
|
23536
|
+
* removed from the DOM.
|
|
23537
|
+
*/
|
|
23538
|
+
this.gestureAnimationDismissing = true;
|
|
23539
|
+
/**
|
|
23540
|
+
* Reset the status bar style as the dismiss animation
|
|
23541
|
+
* starts otherwise the status bar will be the wrong
|
|
23542
|
+
* color for the duration of the dismiss animation.
|
|
23543
|
+
* The dismiss method does this as well, but
|
|
23544
|
+
* in this case it's only called once the animation
|
|
23545
|
+
* has finished.
|
|
23546
|
+
*/
|
|
23547
|
+
setCardStatusBarDefault(this.statusBarStyle);
|
|
23548
|
+
this.animation.onFinish(async () => {
|
|
23549
|
+
await this.dismiss(undefined, GESTURE);
|
|
23550
|
+
this.gestureAnimationDismissing = false;
|
|
23551
|
+
});
|
|
23552
|
+
}
|
|
23406
23553
|
/**
|
|
23407
23554
|
* Dismiss the modal overlay after it has been presented.
|
|
23408
23555
|
* This is a no-op if the overlay has not been presented yet. If you want
|
|
@@ -23718,6 +23865,15 @@ class Modal {
|
|
|
23718
23865
|
(_a = this.parentRemovalObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
23719
23866
|
this.parentRemovalObserver = undefined;
|
|
23720
23867
|
}
|
|
23868
|
+
onDragStart() {
|
|
23869
|
+
this.ionDragStart.emit();
|
|
23870
|
+
}
|
|
23871
|
+
onDragMove(detail) {
|
|
23872
|
+
this.ionDragMove.emit(detail);
|
|
23873
|
+
}
|
|
23874
|
+
onDragEnd(detail) {
|
|
23875
|
+
this.ionDragEnd.emit(detail);
|
|
23876
|
+
}
|
|
23721
23877
|
render() {
|
|
23722
23878
|
const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior, inheritedAttributes, focusTrap, expandToScroll, } = this;
|
|
23723
23879
|
const showHandle = handle !== false && isSheetModal;
|
|
@@ -23725,20 +23881,20 @@ class Modal {
|
|
|
23725
23881
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
23726
23882
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
23727
23883
|
const isSheetModalWithHandle = isSheetModal && showHandle;
|
|
23728
|
-
return (hAsync(Host, Object.assign({ key: '
|
|
23884
|
+
return (hAsync(Host, Object.assign({ key: 'bca3cbdb2ce8e5127d27eae7494c434aaeddaf88', "no-router": true,
|
|
23729
23885
|
// Allow the modal to be navigable when the handle is focusable
|
|
23730
23886
|
tabIndex: isHandleCycle && isSheetModalWithHandle ? 0 : -1 }, htmlAttributes, { style: {
|
|
23731
23887
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
23732
|
-
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), hAsync("ion-backdrop", { key: '
|
|
23888
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle, onFocus: this.onModalFocus }), hAsync("ion-backdrop", { key: 'b1c4112123d84d8a9b9d455bcc17d884f99d9f28', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && hAsync("div", { key: '080c8e6d37b311a1b5ad2655d99f18668abae211', class: "modal-shadow" }), hAsync("div", Object.assign({ key: '8ba05e9520b1b5529bf0caeb766da5bf612d4d14',
|
|
23733
23889
|
/*
|
|
23734
23890
|
role and aria-modal must be used on the
|
|
23735
23891
|
same element. They must also be set inside the
|
|
23736
23892
|
shadow DOM otherwise ion-button will not be highlighted
|
|
23737
23893
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
23738
23894
|
*/
|
|
23739
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '
|
|
23895
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (hAsync("button", { key: '2d2d5d731f55755f32ebcbf557f97486dc6202a6', class: "modal-handle",
|
|
23740
23896
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
23741
|
-
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), hAsync("slot", { key: '
|
|
23897
|
+
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle", ref: (el) => (this.dragHandleEl = el) })), hAsync("slot", { key: 'c717d19865dafba02e15db79bc0662c5d89e96fd', onSlotchange: this.onSlotChange }))));
|
|
23742
23898
|
}
|
|
23743
23899
|
get el() { return getElement(this); }
|
|
23744
23900
|
static get watchers() { return {
|
|
@@ -33489,9 +33645,9 @@ class SegmentContent {
|
|
|
33489
33645
|
}; }
|
|
33490
33646
|
}
|
|
33491
33647
|
|
|
33492
|
-
const segmentViewIosCss = ":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}";
|
|
33648
|
+
const segmentViewIosCss = ":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled),:host(.segment-view-swipe-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}";
|
|
33493
33649
|
|
|
33494
|
-
const segmentViewMdCss = ":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}";
|
|
33650
|
+
const segmentViewMdCss = ":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled),:host(.segment-view-swipe-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}";
|
|
33495
33651
|
|
|
33496
33652
|
class SegmentView {
|
|
33497
33653
|
constructor(hostRef) {
|
|
@@ -33503,6 +33659,10 @@ class SegmentView {
|
|
|
33503
33659
|
* If `true`, the segment view cannot be interacted with.
|
|
33504
33660
|
*/
|
|
33505
33661
|
this.disabled = false;
|
|
33662
|
+
/**
|
|
33663
|
+
* If `true`, users will be able to swipe the segment view to navigate between segment contents.
|
|
33664
|
+
*/
|
|
33665
|
+
this.swipeGesture = true;
|
|
33506
33666
|
}
|
|
33507
33667
|
handleScroll(ev) {
|
|
33508
33668
|
var _a;
|
|
@@ -33590,11 +33750,12 @@ class SegmentView {
|
|
|
33590
33750
|
return Array.from(this.el.querySelectorAll('ion-segment-content'));
|
|
33591
33751
|
}
|
|
33592
33752
|
render() {
|
|
33593
|
-
const { disabled, isManualScroll } = this;
|
|
33594
|
-
return (hAsync(Host, { key: '
|
|
33753
|
+
const { disabled, isManualScroll, swipeGesture } = this;
|
|
33754
|
+
return (hAsync(Host, { key: '565cccce7f0cfc4c71508777cc60292d6f24334f', class: {
|
|
33595
33755
|
'segment-view-disabled': disabled,
|
|
33596
33756
|
'segment-view-scroll-disabled': isManualScroll === false,
|
|
33597
|
-
|
|
33757
|
+
'segment-view-swipe-disabled': swipeGesture === false,
|
|
33758
|
+
} }, hAsync("slot", { key: '4118c240364467302b8f593e33c37837ea5d06f0' })));
|
|
33598
33759
|
}
|
|
33599
33760
|
get el() { return getElement(this); }
|
|
33600
33761
|
static get style() { return {
|
|
@@ -33606,6 +33767,7 @@ class SegmentView {
|
|
|
33606
33767
|
"$tagName$": "ion-segment-view",
|
|
33607
33768
|
"$members$": {
|
|
33608
33769
|
"disabled": [4],
|
|
33770
|
+
"swipeGesture": [4, "swipe-gesture"],
|
|
33609
33771
|
"isManualScroll": [32],
|
|
33610
33772
|
"setContent": [64]
|
|
33611
33773
|
},
|
|
@@ -33635,6 +33797,9 @@ const selectMdCss = ":host{--padding-top:0px;--padding-end:0px;--padding-bottom:
|
|
|
33635
33797
|
* @part supporting-text - Supporting text displayed beneath the select.
|
|
33636
33798
|
* @part helper-text - Supporting text displayed beneath the select when the select is valid.
|
|
33637
33799
|
* @part error-text - Supporting text displayed beneath the select when the select is invalid and touched.
|
|
33800
|
+
* @part bottom - The container element for helper text, error text, and counter.
|
|
33801
|
+
* @part wrapper - The clickable label element that wraps the entire form field (label text, slots, selected values or placeholder, and toggle icons).
|
|
33802
|
+
* @part inner - The inner element of the wrapper that manages the slots, selected values or placeholder, and toggle icons.
|
|
33638
33803
|
*/
|
|
33639
33804
|
class Select {
|
|
33640
33805
|
constructor(hostRef) {
|
|
@@ -34331,7 +34496,7 @@ class Select {
|
|
|
34331
34496
|
if (!hasHintText) {
|
|
34332
34497
|
return;
|
|
34333
34498
|
}
|
|
34334
|
-
return hAsync("div", { class: "select-bottom" }, this.renderHintText());
|
|
34499
|
+
return (hAsync("div", { class: "select-bottom", part: "bottom" }, this.renderHintText()));
|
|
34335
34500
|
}
|
|
34336
34501
|
render() {
|
|
34337
34502
|
const { disabled, el, isExpanded, expandedIcon, labelPlacement, justify, placeholder, fill, shape, name, value, hasFocus, } = this;
|
|
@@ -34362,7 +34527,7 @@ class Select {
|
|
|
34362
34527
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
34363
34528
|
*/
|
|
34364
34529
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
34365
|
-
return (hAsync(Host, { key: '
|
|
34530
|
+
return (hAsync(Host, { key: 'ada627c442ebcdd4a4ee96e5f5f3ec0e2181d689', onClick: this.onClick, class: createColorClasses$1(this.color, {
|
|
34366
34531
|
[mode]: true,
|
|
34367
34532
|
'in-item': inItem,
|
|
34368
34533
|
'in-item-color': hostContext('ion-item.ion-color', el),
|
|
@@ -34380,7 +34545,7 @@ class Select {
|
|
|
34380
34545
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
34381
34546
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
34382
34547
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
34383
|
-
}) }, hAsync("label", { key: '
|
|
34548
|
+
}) }, hAsync("label", { key: 'd1c4663e740cfdcd28f90a5e0297d05cf42cc4df', class: "select-wrapper", id: "select-label", onClick: this.onLabelClick, part: "wrapper" }, this.renderLabelContainer(), hAsync("div", { key: 'cd671e0b543378e7b822ce649a7b4006094b111f', class: "select-wrapper-inner", part: "inner" }, hAsync("slot", { key: '48e7df0c517a382195736273019b855e422a82ed', name: "start" }), hAsync("div", { key: '822747ffb9101cb1d3ff947da55bc2e8e1f2c8e2', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), hAsync("slot", { key: '349200d9f9ebf25e0b8708ac8683a76e7c6ed33c', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && hAsync("div", { key: '7eefb70d431cb9c01cc408d35349f7a3d0f2af35', class: "select-highlight" })), this.renderBottomContent()));
|
|
34384
34549
|
}
|
|
34385
34550
|
get el() { return getElement(this); }
|
|
34386
34551
|
static get watchers() { return {
|
|
@@ -35874,7 +36039,7 @@ class Textarea {
|
|
|
35874
36039
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
35875
36040
|
*/
|
|
35876
36041
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
35877
|
-
return (hAsync(Host, { key: '
|
|
36042
|
+
return (hAsync(Host, { key: '543076e7ed730451b490a9008cabe8f4a5d1f347', class: createColorClasses$1(this.color, {
|
|
35878
36043
|
[mode]: true,
|
|
35879
36044
|
'has-value': hasValue,
|
|
35880
36045
|
'has-focus': hasFocus,
|
|
@@ -35883,7 +36048,7 @@ class Textarea {
|
|
|
35883
36048
|
[`textarea-shape-${shape}`]: shape !== undefined,
|
|
35884
36049
|
[`textarea-label-placement-${labelPlacement}`]: true,
|
|
35885
36050
|
'textarea-disabled': disabled,
|
|
35886
|
-
}) }, hAsync("label", { key: '
|
|
36051
|
+
}) }, hAsync("label", { key: '3aebaa02edde10e19b2bbe2fbcc10f70b4faccff', class: "textarea-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), hAsync("div", { key: '73c1c7fee0ffffe65296060dd4110003d3975c44', class: "textarea-wrapper-inner" }, hAsync("div", { key: '5a245b822afae0b9858ef0d176a2fe06983954e2', class: "start-slot-wrapper" }, hAsync("slot", { key: '684305a1b558f93af6eb99825981ced1c09c7a8c', name: "start" })), hAsync("div", { key: 'f2f723b674cff48cf76656450ff6c1362514ea90', class: "native-wrapper", ref: (el) => (this.textareaWrapper = el) }, hAsync("textarea", Object.assign({ key: 'ae826e876a4b476502498b9c64ea020010c55db3', class: "native-textarea", ref: (el) => (this.nativeInput = el), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown, "aria-describedby": this.getHintTextID(), "aria-invalid": this.isInvalid ? 'true' : undefined }, this.inheritedAttributes), value)), hAsync("div", { key: '018cbf061fb53aa1d1caf6173fd08348cbe3413a', class: "end-slot-wrapper" }, hAsync("slot", { key: 'c383636f2d8a548e48848d0967f71ee1969b1411', name: "end" }))), shouldRenderHighlight && hAsync("div", { key: '6522d2058f9842abad9e7223b542cb7e1af40477', class: "textarea-highlight" })), this.renderBottomContent()));
|
|
35887
36052
|
}
|
|
35888
36053
|
get el() { return getElement(this); }
|
|
35889
36054
|
static get watchers() { return {
|
|
@@ -35904,7 +36069,7 @@ class Textarea {
|
|
|
35904
36069
|
"autofocus": [4],
|
|
35905
36070
|
"clearOnEdit": [4, "clear-on-edit"],
|
|
35906
36071
|
"debounce": [2],
|
|
35907
|
-
"disabled": [
|
|
36072
|
+
"disabled": [516],
|
|
35908
36073
|
"fill": [1],
|
|
35909
36074
|
"inputmode": [1],
|
|
35910
36075
|
"enterkeyhint": [1],
|
|
@@ -35912,7 +36077,7 @@ class Textarea {
|
|
|
35912
36077
|
"minlength": [2],
|
|
35913
36078
|
"name": [1],
|
|
35914
36079
|
"placeholder": [1],
|
|
35915
|
-
"readonly": [
|
|
36080
|
+
"readonly": [516],
|
|
35916
36081
|
"required": [4],
|
|
35917
36082
|
"spellcheck": [4],
|
|
35918
36083
|
"cols": [514],
|
|
@@ -35934,7 +36099,7 @@ class Textarea {
|
|
|
35934
36099
|
},
|
|
35935
36100
|
"$listeners$": [[2, "click", "onClickCapture"]],
|
|
35936
36101
|
"$lazyBundleId$": "-",
|
|
35937
|
-
"$attrsToReflect$": [["color", "color"], ["cols", "cols"], ["autoGrow", "auto-grow"]]
|
|
36102
|
+
"$attrsToReflect$": [["color", "color"], ["disabled", "disabled"], ["readonly", "readonly"], ["cols", "cols"], ["autoGrow", "auto-grow"]]
|
|
35938
36103
|
}; }
|
|
35939
36104
|
}
|
|
35940
36105
|
let textareaIds = 0;
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{r as s,c as t,h as e,d as o,g as l}from"./p-C8IsBmNU.js";import{i}from"./p-C53feagD.js";const n=class{constructor(e){s(this,e),this.ionSegmentViewScroll=t(this,"ionSegmentViewScroll",7),this.scrollEndTimeout=null,this.isTouching=!1,this.disabled=!1}handleScroll(s){var t;const{scrollLeft:e,scrollWidth:o,clientWidth:l}=s.target,n=o-l,a=(i(this.el)?-1:1)*(e/n);this.ionSegmentViewScroll.emit({scrollRatio:a,isManualScroll:null===(t=this.isManualScroll)||void 0===t||t}),this.resetScrollEndTimeout()}handleScrollStart(){this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.isTouching=!0}handleTouchEnd(){this.isTouching=!1}resetScrollEndTimeout(){this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.scrollEndTimeout=setTimeout((()=>{this.checkForScrollEnd()}),100)}checkForScrollEnd(){this.isTouching||(this.isManualScroll=void 0)}async setContent(s,t=!0){const e=this.getSegmentContents().findIndex((t=>t.id===s));if(-1===e)return;this.isManualScroll=!1,this.resetScrollEndTimeout();const o=e*this.el.offsetWidth;this.el.scrollTo({top:0,left:(i(this.el)?-1:1)*o,behavior:t?"smooth":"instant"})}getSegmentContents(){return Array.from(this.el.querySelectorAll("ion-segment-content"))}render(){const{disabled:s,isManualScroll:t}=this;return e(o,{key:"e180b67bb3143a5f4611fb358c037be6fc782a8f",class:{"segment-view-disabled":s,"segment-view-scroll-disabled":!1===t}},e("slot",{key:"41c11d6a7406a10f5c64a2e73abfc072afd8fc73"}))}get el(){return l(this)}};n.style={ios:":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}",md:":host{display:-ms-flexbox;display:flex;height:100%;overflow-x:scroll;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none}:host::-webkit-scrollbar{display:none}:host(.segment-view-disabled){-ms-touch-action:none;touch-action:none;overflow-x:hidden}:host(.segment-view-scroll-disabled){pointer-events:none}:host(.segment-view-disabled){opacity:0.3}"};export{n as ion_segment_view}
|