@ionic/core 8.7.17-dev.11770405784.157a3c10 → 8.7.17-dev.11771865171.14f4c2cf

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/hydrate/index.js CHANGED
@@ -28717,13 +28717,30 @@ const rangeMdCss = ":host{--knob-handle-size:calc(var(--knob-size) * 2);display:
28717
28717
  * @slot start - Content is placed to the left of the range slider in LTR, and to the right in RTL.
28718
28718
  * @slot end - Content is placed to the right of the range slider in LTR, and to the left in RTL.
28719
28719
  *
28720
+ * @part label - The label text describing the range.
28720
28721
  * @part tick - An inactive tick mark.
28721
28722
  * @part tick-active - An active tick mark.
28722
- * @part pin - The counter that appears above a knob.
28723
- * @part knob - The handle that is used to drag the range.
28724
28723
  * @part bar - The inactive part of the bar.
28725
28724
  * @part bar-active - The active part of the bar.
28726
- * @part label - The label text describing the range.
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 activated - Added to the knob-handle, knob, and pin when the knob is activated (has the `ion-activated` class). Only one set has this part at a time when `dualKnobs` is `true`.
28741
+ * @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`.
28742
+ * @part hover - Added to the knob-handle, knob, and pin when the knob has hover. Only one set has this part at a time when `dualKnobs` is `true`.
28743
+ * @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`.
28727
28744
  */
28728
28745
  class Range {
28729
28746
  constructor(hostRef) {
@@ -28741,6 +28758,7 @@ class Range {
28741
28758
  this.inheritedAttributes = {};
28742
28759
  this.contentEl = null;
28743
28760
  this.initialContentScrollY = true;
28761
+ this.focusFromPointer = false;
28744
28762
  this.ratioA = 0;
28745
28763
  this.ratioB = 0;
28746
28764
  /**
@@ -28850,6 +28868,29 @@ class Range {
28850
28868
  this.gesture.enable(!this.disabled);
28851
28869
  }
28852
28870
  };
28871
+ /**
28872
+ * Observes the knob handles for the ion-activated class and syncs
28873
+ * activatedKnob so the activated part is correctly set on the handle,
28874
+ * knob, and pin.
28875
+ */
28876
+ this.setupActivatedObserver = () => {
28877
+ const knobHandleA = this.el.shadowRoot.querySelector('.range-knob-handle-a');
28878
+ const knobHandleB = this.el.shadowRoot.querySelector('.range-knob-handle-b');
28879
+ const syncActivated = () => {
28880
+ this.activatedKnob = (knobHandleA === null || knobHandleA === void 0 ? void 0 : knobHandleA.classList.contains('ion-activated'))
28881
+ ? 'A'
28882
+ : (knobHandleB === null || knobHandleB === void 0 ? void 0 : knobHandleB.classList.contains('ion-activated'))
28883
+ ? 'B'
28884
+ : undefined;
28885
+ };
28886
+ this.activatedObserver = new MutationObserver(syncActivated);
28887
+ this.activatedObserver.observe(this.el.shadowRoot, {
28888
+ attributes: true,
28889
+ attributeFilter: ['class'],
28890
+ subtree: true,
28891
+ });
28892
+ syncActivated();
28893
+ };
28853
28894
  this.handleKeyboard = (knob, isIncrease) => {
28854
28895
  const { ensureValueInBounds } = this;
28855
28896
  let step = this.step;
@@ -28872,6 +28913,7 @@ class Range {
28872
28913
  this.onBlur = () => {
28873
28914
  if (this.hasFocus) {
28874
28915
  this.hasFocus = false;
28916
+ this.focusedKnob = undefined;
28875
28917
  this.ionBlur.emit();
28876
28918
  }
28877
28919
  };
@@ -28882,21 +28924,20 @@ class Range {
28882
28924
  }
28883
28925
  };
28884
28926
  this.onKnobFocus = (knob) => {
28927
+ // Clicking focuses the range which is needed for the keyboard,
28928
+ // but we only want to add the ion-focused class when focused via Tab.
28929
+ if (!this.focusFromPointer) {
28930
+ this.focusedKnob = knob;
28931
+ }
28932
+ else {
28933
+ this.focusFromPointer = false;
28934
+ this.focusedKnob = undefined;
28935
+ }
28936
+ // If the knob was not already focused, emit the focus event
28885
28937
  if (!this.hasFocus) {
28886
28938
  this.hasFocus = true;
28887
28939
  this.ionFocus.emit();
28888
28940
  }
28889
- // Manually manage ion-focused class for dual knobs
28890
- if (this.dualKnobs && this.el.shadowRoot) {
28891
- const knobA = this.el.shadowRoot.querySelector('.range-knob-a');
28892
- const knobB = this.el.shadowRoot.querySelector('.range-knob-b');
28893
- // Remove ion-focused from both knobs first
28894
- knobA === null || knobA === void 0 ? void 0 : knobA.classList.remove('ion-focused');
28895
- knobB === null || knobB === void 0 ? void 0 : knobB.classList.remove('ion-focused');
28896
- // Add ion-focused only to the focused knob
28897
- const focusedKnobEl = knob === 'A' ? knobA : knobB;
28898
- focusedKnobEl === null || focusedKnobEl === void 0 ? void 0 : focusedKnobEl.classList.add('ion-focused');
28899
- }
28900
28941
  };
28901
28942
  this.onKnobBlur = () => {
28902
28943
  // Check if focus is moving to another knob within the same range
@@ -28908,18 +28949,18 @@ class Range {
28908
28949
  if (!isStillFocusedOnKnob) {
28909
28950
  if (this.hasFocus) {
28910
28951
  this.hasFocus = false;
28952
+ this.focusedKnob = undefined;
28911
28953
  this.ionBlur.emit();
28912
28954
  }
28913
- // Remove ion-focused from both knobs when focus leaves the range
28914
- if (this.dualKnobs && this.el.shadowRoot) {
28915
- const knobA = this.el.shadowRoot.querySelector('.range-knob-a');
28916
- const knobB = this.el.shadowRoot.querySelector('.range-knob-b');
28917
- knobA === null || knobA === void 0 ? void 0 : knobA.classList.remove('ion-focused');
28918
- knobB === null || knobB === void 0 ? void 0 : knobB.classList.remove('ion-focused');
28919
- }
28920
28955
  }
28921
28956
  }, 0);
28922
28957
  };
28958
+ this.onKnobMouseEnter = (knob) => {
28959
+ this.hoveredKnob = knob;
28960
+ };
28961
+ this.onKnobMouseLeave = () => {
28962
+ this.hoveredKnob = undefined;
28963
+ };
28923
28964
  }
28924
28965
  debounceChanged() {
28925
28966
  const { ionInput, debounce, originalIonInput } = this;
@@ -28996,6 +29037,7 @@ class Range {
28996
29037
  this.originalIonInput = this.ionInput;
28997
29038
  this.setupGesture();
28998
29039
  this.updateRatio();
29040
+ this.setupActivatedObserver();
28999
29041
  this.didLoad = true;
29000
29042
  }
29001
29043
  connectedCallback() {
@@ -29021,6 +29063,10 @@ class Range {
29021
29063
  this.gesture.destroy();
29022
29064
  this.gesture = undefined;
29023
29065
  }
29066
+ if (this.activatedObserver) {
29067
+ this.activatedObserver.disconnect();
29068
+ this.activatedObserver = undefined;
29069
+ }
29024
29070
  }
29025
29071
  getValue() {
29026
29072
  var _a;
@@ -29173,7 +29219,6 @@ class Range {
29173
29219
  ratio = 1 - ratio;
29174
29220
  }
29175
29221
  this.pressedKnob = !this.dualKnobs || Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio) ? 'A' : 'B';
29176
- this.setFocus(this.pressedKnob);
29177
29222
  }
29178
29223
  get valA() {
29179
29224
  return ratioToValue(this.ratioA, this.min, this.max, this.step);
@@ -29200,9 +29245,23 @@ class Range {
29200
29245
  updateRatio() {
29201
29246
  const value = this.getValue();
29202
29247
  const { min, max } = this;
29248
+ /**
29249
+ * For dual knobs, value gives lower/upper but not which is A vs B.
29250
+ * Assign (lowerRatio, upperRatio) to (ratioA, ratioB) in the way that
29251
+ * minimizes change from the current ratios so the knobs don't swap.
29252
+ */
29203
29253
  if (this.dualKnobs) {
29204
- this.ratioA = valueToRatio(value.lower, min, max);
29205
- this.ratioB = valueToRatio(value.upper, min, max);
29254
+ const lowerRatio = valueToRatio(value.lower, min, max);
29255
+ const upperRatio = valueToRatio(value.upper, min, max);
29256
+ if (Math.abs(this.ratioA - lowerRatio) + Math.abs(this.ratioB - upperRatio) <=
29257
+ Math.abs(this.ratioA - upperRatio) + Math.abs(this.ratioB - lowerRatio)) {
29258
+ this.ratioA = lowerRatio;
29259
+ this.ratioB = upperRatio;
29260
+ }
29261
+ else {
29262
+ this.ratioA = upperRatio;
29263
+ this.ratioB = lowerRatio;
29264
+ }
29206
29265
  }
29207
29266
  else {
29208
29267
  this.ratioA = valueToRatio(value, min, max);
@@ -29219,14 +29278,6 @@ class Range {
29219
29278
  };
29220
29279
  this.noUpdate = false;
29221
29280
  }
29222
- setFocus(knob) {
29223
- if (this.el.shadowRoot) {
29224
- const knobEl = this.el.shadowRoot.querySelector(knob === 'A' ? '.range-knob-a' : '.range-knob-b');
29225
- if (knobEl) {
29226
- knobEl.focus();
29227
- }
29228
- }
29229
- }
29230
29281
  /**
29231
29282
  * Returns true if content was passed to the "start" slot
29232
29283
  */
@@ -29244,7 +29295,7 @@ class Range {
29244
29295
  }
29245
29296
  renderRangeSlider() {
29246
29297
  var _a;
29247
- const { min, max, step, handleKeyboard, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
29298
+ const { min, max, step, handleKeyboard, activatedKnob, focusedKnob, hoveredKnob, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
29248
29299
  let barStart = `${ratioLower * 100}%`;
29249
29300
  let barEnd = `${100 - ratioUpper * 100}%`;
29250
29301
  const rtl = isRTL$1(this.el);
@@ -29304,7 +29355,9 @@ class Range {
29304
29355
  ticks.push(tick);
29305
29356
  }
29306
29357
  }
29307
- return (hAsync("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl),
29358
+ return (hAsync("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl), onPointerDown: () => {
29359
+ this.focusFromPointer = true;
29360
+ },
29308
29361
  /**
29309
29362
  * Since the gesture has a threshold, the value
29310
29363
  * won't change until the user has dragged past
@@ -29317,6 +29370,7 @@ class Range {
29317
29370
  * we need to listen for the "pointerUp" event.
29318
29371
  */
29319
29372
  onPointerUp: (ev) => {
29373
+ this.focusFromPointer = false;
29320
29374
  /**
29321
29375
  * If the user drags the knob on the web
29322
29376
  * version (does not occur on mobile),
@@ -29342,6 +29396,11 @@ class Range {
29342
29396
  'has-ticks': ticks.length > 0,
29343
29397
  }, role: "presentation", style: barStyle, part: "bar-active" })), renderKnob(rtl, {
29344
29398
  knob: 'A',
29399
+ position: getKnobPosition('A', this.ratioA, this.ratioB, this.dualKnobs),
29400
+ dualKnobs: this.dualKnobs,
29401
+ activated: activatedKnob === 'A',
29402
+ focused: focusedKnob === 'A',
29403
+ hovered: hoveredKnob === 'A',
29345
29404
  pressed: pressedKnob === 'A',
29346
29405
  value: this.valA,
29347
29406
  ratio: this.ratioA,
@@ -29354,9 +29413,16 @@ class Range {
29354
29413
  inheritedAttributes,
29355
29414
  onKnobFocus: this.onKnobFocus,
29356
29415
  onKnobBlur: this.onKnobBlur,
29416
+ onKnobMouseEnter: this.onKnobMouseEnter,
29417
+ onKnobMouseLeave: this.onKnobMouseLeave,
29357
29418
  }), this.dualKnobs &&
29358
29419
  renderKnob(rtl, {
29359
29420
  knob: 'B',
29421
+ position: getKnobPosition('B', this.ratioA, this.ratioB, this.dualKnobs),
29422
+ dualKnobs: this.dualKnobs,
29423
+ activated: activatedKnob === 'B',
29424
+ focused: focusedKnob === 'B',
29425
+ hovered: hoveredKnob === 'B',
29360
29426
  pressed: pressedKnob === 'B',
29361
29427
  value: this.valB,
29362
29428
  ratio: this.ratioB,
@@ -29369,6 +29435,8 @@ class Range {
29369
29435
  inheritedAttributes,
29370
29436
  onKnobFocus: this.onKnobFocus,
29371
29437
  onKnobBlur: this.onKnobBlur,
29438
+ onKnobMouseEnter: this.onKnobMouseEnter,
29439
+ onKnobMouseLeave: this.onKnobMouseLeave,
29372
29440
  })));
29373
29441
  }
29374
29442
  render() {
@@ -29387,6 +29455,12 @@ class Range {
29387
29455
  const hasEndContent = (hasLabel && labelPlacement === 'end') || this.hasEndSlotContent;
29388
29456
  const needsEndAdjustment = inItem && !hasEndContent;
29389
29457
  const mode = getIonMode$1(this);
29458
+ /**
29459
+ * Determine the name and position of the pressed knob to apply
29460
+ * Host classes for styling.
29461
+ */
29462
+ const pressedKnobName = dualKnobs ? pressedKnob === null || pressedKnob === void 0 ? void 0 : pressedKnob.toLowerCase() : undefined;
29463
+ const pressedKnobPosition = dualKnobs && pressedKnob ? getKnobPosition(pressedKnob, this.ratioA, this.ratioB, dualKnobs) : undefined;
29390
29464
  /**
29391
29465
  * Determine if any knob is at the min or max value to
29392
29466
  * apply Host classes for styling.
@@ -29394,21 +29468,24 @@ class Range {
29394
29468
  const valueAtMin = dualKnobs ? this.valA === min || this.valB === min : this.valA === min;
29395
29469
  const valueAtMax = dualKnobs ? this.valA === max || this.valB === max : this.valA === max;
29396
29470
  renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);
29397
- return (hAsync(Host, { key: 'ed646a42d51b8fe22012198c354cbcf5a389c108', onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: createColorClasses$1(this.color, {
29471
+ return (hAsync(Host, { key: '8e439db9836fdefdc779573082c788e3ddb3ef73', onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: createColorClasses$1(this.color, {
29398
29472
  [mode]: true,
29399
29473
  'in-item': inItem,
29400
29474
  'range-disabled': disabled,
29475
+ 'range-dual-knobs': dualKnobs,
29401
29476
  'range-pressed': pressedKnob !== undefined,
29477
+ [`range-pressed-${pressedKnobName}`]: pressedKnob !== undefined && pressedKnobName !== undefined,
29478
+ [`range-pressed-${pressedKnobPosition}`]: pressedKnob !== undefined && pressedKnobPosition !== undefined,
29402
29479
  'range-has-pin': pin,
29403
29480
  [`range-label-placement-${labelPlacement}`]: true,
29404
29481
  'range-item-start-adjustment': needsStartAdjustment,
29405
29482
  'range-item-end-adjustment': needsEndAdjustment,
29406
29483
  'range-value-min': valueAtMin,
29407
29484
  'range-value-max': valueAtMax,
29408
- }) }, hAsync("label", { key: '3083e4f2a624e3b268396acb4415f7c6ac44d851', class: "range-wrapper", id: "range-label" }, hAsync("div", { key: '47b92f94d2a0381dd7c5cd3dda54ed2942096715', class: {
29485
+ }) }, hAsync("label", { key: 'e14c56db4d1eef11a3a0639c4bbed368041fc3eb', class: "range-wrapper", id: "range-label" }, hAsync("div", { key: '16d125b0af19fdfa3663731657a7cca51a7ed442', class: {
29409
29486
  'label-text-wrapper': true,
29410
29487
  'label-text-wrapper-hidden': !hasLabel,
29411
- }, part: "label" }, label !== undefined ? hAsync("div", { class: "label-text" }, label) : hAsync("slot", { name: "label" })), hAsync("div", { key: '5341da8d19eb29091df680978a0e20cc8f2eec65', class: "native-wrapper" }, hAsync("slot", { key: '09f1437078032676695442d8c827a16faa7dffe2', name: "start" }), this.renderRangeSlider(), hAsync("slot", { key: '02b7781970ea4d44f10b5f4627a2ca36eca45f85', name: "end" })))));
29488
+ }, part: "label" }, label !== undefined ? hAsync("div", { class: "label-text" }, label) : hAsync("slot", { name: "label" })), hAsync("div", { key: '545cc52a3e675e9df328dab537a4e44b7f3c59f8', class: "native-wrapper" }, hAsync("slot", { key: 'ac54b45a21c9db231ebe11498d508d05864b56fb', name: "start" }), this.renderRangeSlider(), hAsync("slot", { key: '7182dba53df2ff878d572b30afda64b37082c82e', name: "end" })))));
29412
29489
  }
29413
29490
  get el() { return getElement(this); }
29414
29491
  static get watchers() { return {
@@ -29446,6 +29523,9 @@ class Range {
29446
29523
  "labelPlacement": [1, "label-placement"],
29447
29524
  "ratioA": [32],
29448
29525
  "ratioB": [32],
29526
+ "activatedKnob": [32],
29527
+ "focusedKnob": [32],
29528
+ "hoveredKnob": [32],
29449
29529
  "pressedKnob": [32]
29450
29530
  },
29451
29531
  "$listeners$": undefined,
@@ -29453,7 +29533,7 @@ class Range {
29453
29533
  "$attrsToReflect$": [["color", "color"]]
29454
29534
  }; }
29455
29535
  }
29456
- const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, }) => {
29536
+ const renderKnob = (rtl, { knob, position, dualKnobs, value, ratio, min, max, disabled, activated, focused, hovered, pressed, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, onKnobMouseEnter, onKnobMouseLeave, }) => {
29457
29537
  const start = rtl ? 'right' : 'left';
29458
29538
  const knobStyle = () => {
29459
29539
  const style = {};
@@ -29474,16 +29554,66 @@ const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin,
29474
29554
  ev.preventDefault();
29475
29555
  ev.stopPropagation();
29476
29556
  }
29477
- }, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur, class: {
29557
+ }, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur, onMouseEnter: () => onKnobMouseEnter(knob), onMouseLeave: onKnobMouseLeave, class: {
29478
29558
  'range-knob-handle': true,
29479
- 'range-knob-a': knob === 'A',
29480
- 'range-knob-b': knob === 'B',
29559
+ 'range-knob-handle-a': knob === 'A',
29560
+ 'range-knob-handle-b': knob === 'B',
29481
29561
  'range-knob-pressed': pressed,
29482
29562
  'range-knob-min': value === min,
29483
29563
  'range-knob-max': value === max,
29484
29564
  'ion-activatable': true,
29485
29565
  'ion-focusable': true,
29486
- }, 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: "pin" }, pinFormatter(value))), hAsync("div", { class: "range-knob", role: "presentation", part: "knob" })));
29566
+ 'ion-focused': focused,
29567
+ }, part: [
29568
+ 'knob-handle',
29569
+ dualKnobs && knob === 'A' && 'knob-handle-a',
29570
+ dualKnobs && knob === 'B' && 'knob-handle-b',
29571
+ dualKnobs && position === 'lower' && 'knob-handle-lower',
29572
+ dualKnobs && position === 'upper' && 'knob-handle-upper',
29573
+ pressed && 'pressed',
29574
+ focused && 'focused',
29575
+ hovered && 'hover',
29576
+ activated && 'activated',
29577
+ ]
29578
+ .filter(Boolean)
29579
+ .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: [
29580
+ 'pin',
29581
+ dualKnobs && knob === 'A' && 'pin-a',
29582
+ dualKnobs && knob === 'B' && 'pin-b',
29583
+ dualKnobs && position === 'lower' && 'pin-lower',
29584
+ dualKnobs && position === 'upper' && 'pin-upper',
29585
+ pressed && 'pressed',
29586
+ focused && 'focused',
29587
+ hovered && 'hover',
29588
+ activated && 'activated',
29589
+ ]
29590
+ .filter(Boolean)
29591
+ .join(' ') }, pinFormatter(value))), hAsync("div", { class: "range-knob", role: "presentation", part: [
29592
+ 'knob',
29593
+ dualKnobs && knob === 'A' && 'knob-a',
29594
+ dualKnobs && knob === 'B' && 'knob-b',
29595
+ dualKnobs && position === 'lower' && 'knob-lower',
29596
+ dualKnobs && position === 'upper' && 'knob-upper',
29597
+ pressed && 'pressed',
29598
+ focused && 'focused',
29599
+ hovered && 'hover',
29600
+ activated && 'activated',
29601
+ ]
29602
+ .filter(Boolean)
29603
+ .join(' ') })));
29604
+ };
29605
+ /**
29606
+ * Returns whether the given knob is at the lower or upper position based
29607
+ * on current ratios for the given knob.
29608
+ */
29609
+ const getKnobPosition = (knob, ratioA, ratioB, dualKnobs) => {
29610
+ if (dualKnobs) {
29611
+ if (knob === 'A') {
29612
+ return ratioA <= ratioB ? 'lower' : 'upper';
29613
+ }
29614
+ return ratioB <= ratioA ? 'lower' : 'upper';
29615
+ }
29616
+ return 'lower';
29487
29617
  };
29488
29618
  const ratioToValue = (ratio, min, max, step) => {
29489
29619
  let value = (max - min) * ratio;
@@ -33484,9 +33614,9 @@ class SegmentContent {
33484
33614
  }; }
33485
33615
  }
33486
33616
 
33487
- 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}";
33617
+ 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}";
33488
33618
 
33489
- 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}";
33619
+ 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}";
33490
33620
 
33491
33621
  class SegmentView {
33492
33622
  constructor(hostRef) {
@@ -33498,10 +33628,6 @@ class SegmentView {
33498
33628
  * If `true`, the segment view cannot be interacted with.
33499
33629
  */
33500
33630
  this.disabled = false;
33501
- /**
33502
- * If `true`, users will be able to swipe the segment view to navigate between segment contents.
33503
- */
33504
- this.swipeGesture = true;
33505
33631
  }
33506
33632
  handleScroll(ev) {
33507
33633
  var _a;
@@ -33589,12 +33715,11 @@ class SegmentView {
33589
33715
  return Array.from(this.el.querySelectorAll('ion-segment-content'));
33590
33716
  }
33591
33717
  render() {
33592
- const { disabled, isManualScroll, swipeGesture } = this;
33593
- return (hAsync(Host, { key: '565cccce7f0cfc4c71508777cc60292d6f24334f', class: {
33718
+ const { disabled, isManualScroll } = this;
33719
+ return (hAsync(Host, { key: 'e180b67bb3143a5f4611fb358c037be6fc782a8f', class: {
33594
33720
  'segment-view-disabled': disabled,
33595
33721
  'segment-view-scroll-disabled': isManualScroll === false,
33596
- 'segment-view-swipe-disabled': swipeGesture === false,
33597
- } }, hAsync("slot", { key: '4118c240364467302b8f593e33c37837ea5d06f0' })));
33722
+ } }, hAsync("slot", { key: '41c11d6a7406a10f5c64a2e73abfc072afd8fc73' })));
33598
33723
  }
33599
33724
  get el() { return getElement(this); }
33600
33725
  static get style() { return {
@@ -33606,7 +33731,6 @@ class SegmentView {
33606
33731
  "$tagName$": "ion-segment-view",
33607
33732
  "$members$": {
33608
33733
  "disabled": [4],
33609
- "swipeGesture": [4, "swipe-gesture"],
33610
33734
  "isManualScroll": [32],
33611
33735
  "setContent": [64]
33612
33736
  },