@ionic/core 8.7.17-dev.11770147425.1bfcd5e5 → 8.7.17-dev.11770319814.172b4f50
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-refresher.js +32 -3
- 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-refresher_2.cjs.entry.js +32 -3
- 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/refresher/refresher.js +70 -4
- package/dist/collection/components/select/select.js +3 -2
- package/dist/collection/components/select-modal/select-modal.js +25 -1
- package/dist/docs.json +83 -137
- package/dist/esm/ion-range.entry.js +39 -95
- package/dist/esm/ion-refresher_2.entry.js +32 -3
- 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 +5 -1
- 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-90f2d3ff.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/refresher/refresher-interface.d.ts +7 -0
- package/dist/types/components/refresher/refresher.d.ts +16 -3
- package/dist/types/components/select-modal/select-modal.d.ts +4 -0
- package/dist/types/components.d.ts +26 -5
- package/dist/types/interface.d.ts +1 -1
- package/hydrate/index.js +83 -122
- package/hydrate/index.mjs +83 -122
- package/package.json +1 -1
- package/dist/ionic/p-02d76786.entry.js +0 -4
- package/dist/ionic/p-639dd543.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;
|
|
@@ -23,6 +23,8 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
23
23
|
this.ionRefresh = createEvent(this, "ionRefresh", 7);
|
|
24
24
|
this.ionPull = createEvent(this, "ionPull", 7);
|
|
25
25
|
this.ionStart = createEvent(this, "ionStart", 7);
|
|
26
|
+
this.ionPullStart = createEvent(this, "ionPullStart", 7);
|
|
27
|
+
this.ionPullEnd = createEvent(this, "ionPullEnd", 7);
|
|
26
28
|
this.appliedStyles = false;
|
|
27
29
|
this.didStart = false;
|
|
28
30
|
this.progress = 0;
|
|
@@ -77,8 +79,8 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
77
79
|
* than `1`. The default value is `1` which is equal to the speed of the cursor.
|
|
78
80
|
* If a negative value is passed in, the factor will be `1` instead.
|
|
79
81
|
*
|
|
80
|
-
* For example
|
|
81
|
-
* `10` pixels, instead of `10` pixels the content will be pulled by `12` pixels
|
|
82
|
+
* For example, If the value passed is `1.2` and the content is dragged by
|
|
83
|
+
* `10` pixels, instead of `10` pixels, the content will be pulled by `12` pixels
|
|
82
84
|
* (an increase of 20 percent). If the value passed is `0.8`, the dragged amount
|
|
83
85
|
* will be `8` pixels, less than the amount the cursor has moved.
|
|
84
86
|
*
|
|
@@ -128,6 +130,9 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
128
130
|
this.animations = [];
|
|
129
131
|
this.progress = 0;
|
|
130
132
|
this.state = 1 /* RefresherState.Inactive */;
|
|
133
|
+
this.ionPullEnd.emit({
|
|
134
|
+
reason: state === 32 /* RefresherState.Completing */ ? 'complete' : 'cancel',
|
|
135
|
+
});
|
|
131
136
|
}
|
|
132
137
|
async setupiOSNativeRefresher(pullingSpinner, refreshingSpinner) {
|
|
133
138
|
this.elementToTransform = this.scrollEl;
|
|
@@ -160,6 +165,7 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
160
165
|
if (!this.didStart) {
|
|
161
166
|
this.didStart = true;
|
|
162
167
|
this.ionStart.emit();
|
|
168
|
+
this.ionPullStart.emit();
|
|
163
169
|
}
|
|
164
170
|
// emit "pulling" on every move
|
|
165
171
|
if (this.pointerDown) {
|
|
@@ -235,6 +241,7 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
235
241
|
this.lastVelocityY = ev.velocityY;
|
|
236
242
|
},
|
|
237
243
|
onEnd: () => {
|
|
244
|
+
const hadStarted = this.didStart;
|
|
238
245
|
this.pointerDown = false;
|
|
239
246
|
this.didStart = false;
|
|
240
247
|
if (this.needsCompletion) {
|
|
@@ -244,6 +251,13 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
244
251
|
else if (this.didRefresh) {
|
|
245
252
|
readTask(() => translateElement(this.elementToTransform, `${this.el.clientHeight}px`));
|
|
246
253
|
}
|
|
254
|
+
else if (hadStarted) {
|
|
255
|
+
/**
|
|
256
|
+
* User started pulling but released before reaching the refresh threshold.
|
|
257
|
+
* Emit ionPullEnd to complete the event pair.
|
|
258
|
+
*/
|
|
259
|
+
this.ionPullEnd.emit({ reason: 'cancel' });
|
|
260
|
+
}
|
|
247
261
|
},
|
|
248
262
|
});
|
|
249
263
|
this.disabledChanged();
|
|
@@ -290,6 +304,7 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
290
304
|
ev.data.animation = animation;
|
|
291
305
|
animation.progressStart(false, 0);
|
|
292
306
|
this.ionStart.emit();
|
|
307
|
+
this.ionPullStart.emit();
|
|
293
308
|
this.animations.push(animation);
|
|
294
309
|
return;
|
|
295
310
|
}
|
|
@@ -312,6 +327,7 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
312
327
|
this.animations = [];
|
|
313
328
|
this.gesture.enable(true);
|
|
314
329
|
this.state = 1 /* RefresherState.Inactive */;
|
|
330
|
+
this.ionPullEnd.emit({ reason: 'cancel' });
|
|
315
331
|
});
|
|
316
332
|
return;
|
|
317
333
|
}
|
|
@@ -556,6 +572,7 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
556
572
|
if (!this.didStart) {
|
|
557
573
|
this.didStart = true;
|
|
558
574
|
this.ionStart.emit();
|
|
575
|
+
this.ionPullStart.emit();
|
|
559
576
|
}
|
|
560
577
|
// emit "pulling" on every move
|
|
561
578
|
this.ionPull.emit();
|
|
@@ -599,6 +616,15 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
599
616
|
* available right away.
|
|
600
617
|
*/
|
|
601
618
|
this.restoreOverflowStyle();
|
|
619
|
+
/**
|
|
620
|
+
* If ionPullStart was emitted, we need to emit ionPullEnd
|
|
621
|
+
* even though the gesture was aborted before reaching the
|
|
622
|
+
* pulling threshold.
|
|
623
|
+
*/
|
|
624
|
+
if (this.didStart) {
|
|
625
|
+
this.didStart = false;
|
|
626
|
+
this.ionPullEnd.emit({ reason: 'cancel' });
|
|
627
|
+
}
|
|
602
628
|
}
|
|
603
629
|
}
|
|
604
630
|
beginRefresh() {
|
|
@@ -645,6 +671,9 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
645
671
|
if (this.contentFullscreen && this.backgroundContentEl) {
|
|
646
672
|
(_a = this.backgroundContentEl) === null || _a === void 0 ? void 0 : _a.style.removeProperty('--offset-top');
|
|
647
673
|
}
|
|
674
|
+
this.ionPullEnd.emit({
|
|
675
|
+
reason: state === 32 /* RefresherState.Completing */ ? 'complete' : 'cancel',
|
|
676
|
+
});
|
|
648
677
|
}, 600);
|
|
649
678
|
// reset the styles on the scroll element
|
|
650
679
|
// set that the refresh is actively cancelling/completing
|
|
@@ -698,7 +727,7 @@ const Refresher = /*@__PURE__*/ proxyCustomElement(class Refresher extends HTMLE
|
|
|
698
727
|
}
|
|
699
728
|
render() {
|
|
700
729
|
const mode = getIonMode(this);
|
|
701
|
-
return (h(Host, { key: '
|
|
730
|
+
return (h(Host, { key: 'bed0c2f44c32ecac24b7d8326ac7c7ef1d12c44f', slot: "fixed", class: {
|
|
702
731
|
[mode]: true,
|
|
703
732
|
// Used internally for styling
|
|
704
733
|
[`refresher-${mode}`]: true,
|
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
|
}]);
|