@ionic/core 8.7.17-dev.11771865171.14f4c2cf → 8.7.17-dev.11771870864.19b2cde1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ion-range.js +39 -152
- package/components/ion-segment-view.js +11 -5
- package/components/ion-select.js +3 -3
- package/components/ion-textarea.js +4 -4
- package/components/modal.js +206 -43
- package/dist/cjs/ion-modal.cjs.entry.js +206 -43
- package/dist/cjs/ion-range.cjs.entry.js +39 -149
- package/dist/cjs/ion-segment-view.cjs.entry.js +10 -5
- package/dist/cjs/ion-select_3.cjs.entry.js +3 -3
- package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/modal/gestures/sheet.js +108 -11
- package/dist/collection/components/modal/gestures/swipe-to-close.js +54 -1
- package/dist/collection/components/modal/modal.js +98 -31
- package/dist/collection/components/range/range.js +42 -172
- package/dist/collection/components/segment-view/segment-view.ios.css +2 -1
- package/dist/collection/components/segment-view/segment-view.js +28 -3
- package/dist/collection/components/segment-view/segment-view.md.css +2 -1
- package/dist/collection/components/select/select.js +6 -3
- package/dist/collection/components/textarea/textarea.js +4 -4
- package/dist/docs.json +120 -144
- package/dist/esm/ion-modal.entry.js +206 -43
- package/dist/esm/ion-range.entry.js +39 -149
- package/dist/esm/ion-segment-view.entry.js +10 -5
- package/dist/esm/ion-select_3.entry.js +3 -3
- package/dist/esm/ion-textarea.entry.js +2 -2
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/html.html-data.json +4 -0
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-012212e4.entry.js +4 -0
- package/dist/ionic/p-0f418a37.entry.js +4 -0
- package/dist/ionic/p-1838bed5.entry.js +4 -0
- package/dist/ionic/p-9a2d390d.entry.js +4 -0
- package/dist/ionic/{p-c19f63d0.entry.js → p-e1d1f3cc.entry.js} +1 -1
- package/dist/types/components/modal/gestures/sheet.d.ts +2 -2
- package/dist/types/components/modal/gestures/swipe-to-close.d.ts +2 -2
- package/dist/types/components/modal/modal-interface.d.ts +7 -0
- package/dist/types/components/modal/modal.d.ts +17 -1
- package/dist/types/components/range/range-interface.d.ts +0 -1
- package/dist/types/components/range/range.d.ts +4 -33
- package/dist/types/components/segment-view/segment-view.d.ts +4 -0
- package/dist/types/components/select/select.d.ts +3 -0
- package/dist/types/components.d.ts +27 -2
- package/hydrate/index.js +270 -228
- package/hydrate/index.mjs +270 -228
- package/package.json +1 -1
- package/dist/ionic/p-020af078.entry.js +0 -4
- package/dist/ionic/p-88367362.entry.js +0 -4
- package/dist/ionic/p-91840a80.entry.js +0 -4
- package/dist/ionic/p-991a3dd9.entry.js +0 -4
|
@@ -74,7 +74,6 @@ const Range = class {
|
|
|
74
74
|
this.inheritedAttributes = {};
|
|
75
75
|
this.contentEl = null;
|
|
76
76
|
this.initialContentScrollY = true;
|
|
77
|
-
this.focusFromPointer = false;
|
|
78
77
|
this.ratioA = 0;
|
|
79
78
|
this.ratioB = 0;
|
|
80
79
|
/**
|
|
@@ -184,29 +183,6 @@ const Range = class {
|
|
|
184
183
|
this.gesture.enable(!this.disabled);
|
|
185
184
|
}
|
|
186
185
|
};
|
|
187
|
-
/**
|
|
188
|
-
* Observes the knob handles for the ion-activated class and syncs
|
|
189
|
-
* activatedKnob so the activated part is correctly set on the handle,
|
|
190
|
-
* knob, and pin.
|
|
191
|
-
*/
|
|
192
|
-
this.setupActivatedObserver = () => {
|
|
193
|
-
const knobHandleA = this.el.shadowRoot.querySelector('.range-knob-handle-a');
|
|
194
|
-
const knobHandleB = this.el.shadowRoot.querySelector('.range-knob-handle-b');
|
|
195
|
-
const syncActivated = () => {
|
|
196
|
-
this.activatedKnob = (knobHandleA === null || knobHandleA === void 0 ? void 0 : knobHandleA.classList.contains('ion-activated'))
|
|
197
|
-
? 'A'
|
|
198
|
-
: (knobHandleB === null || knobHandleB === void 0 ? void 0 : knobHandleB.classList.contains('ion-activated'))
|
|
199
|
-
? 'B'
|
|
200
|
-
: undefined;
|
|
201
|
-
};
|
|
202
|
-
this.activatedObserver = new MutationObserver(syncActivated);
|
|
203
|
-
this.activatedObserver.observe(this.el.shadowRoot, {
|
|
204
|
-
attributes: true,
|
|
205
|
-
attributeFilter: ['class'],
|
|
206
|
-
subtree: true,
|
|
207
|
-
});
|
|
208
|
-
syncActivated();
|
|
209
|
-
};
|
|
210
186
|
this.handleKeyboard = (knob, isIncrease) => {
|
|
211
187
|
const { ensureValueInBounds } = this;
|
|
212
188
|
let step = this.step;
|
|
@@ -229,7 +205,6 @@ const Range = class {
|
|
|
229
205
|
this.onBlur = () => {
|
|
230
206
|
if (this.hasFocus) {
|
|
231
207
|
this.hasFocus = false;
|
|
232
|
-
this.focusedKnob = undefined;
|
|
233
208
|
this.ionBlur.emit();
|
|
234
209
|
}
|
|
235
210
|
};
|
|
@@ -240,20 +215,21 @@ const Range = class {
|
|
|
240
215
|
}
|
|
241
216
|
};
|
|
242
217
|
this.onKnobFocus = (knob) => {
|
|
243
|
-
// Clicking focuses the range which is needed for the keyboard,
|
|
244
|
-
// but we only want to add the ion-focused class when focused via Tab.
|
|
245
|
-
if (!this.focusFromPointer) {
|
|
246
|
-
this.focusedKnob = knob;
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
this.focusFromPointer = false;
|
|
250
|
-
this.focusedKnob = undefined;
|
|
251
|
-
}
|
|
252
|
-
// If the knob was not already focused, emit the focus event
|
|
253
218
|
if (!this.hasFocus) {
|
|
254
219
|
this.hasFocus = true;
|
|
255
220
|
this.ionFocus.emit();
|
|
256
221
|
}
|
|
222
|
+
// Manually manage ion-focused class for dual knobs
|
|
223
|
+
if (this.dualKnobs && this.el.shadowRoot) {
|
|
224
|
+
const knobA = this.el.shadowRoot.querySelector('.range-knob-a');
|
|
225
|
+
const knobB = this.el.shadowRoot.querySelector('.range-knob-b');
|
|
226
|
+
// Remove ion-focused from both knobs first
|
|
227
|
+
knobA === null || knobA === void 0 ? void 0 : knobA.classList.remove('ion-focused');
|
|
228
|
+
knobB === null || knobB === void 0 ? void 0 : knobB.classList.remove('ion-focused');
|
|
229
|
+
// Add ion-focused only to the focused knob
|
|
230
|
+
const focusedKnobEl = knob === 'A' ? knobA : knobB;
|
|
231
|
+
focusedKnobEl === null || focusedKnobEl === void 0 ? void 0 : focusedKnobEl.classList.add('ion-focused');
|
|
232
|
+
}
|
|
257
233
|
};
|
|
258
234
|
this.onKnobBlur = () => {
|
|
259
235
|
// Check if focus is moving to another knob within the same range
|
|
@@ -265,18 +241,18 @@ const Range = class {
|
|
|
265
241
|
if (!isStillFocusedOnKnob) {
|
|
266
242
|
if (this.hasFocus) {
|
|
267
243
|
this.hasFocus = false;
|
|
268
|
-
this.focusedKnob = undefined;
|
|
269
244
|
this.ionBlur.emit();
|
|
270
245
|
}
|
|
246
|
+
// Remove ion-focused from both knobs when focus leaves the range
|
|
247
|
+
if (this.dualKnobs && this.el.shadowRoot) {
|
|
248
|
+
const knobA = this.el.shadowRoot.querySelector('.range-knob-a');
|
|
249
|
+
const knobB = this.el.shadowRoot.querySelector('.range-knob-b');
|
|
250
|
+
knobA === null || knobA === void 0 ? void 0 : knobA.classList.remove('ion-focused');
|
|
251
|
+
knobB === null || knobB === void 0 ? void 0 : knobB.classList.remove('ion-focused');
|
|
252
|
+
}
|
|
271
253
|
}
|
|
272
254
|
}, 0);
|
|
273
255
|
};
|
|
274
|
-
this.onKnobMouseEnter = (knob) => {
|
|
275
|
-
this.hoveredKnob = knob;
|
|
276
|
-
};
|
|
277
|
-
this.onKnobMouseLeave = () => {
|
|
278
|
-
this.hoveredKnob = undefined;
|
|
279
|
-
};
|
|
280
256
|
}
|
|
281
257
|
debounceChanged() {
|
|
282
258
|
const { ionInput, debounce, originalIonInput } = this;
|
|
@@ -353,7 +329,6 @@ const Range = class {
|
|
|
353
329
|
this.originalIonInput = this.ionInput;
|
|
354
330
|
this.setupGesture();
|
|
355
331
|
this.updateRatio();
|
|
356
|
-
this.setupActivatedObserver();
|
|
357
332
|
this.didLoad = true;
|
|
358
333
|
}
|
|
359
334
|
connectedCallback() {
|
|
@@ -379,10 +354,6 @@ const Range = class {
|
|
|
379
354
|
this.gesture.destroy();
|
|
380
355
|
this.gesture = undefined;
|
|
381
356
|
}
|
|
382
|
-
if (this.activatedObserver) {
|
|
383
|
-
this.activatedObserver.disconnect();
|
|
384
|
-
this.activatedObserver = undefined;
|
|
385
|
-
}
|
|
386
357
|
}
|
|
387
358
|
getValue() {
|
|
388
359
|
var _a;
|
|
@@ -535,6 +506,7 @@ const Range = class {
|
|
|
535
506
|
ratio = 1 - ratio;
|
|
536
507
|
}
|
|
537
508
|
this.pressedKnob = !this.dualKnobs || Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio) ? 'A' : 'B';
|
|
509
|
+
this.setFocus(this.pressedKnob);
|
|
538
510
|
}
|
|
539
511
|
get valA() {
|
|
540
512
|
return ratioToValue(this.ratioA, this.min, this.max, this.step);
|
|
@@ -561,23 +533,9 @@ const Range = class {
|
|
|
561
533
|
updateRatio() {
|
|
562
534
|
const value = this.getValue();
|
|
563
535
|
const { min, max } = this;
|
|
564
|
-
/**
|
|
565
|
-
* For dual knobs, value gives lower/upper but not which is A vs B.
|
|
566
|
-
* Assign (lowerRatio, upperRatio) to (ratioA, ratioB) in the way that
|
|
567
|
-
* minimizes change from the current ratios so the knobs don't swap.
|
|
568
|
-
*/
|
|
569
536
|
if (this.dualKnobs) {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
if (Math.abs(this.ratioA - lowerRatio) + Math.abs(this.ratioB - upperRatio) <=
|
|
573
|
-
Math.abs(this.ratioA - upperRatio) + Math.abs(this.ratioB - lowerRatio)) {
|
|
574
|
-
this.ratioA = lowerRatio;
|
|
575
|
-
this.ratioB = upperRatio;
|
|
576
|
-
}
|
|
577
|
-
else {
|
|
578
|
-
this.ratioA = upperRatio;
|
|
579
|
-
this.ratioB = lowerRatio;
|
|
580
|
-
}
|
|
537
|
+
this.ratioA = valueToRatio(value.lower, min, max);
|
|
538
|
+
this.ratioB = valueToRatio(value.upper, min, max);
|
|
581
539
|
}
|
|
582
540
|
else {
|
|
583
541
|
this.ratioA = valueToRatio(value, min, max);
|
|
@@ -594,6 +552,14 @@ const Range = class {
|
|
|
594
552
|
};
|
|
595
553
|
this.noUpdate = false;
|
|
596
554
|
}
|
|
555
|
+
setFocus(knob) {
|
|
556
|
+
if (this.el.shadowRoot) {
|
|
557
|
+
const knobEl = this.el.shadowRoot.querySelector(knob === 'A' ? '.range-knob-a' : '.range-knob-b');
|
|
558
|
+
if (knobEl) {
|
|
559
|
+
knobEl.focus();
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
597
563
|
/**
|
|
598
564
|
* Returns true if content was passed to the "start" slot
|
|
599
565
|
*/
|
|
@@ -611,7 +577,7 @@ const Range = class {
|
|
|
611
577
|
}
|
|
612
578
|
renderRangeSlider() {
|
|
613
579
|
var _a;
|
|
614
|
-
const { min, max, step, handleKeyboard,
|
|
580
|
+
const { min, max, step, handleKeyboard, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
|
|
615
581
|
let barStart = `${ratioLower * 100}%`;
|
|
616
582
|
let barEnd = `${100 - ratioUpper * 100}%`;
|
|
617
583
|
const rtl = isRTL(this.el);
|
|
@@ -671,9 +637,7 @@ const Range = class {
|
|
|
671
637
|
ticks.push(tick);
|
|
672
638
|
}
|
|
673
639
|
}
|
|
674
|
-
return (h("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl),
|
|
675
|
-
this.focusFromPointer = true;
|
|
676
|
-
},
|
|
640
|
+
return (h("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl),
|
|
677
641
|
/**
|
|
678
642
|
* Since the gesture has a threshold, the value
|
|
679
643
|
* won't change until the user has dragged past
|
|
@@ -686,7 +650,6 @@ const Range = class {
|
|
|
686
650
|
* we need to listen for the "pointerUp" event.
|
|
687
651
|
*/
|
|
688
652
|
onPointerUp: (ev) => {
|
|
689
|
-
this.focusFromPointer = false;
|
|
690
653
|
/**
|
|
691
654
|
* If the user drags the knob on the web
|
|
692
655
|
* version (does not occur on mobile),
|
|
@@ -712,11 +675,6 @@ const Range = class {
|
|
|
712
675
|
'has-ticks': ticks.length > 0,
|
|
713
676
|
}, role: "presentation", style: barStyle, part: "bar-active" })), renderKnob(rtl, {
|
|
714
677
|
knob: 'A',
|
|
715
|
-
position: getKnobPosition('A', this.ratioA, this.ratioB, this.dualKnobs),
|
|
716
|
-
dualKnobs: this.dualKnobs,
|
|
717
|
-
activated: activatedKnob === 'A',
|
|
718
|
-
focused: focusedKnob === 'A',
|
|
719
|
-
hovered: hoveredKnob === 'A',
|
|
720
678
|
pressed: pressedKnob === 'A',
|
|
721
679
|
value: this.valA,
|
|
722
680
|
ratio: this.ratioA,
|
|
@@ -729,16 +687,9 @@ const Range = class {
|
|
|
729
687
|
inheritedAttributes,
|
|
730
688
|
onKnobFocus: this.onKnobFocus,
|
|
731
689
|
onKnobBlur: this.onKnobBlur,
|
|
732
|
-
onKnobMouseEnter: this.onKnobMouseEnter,
|
|
733
|
-
onKnobMouseLeave: this.onKnobMouseLeave,
|
|
734
690
|
}), this.dualKnobs &&
|
|
735
691
|
renderKnob(rtl, {
|
|
736
692
|
knob: 'B',
|
|
737
|
-
position: getKnobPosition('B', this.ratioA, this.ratioB, this.dualKnobs),
|
|
738
|
-
dualKnobs: this.dualKnobs,
|
|
739
|
-
activated: activatedKnob === 'B',
|
|
740
|
-
focused: focusedKnob === 'B',
|
|
741
|
-
hovered: hoveredKnob === 'B',
|
|
742
693
|
pressed: pressedKnob === 'B',
|
|
743
694
|
value: this.valB,
|
|
744
695
|
ratio: this.ratioB,
|
|
@@ -751,8 +702,6 @@ const Range = class {
|
|
|
751
702
|
inheritedAttributes,
|
|
752
703
|
onKnobFocus: this.onKnobFocus,
|
|
753
704
|
onKnobBlur: this.onKnobBlur,
|
|
754
|
-
onKnobMouseEnter: this.onKnobMouseEnter,
|
|
755
|
-
onKnobMouseLeave: this.onKnobMouseLeave,
|
|
756
705
|
})));
|
|
757
706
|
}
|
|
758
707
|
render() {
|
|
@@ -771,12 +720,6 @@ const Range = class {
|
|
|
771
720
|
const hasEndContent = (hasLabel && labelPlacement === 'end') || this.hasEndSlotContent;
|
|
772
721
|
const needsEndAdjustment = inItem && !hasEndContent;
|
|
773
722
|
const mode = getIonMode(this);
|
|
774
|
-
/**
|
|
775
|
-
* Determine the name and position of the pressed knob to apply
|
|
776
|
-
* Host classes for styling.
|
|
777
|
-
*/
|
|
778
|
-
const pressedKnobName = dualKnobs ? pressedKnob === null || pressedKnob === void 0 ? void 0 : pressedKnob.toLowerCase() : undefined;
|
|
779
|
-
const pressedKnobPosition = dualKnobs && pressedKnob ? getKnobPosition(pressedKnob, this.ratioA, this.ratioB, dualKnobs) : undefined;
|
|
780
723
|
/**
|
|
781
724
|
* Determine if any knob is at the min or max value to
|
|
782
725
|
* apply Host classes for styling.
|
|
@@ -784,24 +727,21 @@ const Range = class {
|
|
|
784
727
|
const valueAtMin = dualKnobs ? this.valA === min || this.valB === min : this.valA === min;
|
|
785
728
|
const valueAtMax = dualKnobs ? this.valA === max || this.valB === max : this.valA === max;
|
|
786
729
|
renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);
|
|
787
|
-
return (h(Host, { key: '
|
|
730
|
+
return (h(Host, { key: 'ed646a42d51b8fe22012198c354cbcf5a389c108', onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: createColorClasses(this.color, {
|
|
788
731
|
[mode]: true,
|
|
789
732
|
'in-item': inItem,
|
|
790
733
|
'range-disabled': disabled,
|
|
791
|
-
'range-dual-knobs': dualKnobs,
|
|
792
734
|
'range-pressed': pressedKnob !== undefined,
|
|
793
|
-
[`range-pressed-${pressedKnobName}`]: pressedKnob !== undefined && pressedKnobName !== undefined,
|
|
794
|
-
[`range-pressed-${pressedKnobPosition}`]: pressedKnob !== undefined && pressedKnobPosition !== undefined,
|
|
795
735
|
'range-has-pin': pin,
|
|
796
736
|
[`range-label-placement-${labelPlacement}`]: true,
|
|
797
737
|
'range-item-start-adjustment': needsStartAdjustment,
|
|
798
738
|
'range-item-end-adjustment': needsEndAdjustment,
|
|
799
739
|
'range-value-min': valueAtMin,
|
|
800
740
|
'range-value-max': valueAtMax,
|
|
801
|
-
}) }, h("label", { key: '
|
|
741
|
+
}) }, h("label", { key: '3083e4f2a624e3b268396acb4415f7c6ac44d851', class: "range-wrapper", id: "range-label" }, h("div", { key: '47b92f94d2a0381dd7c5cd3dda54ed2942096715', class: {
|
|
802
742
|
'label-text-wrapper': true,
|
|
803
743
|
'label-text-wrapper-hidden': !hasLabel,
|
|
804
|
-
}, part: "label" }, label !== undefined ? h("div", { class: "label-text" }, label) : h("slot", { name: "label" })), h("div", { key: '
|
|
744
|
+
}, part: "label" }, label !== undefined ? h("div", { class: "label-text" }, label) : h("slot", { name: "label" })), h("div", { key: '5341da8d19eb29091df680978a0e20cc8f2eec65', class: "native-wrapper" }, h("slot", { key: '09f1437078032676695442d8c827a16faa7dffe2', name: "start" }), this.renderRangeSlider(), h("slot", { key: '02b7781970ea4d44f10b5f4627a2ca36eca45f85', name: "end" })))));
|
|
805
745
|
}
|
|
806
746
|
get el() { return getElement(this); }
|
|
807
747
|
static get watchers() { return {
|
|
@@ -814,7 +754,7 @@ const Range = class {
|
|
|
814
754
|
"value": ["valueChanged"]
|
|
815
755
|
}; }
|
|
816
756
|
};
|
|
817
|
-
const renderKnob = (rtl, { knob,
|
|
757
|
+
const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, }) => {
|
|
818
758
|
const start = rtl ? 'right' : 'left';
|
|
819
759
|
const knobStyle = () => {
|
|
820
760
|
const style = {};
|
|
@@ -835,66 +775,16 @@ const renderKnob = (rtl, { knob, position, dualKnobs, value, ratio, min, max, di
|
|
|
835
775
|
ev.preventDefault();
|
|
836
776
|
ev.stopPropagation();
|
|
837
777
|
}
|
|
838
|
-
}, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur,
|
|
778
|
+
}, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur, class: {
|
|
839
779
|
'range-knob-handle': true,
|
|
840
|
-
'range-knob-
|
|
841
|
-
'range-knob-
|
|
780
|
+
'range-knob-a': knob === 'A',
|
|
781
|
+
'range-knob-b': knob === 'B',
|
|
842
782
|
'range-knob-pressed': pressed,
|
|
843
783
|
'range-knob-min': value === min,
|
|
844
784
|
'range-knob-max': value === max,
|
|
845
785
|
'ion-activatable': true,
|
|
846
786
|
'ion-focusable': true,
|
|
847
|
-
|
|
848
|
-
}, part: [
|
|
849
|
-
'knob-handle',
|
|
850
|
-
dualKnobs && knob === 'A' && 'knob-handle-a',
|
|
851
|
-
dualKnobs && knob === 'B' && 'knob-handle-b',
|
|
852
|
-
dualKnobs && position === 'lower' && 'knob-handle-lower',
|
|
853
|
-
dualKnobs && position === 'upper' && 'knob-handle-upper',
|
|
854
|
-
pressed && 'pressed',
|
|
855
|
-
focused && 'focused',
|
|
856
|
-
hovered && 'hover',
|
|
857
|
-
activated && 'activated',
|
|
858
|
-
]
|
|
859
|
-
.filter(Boolean)
|
|
860
|
-
.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 && (h("div", { class: "range-pin", role: "presentation", part: [
|
|
861
|
-
'pin',
|
|
862
|
-
dualKnobs && knob === 'A' && 'pin-a',
|
|
863
|
-
dualKnobs && knob === 'B' && 'pin-b',
|
|
864
|
-
dualKnobs && position === 'lower' && 'pin-lower',
|
|
865
|
-
dualKnobs && position === 'upper' && 'pin-upper',
|
|
866
|
-
pressed && 'pressed',
|
|
867
|
-
focused && 'focused',
|
|
868
|
-
hovered && 'hover',
|
|
869
|
-
activated && 'activated',
|
|
870
|
-
]
|
|
871
|
-
.filter(Boolean)
|
|
872
|
-
.join(' ') }, pinFormatter(value))), h("div", { class: "range-knob", role: "presentation", part: [
|
|
873
|
-
'knob',
|
|
874
|
-
dualKnobs && knob === 'A' && 'knob-a',
|
|
875
|
-
dualKnobs && knob === 'B' && 'knob-b',
|
|
876
|
-
dualKnobs && position === 'lower' && 'knob-lower',
|
|
877
|
-
dualKnobs && position === 'upper' && 'knob-upper',
|
|
878
|
-
pressed && 'pressed',
|
|
879
|
-
focused && 'focused',
|
|
880
|
-
hovered && 'hover',
|
|
881
|
-
activated && 'activated',
|
|
882
|
-
]
|
|
883
|
-
.filter(Boolean)
|
|
884
|
-
.join(' ') })));
|
|
885
|
-
};
|
|
886
|
-
/**
|
|
887
|
-
* Returns whether the given knob is at the lower or upper position based
|
|
888
|
-
* on current ratios for the given knob.
|
|
889
|
-
*/
|
|
890
|
-
const getKnobPosition = (knob, ratioA, ratioB, dualKnobs) => {
|
|
891
|
-
if (dualKnobs) {
|
|
892
|
-
if (knob === 'A') {
|
|
893
|
-
return ratioA <= ratioB ? 'lower' : 'upper';
|
|
894
|
-
}
|
|
895
|
-
return ratioB <= ratioA ? 'lower' : 'upper';
|
|
896
|
-
}
|
|
897
|
-
return 'lower';
|
|
787
|
+
}, 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 && (h("div", { class: "range-pin", role: "presentation", part: "pin" }, pinFormatter(value))), h("div", { class: "range-knob", role: "presentation", part: "knob" })));
|
|
898
788
|
};
|
|
899
789
|
const ratioToValue = (ratio, min, max, step) => {
|
|
900
790
|
let value = (max - min) * ratio;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, d as Host, g as getElement } from './index-C8IsBmNU.js';
|
|
5
5
|
import { i as isRTL } from './dir-C53feagD.js';
|
|
6
6
|
|
|
7
|
-
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}";
|
|
7
|
+
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}";
|
|
8
8
|
|
|
9
|
-
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}";
|
|
9
|
+
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}";
|
|
10
10
|
|
|
11
11
|
const SegmentView = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -18,6 +18,10 @@ const SegmentView = class {
|
|
|
18
18
|
* If `true`, the segment view cannot be interacted with.
|
|
19
19
|
*/
|
|
20
20
|
this.disabled = false;
|
|
21
|
+
/**
|
|
22
|
+
* If `true`, users will be able to swipe the segment view to navigate between segment contents.
|
|
23
|
+
*/
|
|
24
|
+
this.swipeGesture = true;
|
|
21
25
|
}
|
|
22
26
|
handleScroll(ev) {
|
|
23
27
|
var _a;
|
|
@@ -105,11 +109,12 @@ const SegmentView = class {
|
|
|
105
109
|
return Array.from(this.el.querySelectorAll('ion-segment-content'));
|
|
106
110
|
}
|
|
107
111
|
render() {
|
|
108
|
-
const { disabled, isManualScroll } = this;
|
|
109
|
-
return (h(Host, { key: '
|
|
112
|
+
const { disabled, isManualScroll, swipeGesture } = this;
|
|
113
|
+
return (h(Host, { key: '565cccce7f0cfc4c71508777cc60292d6f24334f', class: {
|
|
110
114
|
'segment-view-disabled': disabled,
|
|
111
115
|
'segment-view-scroll-disabled': isManualScroll === false,
|
|
112
|
-
|
|
116
|
+
'segment-view-swipe-disabled': swipeGesture === false,
|
|
117
|
+
} }, h("slot", { key: '4118c240364467302b8f593e33c37837ea5d06f0' })));
|
|
113
118
|
}
|
|
114
119
|
get el() { return getElement(this); }
|
|
115
120
|
};
|
|
@@ -757,7 +757,7 @@ const Select = class {
|
|
|
757
757
|
if (!hasHintText) {
|
|
758
758
|
return;
|
|
759
759
|
}
|
|
760
|
-
return h("div", { class: "select-bottom" }, this.renderHintText());
|
|
760
|
+
return (h("div", { class: "select-bottom", part: "bottom" }, this.renderHintText()));
|
|
761
761
|
}
|
|
762
762
|
render() {
|
|
763
763
|
const { disabled, el, isExpanded, expandedIcon, labelPlacement, justify, placeholder, fill, shape, name, value, hasFocus, } = this;
|
|
@@ -788,7 +788,7 @@ const Select = class {
|
|
|
788
788
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
789
789
|
*/
|
|
790
790
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
791
|
-
return (h(Host, { key: '
|
|
791
|
+
return (h(Host, { key: 'ada627c442ebcdd4a4ee96e5f5f3ec0e2181d689', onClick: this.onClick, class: createColorClasses(this.color, {
|
|
792
792
|
[mode]: true,
|
|
793
793
|
'in-item': inItem,
|
|
794
794
|
'in-item-color': hostContext('ion-item.ion-color', el),
|
|
@@ -806,7 +806,7 @@ const Select = class {
|
|
|
806
806
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
807
807
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
808
808
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
809
|
-
}) }, h("label", { key: '
|
|
809
|
+
}) }, h("label", { key: 'd1c4663e740cfdcd28f90a5e0297d05cf42cc4df', class: "select-wrapper", id: "select-label", onClick: this.onLabelClick, part: "wrapper" }, this.renderLabelContainer(), h("div", { key: 'cd671e0b543378e7b822ce649a7b4006094b111f', class: "select-wrapper-inner", part: "inner" }, h("slot", { key: '48e7df0c517a382195736273019b855e422a82ed', name: "start" }), h("div", { key: '822747ffb9101cb1d3ff947da55bc2e8e1f2c8e2', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), h("slot", { key: '349200d9f9ebf25e0b8708ac8683a76e7c6ed33c', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && h("div", { key: '7eefb70d431cb9c01cc408d35349f7a3d0f2af35', class: "select-highlight" })), this.renderBottomContent()));
|
|
810
810
|
}
|
|
811
811
|
get el() { return getElement(this); }
|
|
812
812
|
static get watchers() { return {
|
|
@@ -475,7 +475,7 @@ const Textarea = class {
|
|
|
475
475
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
476
476
|
*/
|
|
477
477
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
478
|
-
return (h(Host, { key: '
|
|
478
|
+
return (h(Host, { key: '543076e7ed730451b490a9008cabe8f4a5d1f347', class: createColorClasses(this.color, {
|
|
479
479
|
[mode]: true,
|
|
480
480
|
'has-value': hasValue,
|
|
481
481
|
'has-focus': hasFocus,
|
|
@@ -484,7 +484,7 @@ const Textarea = class {
|
|
|
484
484
|
[`textarea-shape-${shape}`]: shape !== undefined,
|
|
485
485
|
[`textarea-label-placement-${labelPlacement}`]: true,
|
|
486
486
|
'textarea-disabled': disabled,
|
|
487
|
-
}) }, h("label", { key: '
|
|
487
|
+
}) }, h("label", { key: '3aebaa02edde10e19b2bbe2fbcc10f70b4faccff', class: "textarea-wrapper", htmlFor: inputId, onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: '73c1c7fee0ffffe65296060dd4110003d3975c44', class: "textarea-wrapper-inner" }, h("div", { key: '5a245b822afae0b9858ef0d176a2fe06983954e2', class: "start-slot-wrapper" }, h("slot", { key: '684305a1b558f93af6eb99825981ced1c09c7a8c', name: "start" })), h("div", { key: 'f2f723b674cff48cf76656450ff6c1362514ea90', class: "native-wrapper", ref: (el) => (this.textareaWrapper = el) }, h("textarea", Object.assign({ key: 'ae826e876a4b476502498b9c64ea020010c55db3', class: "native-textarea", ref: (el) => (this.nativeInput = el), id: inputId, disabled: disabled, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, minLength: this.minlength, maxLength: this.maxlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onChange: this.onChange, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown, "aria-describedby": this.getHintTextID(), "aria-invalid": this.isInvalid ? 'true' : undefined }, this.inheritedAttributes), value)), h("div", { key: '018cbf061fb53aa1d1caf6173fd08348cbe3413a', class: "end-slot-wrapper" }, h("slot", { key: 'c383636f2d8a548e48848d0967f71ee1969b1411', name: "end" }))), shouldRenderHighlight && h("div", { key: '6522d2058f9842abad9e7223b542cb7e1af40477', class: "textarea-highlight" })), this.renderBottomContent()));
|
|
488
488
|
}
|
|
489
489
|
get el() { return getElement(this); }
|
|
490
490
|
static get watchers() { return {
|