@ionic/core 8.7.17-dev.11770147425.1bfcd5e5 → 8.7.17-dev.11770405784.157a3c10
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 -97
- package/components/ion-segment-view.js +11 -5
- package/components/ion-select.js +3 -2
- package/components/select-modal.js +6 -1
- package/dist/cjs/ion-range.cjs.entry.js +39 -95
- package/dist/cjs/ion-segment-view.cjs.entry.js +10 -5
- package/dist/cjs/ion-select-modal.cjs.entry.js +5 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +3 -2
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/range/range.js +42 -116
- 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 +3 -2
- package/dist/collection/components/select-modal/select-modal.js +25 -1
- package/dist/docs.json +64 -134
- package/dist/esm/ion-range.entry.js +39 -95
- package/dist/esm/ion-segment-view.entry.js +10 -5
- package/dist/esm/ion-select-modal.entry.js +5 -1
- package/dist/esm/ion-select_3.entry.js +3 -2
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/html.html-data.json +8 -0
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-012212e4.entry.js +4 -0
- package/dist/ionic/p-88367362.entry.js +4 -0
- package/dist/ionic/p-9a2d390d.entry.js +4 -0
- package/dist/ionic/p-d2489bf2.entry.js +4 -0
- package/dist/types/components/range/range-interface.d.ts +0 -1
- package/dist/types/components/range/range.d.ts +4 -24
- package/dist/types/components/segment-view/segment-view.d.ts +4 -0
- package/dist/types/components/select-modal/select-modal.d.ts +4 -0
- package/dist/types/components.d.ts +20 -0
- package/hydrate/index.js +62 -124
- package/hydrate/index.mjs +62 -124
- package/package.json +1 -1
- package/dist/ionic/p-020af078.entry.js +0 -4
- package/dist/ionic/p-02d76786.entry.js +0 -4
- package/dist/ionic/p-b0c2f1f1.entry.js +0 -4
- package/dist/ionic/p-eb024a5b.entry.js +0 -4
package/components/ion-range.js
CHANGED
|
@@ -79,7 +79,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
79
79
|
this.inheritedAttributes = {};
|
|
80
80
|
this.contentEl = null;
|
|
81
81
|
this.initialContentScrollY = true;
|
|
82
|
-
this.focusFromPointer = false;
|
|
83
82
|
this.ratioA = 0;
|
|
84
83
|
this.ratioB = 0;
|
|
85
84
|
/**
|
|
@@ -211,7 +210,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
211
210
|
this.onBlur = () => {
|
|
212
211
|
if (this.hasFocus) {
|
|
213
212
|
this.hasFocus = false;
|
|
214
|
-
this.focusedKnob = undefined;
|
|
215
213
|
this.ionBlur.emit();
|
|
216
214
|
}
|
|
217
215
|
};
|
|
@@ -222,20 +220,21 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
222
220
|
}
|
|
223
221
|
};
|
|
224
222
|
this.onKnobFocus = (knob) => {
|
|
225
|
-
// Clicking focuses the range which is needed for the keyboard,
|
|
226
|
-
// but we only want to add the ion-focused class when focused via Tab.
|
|
227
|
-
if (!this.focusFromPointer) {
|
|
228
|
-
this.focusedKnob = knob;
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
this.focusFromPointer = false;
|
|
232
|
-
this.focusedKnob = undefined;
|
|
233
|
-
}
|
|
234
|
-
// If the knob was not already focused, emit the focus event
|
|
235
223
|
if (!this.hasFocus) {
|
|
236
224
|
this.hasFocus = true;
|
|
237
225
|
this.ionFocus.emit();
|
|
238
226
|
}
|
|
227
|
+
// Manually manage ion-focused class for dual knobs
|
|
228
|
+
if (this.dualKnobs && this.el.shadowRoot) {
|
|
229
|
+
const knobA = this.el.shadowRoot.querySelector('.range-knob-a');
|
|
230
|
+
const knobB = this.el.shadowRoot.querySelector('.range-knob-b');
|
|
231
|
+
// Remove ion-focused from both knobs first
|
|
232
|
+
knobA === null || knobA === void 0 ? void 0 : knobA.classList.remove('ion-focused');
|
|
233
|
+
knobB === null || knobB === void 0 ? void 0 : knobB.classList.remove('ion-focused');
|
|
234
|
+
// Add ion-focused only to the focused knob
|
|
235
|
+
const focusedKnobEl = knob === 'A' ? knobA : knobB;
|
|
236
|
+
focusedKnobEl === null || focusedKnobEl === void 0 ? void 0 : focusedKnobEl.classList.add('ion-focused');
|
|
237
|
+
}
|
|
239
238
|
};
|
|
240
239
|
this.onKnobBlur = () => {
|
|
241
240
|
// Check if focus is moving to another knob within the same range
|
|
@@ -247,18 +246,18 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
247
246
|
if (!isStillFocusedOnKnob) {
|
|
248
247
|
if (this.hasFocus) {
|
|
249
248
|
this.hasFocus = false;
|
|
250
|
-
this.focusedKnob = undefined;
|
|
251
249
|
this.ionBlur.emit();
|
|
252
250
|
}
|
|
251
|
+
// Remove ion-focused from both knobs when focus leaves the range
|
|
252
|
+
if (this.dualKnobs && this.el.shadowRoot) {
|
|
253
|
+
const knobA = this.el.shadowRoot.querySelector('.range-knob-a');
|
|
254
|
+
const knobB = this.el.shadowRoot.querySelector('.range-knob-b');
|
|
255
|
+
knobA === null || knobA === void 0 ? void 0 : knobA.classList.remove('ion-focused');
|
|
256
|
+
knobB === null || knobB === void 0 ? void 0 : knobB.classList.remove('ion-focused');
|
|
257
|
+
}
|
|
253
258
|
}
|
|
254
259
|
}, 0);
|
|
255
260
|
};
|
|
256
|
-
this.onKnobMouseEnter = (knob) => {
|
|
257
|
-
this.hoveredKnob = knob;
|
|
258
|
-
};
|
|
259
|
-
this.onKnobMouseLeave = () => {
|
|
260
|
-
this.hoveredKnob = undefined;
|
|
261
|
-
};
|
|
262
261
|
}
|
|
263
262
|
debounceChanged() {
|
|
264
263
|
const { ionInput, debounce, originalIonInput } = this;
|
|
@@ -512,6 +511,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
512
511
|
ratio = 1 - ratio;
|
|
513
512
|
}
|
|
514
513
|
this.pressedKnob = !this.dualKnobs || Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio) ? 'A' : 'B';
|
|
514
|
+
this.setFocus(this.pressedKnob);
|
|
515
515
|
}
|
|
516
516
|
get valA() {
|
|
517
517
|
return ratioToValue(this.ratioA, this.min, this.max, this.step);
|
|
@@ -538,23 +538,9 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
538
538
|
updateRatio() {
|
|
539
539
|
const value = this.getValue();
|
|
540
540
|
const { min, max } = this;
|
|
541
|
-
/**
|
|
542
|
-
* For dual knobs, value gives lower/upper but not which is A vs B.
|
|
543
|
-
* Assign (lowerRatio, upperRatio) to (ratioA, ratioB) in the way that
|
|
544
|
-
* minimizes change from the current ratios so the knobs don't swap.
|
|
545
|
-
*/
|
|
546
541
|
if (this.dualKnobs) {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
if (Math.abs(this.ratioA - lowerRatio) + Math.abs(this.ratioB - upperRatio) <=
|
|
550
|
-
Math.abs(this.ratioA - upperRatio) + Math.abs(this.ratioB - lowerRatio)) {
|
|
551
|
-
this.ratioA = lowerRatio;
|
|
552
|
-
this.ratioB = upperRatio;
|
|
553
|
-
}
|
|
554
|
-
else {
|
|
555
|
-
this.ratioA = upperRatio;
|
|
556
|
-
this.ratioB = lowerRatio;
|
|
557
|
-
}
|
|
542
|
+
this.ratioA = valueToRatio(value.lower, min, max);
|
|
543
|
+
this.ratioB = valueToRatio(value.upper, min, max);
|
|
558
544
|
}
|
|
559
545
|
else {
|
|
560
546
|
this.ratioA = valueToRatio(value, min, max);
|
|
@@ -571,6 +557,14 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
571
557
|
};
|
|
572
558
|
this.noUpdate = false;
|
|
573
559
|
}
|
|
560
|
+
setFocus(knob) {
|
|
561
|
+
if (this.el.shadowRoot) {
|
|
562
|
+
const knobEl = this.el.shadowRoot.querySelector(knob === 'A' ? '.range-knob-a' : '.range-knob-b');
|
|
563
|
+
if (knobEl) {
|
|
564
|
+
knobEl.focus();
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
}
|
|
574
568
|
/**
|
|
575
569
|
* Returns true if content was passed to the "start" slot
|
|
576
570
|
*/
|
|
@@ -588,7 +582,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
588
582
|
}
|
|
589
583
|
renderRangeSlider() {
|
|
590
584
|
var _a;
|
|
591
|
-
const { min, max, step, handleKeyboard,
|
|
585
|
+
const { min, max, step, handleKeyboard, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
|
|
592
586
|
let barStart = `${ratioLower * 100}%`;
|
|
593
587
|
let barEnd = `${100 - ratioUpper * 100}%`;
|
|
594
588
|
const rtl = isRTL(this.el);
|
|
@@ -648,9 +642,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
648
642
|
ticks.push(tick);
|
|
649
643
|
}
|
|
650
644
|
}
|
|
651
|
-
return (h("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl),
|
|
652
|
-
this.focusFromPointer = true;
|
|
653
|
-
},
|
|
645
|
+
return (h("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl),
|
|
654
646
|
/**
|
|
655
647
|
* Since the gesture has a threshold, the value
|
|
656
648
|
* won't change until the user has dragged past
|
|
@@ -663,7 +655,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
663
655
|
* we need to listen for the "pointerUp" event.
|
|
664
656
|
*/
|
|
665
657
|
onPointerUp: (ev) => {
|
|
666
|
-
this.focusFromPointer = false;
|
|
667
658
|
/**
|
|
668
659
|
* If the user drags the knob on the web
|
|
669
660
|
* version (does not occur on mobile),
|
|
@@ -689,10 +680,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
689
680
|
'has-ticks': ticks.length > 0,
|
|
690
681
|
}, role: "presentation", style: barStyle, part: "bar-active" })), renderKnob(rtl, {
|
|
691
682
|
knob: 'A',
|
|
692
|
-
position: this.dualKnobs ? (this.ratioA <= this.ratioB ? 'lower' : 'upper') : 'lower',
|
|
693
|
-
dualKnobs: this.dualKnobs,
|
|
694
|
-
focused: focusedKnob === 'A',
|
|
695
|
-
hovered: hoveredKnob === 'A',
|
|
696
683
|
pressed: pressedKnob === 'A',
|
|
697
684
|
value: this.valA,
|
|
698
685
|
ratio: this.ratioA,
|
|
@@ -705,15 +692,9 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
705
692
|
inheritedAttributes,
|
|
706
693
|
onKnobFocus: this.onKnobFocus,
|
|
707
694
|
onKnobBlur: this.onKnobBlur,
|
|
708
|
-
onKnobMouseEnter: this.onKnobMouseEnter,
|
|
709
|
-
onKnobMouseLeave: this.onKnobMouseLeave,
|
|
710
695
|
}), this.dualKnobs &&
|
|
711
696
|
renderKnob(rtl, {
|
|
712
697
|
knob: 'B',
|
|
713
|
-
position: this.ratioB <= this.ratioA ? 'lower' : 'upper',
|
|
714
|
-
dualKnobs: this.dualKnobs,
|
|
715
|
-
focused: focusedKnob === 'B',
|
|
716
|
-
hovered: hoveredKnob === 'B',
|
|
717
698
|
pressed: pressedKnob === 'B',
|
|
718
699
|
value: this.valB,
|
|
719
700
|
ratio: this.ratioB,
|
|
@@ -726,8 +707,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
726
707
|
inheritedAttributes,
|
|
727
708
|
onKnobFocus: this.onKnobFocus,
|
|
728
709
|
onKnobBlur: this.onKnobBlur,
|
|
729
|
-
onKnobMouseEnter: this.onKnobMouseEnter,
|
|
730
|
-
onKnobMouseLeave: this.onKnobMouseLeave,
|
|
731
710
|
})));
|
|
732
711
|
}
|
|
733
712
|
render() {
|
|
@@ -753,11 +732,10 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
753
732
|
const valueAtMin = dualKnobs ? this.valA === min || this.valB === min : this.valA === min;
|
|
754
733
|
const valueAtMax = dualKnobs ? this.valA === max || this.valB === max : this.valA === max;
|
|
755
734
|
renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);
|
|
756
|
-
return (h(Host, { key: '
|
|
735
|
+
return (h(Host, { key: 'ed646a42d51b8fe22012198c354cbcf5a389c108', onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: createColorClasses(this.color, {
|
|
757
736
|
[mode]: true,
|
|
758
737
|
'in-item': inItem,
|
|
759
738
|
'range-disabled': disabled,
|
|
760
|
-
'range-dual-knobs': dualKnobs,
|
|
761
739
|
'range-pressed': pressedKnob !== undefined,
|
|
762
740
|
'range-has-pin': pin,
|
|
763
741
|
[`range-label-placement-${labelPlacement}`]: true,
|
|
@@ -765,10 +743,10 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
765
743
|
'range-item-end-adjustment': needsEndAdjustment,
|
|
766
744
|
'range-value-min': valueAtMin,
|
|
767
745
|
'range-value-max': valueAtMax,
|
|
768
|
-
}) }, h("label", { key: '
|
|
746
|
+
}) }, h("label", { key: '3083e4f2a624e3b268396acb4415f7c6ac44d851', class: "range-wrapper", id: "range-label" }, h("div", { key: '47b92f94d2a0381dd7c5cd3dda54ed2942096715', class: {
|
|
769
747
|
'label-text-wrapper': true,
|
|
770
748
|
'label-text-wrapper-hidden': !hasLabel,
|
|
771
|
-
}, part: "label" }, label !== undefined ? h("div", { class: "label-text" }, label) : h("slot", { name: "label" })), h("div", { key: '
|
|
749
|
+
}, 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" })))));
|
|
772
750
|
}
|
|
773
751
|
get el() { return this; }
|
|
774
752
|
static get watchers() { return {
|
|
@@ -803,8 +781,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
803
781
|
"labelPlacement": [1, "label-placement"],
|
|
804
782
|
"ratioA": [32],
|
|
805
783
|
"ratioB": [32],
|
|
806
|
-
"focusedKnob": [32],
|
|
807
|
-
"hoveredKnob": [32],
|
|
808
784
|
"pressedKnob": [32]
|
|
809
785
|
}, undefined, {
|
|
810
786
|
"debounce": ["debounceChanged"],
|
|
@@ -815,7 +791,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
815
791
|
"disabled": ["disabledChanged"],
|
|
816
792
|
"value": ["valueChanged"]
|
|
817
793
|
}]);
|
|
818
|
-
const renderKnob = (rtl, { knob,
|
|
794
|
+
const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, }) => {
|
|
819
795
|
const start = rtl ? 'right' : 'left';
|
|
820
796
|
const knobStyle = () => {
|
|
821
797
|
const style = {};
|
|
@@ -836,50 +812,16 @@ const renderKnob = (rtl, { knob, position, dualKnobs, value, ratio, min, max, di
|
|
|
836
812
|
ev.preventDefault();
|
|
837
813
|
ev.stopPropagation();
|
|
838
814
|
}
|
|
839
|
-
}, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur,
|
|
815
|
+
}, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur, class: {
|
|
840
816
|
'range-knob-handle': true,
|
|
841
|
-
'range-knob-
|
|
842
|
-
'range-knob-
|
|
817
|
+
'range-knob-a': knob === 'A',
|
|
818
|
+
'range-knob-b': knob === 'B',
|
|
843
819
|
'range-knob-pressed': pressed,
|
|
844
820
|
'range-knob-min': value === min,
|
|
845
821
|
'range-knob-max': value === max,
|
|
846
822
|
'ion-activatable': true,
|
|
847
823
|
'ion-focusable': true,
|
|
848
|
-
|
|
849
|
-
}, part: [
|
|
850
|
-
'knob-handle',
|
|
851
|
-
dualKnobs && knob === 'A' && 'knob-handle-a',
|
|
852
|
-
dualKnobs && knob === 'B' && 'knob-handle-b',
|
|
853
|
-
dualKnobs && position === 'lower' && 'knob-handle-lower',
|
|
854
|
-
dualKnobs && position === 'upper' && 'knob-handle-upper',
|
|
855
|
-
pressed && 'pressed',
|
|
856
|
-
focused && 'focused',
|
|
857
|
-
hovered && 'hover',
|
|
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
|
-
]
|
|
870
|
-
.filter(Boolean)
|
|
871
|
-
.join(' ') }, pinFormatter(value))), h("div", { class: "range-knob", role: "presentation", part: [
|
|
872
|
-
'knob',
|
|
873
|
-
dualKnobs && knob === 'A' && 'knob-a',
|
|
874
|
-
dualKnobs && knob === 'B' && 'knob-b',
|
|
875
|
-
dualKnobs && position === 'lower' && 'knob-lower',
|
|
876
|
-
dualKnobs && position === 'upper' && 'knob-upper',
|
|
877
|
-
pressed && 'pressed',
|
|
878
|
-
focused && 'focused',
|
|
879
|
-
hovered && 'hover',
|
|
880
|
-
]
|
|
881
|
-
.filter(Boolean)
|
|
882
|
-
.join(' ') })));
|
|
824
|
+
}, 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" })));
|
|
883
825
|
};
|
|
884
826
|
const ratioToValue = (ratio, min, max, step) => {
|
|
885
827
|
let value = (max - min) * ratio;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
5
5
|
import { i as isRTL } from './dir.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 = /*@__PURE__*/ proxyCustomElement(class SegmentView extends HTMLElement {
|
|
12
12
|
constructor(registerHost) {
|
|
@@ -22,6 +22,10 @@ const SegmentView = /*@__PURE__*/ proxyCustomElement(class SegmentView extends H
|
|
|
22
22
|
* If `true`, the segment view cannot be interacted with.
|
|
23
23
|
*/
|
|
24
24
|
this.disabled = false;
|
|
25
|
+
/**
|
|
26
|
+
* If `true`, users will be able to swipe the segment view to navigate between segment contents.
|
|
27
|
+
*/
|
|
28
|
+
this.swipeGesture = true;
|
|
25
29
|
}
|
|
26
30
|
handleScroll(ev) {
|
|
27
31
|
var _a;
|
|
@@ -109,11 +113,12 @@ const SegmentView = /*@__PURE__*/ proxyCustomElement(class SegmentView extends H
|
|
|
109
113
|
return Array.from(this.el.querySelectorAll('ion-segment-content'));
|
|
110
114
|
}
|
|
111
115
|
render() {
|
|
112
|
-
const { disabled, isManualScroll } = this;
|
|
113
|
-
return (h(Host, { key: '
|
|
116
|
+
const { disabled, isManualScroll, swipeGesture } = this;
|
|
117
|
+
return (h(Host, { key: '565cccce7f0cfc4c71508777cc60292d6f24334f', class: {
|
|
114
118
|
'segment-view-disabled': disabled,
|
|
115
119
|
'segment-view-scroll-disabled': isManualScroll === false,
|
|
116
|
-
|
|
120
|
+
'segment-view-swipe-disabled': swipeGesture === false,
|
|
121
|
+
} }, h("slot", { key: '4118c240364467302b8f593e33c37837ea5d06f0' })));
|
|
117
122
|
}
|
|
118
123
|
get el() { return this; }
|
|
119
124
|
static get style() { return {
|
|
@@ -122,6 +127,7 @@ const SegmentView = /*@__PURE__*/ proxyCustomElement(class SegmentView extends H
|
|
|
122
127
|
}; }
|
|
123
128
|
}, [289, "ion-segment-view", {
|
|
124
129
|
"disabled": [4],
|
|
130
|
+
"swipeGesture": [4, "swipe-gesture"],
|
|
125
131
|
"isManualScroll": [32],
|
|
126
132
|
"setContent": [64]
|
|
127
133
|
}, [[1, "scroll", "handleScroll"], [1, "touchstart", "handleScrollStart"], [1, "touchend", "handleTouchEnd"]]]);
|
package/components/ion-select.js
CHANGED
|
@@ -560,6 +560,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
560
560
|
const mode = getIonMode(this);
|
|
561
561
|
const modalOpts = Object.assign(Object.assign({}, interfaceOptions), { mode, cssClass: ['select-modal', interfaceOptions.cssClass], component: 'ion-select-modal', componentProps: {
|
|
562
562
|
header: interfaceOptions.header,
|
|
563
|
+
cancelText: this.cancelText,
|
|
563
564
|
multiple,
|
|
564
565
|
value,
|
|
565
566
|
options: this.createOverlaySelectOptions(this.childOpts, value),
|
|
@@ -809,7 +810,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
809
810
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
810
811
|
*/
|
|
811
812
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
812
|
-
return (h(Host, { key: '
|
|
813
|
+
return (h(Host, { key: 'b7fa907f8fbc54fd63e2d07a9bb5156d94fd5057', onClick: this.onClick, class: createColorClasses(this.color, {
|
|
813
814
|
[mode]: true,
|
|
814
815
|
'in-item': inItem,
|
|
815
816
|
'in-item-color': hostContext('ion-item.ion-color', el),
|
|
@@ -827,7 +828,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
827
828
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
828
829
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
829
830
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
830
|
-
}) }, h("label", { key: '
|
|
831
|
+
}) }, h("label", { key: '11137e6a8b0374e93923ddb5a4629972ded5f43c', class: "select-wrapper", id: "select-label", onClick: this.onLabelClick }, this.renderLabelContainer(), h("div", { key: '99e3c09b5e6c2e7be493ed5834f991fffe45cfff', class: "select-wrapper-inner" }, h("slot", { key: '740f0e5a913cb0209d5acae31c33a6ed8f672dfc', name: "start" }), h("div", { key: 'b20e33c8b60915a5194948fcf8e22d7789f0b050', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), h("slot", { key: '0199f338185d5fa2cdd977bb20516746bd9ddad5', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && h("div", { key: '3b54de893cc8fc66df8588cee22e30d6f10850b3', class: "select-highlight" })), this.renderBottomContent()));
|
|
831
832
|
}
|
|
832
833
|
get el() { return this; }
|
|
833
834
|
static get watchers() { return {
|
|
@@ -31,6 +31,10 @@ const SelectModal = /*@__PURE__*/ proxyCustomElement(class SelectModal extends H
|
|
|
31
31
|
if (registerHost !== false) {
|
|
32
32
|
this.__registerHost();
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* The text to display on the cancel button.
|
|
36
|
+
*/
|
|
37
|
+
this.cancelText = 'Close';
|
|
34
38
|
this.options = [];
|
|
35
39
|
}
|
|
36
40
|
closeModal() {
|
|
@@ -99,7 +103,7 @@ const SelectModal = /*@__PURE__*/ proxyCustomElement(class SelectModal extends H
|
|
|
99
103
|
} }, option.text))));
|
|
100
104
|
}
|
|
101
105
|
render() {
|
|
102
|
-
return (h(Host, { key: '
|
|
106
|
+
return (h(Host, { key: '59ba79ffdbb69befe8e13745450c1071a1fe8c6c', class: getIonMode(this) }, h("ion-header", { key: 'fa4d08ee43eec4b9add09d9ffabcba9ed13dd4af' }, h("ion-toolbar", { key: 'b5e26cf092297c51c1dba3ce7963e7b03420393b' }, this.header !== undefined && h("ion-title", { key: 'a8a93cdea4d119d3a17d8cef3878b8a1daa86e26' }, this.header), h("ion-buttons", { key: 'bbc656713b41ef09099ed466f93a9cfbdaceecc1', slot: "end" }, h("ion-button", { key: '80b8751fe4c96e06b620a0b9d17b2d9b3da2faa5', onClick: () => this.closeModal() }, this.cancelText)))), h("ion-content", { key: 'a251fc00ae4cc7e6b3abe13caa10d95bb515558e' }, h("ion-list", { key: 'bcaf38d6d91accfabb4a9d26783bc0e4801abe3c' }, this.multiple === true ? this.renderCheckboxOptions() : this.renderRadioOptions()))));
|
|
103
107
|
}
|
|
104
108
|
get el() { return this; }
|
|
105
109
|
static get style() { return {
|
|
@@ -109,6 +113,7 @@ const SelectModal = /*@__PURE__*/ proxyCustomElement(class SelectModal extends H
|
|
|
109
113
|
}; }
|
|
110
114
|
}, [290, "ion-select-modal", {
|
|
111
115
|
"header": [1],
|
|
116
|
+
"cancelText": [1, "cancel-text"],
|
|
112
117
|
"multiple": [4],
|
|
113
118
|
"options": [16]
|
|
114
119
|
}]);
|