@ionic/core 8.7.17-dev.11769628168.11eca7cd → 8.7.17-dev.11770147425.1bfcd5e5
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 +10 -9
- package/components/ion-range.js +97 -39
- package/dist/cjs/ion-datetime_3.cjs.entry.js +10 -9
- package/dist/cjs/ion-range.cjs.entry.js +95 -39
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/datetime/datetime.js +11 -9
- package/dist/collection/components/range/range.js +116 -42
- package/dist/docs.json +142 -6
- package/dist/esm/ion-datetime_3.entry.js +10 -9
- package/dist/esm/ion-range.entry.js +95 -39
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-29721c43.entry.js +4 -0
- package/dist/ionic/p-b0c2f1f1.entry.js +4 -0
- package/dist/types/components/datetime/datetime.d.ts +1 -0
- package/dist/types/components/range/range-interface.d.ts +1 -0
- package/dist/types/components/range/range.d.ts +24 -4
- package/hydrate/index.js +127 -51
- package/hydrate/index.mjs +127 -51
- package/package.json +1 -1
- package/dist/ionic/p-012212e4.entry.js +0 -4
- package/dist/ionic/p-c19af093.entry.js +0 -4
package/hydrate/index.mjs
CHANGED
|
@@ -12869,6 +12869,7 @@ const datetimeMdCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:colu
|
|
|
12869
12869
|
* @slot buttons - The buttons in the datetime.
|
|
12870
12870
|
* @slot time-label - The label for the time selector in the datetime.
|
|
12871
12871
|
*
|
|
12872
|
+
* @part wheel - The wheel container when using a wheel style layout, or in the month/year picker when using a grid style layout.
|
|
12872
12873
|
* @part wheel-item - The individual items when using a wheel style layout, or in the
|
|
12873
12874
|
* month/year picker when using a grid style layout.
|
|
12874
12875
|
* @part wheel-item active - The currently selected wheel-item.
|
|
@@ -14044,7 +14045,7 @@ class Datetime {
|
|
|
14044
14045
|
const todayString = workingParts.day !== null
|
|
14045
14046
|
? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
|
|
14046
14047
|
: `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
|
|
14047
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
|
|
14048
|
+
return (hAsync("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
|
|
14048
14049
|
const { value } = ev.detail;
|
|
14049
14050
|
const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
|
|
14050
14051
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
|
|
@@ -14119,7 +14120,7 @@ class Datetime {
|
|
|
14119
14120
|
const { disabled, workingParts } = this;
|
|
14120
14121
|
const activePart = this.getActivePartsWithFallback();
|
|
14121
14122
|
const pickerColumnValue = (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined;
|
|
14122
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
|
|
14123
|
+
return (hAsync("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
|
|
14123
14124
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
|
|
14124
14125
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
|
|
14125
14126
|
ev.stopPropagation();
|
|
@@ -14131,7 +14132,7 @@ class Datetime {
|
|
|
14131
14132
|
}
|
|
14132
14133
|
const { disabled, workingParts } = this;
|
|
14133
14134
|
const activePart = this.getActivePartsWithFallback();
|
|
14134
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
|
|
14135
|
+
return (hAsync("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
|
|
14135
14136
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
|
|
14136
14137
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
|
|
14137
14138
|
ev.stopPropagation();
|
|
@@ -14143,7 +14144,7 @@ class Datetime {
|
|
|
14143
14144
|
}
|
|
14144
14145
|
const { disabled, workingParts } = this;
|
|
14145
14146
|
const activePart = this.getActivePartsWithFallback();
|
|
14146
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
|
|
14147
|
+
return (hAsync("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
|
|
14147
14148
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
|
|
14148
14149
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
|
|
14149
14150
|
ev.stopPropagation();
|
|
@@ -14176,7 +14177,7 @@ class Datetime {
|
|
|
14176
14177
|
if (hoursData.length === 0)
|
|
14177
14178
|
return [];
|
|
14178
14179
|
const activePart = this.getActivePartsWithFallback();
|
|
14179
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
|
|
14180
|
+
return (hAsync("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
|
|
14180
14181
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
|
|
14181
14182
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { hour: ev.detail.value }));
|
|
14182
14183
|
ev.stopPropagation();
|
|
@@ -14187,7 +14188,7 @@ class Datetime {
|
|
|
14187
14188
|
if (minutesData.length === 0)
|
|
14188
14189
|
return [];
|
|
14189
14190
|
const activePart = this.getActivePartsWithFallback();
|
|
14190
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
|
|
14191
|
+
return (hAsync("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
|
|
14191
14192
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
|
|
14192
14193
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { minute: ev.detail.value }));
|
|
14193
14194
|
ev.stopPropagation();
|
|
@@ -14200,7 +14201,7 @@ class Datetime {
|
|
|
14200
14201
|
}
|
|
14201
14202
|
const activePart = this.getActivePartsWithFallback();
|
|
14202
14203
|
const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
|
|
14203
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
|
|
14204
|
+
return (hAsync("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
|
|
14204
14205
|
const hour = calculateHourFromAMPM(workingParts, ev.detail.value);
|
|
14205
14206
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
|
|
14206
14207
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { ampm: ev.detail.value, hour }));
|
|
@@ -14542,7 +14543,7 @@ class Datetime {
|
|
|
14542
14543
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
14543
14544
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
14544
14545
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
14545
|
-
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, {
|
|
14546
14547
|
[mode]: true,
|
|
14547
14548
|
['datetime-readonly']: readonly,
|
|
14548
14549
|
['datetime-disabled']: disabled,
|
|
@@ -14552,7 +14553,7 @@ class Datetime {
|
|
|
14552
14553
|
[`datetime-size-${size}`]: true,
|
|
14553
14554
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
14554
14555
|
[`datetime-grid`]: isGridStyle,
|
|
14555
|
-
})) }, hAsync("div", { key: '
|
|
14556
|
+
})) }, hAsync("div", { key: 'e31b5ef76cd6262dafd39f2d21980887880ec32e', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
14556
14557
|
}
|
|
14557
14558
|
get el() { return getElement(this); }
|
|
14558
14559
|
static get watchers() { return {
|
|
@@ -14624,6 +14625,7 @@ class Datetime {
|
|
|
14624
14625
|
let datetimeIds = 0;
|
|
14625
14626
|
const CANCEL_ROLE = 'datetime-cancel';
|
|
14626
14627
|
const CONFIRM_ROLE = 'datetime-confirm';
|
|
14628
|
+
const WHEEL_PART = 'wheel';
|
|
14627
14629
|
const WHEEL_ITEM_PART = 'wheel-item';
|
|
14628
14630
|
const WHEEL_ITEM_ACTIVE_PART = `active`;
|
|
14629
14631
|
|
|
@@ -28713,13 +28715,29 @@ const rangeMdCss = ":host{--knob-handle-size:calc(var(--knob-size) * 2);display:
|
|
|
28713
28715
|
* @slot start - Content is placed to the left of the range slider in LTR, and to the right in RTL.
|
|
28714
28716
|
* @slot end - Content is placed to the right of the range slider in LTR, and to the left in RTL.
|
|
28715
28717
|
*
|
|
28718
|
+
* @part label - The label text describing the range.
|
|
28716
28719
|
* @part tick - An inactive tick mark.
|
|
28717
28720
|
* @part tick-active - An active tick mark.
|
|
28718
|
-
* @part pin - The counter that appears above a knob.
|
|
28719
|
-
* @part knob - The handle that is used to drag the range.
|
|
28720
28721
|
* @part bar - The inactive part of the bar.
|
|
28721
28722
|
* @part bar-active - The active part of the bar.
|
|
28722
|
-
* @part
|
|
28723
|
+
* @part knob-handle - The container element that wraps the knob and handles drag interactions.
|
|
28724
|
+
* @part knob-handle-a - The container element for the first knob. Only available when `dualKnobs` is `true`.
|
|
28725
|
+
* @part knob-handle-b - The container element for the second knob. Only available when `dualKnobs` is `true`.
|
|
28726
|
+
* @part knob-handle-lower - The container element for the lower knob. Only available when `dualKnobs` is `true`.
|
|
28727
|
+
* @part knob-handle-upper - The container element for the upper knob. Only available when `dualKnobs` is `true`.
|
|
28728
|
+
* @part pin - The counter that appears above a knob.
|
|
28729
|
+
* @part pin-a - The counter that appears above the first knob. Only available when `dualKnobs` is `true`.
|
|
28730
|
+
* @part pin-b - The counter that appears above the second knob. Only available when `dualKnobs` is `true`.
|
|
28731
|
+
* @part pin-lower - The counter that appears above the lower knob. Only available when `dualKnobs` is `true`.
|
|
28732
|
+
* @part pin-upper - The counter that appears above the upper knob. Only available when `dualKnobs` is `true`.
|
|
28733
|
+
* @part knob - The visual knob element that appears on the range track.
|
|
28734
|
+
* @part knob-a - The visual knob element for the first knob. Only available when `dualKnobs` is `true`.
|
|
28735
|
+
* @part knob-b - The visual knob element for the second knob. Only available when `dualKnobs` is `true`.
|
|
28736
|
+
* @part knob-lower - The visual knob element for the lower knob. Only available when `dualKnobs` is `true`.
|
|
28737
|
+
* @part knob-upper - The visual knob element for the upper knob. Only available when `dualKnobs` is `true`.
|
|
28738
|
+
* @part pressed - Added to the knob-handle, knob, and pin that is currently being pressed to drag. Only one set has this part at a time when `dualKnobs` is `true`.
|
|
28739
|
+
* @part focused - Added to the knob-handle, knob, and pin that currently has focus. Only one set has this part at a time when `dualKnobs` is `true`.
|
|
28740
|
+
* @part hover - Added to the knob-handle, knob, and pin when the knob has hover. Only one set has this part at a time.
|
|
28723
28741
|
*/
|
|
28724
28742
|
class Range {
|
|
28725
28743
|
constructor(hostRef) {
|
|
@@ -28737,6 +28755,7 @@ class Range {
|
|
|
28737
28755
|
this.inheritedAttributes = {};
|
|
28738
28756
|
this.contentEl = null;
|
|
28739
28757
|
this.initialContentScrollY = true;
|
|
28758
|
+
this.focusFromPointer = false;
|
|
28740
28759
|
this.ratioA = 0;
|
|
28741
28760
|
this.ratioB = 0;
|
|
28742
28761
|
/**
|
|
@@ -28868,6 +28887,7 @@ class Range {
|
|
|
28868
28887
|
this.onBlur = () => {
|
|
28869
28888
|
if (this.hasFocus) {
|
|
28870
28889
|
this.hasFocus = false;
|
|
28890
|
+
this.focusedKnob = undefined;
|
|
28871
28891
|
this.ionBlur.emit();
|
|
28872
28892
|
}
|
|
28873
28893
|
};
|
|
@@ -28878,21 +28898,20 @@ class Range {
|
|
|
28878
28898
|
}
|
|
28879
28899
|
};
|
|
28880
28900
|
this.onKnobFocus = (knob) => {
|
|
28901
|
+
// Clicking focuses the range which is needed for the keyboard,
|
|
28902
|
+
// but we only want to add the ion-focused class when focused via Tab.
|
|
28903
|
+
if (!this.focusFromPointer) {
|
|
28904
|
+
this.focusedKnob = knob;
|
|
28905
|
+
}
|
|
28906
|
+
else {
|
|
28907
|
+
this.focusFromPointer = false;
|
|
28908
|
+
this.focusedKnob = undefined;
|
|
28909
|
+
}
|
|
28910
|
+
// If the knob was not already focused, emit the focus event
|
|
28881
28911
|
if (!this.hasFocus) {
|
|
28882
28912
|
this.hasFocus = true;
|
|
28883
28913
|
this.ionFocus.emit();
|
|
28884
28914
|
}
|
|
28885
|
-
// Manually manage ion-focused class for dual knobs
|
|
28886
|
-
if (this.dualKnobs && this.el.shadowRoot) {
|
|
28887
|
-
const knobA = this.el.shadowRoot.querySelector('.range-knob-a');
|
|
28888
|
-
const knobB = this.el.shadowRoot.querySelector('.range-knob-b');
|
|
28889
|
-
// Remove ion-focused from both knobs first
|
|
28890
|
-
knobA === null || knobA === void 0 ? void 0 : knobA.classList.remove('ion-focused');
|
|
28891
|
-
knobB === null || knobB === void 0 ? void 0 : knobB.classList.remove('ion-focused');
|
|
28892
|
-
// Add ion-focused only to the focused knob
|
|
28893
|
-
const focusedKnobEl = knob === 'A' ? knobA : knobB;
|
|
28894
|
-
focusedKnobEl === null || focusedKnobEl === void 0 ? void 0 : focusedKnobEl.classList.add('ion-focused');
|
|
28895
|
-
}
|
|
28896
28915
|
};
|
|
28897
28916
|
this.onKnobBlur = () => {
|
|
28898
28917
|
// Check if focus is moving to another knob within the same range
|
|
@@ -28904,18 +28923,18 @@ class Range {
|
|
|
28904
28923
|
if (!isStillFocusedOnKnob) {
|
|
28905
28924
|
if (this.hasFocus) {
|
|
28906
28925
|
this.hasFocus = false;
|
|
28926
|
+
this.focusedKnob = undefined;
|
|
28907
28927
|
this.ionBlur.emit();
|
|
28908
28928
|
}
|
|
28909
|
-
// Remove ion-focused from both knobs when focus leaves the range
|
|
28910
|
-
if (this.dualKnobs && this.el.shadowRoot) {
|
|
28911
|
-
const knobA = this.el.shadowRoot.querySelector('.range-knob-a');
|
|
28912
|
-
const knobB = this.el.shadowRoot.querySelector('.range-knob-b');
|
|
28913
|
-
knobA === null || knobA === void 0 ? void 0 : knobA.classList.remove('ion-focused');
|
|
28914
|
-
knobB === null || knobB === void 0 ? void 0 : knobB.classList.remove('ion-focused');
|
|
28915
|
-
}
|
|
28916
28929
|
}
|
|
28917
28930
|
}, 0);
|
|
28918
28931
|
};
|
|
28932
|
+
this.onKnobMouseEnter = (knob) => {
|
|
28933
|
+
this.hoveredKnob = knob;
|
|
28934
|
+
};
|
|
28935
|
+
this.onKnobMouseLeave = () => {
|
|
28936
|
+
this.hoveredKnob = undefined;
|
|
28937
|
+
};
|
|
28919
28938
|
}
|
|
28920
28939
|
debounceChanged() {
|
|
28921
28940
|
const { ionInput, debounce, originalIonInput } = this;
|
|
@@ -29169,7 +29188,6 @@ class Range {
|
|
|
29169
29188
|
ratio = 1 - ratio;
|
|
29170
29189
|
}
|
|
29171
29190
|
this.pressedKnob = !this.dualKnobs || Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio) ? 'A' : 'B';
|
|
29172
|
-
this.setFocus(this.pressedKnob);
|
|
29173
29191
|
}
|
|
29174
29192
|
get valA() {
|
|
29175
29193
|
return ratioToValue(this.ratioA, this.min, this.max, this.step);
|
|
@@ -29196,9 +29214,23 @@ class Range {
|
|
|
29196
29214
|
updateRatio() {
|
|
29197
29215
|
const value = this.getValue();
|
|
29198
29216
|
const { min, max } = this;
|
|
29217
|
+
/**
|
|
29218
|
+
* For dual knobs, value gives lower/upper but not which is A vs B.
|
|
29219
|
+
* Assign (lowerRatio, upperRatio) to (ratioA, ratioB) in the way that
|
|
29220
|
+
* minimizes change from the current ratios so the knobs don't swap.
|
|
29221
|
+
*/
|
|
29199
29222
|
if (this.dualKnobs) {
|
|
29200
|
-
|
|
29201
|
-
|
|
29223
|
+
const lowerRatio = valueToRatio(value.lower, min, max);
|
|
29224
|
+
const upperRatio = valueToRatio(value.upper, min, max);
|
|
29225
|
+
if (Math.abs(this.ratioA - lowerRatio) + Math.abs(this.ratioB - upperRatio) <=
|
|
29226
|
+
Math.abs(this.ratioA - upperRatio) + Math.abs(this.ratioB - lowerRatio)) {
|
|
29227
|
+
this.ratioA = lowerRatio;
|
|
29228
|
+
this.ratioB = upperRatio;
|
|
29229
|
+
}
|
|
29230
|
+
else {
|
|
29231
|
+
this.ratioA = upperRatio;
|
|
29232
|
+
this.ratioB = lowerRatio;
|
|
29233
|
+
}
|
|
29202
29234
|
}
|
|
29203
29235
|
else {
|
|
29204
29236
|
this.ratioA = valueToRatio(value, min, max);
|
|
@@ -29215,14 +29247,6 @@ class Range {
|
|
|
29215
29247
|
};
|
|
29216
29248
|
this.noUpdate = false;
|
|
29217
29249
|
}
|
|
29218
|
-
setFocus(knob) {
|
|
29219
|
-
if (this.el.shadowRoot) {
|
|
29220
|
-
const knobEl = this.el.shadowRoot.querySelector(knob === 'A' ? '.range-knob-a' : '.range-knob-b');
|
|
29221
|
-
if (knobEl) {
|
|
29222
|
-
knobEl.focus();
|
|
29223
|
-
}
|
|
29224
|
-
}
|
|
29225
|
-
}
|
|
29226
29250
|
/**
|
|
29227
29251
|
* Returns true if content was passed to the "start" slot
|
|
29228
29252
|
*/
|
|
@@ -29240,7 +29264,7 @@ class Range {
|
|
|
29240
29264
|
}
|
|
29241
29265
|
renderRangeSlider() {
|
|
29242
29266
|
var _a;
|
|
29243
|
-
const { min, max, step, handleKeyboard, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
|
|
29267
|
+
const { min, max, step, handleKeyboard, focusedKnob, hoveredKnob, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
|
|
29244
29268
|
let barStart = `${ratioLower * 100}%`;
|
|
29245
29269
|
let barEnd = `${100 - ratioUpper * 100}%`;
|
|
29246
29270
|
const rtl = isRTL$1(this.el);
|
|
@@ -29300,7 +29324,9 @@ class Range {
|
|
|
29300
29324
|
ticks.push(tick);
|
|
29301
29325
|
}
|
|
29302
29326
|
}
|
|
29303
|
-
return (hAsync("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl),
|
|
29327
|
+
return (hAsync("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl), onPointerDown: () => {
|
|
29328
|
+
this.focusFromPointer = true;
|
|
29329
|
+
},
|
|
29304
29330
|
/**
|
|
29305
29331
|
* Since the gesture has a threshold, the value
|
|
29306
29332
|
* won't change until the user has dragged past
|
|
@@ -29313,6 +29339,7 @@ class Range {
|
|
|
29313
29339
|
* we need to listen for the "pointerUp" event.
|
|
29314
29340
|
*/
|
|
29315
29341
|
onPointerUp: (ev) => {
|
|
29342
|
+
this.focusFromPointer = false;
|
|
29316
29343
|
/**
|
|
29317
29344
|
* If the user drags the knob on the web
|
|
29318
29345
|
* version (does not occur on mobile),
|
|
@@ -29338,6 +29365,10 @@ class Range {
|
|
|
29338
29365
|
'has-ticks': ticks.length > 0,
|
|
29339
29366
|
}, role: "presentation", style: barStyle, part: "bar-active" })), renderKnob(rtl, {
|
|
29340
29367
|
knob: 'A',
|
|
29368
|
+
position: this.dualKnobs ? (this.ratioA <= this.ratioB ? 'lower' : 'upper') : 'lower',
|
|
29369
|
+
dualKnobs: this.dualKnobs,
|
|
29370
|
+
focused: focusedKnob === 'A',
|
|
29371
|
+
hovered: hoveredKnob === 'A',
|
|
29341
29372
|
pressed: pressedKnob === 'A',
|
|
29342
29373
|
value: this.valA,
|
|
29343
29374
|
ratio: this.ratioA,
|
|
@@ -29350,9 +29381,15 @@ class Range {
|
|
|
29350
29381
|
inheritedAttributes,
|
|
29351
29382
|
onKnobFocus: this.onKnobFocus,
|
|
29352
29383
|
onKnobBlur: this.onKnobBlur,
|
|
29384
|
+
onKnobMouseEnter: this.onKnobMouseEnter,
|
|
29385
|
+
onKnobMouseLeave: this.onKnobMouseLeave,
|
|
29353
29386
|
}), this.dualKnobs &&
|
|
29354
29387
|
renderKnob(rtl, {
|
|
29355
29388
|
knob: 'B',
|
|
29389
|
+
position: this.ratioB <= this.ratioA ? 'lower' : 'upper',
|
|
29390
|
+
dualKnobs: this.dualKnobs,
|
|
29391
|
+
focused: focusedKnob === 'B',
|
|
29392
|
+
hovered: hoveredKnob === 'B',
|
|
29356
29393
|
pressed: pressedKnob === 'B',
|
|
29357
29394
|
value: this.valB,
|
|
29358
29395
|
ratio: this.ratioB,
|
|
@@ -29365,6 +29402,8 @@ class Range {
|
|
|
29365
29402
|
inheritedAttributes,
|
|
29366
29403
|
onKnobFocus: this.onKnobFocus,
|
|
29367
29404
|
onKnobBlur: this.onKnobBlur,
|
|
29405
|
+
onKnobMouseEnter: this.onKnobMouseEnter,
|
|
29406
|
+
onKnobMouseLeave: this.onKnobMouseLeave,
|
|
29368
29407
|
})));
|
|
29369
29408
|
}
|
|
29370
29409
|
render() {
|
|
@@ -29390,10 +29429,11 @@ class Range {
|
|
|
29390
29429
|
const valueAtMin = dualKnobs ? this.valA === min || this.valB === min : this.valA === min;
|
|
29391
29430
|
const valueAtMax = dualKnobs ? this.valA === max || this.valB === max : this.valA === max;
|
|
29392
29431
|
renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);
|
|
29393
|
-
return (hAsync(Host, { key: '
|
|
29432
|
+
return (hAsync(Host, { key: '4a393e229cf599f3377b606acaebe5f090d41f6e', onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: createColorClasses$1(this.color, {
|
|
29394
29433
|
[mode]: true,
|
|
29395
29434
|
'in-item': inItem,
|
|
29396
29435
|
'range-disabled': disabled,
|
|
29436
|
+
'range-dual-knobs': dualKnobs,
|
|
29397
29437
|
'range-pressed': pressedKnob !== undefined,
|
|
29398
29438
|
'range-has-pin': pin,
|
|
29399
29439
|
[`range-label-placement-${labelPlacement}`]: true,
|
|
@@ -29401,10 +29441,10 @@ class Range {
|
|
|
29401
29441
|
'range-item-end-adjustment': needsEndAdjustment,
|
|
29402
29442
|
'range-value-min': valueAtMin,
|
|
29403
29443
|
'range-value-max': valueAtMax,
|
|
29404
|
-
}) }, hAsync("label", { key: '
|
|
29444
|
+
}) }, hAsync("label", { key: 'd7f45882aa7f11bbac1cb783caa0053151efcc70', class: "range-wrapper", id: "range-label" }, hAsync("div", { key: '537d3b1e7f9fed0c8380678551e31325b1ef1f85', class: {
|
|
29405
29445
|
'label-text-wrapper': true,
|
|
29406
29446
|
'label-text-wrapper-hidden': !hasLabel,
|
|
29407
|
-
}, part: "label" }, label !== undefined ? hAsync("div", { class: "label-text" }, label) : hAsync("slot", { name: "label" })), hAsync("div", { key: '
|
|
29447
|
+
}, part: "label" }, label !== undefined ? hAsync("div", { class: "label-text" }, label) : hAsync("slot", { name: "label" })), hAsync("div", { key: 'cb50f07a3704d04af3554211ffad35f7d9fcc450', class: "native-wrapper" }, hAsync("slot", { key: '09004eaa72688ca0f0536bd5f5d7160a23d16406', name: "start" }), this.renderRangeSlider(), hAsync("slot", { key: 'a94da21d2ea7ed2feafcc0651c72da21d6de1e57', name: "end" })))));
|
|
29408
29448
|
}
|
|
29409
29449
|
get el() { return getElement(this); }
|
|
29410
29450
|
static get watchers() { return {
|
|
@@ -29442,6 +29482,8 @@ class Range {
|
|
|
29442
29482
|
"labelPlacement": [1, "label-placement"],
|
|
29443
29483
|
"ratioA": [32],
|
|
29444
29484
|
"ratioB": [32],
|
|
29485
|
+
"focusedKnob": [32],
|
|
29486
|
+
"hoveredKnob": [32],
|
|
29445
29487
|
"pressedKnob": [32]
|
|
29446
29488
|
},
|
|
29447
29489
|
"$listeners$": undefined,
|
|
@@ -29449,7 +29491,7 @@ class Range {
|
|
|
29449
29491
|
"$attrsToReflect$": [["color", "color"]]
|
|
29450
29492
|
}; }
|
|
29451
29493
|
}
|
|
29452
|
-
const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, }) => {
|
|
29494
|
+
const renderKnob = (rtl, { knob, position, dualKnobs, value, ratio, min, max, disabled, pressed, focused, hovered, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, onKnobMouseEnter, onKnobMouseLeave, }) => {
|
|
29453
29495
|
const start = rtl ? 'right' : 'left';
|
|
29454
29496
|
const knobStyle = () => {
|
|
29455
29497
|
const style = {};
|
|
@@ -29470,16 +29512,50 @@ const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin,
|
|
|
29470
29512
|
ev.preventDefault();
|
|
29471
29513
|
ev.stopPropagation();
|
|
29472
29514
|
}
|
|
29473
|
-
}, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur, class: {
|
|
29515
|
+
}, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur, onMouseEnter: () => onKnobMouseEnter(knob), onMouseLeave: onKnobMouseLeave, class: {
|
|
29474
29516
|
'range-knob-handle': true,
|
|
29475
|
-
'range-knob-a': knob === 'A',
|
|
29476
|
-
'range-knob-b': knob === 'B',
|
|
29517
|
+
'range-knob-handle-a': knob === 'A',
|
|
29518
|
+
'range-knob-handle-b': knob === 'B',
|
|
29477
29519
|
'range-knob-pressed': pressed,
|
|
29478
29520
|
'range-knob-min': value === min,
|
|
29479
29521
|
'range-knob-max': value === max,
|
|
29480
29522
|
'ion-activatable': true,
|
|
29481
29523
|
'ion-focusable': true,
|
|
29482
|
-
|
|
29524
|
+
'ion-focused': focused,
|
|
29525
|
+
}, part: [
|
|
29526
|
+
'knob-handle',
|
|
29527
|
+
dualKnobs && knob === 'A' && 'knob-handle-a',
|
|
29528
|
+
dualKnobs && knob === 'B' && 'knob-handle-b',
|
|
29529
|
+
dualKnobs && position === 'lower' && 'knob-handle-lower',
|
|
29530
|
+
dualKnobs && position === 'upper' && 'knob-handle-upper',
|
|
29531
|
+
pressed && 'pressed',
|
|
29532
|
+
focused && 'focused',
|
|
29533
|
+
hovered && 'hover',
|
|
29534
|
+
]
|
|
29535
|
+
.filter(Boolean)
|
|
29536
|
+
.join(' '), style: knobStyle(), role: "slider", tabindex: disabled ? -1 : 0, "aria-label": ariaLabel !== undefined ? ariaLabel : null, "aria-labelledby": ariaLabel === undefined ? 'range-label' : null, "aria-valuemin": min, "aria-valuemax": max, "aria-disabled": disabled ? 'true' : null, "aria-valuenow": value }, pin && (hAsync("div", { class: "range-pin", role: "presentation", part: [
|
|
29537
|
+
'pin',
|
|
29538
|
+
dualKnobs && knob === 'A' && 'pin-a',
|
|
29539
|
+
dualKnobs && knob === 'B' && 'pin-b',
|
|
29540
|
+
dualKnobs && position === 'lower' && 'pin-lower',
|
|
29541
|
+
dualKnobs && position === 'upper' && 'pin-upper',
|
|
29542
|
+
pressed && 'pressed',
|
|
29543
|
+
focused && 'focused',
|
|
29544
|
+
hovered && 'hover',
|
|
29545
|
+
]
|
|
29546
|
+
.filter(Boolean)
|
|
29547
|
+
.join(' ') }, pinFormatter(value))), hAsync("div", { class: "range-knob", role: "presentation", part: [
|
|
29548
|
+
'knob',
|
|
29549
|
+
dualKnobs && knob === 'A' && 'knob-a',
|
|
29550
|
+
dualKnobs && knob === 'B' && 'knob-b',
|
|
29551
|
+
dualKnobs && position === 'lower' && 'knob-lower',
|
|
29552
|
+
dualKnobs && position === 'upper' && 'knob-upper',
|
|
29553
|
+
pressed && 'pressed',
|
|
29554
|
+
focused && 'focused',
|
|
29555
|
+
hovered && 'hover',
|
|
29556
|
+
]
|
|
29557
|
+
.filter(Boolean)
|
|
29558
|
+
.join(' ') })));
|
|
29483
29559
|
};
|
|
29484
29560
|
const ratioToValue = (ratio, min, max, step) => {
|
|
29485
29561
|
let value = (max - min) * ratio;
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import{r as e,c as t,f as a,h as n,d as r,g as i}from"./p-C8IsBmNU.js";import{f as o,d as s,r as l}from"./p-CwgG81ZD.js";import{j as h,e as d,d as b,i as g,a as c}from"./p-CTfR9YZG.js";import{i as p}from"./p-C53feagD.js";import{h as m,c as u}from"./p-DiVJyqlX.js";import{b as k}from"./p-BFvmZNyx.js";const x=class{constructor(a){e(this,a),this.ionChange=t(this,"ionChange",7),this.ionInput=t(this,"ionInput",7),this.ionFocus=t(this,"ionFocus",7),this.ionBlur=t(this,"ionBlur",7),this.ionKnobMoveStart=t(this,"ionKnobMoveStart",7),this.ionKnobMoveEnd=t(this,"ionKnobMoveEnd",7),this.rangeId="ion-r-"+y++,this.didLoad=!1,this.noUpdate=!1,this.hasFocus=!1,this.inheritedAttributes={},this.contentEl=null,this.initialContentScrollY=!0,this.ratioA=0,this.ratioB=0,this.name=this.rangeId,this.dualKnobs=!1,this.min=0,this.max=100,this.pin=!1,this.pinFormatter=e=>Math.round(e),this.snaps=!1,this.step=1,this.ticks=!0,this.disabled=!1,this.value=0,this.compareValues=(e,t)=>"object"==typeof e&&"object"==typeof t?e.lower!==t.lower||e.upper!==t.upper:e!==t,this.clampBounds=e=>d(this.min,e,this.max),this.ensureValueInBounds=e=>this.dualKnobs?{lower:this.clampBounds(e.lower),upper:this.clampBounds(e.upper)}:this.clampBounds(e),this.labelPlacement="start",this.setupGesture=async()=>{const e=this.rangeSlider;e&&(this.gesture=(await import("./p-Cl0B-RWe.js")).createGesture({el:e,gestureName:"range",gesturePriority:100,threshold:10,onStart:()=>this.onStart(),onMove:e=>this.onMove(e),onEnd:e=>this.onEnd(e)}),this.gesture.enable(!this.disabled))},this.handleKeyboard=(e,t)=>{const{ensureValueInBounds:a}=this;let n=this.step;n=n>0?n:1,n/=this.max-this.min,t||(n*=-1),"A"===e?this.ratioA=d(0,this.ratioA+n,1):this.ratioB=d(0,this.ratioB+n,1),this.ionKnobMoveStart.emit({value:a(this.value)}),this.updateValue(),this.emitValueChange(),this.ionKnobMoveEnd.emit({value:a(this.value)})},this.onBlur=()=>{this.hasFocus&&(this.hasFocus=!1,this.ionBlur.emit())},this.onFocus=()=>{this.hasFocus||(this.hasFocus=!0,this.ionFocus.emit())},this.onKnobFocus=e=>{if(this.hasFocus||(this.hasFocus=!0,this.ionFocus.emit()),this.dualKnobs&&this.el.shadowRoot){const t=this.el.shadowRoot.querySelector(".range-knob-a"),a=this.el.shadowRoot.querySelector(".range-knob-b");null==t||t.classList.remove("ion-focused"),null==a||a.classList.remove("ion-focused");const n="A"===e?t:a;null==n||n.classList.add("ion-focused")}},this.onKnobBlur=()=>{setTimeout((()=>{var e;const t=null===(e=this.el.shadowRoot)||void 0===e?void 0:e.activeElement;if((!t||!t.classList.contains("range-knob-handle"))&&(this.hasFocus&&(this.hasFocus=!1,this.ionBlur.emit()),this.dualKnobs&&this.el.shadowRoot)){const e=this.el.shadowRoot.querySelector(".range-knob-a"),t=this.el.shadowRoot.querySelector(".range-knob-b");null==e||e.classList.remove("ion-focused"),null==t||t.classList.remove("ion-focused")}}),0)}}debounceChanged(){const{ionInput:e,debounce:t,originalIonInput:a}=this;this.ionInput=void 0===t?null!=a?a:e:b(e,t)}minChanged(e){h(e)||(this.min=0),this.noUpdate||this.updateRatio()}maxChanged(e){h(e)||(this.max=100),this.noUpdate||this.updateRatio()}stepChanged(e){h(e)||(this.step=1)}activeBarStartChanged(){const{activeBarStart:e}=this;void 0!==e&&(e>this.max?(a(`[ion-range] - The value of activeBarStart (${e}) is greater than the max (${this.max}). Valid values are greater than or equal to the min value and less than or equal to the max value.`,this.el),this.activeBarStart=this.max):e<this.min&&(a(`[ion-range] - The value of activeBarStart (${e}) is less than the min (${this.min}). Valid values are greater than or equal to the min value and less than or equal to the max value.`,this.el),this.activeBarStart=this.min))}disabledChanged(){this.gesture&&this.gesture.enable(!this.disabled)}valueChanged(e,t){this.compareValues(e,t)&&this.ionInput.emit({value:this.value}),this.noUpdate||this.updateRatio()}componentWillLoad(){this.el.hasAttribute("id")&&(this.rangeId=this.el.getAttribute("id")),this.inheritedAttributes=g(this.el),this.min=h(this.min)?this.min:0,this.max=h(this.max)?this.max:100,this.step=h(this.step)?this.step:1}componentDidLoad(){this.originalIonInput=this.ionInput,this.setupGesture(),this.updateRatio(),this.didLoad=!0}connectedCallback(){var e;this.updateRatio(),this.debounceChanged(),this.disabledChanged(),this.activeBarStartChanged(),this.didLoad&&this.setupGesture();const t=o(this.el);this.contentEl=null!==(e=null==t?void 0:t.querySelector(".ion-content-scroll-host"))&&void 0!==e?e:t}disconnectedCallback(){this.gesture&&(this.gesture.destroy(),this.gesture=void 0)}getValue(){var e;const t=null!==(e=this.value)&&void 0!==e?e:0;return this.dualKnobs?"object"==typeof t?t:{lower:0,upper:t}:"object"==typeof t?t.upper:t}emitValueChange(){this.value=this.ensureValueInBounds(this.value),this.ionChange.emit({value:this.value})}onStart(){this.ionKnobMoveStart.emit({value:this.ensureValueInBounds(this.value)})}onMove(e){const{contentEl:t,pressedKnob:a}=this,n=e.currentX;t&&void 0===this.pressedKnob&&(this.initialContentScrollY=s(t)),void 0===a&&this.setPressedKnob(n),this.update(n)}onEnd(e){var t;const{contentEl:a,initialContentScrollY:n}=this,r=null!==(t=e.currentX)&&void 0!==t?t:e.clientX;void 0===this.pressedKnob&&this.setPressedKnob(r),a&&void 0!==this.pressedKnob&&l(a,n),this.update(r),this.pressedKnob=void 0,this.emitValueChange(),this.ionKnobMoveEnd.emit({value:this.ensureValueInBounds(this.value)})}update(e){const t=this.rect;let a=d(0,(e-t.left)/t.width,1);p(this.el)&&(a=1-a),this.snaps&&(a=w(v(a,this.min,this.max,this.step),this.min,this.max)),"A"===this.pressedKnob?this.ratioA=a:this.ratioB=a,this.updateValue()}setPressedKnob(e){const t=this.rect=this.rangeSlider.getBoundingClientRect();let a=d(0,(e-t.left)/t.width,1);p(this.el)&&(a=1-a),this.pressedKnob=!this.dualKnobs||Math.abs(this.ratioA-a)<Math.abs(this.ratioB-a)?"A":"B",this.setFocus(this.pressedKnob)}get valA(){return v(this.ratioA,this.min,this.max,this.step)}get valB(){return v(this.ratioB,this.min,this.max,this.step)}get ratioLower(){if(this.dualKnobs)return Math.min(this.ratioA,this.ratioB);const{activeBarStart:e}=this;return null==e?0:w(e,this.min,this.max)}get ratioUpper(){return this.dualKnobs?Math.max(this.ratioA,this.ratioB):this.ratioA}updateRatio(){const e=this.getValue(),{min:t,max:a}=this;this.dualKnobs?(this.ratioA=w(e.lower,t,a),this.ratioB=w(e.upper,t,a)):this.ratioA=w(e,t,a)}updateValue(){this.noUpdate=!0;const{valA:e,valB:t}=this;this.value=this.dualKnobs?{lower:Math.min(e,t),upper:Math.max(e,t)}:e,this.noUpdate=!1}setFocus(e){if(this.el.shadowRoot){const t=this.el.shadowRoot.querySelector("A"===e?".range-knob-a":".range-knob-b");t&&t.focus()}}get hasStartSlotContent(){return null!==this.el.querySelector('[slot="start"]')}get hasEndSlotContent(){return null!==this.el.querySelector('[slot="end"]')}get hasLabel(){return void 0!==this.label||null!==this.el.querySelector('[slot="label"]')}renderRangeSlider(){var e;const{min:t,max:a,step:r,handleKeyboard:i,pressedKnob:o,disabled:s,pin:l,ratioLower:h,ratioUpper:d,pinFormatter:b,inheritedAttributes:g}=this;let c=100*h+"%",m=100-100*d+"%";const u=p(this.el),k=u?"right":"left",x=u?"left":"right",v=e=>({[k]:e[k]});!1===this.dualKnobs&&(this.valA<(null!==(e=this.activeBarStart)&&void 0!==e?e:this.min)?(c=100*d+"%",m=100-100*h+"%"):(c=100*h+"%",m=100-100*d+"%"));const y={[k]:c,[x]:m},z=[];if(this.snaps&&this.ticks)for(let e=t;e<=a;e+=r){const n=w(e,t,a),r=Math.min(h,d),i=Math.max(h,d),o={ratio:n,active:n>=r&&n<=i};o[k]=100*n+"%",z.push(o)}return n("div",{class:"range-slider",ref:e=>this.rangeSlider=e,onPointerUp:e=>{void 0===this.pressedKnob&&(this.onStart(),this.onEnd(e))}},z.map((e=>n("div",{style:v(e),role:"presentation",class:{"range-tick":!0,"range-tick-active":e.active},part:e.active?"tick-active":"tick"}))),n("div",{class:"range-bar-container"},n("div",{class:"range-bar",role:"presentation",part:"bar"}),n("div",{class:{"range-bar":!0,"range-bar-active":!0,"has-ticks":z.length>0},role:"presentation",style:y,part:"bar-active"})),f(u,{knob:"A",pressed:"A"===o,value:this.valA,ratio:this.ratioA,pin:l,pinFormatter:b,disabled:s,handleKeyboard:i,min:t,max:a,inheritedAttributes:g,onKnobFocus:this.onKnobFocus,onKnobBlur:this.onKnobBlur}),this.dualKnobs&&f(u,{knob:"B",pressed:"B"===o,value:this.valB,ratio:this.ratioB,pin:l,pinFormatter:b,disabled:s,handleKeyboard:i,min:t,max:a,inheritedAttributes:g,onKnobFocus:this.onKnobFocus,onKnobBlur:this.onKnobBlur}))}render(){const{disabled:e,el:t,hasLabel:a,rangeId:i,pin:o,pressedKnob:s,labelPlacement:l,label:h,dualKnobs:d,min:b,max:g}=this,p=m("ion-item",t),x=p&&!(a&&("start"===l||"fixed"===l)||this.hasStartSlotContent),f=p&&!(a&&"end"===l||this.hasEndSlotContent),v=k(this),w=d?this.valA===b||this.valB===b:this.valA===b,y=d?this.valA===g||this.valB===g:this.valA===g;return c(!0,t,this.name,JSON.stringify(this.getValue()),e),n(r,{key:"ed646a42d51b8fe22012198c354cbcf5a389c108",onFocusin:this.onFocus,onFocusout:this.onBlur,id:i,class:u(this.color,{[v]:!0,"in-item":p,"range-disabled":e,"range-pressed":void 0!==s,"range-has-pin":o,[`range-label-placement-${l}`]:!0,"range-item-start-adjustment":x,"range-item-end-adjustment":f,"range-value-min":w,"range-value-max":y})},n("label",{key:"3083e4f2a624e3b268396acb4415f7c6ac44d851",class:"range-wrapper",id:"range-label"},n("div",{key:"47b92f94d2a0381dd7c5cd3dda54ed2942096715",class:{"label-text-wrapper":!0,"label-text-wrapper-hidden":!a},part:"label"},void 0!==h?n("div",{class:"label-text"},h):n("slot",{name:"label"})),n("div",{key:"5341da8d19eb29091df680978a0e20cc8f2eec65",class:"native-wrapper"},n("slot",{key:"09f1437078032676695442d8c827a16faa7dffe2",name:"start"}),this.renderRangeSlider(),n("slot",{key:"02b7781970ea4d44f10b5f4627a2ca36eca45f85",name:"end"}))))}get el(){return i(this)}static get watchers(){return{debounce:["debounceChanged"],min:["minChanged"],max:["maxChanged"],step:["stepChanged"],activeBarStart:["activeBarStartChanged"],disabled:["disabledChanged"],value:["valueChanged"]}}},f=(e,{knob:t,value:a,ratio:r,min:i,max:o,disabled:s,pressed:l,pin:h,handleKeyboard:d,pinFormatter:b,inheritedAttributes:g,onKnobFocus:c,onKnobBlur:p})=>{const m=e?"right":"left",u=g["aria-label"];return n("div",{onKeyDown:e=>{const a=e.key;"ArrowLeft"===a||"ArrowDown"===a?(d(t,!1),e.preventDefault(),e.stopPropagation()):"ArrowRight"!==a&&"ArrowUp"!==a||(d(t,!0),e.preventDefault(),e.stopPropagation())},onFocus:()=>c(t),onBlur:p,class:{"range-knob-handle":!0,"range-knob-a":"A"===t,"range-knob-b":"B"===t,"range-knob-pressed":l,"range-knob-min":a===i,"range-knob-max":a===o,"ion-activatable":!0,"ion-focusable":!0},style:(()=>{const e={};return e[m]=100*r+"%",e})(),role:"slider",tabindex:s?-1:0,"aria-label":void 0!==u?u:null,"aria-labelledby":void 0===u?"range-label":null,"aria-valuemin":i,"aria-valuemax":o,"aria-disabled":s?"true":null,"aria-valuenow":a},h&&n("div",{class:"range-pin",role:"presentation",part:"pin"},b(a)),n("div",{class:"range-knob",role:"presentation",part:"knob"}))},v=(e,t,a,n)=>{let r=(a-t)*e;return n>0&&(r=Math.round(r/n)*n+t),function(e,...t){if(!h(e))return 0;const a=Math.max(...t.map((e=>function(e){return h(e)?e%1==0?0:e.toString().split(".")[1].length:0}(e))));return Number(e.toFixed(a))}(d(t,r,a),t,a,n)},w=(e,t,a)=>d(0,(e-t)/(a-t),1);let y=0;x.style={ios:":host{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family, inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.range-disabled){pointer-events:none}::slotted(ion-label){-ms-flex:initial;flex:initial}::slotted(ion-icon[slot]){font-size:24px}.range-slider{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab;-ms-touch-action:pan-y;touch-action:pan-y}:host(.range-pressed) .range-slider{cursor:-webkit-grabbing;cursor:grabbing}.range-pin{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box}.range-knob-handle{top:calc((var(--height) - var(--knob-handle-size)) / 2);-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-pack:center;justify-content:center;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}.range-knob-handle{inset-inline-start:0}:host-context([dir=rtl]) .range-knob-handle{left:unset}[dir=rtl] .range-knob-handle{left:unset}@supports selector(:dir(rtl)){.range-knob-handle:dir(rtl){left:unset}}.range-knob-handle:active,.range-knob-handle:focus{outline:none}.range-bar-container{border-radius:var(--bar-border-radius);top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height)}.range-bar-container{inset-inline-start:0}:host-context([dir=rtl]) .range-bar-container{left:unset}[dir=rtl] .range-bar-container{left:unset}@supports selector(:dir(rtl)){.range-bar-container:dir(rtl){left:unset}}.range-bar{border-radius:var(--bar-border-radius);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}.range-knob{border-radius:var(--knob-border-radius);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}.range-knob{inset-inline-start:calc(50% - var(--knob-size) / 2)}:host-context([dir=rtl]) .range-knob{left:unset}[dir=rtl] .range-knob{left:unset}@supports selector(:dir(rtl)){.range-knob:dir(rtl){left:unset}}:host(.range-pressed) .range-bar-active{will-change:left, right}:host(.in-item){width:100%}:host([slot=start]),:host([slot=end]){width:auto}:host(.in-item) ::slotted(ion-label){-ms-flex-item-align:center;align-self:center}.range-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit}::slotted([slot=label]){max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}:host(.range-label-placement-start) .range-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.range-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-end) .range-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.range-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.range-label-placement-stacked) .range-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch}:host(.range-label-placement-stacked) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host-context([dir=rtl]):host(.range-label-placement-stacked) .label-text-wrapper,:host-context([dir=rtl]).range-label-placement-stacked .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.range-label-placement-stacked:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.in-item.range-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.range-label-placement-stacked) .native-wrapper{margin-bottom:0px}:host{--knob-border-radius:50%;--knob-background:#ffffff;--knob-box-shadow:0px 0.5px 4px rgba(0, 0, 0, 0.12), 0px 6px 13px rgba(0, 0, 0, 0.12);--knob-size:26px;--bar-height:4px;--bar-background:var(--ion-color-step-900, var(--ion-background-color-step-900, #e6e6e6));--bar-background-active:var(--ion-color-primary, #0054e9);--bar-border-radius:2px;--height:42px}:host(.range-item-start-adjustment){-webkit-padding-start:24px;padding-inline-start:24px}:host(.range-item-end-adjustment){-webkit-padding-end:24px;padding-inline-end:24px}:host(.ion-color) .range-bar-active,:host(.ion-color) .range-tick-active{background:var(--ion-color-base)}::slotted([slot=start]){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}::slotted([slot=end]){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-has-pin:not(.range-label-placement-stacked)){padding-top:calc(8px + 0.75rem)}:host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper{margin-bottom:calc(8px + 0.75rem)}.range-bar-active{bottom:0;width:auto;background:var(--bar-background-active)}.range-bar-active.has-ticks{border-radius:0;-webkit-margin-start:-2px;margin-inline-start:-2px;-webkit-margin-end:-2px;margin-inline-end:-2px}.range-tick{-webkit-margin-start:-2px;margin-inline-start:-2px;border-radius:0;position:absolute;top:17px;width:4px;height:8px;background:var(--ion-color-step-900, var(--ion-background-color-step-900, #e6e6e6));pointer-events:none}.range-tick-active{background:var(--bar-background-active)}.range-pin{-webkit-transform:translate3d(0, 100%, 0) scale(0.01);transform:translate3d(0, 100%, 0) scale(0.01);-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;min-width:28px;-webkit-transition:-webkit-transform 120ms ease;transition:-webkit-transform 120ms ease;transition:transform 120ms ease;transition:transform 120ms ease, -webkit-transform 120ms ease;background:transparent;color:var(--ion-text-color, #000);font-size:0.75rem;text-align:center}.range-knob-pressed .range-pin,.range-knob-handle.ion-focused .range-pin{-webkit-transform:translate3d(0, calc(-100% + 11px), 0) scale(1);transform:translate3d(0, calc(-100% + 11px), 0) scale(1)}:host(.range-disabled){opacity:0.3}",md:':host{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family, inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.range-disabled){pointer-events:none}::slotted(ion-label){-ms-flex:initial;flex:initial}::slotted(ion-icon[slot]){font-size:24px}.range-slider{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab;-ms-touch-action:pan-y;touch-action:pan-y}:host(.range-pressed) .range-slider{cursor:-webkit-grabbing;cursor:grabbing}.range-pin{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box}.range-knob-handle{top:calc((var(--height) - var(--knob-handle-size)) / 2);-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-pack:center;justify-content:center;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}.range-knob-handle{inset-inline-start:0}:host-context([dir=rtl]) .range-knob-handle{left:unset}[dir=rtl] .range-knob-handle{left:unset}@supports selector(:dir(rtl)){.range-knob-handle:dir(rtl){left:unset}}.range-knob-handle:active,.range-knob-handle:focus{outline:none}.range-bar-container{border-radius:var(--bar-border-radius);top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height)}.range-bar-container{inset-inline-start:0}:host-context([dir=rtl]) .range-bar-container{left:unset}[dir=rtl] .range-bar-container{left:unset}@supports selector(:dir(rtl)){.range-bar-container:dir(rtl){left:unset}}.range-bar{border-radius:var(--bar-border-radius);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}.range-knob{border-radius:var(--knob-border-radius);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}.range-knob{inset-inline-start:calc(50% - var(--knob-size) / 2)}:host-context([dir=rtl]) .range-knob{left:unset}[dir=rtl] .range-knob{left:unset}@supports selector(:dir(rtl)){.range-knob:dir(rtl){left:unset}}:host(.range-pressed) .range-bar-active{will-change:left, right}:host(.in-item){width:100%}:host([slot=start]),:host([slot=end]){width:auto}:host(.in-item) ::slotted(ion-label){-ms-flex-item-align:center;align-self:center}.range-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit}::slotted([slot=label]){max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}:host(.range-label-placement-start) .range-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.range-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-end) .range-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.range-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.range-label-placement-stacked) .range-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch}:host(.range-label-placement-stacked) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host-context([dir=rtl]):host(.range-label-placement-stacked) .label-text-wrapper,:host-context([dir=rtl]).range-label-placement-stacked .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.range-label-placement-stacked:dir(rtl)) .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}}:host(.in-item.range-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.range-label-placement-stacked) .native-wrapper{margin-bottom:0px}:host{--knob-border-radius:50%;--knob-background:var(--bar-background-active);--knob-box-shadow:none;--knob-size:18px;--bar-height:2px;--bar-background:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.26);--bar-background-active:var(--ion-color-primary, #0054e9);--bar-border-radius:0;--height:42px;--pin-background:var(--ion-color-primary, #0054e9);--pin-color:var(--ion-color-primary-contrast, #fff)}::slotted(:not(ion-icon)[slot=start]),::slotted(:not(ion-icon)[slot=end]),.native-wrapper{font-size:0.75rem}:host(.range-item-start-adjustment){-webkit-padding-start:18px;padding-inline-start:18px}:host(.range-item-end-adjustment){-webkit-padding-end:18px;padding-inline-end:18px}:host(.ion-color) .range-bar{background:rgba(var(--ion-color-base-rgb), 0.26)}:host(.ion-color) .range-bar-active,:host(.ion-color) .range-knob,:host(.ion-color) .range-knob::before,:host(.ion-color) .range-pin,:host(.ion-color) .range-pin::before,:host(.ion-color) .range-tick{background:var(--ion-color-base);color:var(--ion-color-contrast)}::slotted([slot=start]){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:14px;margin-inline-end:14px;margin-top:0;margin-bottom:0}::slotted([slot=end]){-webkit-margin-start:14px;margin-inline-start:14px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-has-pin:not(.range-label-placement-stacked)){padding-top:1.75rem}:host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper{margin-bottom:1.75rem}.range-bar-active{bottom:0;width:auto;background:var(--bar-background-active)}.range-knob{-webkit-transform:scale(0.67);transform:scale(0.67);-webkit-transition-duration:120ms;transition-duration:120ms;-webkit-transition-property:background-color, border, -webkit-transform;transition-property:background-color, border, -webkit-transform;transition-property:transform, background-color, border;transition-property:transform, background-color, border, -webkit-transform;-webkit-transition-timing-function:ease;transition-timing-function:ease;z-index:2}.range-knob::before{border-radius:50%;position:absolute;width:var(--knob-size);height:var(--knob-size);-webkit-transform:scale(1);transform:scale(1);-webkit-transition:0.267s cubic-bezier(0, 0, 0.58, 1);transition:0.267s cubic-bezier(0, 0, 0.58, 1);background:var(--knob-background);content:"";opacity:0.13;pointer-events:none}.range-knob::before{inset-inline-start:0}.range-tick{position:absolute;top:calc((var(--height) - var(--bar-height)) / 2);width:var(--bar-height);height:var(--bar-height);background:var(--bar-background-active);z-index:1;pointer-events:none}.range-tick-active{background:transparent}.range-pin{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;border-radius:50%;-webkit-transform:translate3d(0, 0, 0) scale(0.01);transform:translate3d(0, 0, 0) scale(0.01);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:1.75rem;height:1.75rem;-webkit-transition:background 120ms ease, -webkit-transform 120ms ease;transition:background 120ms ease, -webkit-transform 120ms ease;transition:transform 120ms ease, background 120ms ease;transition:transform 120ms ease, background 120ms ease, -webkit-transform 120ms ease;background:var(--pin-background);color:var(--pin-color)}.range-pin::before{bottom:-1px;-webkit-margin-start:-13px;margin-inline-start:-13px;border-radius:50% 50% 50% 0;position:absolute;width:26px;height:26px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transition:background 120ms ease;transition:background 120ms ease;background:var(--pin-background);content:"";z-index:-1}.range-pin::before{inset-inline-start:50%}:host-context([dir=rtl]) .range-pin::before{left:unset}[dir=rtl] .range-pin::before{left:unset}@supports selector(:dir(rtl)){.range-pin::before:dir(rtl){left:unset}}.range-knob-pressed .range-pin,.range-knob-handle.ion-focused .range-pin{-webkit-transform:translate3d(0, calc(-100% + 4px), 0) scale(1);transform:translate3d(0, calc(-100% + 4px), 0) scale(1)}@media (any-hover: hover){.range-knob-handle:hover .range-knob:before{-webkit-transform:scale(2);transform:scale(2);opacity:0.13}}.range-knob-handle.ion-activated .range-knob:before,.range-knob-handle.ion-focused .range-knob:before,.range-knob-handle.range-knob-pressed .range-knob:before{-webkit-transform:scale(2);transform:scale(2)}.range-knob-handle.ion-focused .range-knob::before{opacity:0.13}.range-knob-handle.ion-activated .range-knob::before,.range-knob-handle.range-knob-pressed .range-knob::before{opacity:0.25}:host(:not(.range-has-pin)) .range-knob-pressed .range-knob,:host(:not(.range-has-pin)) .range-knob-handle.ion-focused .range-knob{-webkit-transform:scale(1);transform:scale(1)}:host(.range-disabled) .range-bar-active,:host(.range-disabled) .range-bar,:host(.range-disabled) .range-tick{background-color:var(--ion-color-step-250, var(--ion-background-color-step-250, #bfbfbf))}:host(.range-disabled) .range-knob{-webkit-transform:scale(0.55);transform:scale(0.55);outline:5px solid #fff;background-color:var(--ion-color-step-250, var(--ion-background-color-step-250, #bfbfbf))}:host(.range-disabled) .label-text-wrapper,:host(.range-disabled) ::slotted([slot=start]),:host(.range-disabled) ::slotted([slot=end]){opacity:0.38}'};export{x as ion_range}
|