@ionic/core 8.7.17-dev.11769628168.11eca7cd → 8.7.17-dev.11769813102.16c5bfac
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 +81 -39
- package/dist/cjs/ion-datetime_3.cjs.entry.js +10 -9
- package/dist/cjs/ion-range.cjs.entry.js +79 -38
- 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 +99 -42
- package/dist/docs.json +134 -6
- package/dist/esm/ion-datetime_3.entry.js +10 -9
- package/dist/esm/ion-range.entry.js +79 -38
- 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-73ecefff.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 +20 -4
- package/hydrate/index.js +110 -51
- package/hydrate/index.mjs +110 -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.js
CHANGED
|
@@ -12871,6 +12871,7 @@ const datetimeMdCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:colu
|
|
|
12871
12871
|
* @slot buttons - The buttons in the datetime.
|
|
12872
12872
|
* @slot time-label - The label for the time selector in the datetime.
|
|
12873
12873
|
*
|
|
12874
|
+
* @part wheel - The wheel container when using a wheel style layout, or in the month/year picker when using a grid style layout.
|
|
12874
12875
|
* @part wheel-item - The individual items when using a wheel style layout, or in the
|
|
12875
12876
|
* month/year picker when using a grid style layout.
|
|
12876
12877
|
* @part wheel-item active - The currently selected wheel-item.
|
|
@@ -14046,7 +14047,7 @@ class Datetime {
|
|
|
14046
14047
|
const todayString = workingParts.day !== null
|
|
14047
14048
|
? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
|
|
14048
14049
|
: `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
|
|
14049
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
|
|
14050
|
+
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) => {
|
|
14050
14051
|
const { value } = ev.detail;
|
|
14051
14052
|
const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
|
|
14052
14053
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
|
|
@@ -14121,7 +14122,7 @@ class Datetime {
|
|
|
14121
14122
|
const { disabled, workingParts } = this;
|
|
14122
14123
|
const activePart = this.getActivePartsWithFallback();
|
|
14123
14124
|
const pickerColumnValue = (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined;
|
|
14124
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
|
|
14125
|
+
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) => {
|
|
14125
14126
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
|
|
14126
14127
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
|
|
14127
14128
|
ev.stopPropagation();
|
|
@@ -14133,7 +14134,7 @@ class Datetime {
|
|
|
14133
14134
|
}
|
|
14134
14135
|
const { disabled, workingParts } = this;
|
|
14135
14136
|
const activePart = this.getActivePartsWithFallback();
|
|
14136
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
|
|
14137
|
+
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) => {
|
|
14137
14138
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
|
|
14138
14139
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
|
|
14139
14140
|
ev.stopPropagation();
|
|
@@ -14145,7 +14146,7 @@ class Datetime {
|
|
|
14145
14146
|
}
|
|
14146
14147
|
const { disabled, workingParts } = this;
|
|
14147
14148
|
const activePart = this.getActivePartsWithFallback();
|
|
14148
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
|
|
14149
|
+
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) => {
|
|
14149
14150
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
|
|
14150
14151
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
|
|
14151
14152
|
ev.stopPropagation();
|
|
@@ -14178,7 +14179,7 @@ class Datetime {
|
|
|
14178
14179
|
if (hoursData.length === 0)
|
|
14179
14180
|
return [];
|
|
14180
14181
|
const activePart = this.getActivePartsWithFallback();
|
|
14181
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
|
|
14182
|
+
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) => {
|
|
14182
14183
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
|
|
14183
14184
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { hour: ev.detail.value }));
|
|
14184
14185
|
ev.stopPropagation();
|
|
@@ -14189,7 +14190,7 @@ class Datetime {
|
|
|
14189
14190
|
if (minutesData.length === 0)
|
|
14190
14191
|
return [];
|
|
14191
14192
|
const activePart = this.getActivePartsWithFallback();
|
|
14192
|
-
return (hAsync("ion-picker-column", { "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
|
|
14193
|
+
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) => {
|
|
14193
14194
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
|
|
14194
14195
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { minute: ev.detail.value }));
|
|
14195
14196
|
ev.stopPropagation();
|
|
@@ -14202,7 +14203,7 @@ class Datetime {
|
|
|
14202
14203
|
}
|
|
14203
14204
|
const activePart = this.getActivePartsWithFallback();
|
|
14204
14205
|
const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
|
|
14205
|
-
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) => {
|
|
14206
|
+
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) => {
|
|
14206
14207
|
const hour = calculateHourFromAMPM(workingParts, ev.detail.value);
|
|
14207
14208
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
|
|
14208
14209
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { ampm: ev.detail.value, hour }));
|
|
@@ -14544,7 +14545,7 @@ class Datetime {
|
|
|
14544
14545
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
14545
14546
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
14546
14547
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
14547
|
-
return (hAsync(Host, { key: '
|
|
14548
|
+
return (hAsync(Host, { key: '19e20c9b6b5f9467e91a2567b6dc7d9d38b56cc3', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses$1(color, {
|
|
14548
14549
|
[mode]: true,
|
|
14549
14550
|
['datetime-readonly']: readonly,
|
|
14550
14551
|
['datetime-disabled']: disabled,
|
|
@@ -14554,7 +14555,7 @@ class Datetime {
|
|
|
14554
14555
|
[`datetime-size-${size}`]: true,
|
|
14555
14556
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
14556
14557
|
[`datetime-grid`]: isGridStyle,
|
|
14557
|
-
})) }, hAsync("div", { key: '
|
|
14558
|
+
})) }, hAsync("div", { key: 'e31b5ef76cd6262dafd39f2d21980887880ec32e', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
14558
14559
|
}
|
|
14559
14560
|
get el() { return getElement(this); }
|
|
14560
14561
|
static get watchers() { return {
|
|
@@ -14626,6 +14627,7 @@ class Datetime {
|
|
|
14626
14627
|
let datetimeIds = 0;
|
|
14627
14628
|
const CANCEL_ROLE = 'datetime-cancel';
|
|
14628
14629
|
const CONFIRM_ROLE = 'datetime-confirm';
|
|
14630
|
+
const WHEEL_PART = 'wheel';
|
|
14629
14631
|
const WHEEL_ITEM_PART = 'wheel-item';
|
|
14630
14632
|
const WHEEL_ITEM_ACTIVE_PART = `active`;
|
|
14631
14633
|
|
|
@@ -28715,13 +28717,28 @@ const rangeMdCss = ":host{--knob-handle-size:calc(var(--knob-size) * 2);display:
|
|
|
28715
28717
|
* @slot start - Content is placed to the left of the range slider in LTR, and to the right in RTL.
|
|
28716
28718
|
* @slot end - Content is placed to the right of the range slider in LTR, and to the left in RTL.
|
|
28717
28719
|
*
|
|
28720
|
+
* @part label - The label text describing the range.
|
|
28718
28721
|
* @part tick - An inactive tick mark.
|
|
28719
28722
|
* @part tick-active - An active tick mark.
|
|
28720
|
-
* @part pin - The counter that appears above a knob.
|
|
28721
|
-
* @part knob - The handle that is used to drag the range.
|
|
28722
28723
|
* @part bar - The inactive part of the bar.
|
|
28723
28724
|
* @part bar-active - The active part of the bar.
|
|
28724
|
-
* @part
|
|
28725
|
+
* @part knob-handle - The container element that wraps the knob and handles drag interactions.
|
|
28726
|
+
* @part knob-handle-a - The container element for the first knob. Only available when `dualKnobs` is `true`.
|
|
28727
|
+
* @part knob-handle-b - The container element for the second knob. Only available when `dualKnobs` is `true`.
|
|
28728
|
+
* @part knob-handle-lower - The container element for the lower knob. Only available when `dualKnobs` is `true`.
|
|
28729
|
+
* @part knob-handle-upper - The container element for the upper knob. Only available when `dualKnobs` is `true`.
|
|
28730
|
+
* @part pin - The counter that appears above a knob.
|
|
28731
|
+
* @part pin-a - The counter that appears above the first knob. Only available when `dualKnobs` is `true`.
|
|
28732
|
+
* @part pin-b - The counter that appears above the second knob. Only available when `dualKnobs` is `true`.
|
|
28733
|
+
* @part pin-lower - The counter that appears above the lower knob. Only available when `dualKnobs` is `true`.
|
|
28734
|
+
* @part pin-upper - The counter that appears above the upper knob. Only available when `dualKnobs` is `true`.
|
|
28735
|
+
* @part knob - The visual knob element that appears on the range track.
|
|
28736
|
+
* @part knob-a - The visual knob element for the first knob. Only available when `dualKnobs` is `true`.
|
|
28737
|
+
* @part knob-b - The visual knob element for the second knob. Only available when `dualKnobs` is `true`.
|
|
28738
|
+
* @part knob-lower - The visual knob element for the lower knob. Only available when `dualKnobs` is `true`.
|
|
28739
|
+
* @part knob-upper - The visual knob element for the upper knob. Only available when `dualKnobs` is `true`.
|
|
28740
|
+
* @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.
|
|
28741
|
+
* @part focused - Added to the knob-handle, knob, and pin that currently has focus. Only one set has this part at a time.
|
|
28725
28742
|
*/
|
|
28726
28743
|
class Range {
|
|
28727
28744
|
constructor(hostRef) {
|
|
@@ -28739,6 +28756,7 @@ class Range {
|
|
|
28739
28756
|
this.inheritedAttributes = {};
|
|
28740
28757
|
this.contentEl = null;
|
|
28741
28758
|
this.initialContentScrollY = true;
|
|
28759
|
+
this.focusFromPointer = false;
|
|
28742
28760
|
this.ratioA = 0;
|
|
28743
28761
|
this.ratioB = 0;
|
|
28744
28762
|
/**
|
|
@@ -28870,6 +28888,7 @@ class Range {
|
|
|
28870
28888
|
this.onBlur = () => {
|
|
28871
28889
|
if (this.hasFocus) {
|
|
28872
28890
|
this.hasFocus = false;
|
|
28891
|
+
this.focusedKnob = undefined;
|
|
28873
28892
|
this.ionBlur.emit();
|
|
28874
28893
|
}
|
|
28875
28894
|
};
|
|
@@ -28880,21 +28899,20 @@ class Range {
|
|
|
28880
28899
|
}
|
|
28881
28900
|
};
|
|
28882
28901
|
this.onKnobFocus = (knob) => {
|
|
28902
|
+
// Clicking focuses the range which is needed for the keyboard,
|
|
28903
|
+
// but we only want to add the ion-focused class when focused via Tab.
|
|
28904
|
+
if (!this.focusFromPointer) {
|
|
28905
|
+
this.focusedKnob = knob;
|
|
28906
|
+
}
|
|
28907
|
+
else {
|
|
28908
|
+
this.focusFromPointer = false;
|
|
28909
|
+
this.focusedKnob = undefined;
|
|
28910
|
+
}
|
|
28911
|
+
// If the knob was not already focused, emit the focus event
|
|
28883
28912
|
if (!this.hasFocus) {
|
|
28884
28913
|
this.hasFocus = true;
|
|
28885
28914
|
this.ionFocus.emit();
|
|
28886
28915
|
}
|
|
28887
|
-
// Manually manage ion-focused class for dual knobs
|
|
28888
|
-
if (this.dualKnobs && this.el.shadowRoot) {
|
|
28889
|
-
const knobA = this.el.shadowRoot.querySelector('.range-knob-a');
|
|
28890
|
-
const knobB = this.el.shadowRoot.querySelector('.range-knob-b');
|
|
28891
|
-
// Remove ion-focused from both knobs first
|
|
28892
|
-
knobA === null || knobA === void 0 ? void 0 : knobA.classList.remove('ion-focused');
|
|
28893
|
-
knobB === null || knobB === void 0 ? void 0 : knobB.classList.remove('ion-focused');
|
|
28894
|
-
// Add ion-focused only to the focused knob
|
|
28895
|
-
const focusedKnobEl = knob === 'A' ? knobA : knobB;
|
|
28896
|
-
focusedKnobEl === null || focusedKnobEl === void 0 ? void 0 : focusedKnobEl.classList.add('ion-focused');
|
|
28897
|
-
}
|
|
28898
28916
|
};
|
|
28899
28917
|
this.onKnobBlur = () => {
|
|
28900
28918
|
// Check if focus is moving to another knob within the same range
|
|
@@ -28906,15 +28924,9 @@ class Range {
|
|
|
28906
28924
|
if (!isStillFocusedOnKnob) {
|
|
28907
28925
|
if (this.hasFocus) {
|
|
28908
28926
|
this.hasFocus = false;
|
|
28927
|
+
this.focusedKnob = undefined;
|
|
28909
28928
|
this.ionBlur.emit();
|
|
28910
28929
|
}
|
|
28911
|
-
// Remove ion-focused from both knobs when focus leaves the range
|
|
28912
|
-
if (this.dualKnobs && this.el.shadowRoot) {
|
|
28913
|
-
const knobA = this.el.shadowRoot.querySelector('.range-knob-a');
|
|
28914
|
-
const knobB = this.el.shadowRoot.querySelector('.range-knob-b');
|
|
28915
|
-
knobA === null || knobA === void 0 ? void 0 : knobA.classList.remove('ion-focused');
|
|
28916
|
-
knobB === null || knobB === void 0 ? void 0 : knobB.classList.remove('ion-focused');
|
|
28917
|
-
}
|
|
28918
28930
|
}
|
|
28919
28931
|
}, 0);
|
|
28920
28932
|
};
|
|
@@ -29171,7 +29183,6 @@ class Range {
|
|
|
29171
29183
|
ratio = 1 - ratio;
|
|
29172
29184
|
}
|
|
29173
29185
|
this.pressedKnob = !this.dualKnobs || Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio) ? 'A' : 'B';
|
|
29174
|
-
this.setFocus(this.pressedKnob);
|
|
29175
29186
|
}
|
|
29176
29187
|
get valA() {
|
|
29177
29188
|
return ratioToValue(this.ratioA, this.min, this.max, this.step);
|
|
@@ -29198,9 +29209,23 @@ class Range {
|
|
|
29198
29209
|
updateRatio() {
|
|
29199
29210
|
const value = this.getValue();
|
|
29200
29211
|
const { min, max } = this;
|
|
29212
|
+
/**
|
|
29213
|
+
* For dual knobs, value gives lower/upper but not which is A vs B.
|
|
29214
|
+
* Assign (lowerRatio, upperRatio) to (ratioA, ratioB) in the way that
|
|
29215
|
+
* minimizes change from the current ratios so the knobs don't swap.
|
|
29216
|
+
*/
|
|
29201
29217
|
if (this.dualKnobs) {
|
|
29202
|
-
|
|
29203
|
-
|
|
29218
|
+
const lowerRatio = valueToRatio(value.lower, min, max);
|
|
29219
|
+
const upperRatio = valueToRatio(value.upper, min, max);
|
|
29220
|
+
if (Math.abs(this.ratioA - lowerRatio) + Math.abs(this.ratioB - upperRatio) <=
|
|
29221
|
+
Math.abs(this.ratioA - upperRatio) + Math.abs(this.ratioB - lowerRatio)) {
|
|
29222
|
+
this.ratioA = lowerRatio;
|
|
29223
|
+
this.ratioB = upperRatio;
|
|
29224
|
+
}
|
|
29225
|
+
else {
|
|
29226
|
+
this.ratioA = upperRatio;
|
|
29227
|
+
this.ratioB = lowerRatio;
|
|
29228
|
+
}
|
|
29204
29229
|
}
|
|
29205
29230
|
else {
|
|
29206
29231
|
this.ratioA = valueToRatio(value, min, max);
|
|
@@ -29217,14 +29242,6 @@ class Range {
|
|
|
29217
29242
|
};
|
|
29218
29243
|
this.noUpdate = false;
|
|
29219
29244
|
}
|
|
29220
|
-
setFocus(knob) {
|
|
29221
|
-
if (this.el.shadowRoot) {
|
|
29222
|
-
const knobEl = this.el.shadowRoot.querySelector(knob === 'A' ? '.range-knob-a' : '.range-knob-b');
|
|
29223
|
-
if (knobEl) {
|
|
29224
|
-
knobEl.focus();
|
|
29225
|
-
}
|
|
29226
|
-
}
|
|
29227
|
-
}
|
|
29228
29245
|
/**
|
|
29229
29246
|
* Returns true if content was passed to the "start" slot
|
|
29230
29247
|
*/
|
|
@@ -29242,7 +29259,7 @@ class Range {
|
|
|
29242
29259
|
}
|
|
29243
29260
|
renderRangeSlider() {
|
|
29244
29261
|
var _a;
|
|
29245
|
-
const { min, max, step, handleKeyboard, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
|
|
29262
|
+
const { min, max, step, handleKeyboard, focusedKnob, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
|
|
29246
29263
|
let barStart = `${ratioLower * 100}%`;
|
|
29247
29264
|
let barEnd = `${100 - ratioUpper * 100}%`;
|
|
29248
29265
|
const rtl = isRTL$1(this.el);
|
|
@@ -29302,7 +29319,9 @@ class Range {
|
|
|
29302
29319
|
ticks.push(tick);
|
|
29303
29320
|
}
|
|
29304
29321
|
}
|
|
29305
|
-
return (hAsync("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl),
|
|
29322
|
+
return (hAsync("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl), onPointerDown: () => {
|
|
29323
|
+
this.focusFromPointer = true;
|
|
29324
|
+
},
|
|
29306
29325
|
/**
|
|
29307
29326
|
* Since the gesture has a threshold, the value
|
|
29308
29327
|
* won't change until the user has dragged past
|
|
@@ -29315,6 +29334,7 @@ class Range {
|
|
|
29315
29334
|
* we need to listen for the "pointerUp" event.
|
|
29316
29335
|
*/
|
|
29317
29336
|
onPointerUp: (ev) => {
|
|
29337
|
+
this.focusFromPointer = false;
|
|
29318
29338
|
/**
|
|
29319
29339
|
* If the user drags the knob on the web
|
|
29320
29340
|
* version (does not occur on mobile),
|
|
@@ -29340,7 +29360,10 @@ class Range {
|
|
|
29340
29360
|
'has-ticks': ticks.length > 0,
|
|
29341
29361
|
}, role: "presentation", style: barStyle, part: "bar-active" })), renderKnob(rtl, {
|
|
29342
29362
|
knob: 'A',
|
|
29363
|
+
position: this.dualKnobs ? (this.ratioA <= this.ratioB ? 'lower' : 'upper') : 'lower',
|
|
29364
|
+
dualKnobs: this.dualKnobs,
|
|
29343
29365
|
pressed: pressedKnob === 'A',
|
|
29366
|
+
focused: focusedKnob === 'A',
|
|
29344
29367
|
value: this.valA,
|
|
29345
29368
|
ratio: this.ratioA,
|
|
29346
29369
|
pin,
|
|
@@ -29355,7 +29378,10 @@ class Range {
|
|
|
29355
29378
|
}), this.dualKnobs &&
|
|
29356
29379
|
renderKnob(rtl, {
|
|
29357
29380
|
knob: 'B',
|
|
29381
|
+
position: this.ratioB <= this.ratioA ? 'lower' : 'upper',
|
|
29382
|
+
dualKnobs: this.dualKnobs,
|
|
29358
29383
|
pressed: pressedKnob === 'B',
|
|
29384
|
+
focused: focusedKnob === 'B',
|
|
29359
29385
|
value: this.valB,
|
|
29360
29386
|
ratio: this.ratioB,
|
|
29361
29387
|
pin,
|
|
@@ -29392,10 +29418,11 @@ class Range {
|
|
|
29392
29418
|
const valueAtMin = dualKnobs ? this.valA === min || this.valB === min : this.valA === min;
|
|
29393
29419
|
const valueAtMax = dualKnobs ? this.valA === max || this.valB === max : this.valA === max;
|
|
29394
29420
|
renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);
|
|
29395
|
-
return (hAsync(Host, { key: '
|
|
29421
|
+
return (hAsync(Host, { key: '6f3ac66d528c499f840afd31fa3958f2749c9ff5', onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: createColorClasses$1(this.color, {
|
|
29396
29422
|
[mode]: true,
|
|
29397
29423
|
'in-item': inItem,
|
|
29398
29424
|
'range-disabled': disabled,
|
|
29425
|
+
'range-dual-knobs': dualKnobs,
|
|
29399
29426
|
'range-pressed': pressedKnob !== undefined,
|
|
29400
29427
|
'range-has-pin': pin,
|
|
29401
29428
|
[`range-label-placement-${labelPlacement}`]: true,
|
|
@@ -29403,10 +29430,10 @@ class Range {
|
|
|
29403
29430
|
'range-item-end-adjustment': needsEndAdjustment,
|
|
29404
29431
|
'range-value-min': valueAtMin,
|
|
29405
29432
|
'range-value-max': valueAtMax,
|
|
29406
|
-
}) }, hAsync("label", { key: '
|
|
29433
|
+
}) }, hAsync("label", { key: 'a33e928dc37228bd4e1c4d3f804a7bb49d484088', class: "range-wrapper", id: "range-label" }, hAsync("div", { key: '5d4b885fd1a87621734244701838f86d5145b914', class: {
|
|
29407
29434
|
'label-text-wrapper': true,
|
|
29408
29435
|
'label-text-wrapper-hidden': !hasLabel,
|
|
29409
|
-
}, part: "label" }, label !== undefined ? hAsync("div", { class: "label-text" }, label) : hAsync("slot", { name: "label" })), hAsync("div", { key: '
|
|
29436
|
+
}, part: "label" }, label !== undefined ? hAsync("div", { class: "label-text" }, label) : hAsync("slot", { name: "label" })), hAsync("div", { key: '335a10bdb191a179c426ecba3541adada6d6aeb8', class: "native-wrapper" }, hAsync("slot", { key: '57dc846d33d0e1b1f4f18fc8553dc7fa2cca70bf', name: "start" }), this.renderRangeSlider(), hAsync("slot", { key: '57f85044b4f507015d905a73dca9d13a224560b1', name: "end" })))));
|
|
29410
29437
|
}
|
|
29411
29438
|
get el() { return getElement(this); }
|
|
29412
29439
|
static get watchers() { return {
|
|
@@ -29444,14 +29471,15 @@ class Range {
|
|
|
29444
29471
|
"labelPlacement": [1, "label-placement"],
|
|
29445
29472
|
"ratioA": [32],
|
|
29446
29473
|
"ratioB": [32],
|
|
29447
|
-
"pressedKnob": [32]
|
|
29474
|
+
"pressedKnob": [32],
|
|
29475
|
+
"focusedKnob": [32]
|
|
29448
29476
|
},
|
|
29449
29477
|
"$listeners$": undefined,
|
|
29450
29478
|
"$lazyBundleId$": "-",
|
|
29451
29479
|
"$attrsToReflect$": [["color", "color"]]
|
|
29452
29480
|
}; }
|
|
29453
29481
|
}
|
|
29454
|
-
const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, }) => {
|
|
29482
|
+
const renderKnob = (rtl, { knob, position, dualKnobs, value, ratio, min, max, disabled, pressed, focused, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, }) => {
|
|
29455
29483
|
const start = rtl ? 'right' : 'left';
|
|
29456
29484
|
const knobStyle = () => {
|
|
29457
29485
|
const style = {};
|
|
@@ -29474,14 +29502,45 @@ const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin,
|
|
|
29474
29502
|
}
|
|
29475
29503
|
}, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur, class: {
|
|
29476
29504
|
'range-knob-handle': true,
|
|
29477
|
-
'range-knob-a': knob === 'A',
|
|
29478
|
-
'range-knob-b': knob === 'B',
|
|
29505
|
+
'range-knob-handle-a': knob === 'A',
|
|
29506
|
+
'range-knob-handle-b': knob === 'B',
|
|
29479
29507
|
'range-knob-pressed': pressed,
|
|
29480
29508
|
'range-knob-min': value === min,
|
|
29481
29509
|
'range-knob-max': value === max,
|
|
29482
29510
|
'ion-activatable': true,
|
|
29483
29511
|
'ion-focusable': true,
|
|
29484
|
-
|
|
29512
|
+
'ion-focused': focused,
|
|
29513
|
+
}, part: [
|
|
29514
|
+
'knob-handle',
|
|
29515
|
+
dualKnobs && knob === 'A' && 'knob-handle-a',
|
|
29516
|
+
dualKnobs && knob === 'B' && 'knob-handle-b',
|
|
29517
|
+
dualKnobs && position === 'lower' && 'knob-handle-lower',
|
|
29518
|
+
dualKnobs && position === 'upper' && 'knob-handle-upper',
|
|
29519
|
+
pressed && 'pressed',
|
|
29520
|
+
focused && 'focused',
|
|
29521
|
+
]
|
|
29522
|
+
.filter(Boolean)
|
|
29523
|
+
.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: [
|
|
29524
|
+
'pin',
|
|
29525
|
+
dualKnobs && knob === 'A' && 'pin-a',
|
|
29526
|
+
dualKnobs && knob === 'B' && 'pin-b',
|
|
29527
|
+
dualKnobs && position === 'lower' && 'pin-lower',
|
|
29528
|
+
dualKnobs && position === 'upper' && 'pin-upper',
|
|
29529
|
+
pressed && 'pressed',
|
|
29530
|
+
focused && 'focused',
|
|
29531
|
+
]
|
|
29532
|
+
.filter(Boolean)
|
|
29533
|
+
.join(' ') }, pinFormatter(value))), hAsync("div", { class: "range-knob", role: "presentation", part: [
|
|
29534
|
+
'knob',
|
|
29535
|
+
dualKnobs && knob === 'A' && 'knob-a',
|
|
29536
|
+
dualKnobs && knob === 'B' && 'knob-b',
|
|
29537
|
+
dualKnobs && position === 'lower' && 'knob-lower',
|
|
29538
|
+
dualKnobs && position === 'upper' && 'knob-upper',
|
|
29539
|
+
pressed && 'pressed',
|
|
29540
|
+
focused && 'focused',
|
|
29541
|
+
]
|
|
29542
|
+
.filter(Boolean)
|
|
29543
|
+
.join(' ') })));
|
|
29485
29544
|
};
|
|
29486
29545
|
const ratioToValue = (ratio, min, max, step) => {
|
|
29487
29546
|
let value = (max - min) * ratio;
|