@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
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
|
/**
|
|
@@ -189,29 +188,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
189
188
|
this.gesture.enable(!this.disabled);
|
|
190
189
|
}
|
|
191
190
|
};
|
|
192
|
-
/**
|
|
193
|
-
* Observes the knob handles for the ion-activated class and syncs
|
|
194
|
-
* activatedKnob so the activated part is correctly set on the handle,
|
|
195
|
-
* knob, and pin.
|
|
196
|
-
*/
|
|
197
|
-
this.setupActivatedObserver = () => {
|
|
198
|
-
const knobHandleA = this.el.shadowRoot.querySelector('.range-knob-handle-a');
|
|
199
|
-
const knobHandleB = this.el.shadowRoot.querySelector('.range-knob-handle-b');
|
|
200
|
-
const syncActivated = () => {
|
|
201
|
-
this.activatedKnob = (knobHandleA === null || knobHandleA === void 0 ? void 0 : knobHandleA.classList.contains('ion-activated'))
|
|
202
|
-
? 'A'
|
|
203
|
-
: (knobHandleB === null || knobHandleB === void 0 ? void 0 : knobHandleB.classList.contains('ion-activated'))
|
|
204
|
-
? 'B'
|
|
205
|
-
: undefined;
|
|
206
|
-
};
|
|
207
|
-
this.activatedObserver = new MutationObserver(syncActivated);
|
|
208
|
-
this.activatedObserver.observe(this.el.shadowRoot, {
|
|
209
|
-
attributes: true,
|
|
210
|
-
attributeFilter: ['class'],
|
|
211
|
-
subtree: true,
|
|
212
|
-
});
|
|
213
|
-
syncActivated();
|
|
214
|
-
};
|
|
215
191
|
this.handleKeyboard = (knob, isIncrease) => {
|
|
216
192
|
const { ensureValueInBounds } = this;
|
|
217
193
|
let step = this.step;
|
|
@@ -234,7 +210,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
234
210
|
this.onBlur = () => {
|
|
235
211
|
if (this.hasFocus) {
|
|
236
212
|
this.hasFocus = false;
|
|
237
|
-
this.focusedKnob = undefined;
|
|
238
213
|
this.ionBlur.emit();
|
|
239
214
|
}
|
|
240
215
|
};
|
|
@@ -245,20 +220,21 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
245
220
|
}
|
|
246
221
|
};
|
|
247
222
|
this.onKnobFocus = (knob) => {
|
|
248
|
-
// Clicking focuses the range which is needed for the keyboard,
|
|
249
|
-
// but we only want to add the ion-focused class when focused via Tab.
|
|
250
|
-
if (!this.focusFromPointer) {
|
|
251
|
-
this.focusedKnob = knob;
|
|
252
|
-
}
|
|
253
|
-
else {
|
|
254
|
-
this.focusFromPointer = false;
|
|
255
|
-
this.focusedKnob = undefined;
|
|
256
|
-
}
|
|
257
|
-
// If the knob was not already focused, emit the focus event
|
|
258
223
|
if (!this.hasFocus) {
|
|
259
224
|
this.hasFocus = true;
|
|
260
225
|
this.ionFocus.emit();
|
|
261
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
|
+
}
|
|
262
238
|
};
|
|
263
239
|
this.onKnobBlur = () => {
|
|
264
240
|
// Check if focus is moving to another knob within the same range
|
|
@@ -270,18 +246,18 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
270
246
|
if (!isStillFocusedOnKnob) {
|
|
271
247
|
if (this.hasFocus) {
|
|
272
248
|
this.hasFocus = false;
|
|
273
|
-
this.focusedKnob = undefined;
|
|
274
249
|
this.ionBlur.emit();
|
|
275
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
|
+
}
|
|
276
258
|
}
|
|
277
259
|
}, 0);
|
|
278
260
|
};
|
|
279
|
-
this.onKnobMouseEnter = (knob) => {
|
|
280
|
-
this.hoveredKnob = knob;
|
|
281
|
-
};
|
|
282
|
-
this.onKnobMouseLeave = () => {
|
|
283
|
-
this.hoveredKnob = undefined;
|
|
284
|
-
};
|
|
285
261
|
}
|
|
286
262
|
debounceChanged() {
|
|
287
263
|
const { ionInput, debounce, originalIonInput } = this;
|
|
@@ -358,7 +334,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
358
334
|
this.originalIonInput = this.ionInput;
|
|
359
335
|
this.setupGesture();
|
|
360
336
|
this.updateRatio();
|
|
361
|
-
this.setupActivatedObserver();
|
|
362
337
|
this.didLoad = true;
|
|
363
338
|
}
|
|
364
339
|
connectedCallback() {
|
|
@@ -384,10 +359,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
384
359
|
this.gesture.destroy();
|
|
385
360
|
this.gesture = undefined;
|
|
386
361
|
}
|
|
387
|
-
if (this.activatedObserver) {
|
|
388
|
-
this.activatedObserver.disconnect();
|
|
389
|
-
this.activatedObserver = undefined;
|
|
390
|
-
}
|
|
391
362
|
}
|
|
392
363
|
getValue() {
|
|
393
364
|
var _a;
|
|
@@ -540,6 +511,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
540
511
|
ratio = 1 - ratio;
|
|
541
512
|
}
|
|
542
513
|
this.pressedKnob = !this.dualKnobs || Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio) ? 'A' : 'B';
|
|
514
|
+
this.setFocus(this.pressedKnob);
|
|
543
515
|
}
|
|
544
516
|
get valA() {
|
|
545
517
|
return ratioToValue(this.ratioA, this.min, this.max, this.step);
|
|
@@ -566,23 +538,9 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
566
538
|
updateRatio() {
|
|
567
539
|
const value = this.getValue();
|
|
568
540
|
const { min, max } = this;
|
|
569
|
-
/**
|
|
570
|
-
* For dual knobs, value gives lower/upper but not which is A vs B.
|
|
571
|
-
* Assign (lowerRatio, upperRatio) to (ratioA, ratioB) in the way that
|
|
572
|
-
* minimizes change from the current ratios so the knobs don't swap.
|
|
573
|
-
*/
|
|
574
541
|
if (this.dualKnobs) {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
if (Math.abs(this.ratioA - lowerRatio) + Math.abs(this.ratioB - upperRatio) <=
|
|
578
|
-
Math.abs(this.ratioA - upperRatio) + Math.abs(this.ratioB - lowerRatio)) {
|
|
579
|
-
this.ratioA = lowerRatio;
|
|
580
|
-
this.ratioB = upperRatio;
|
|
581
|
-
}
|
|
582
|
-
else {
|
|
583
|
-
this.ratioA = upperRatio;
|
|
584
|
-
this.ratioB = lowerRatio;
|
|
585
|
-
}
|
|
542
|
+
this.ratioA = valueToRatio(value.lower, min, max);
|
|
543
|
+
this.ratioB = valueToRatio(value.upper, min, max);
|
|
586
544
|
}
|
|
587
545
|
else {
|
|
588
546
|
this.ratioA = valueToRatio(value, min, max);
|
|
@@ -599,6 +557,14 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
599
557
|
};
|
|
600
558
|
this.noUpdate = false;
|
|
601
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
|
+
}
|
|
602
568
|
/**
|
|
603
569
|
* Returns true if content was passed to the "start" slot
|
|
604
570
|
*/
|
|
@@ -616,7 +582,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
616
582
|
}
|
|
617
583
|
renderRangeSlider() {
|
|
618
584
|
var _a;
|
|
619
|
-
const { min, max, step, handleKeyboard,
|
|
585
|
+
const { min, max, step, handleKeyboard, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
|
|
620
586
|
let barStart = `${ratioLower * 100}%`;
|
|
621
587
|
let barEnd = `${100 - ratioUpper * 100}%`;
|
|
622
588
|
const rtl = isRTL(this.el);
|
|
@@ -676,9 +642,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
676
642
|
ticks.push(tick);
|
|
677
643
|
}
|
|
678
644
|
}
|
|
679
|
-
return (h("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl),
|
|
680
|
-
this.focusFromPointer = true;
|
|
681
|
-
},
|
|
645
|
+
return (h("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl),
|
|
682
646
|
/**
|
|
683
647
|
* Since the gesture has a threshold, the value
|
|
684
648
|
* won't change until the user has dragged past
|
|
@@ -691,7 +655,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
691
655
|
* we need to listen for the "pointerUp" event.
|
|
692
656
|
*/
|
|
693
657
|
onPointerUp: (ev) => {
|
|
694
|
-
this.focusFromPointer = false;
|
|
695
658
|
/**
|
|
696
659
|
* If the user drags the knob on the web
|
|
697
660
|
* version (does not occur on mobile),
|
|
@@ -717,11 +680,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
717
680
|
'has-ticks': ticks.length > 0,
|
|
718
681
|
}, role: "presentation", style: barStyle, part: "bar-active" })), renderKnob(rtl, {
|
|
719
682
|
knob: 'A',
|
|
720
|
-
position: getKnobPosition('A', this.ratioA, this.ratioB, this.dualKnobs),
|
|
721
|
-
dualKnobs: this.dualKnobs,
|
|
722
|
-
activated: activatedKnob === 'A',
|
|
723
|
-
focused: focusedKnob === 'A',
|
|
724
|
-
hovered: hoveredKnob === 'A',
|
|
725
683
|
pressed: pressedKnob === 'A',
|
|
726
684
|
value: this.valA,
|
|
727
685
|
ratio: this.ratioA,
|
|
@@ -734,16 +692,9 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
734
692
|
inheritedAttributes,
|
|
735
693
|
onKnobFocus: this.onKnobFocus,
|
|
736
694
|
onKnobBlur: this.onKnobBlur,
|
|
737
|
-
onKnobMouseEnter: this.onKnobMouseEnter,
|
|
738
|
-
onKnobMouseLeave: this.onKnobMouseLeave,
|
|
739
695
|
}), this.dualKnobs &&
|
|
740
696
|
renderKnob(rtl, {
|
|
741
697
|
knob: 'B',
|
|
742
|
-
position: getKnobPosition('B', this.ratioA, this.ratioB, this.dualKnobs),
|
|
743
|
-
dualKnobs: this.dualKnobs,
|
|
744
|
-
activated: activatedKnob === 'B',
|
|
745
|
-
focused: focusedKnob === 'B',
|
|
746
|
-
hovered: hoveredKnob === 'B',
|
|
747
698
|
pressed: pressedKnob === 'B',
|
|
748
699
|
value: this.valB,
|
|
749
700
|
ratio: this.ratioB,
|
|
@@ -756,8 +707,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
756
707
|
inheritedAttributes,
|
|
757
708
|
onKnobFocus: this.onKnobFocus,
|
|
758
709
|
onKnobBlur: this.onKnobBlur,
|
|
759
|
-
onKnobMouseEnter: this.onKnobMouseEnter,
|
|
760
|
-
onKnobMouseLeave: this.onKnobMouseLeave,
|
|
761
710
|
})));
|
|
762
711
|
}
|
|
763
712
|
render() {
|
|
@@ -776,12 +725,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
776
725
|
const hasEndContent = (hasLabel && labelPlacement === 'end') || this.hasEndSlotContent;
|
|
777
726
|
const needsEndAdjustment = inItem && !hasEndContent;
|
|
778
727
|
const mode = getIonMode(this);
|
|
779
|
-
/**
|
|
780
|
-
* Determine the name and position of the pressed knob to apply
|
|
781
|
-
* Host classes for styling.
|
|
782
|
-
*/
|
|
783
|
-
const pressedKnobName = dualKnobs ? pressedKnob === null || pressedKnob === void 0 ? void 0 : pressedKnob.toLowerCase() : undefined;
|
|
784
|
-
const pressedKnobPosition = dualKnobs && pressedKnob ? getKnobPosition(pressedKnob, this.ratioA, this.ratioB, dualKnobs) : undefined;
|
|
785
728
|
/**
|
|
786
729
|
* Determine if any knob is at the min or max value to
|
|
787
730
|
* apply Host classes for styling.
|
|
@@ -789,24 +732,21 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
789
732
|
const valueAtMin = dualKnobs ? this.valA === min || this.valB === min : this.valA === min;
|
|
790
733
|
const valueAtMax = dualKnobs ? this.valA === max || this.valB === max : this.valA === max;
|
|
791
734
|
renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);
|
|
792
|
-
return (h(Host, { key: '
|
|
735
|
+
return (h(Host, { key: 'ed646a42d51b8fe22012198c354cbcf5a389c108', onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: createColorClasses(this.color, {
|
|
793
736
|
[mode]: true,
|
|
794
737
|
'in-item': inItem,
|
|
795
738
|
'range-disabled': disabled,
|
|
796
|
-
'range-dual-knobs': dualKnobs,
|
|
797
739
|
'range-pressed': pressedKnob !== undefined,
|
|
798
|
-
[`range-pressed-${pressedKnobName}`]: pressedKnob !== undefined && pressedKnobName !== undefined,
|
|
799
|
-
[`range-pressed-${pressedKnobPosition}`]: pressedKnob !== undefined && pressedKnobPosition !== undefined,
|
|
800
740
|
'range-has-pin': pin,
|
|
801
741
|
[`range-label-placement-${labelPlacement}`]: true,
|
|
802
742
|
'range-item-start-adjustment': needsStartAdjustment,
|
|
803
743
|
'range-item-end-adjustment': needsEndAdjustment,
|
|
804
744
|
'range-value-min': valueAtMin,
|
|
805
745
|
'range-value-max': valueAtMax,
|
|
806
|
-
}) }, h("label", { key: '
|
|
746
|
+
}) }, h("label", { key: '3083e4f2a624e3b268396acb4415f7c6ac44d851', class: "range-wrapper", id: "range-label" }, h("div", { key: '47b92f94d2a0381dd7c5cd3dda54ed2942096715', class: {
|
|
807
747
|
'label-text-wrapper': true,
|
|
808
748
|
'label-text-wrapper-hidden': !hasLabel,
|
|
809
|
-
}, 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" })))));
|
|
810
750
|
}
|
|
811
751
|
get el() { return this; }
|
|
812
752
|
static get watchers() { return {
|
|
@@ -841,9 +781,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
841
781
|
"labelPlacement": [1, "label-placement"],
|
|
842
782
|
"ratioA": [32],
|
|
843
783
|
"ratioB": [32],
|
|
844
|
-
"activatedKnob": [32],
|
|
845
|
-
"focusedKnob": [32],
|
|
846
|
-
"hoveredKnob": [32],
|
|
847
784
|
"pressedKnob": [32]
|
|
848
785
|
}, undefined, {
|
|
849
786
|
"debounce": ["debounceChanged"],
|
|
@@ -854,7 +791,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
854
791
|
"disabled": ["disabledChanged"],
|
|
855
792
|
"value": ["valueChanged"]
|
|
856
793
|
}]);
|
|
857
|
-
const renderKnob = (rtl, { knob,
|
|
794
|
+
const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, }) => {
|
|
858
795
|
const start = rtl ? 'right' : 'left';
|
|
859
796
|
const knobStyle = () => {
|
|
860
797
|
const style = {};
|
|
@@ -875,66 +812,16 @@ const renderKnob = (rtl, { knob, position, dualKnobs, value, ratio, min, max, di
|
|
|
875
812
|
ev.preventDefault();
|
|
876
813
|
ev.stopPropagation();
|
|
877
814
|
}
|
|
878
|
-
}, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur,
|
|
815
|
+
}, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur, class: {
|
|
879
816
|
'range-knob-handle': true,
|
|
880
|
-
'range-knob-
|
|
881
|
-
'range-knob-
|
|
817
|
+
'range-knob-a': knob === 'A',
|
|
818
|
+
'range-knob-b': knob === 'B',
|
|
882
819
|
'range-knob-pressed': pressed,
|
|
883
820
|
'range-knob-min': value === min,
|
|
884
821
|
'range-knob-max': value === max,
|
|
885
822
|
'ion-activatable': true,
|
|
886
823
|
'ion-focusable': true,
|
|
887
|
-
|
|
888
|
-
}, part: [
|
|
889
|
-
'knob-handle',
|
|
890
|
-
dualKnobs && knob === 'A' && 'knob-handle-a',
|
|
891
|
-
dualKnobs && knob === 'B' && 'knob-handle-b',
|
|
892
|
-
dualKnobs && position === 'lower' && 'knob-handle-lower',
|
|
893
|
-
dualKnobs && position === 'upper' && 'knob-handle-upper',
|
|
894
|
-
pressed && 'pressed',
|
|
895
|
-
focused && 'focused',
|
|
896
|
-
hovered && 'hover',
|
|
897
|
-
activated && 'activated',
|
|
898
|
-
]
|
|
899
|
-
.filter(Boolean)
|
|
900
|
-
.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: [
|
|
901
|
-
'pin',
|
|
902
|
-
dualKnobs && knob === 'A' && 'pin-a',
|
|
903
|
-
dualKnobs && knob === 'B' && 'pin-b',
|
|
904
|
-
dualKnobs && position === 'lower' && 'pin-lower',
|
|
905
|
-
dualKnobs && position === 'upper' && 'pin-upper',
|
|
906
|
-
pressed && 'pressed',
|
|
907
|
-
focused && 'focused',
|
|
908
|
-
hovered && 'hover',
|
|
909
|
-
activated && 'activated',
|
|
910
|
-
]
|
|
911
|
-
.filter(Boolean)
|
|
912
|
-
.join(' ') }, pinFormatter(value))), h("div", { class: "range-knob", role: "presentation", part: [
|
|
913
|
-
'knob',
|
|
914
|
-
dualKnobs && knob === 'A' && 'knob-a',
|
|
915
|
-
dualKnobs && knob === 'B' && 'knob-b',
|
|
916
|
-
dualKnobs && position === 'lower' && 'knob-lower',
|
|
917
|
-
dualKnobs && position === 'upper' && 'knob-upper',
|
|
918
|
-
pressed && 'pressed',
|
|
919
|
-
focused && 'focused',
|
|
920
|
-
hovered && 'hover',
|
|
921
|
-
activated && 'activated',
|
|
922
|
-
]
|
|
923
|
-
.filter(Boolean)
|
|
924
|
-
.join(' ') })));
|
|
925
|
-
};
|
|
926
|
-
/**
|
|
927
|
-
* Returns whether the given knob is at the lower or upper position based
|
|
928
|
-
* on current ratios for the given knob.
|
|
929
|
-
*/
|
|
930
|
-
const getKnobPosition = (knob, ratioA, ratioB, dualKnobs) => {
|
|
931
|
-
if (dualKnobs) {
|
|
932
|
-
if (knob === 'A') {
|
|
933
|
-
return ratioA <= ratioB ? 'lower' : 'upper';
|
|
934
|
-
}
|
|
935
|
-
return ratioB <= ratioA ? 'lower' : 'upper';
|
|
936
|
-
}
|
|
937
|
-
return 'lower';
|
|
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" })));
|
|
938
825
|
};
|
|
939
826
|
const ratioToValue = (ratio, min, max, step) => {
|
|
940
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
|
@@ -779,7 +779,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
779
779
|
if (!hasHintText) {
|
|
780
780
|
return;
|
|
781
781
|
}
|
|
782
|
-
return h("div", { class: "select-bottom" }, this.renderHintText());
|
|
782
|
+
return (h("div", { class: "select-bottom", part: "bottom" }, this.renderHintText()));
|
|
783
783
|
}
|
|
784
784
|
render() {
|
|
785
785
|
const { disabled, el, isExpanded, expandedIcon, labelPlacement, justify, placeholder, fill, shape, name, value, hasFocus, } = this;
|
|
@@ -810,7 +810,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
810
810
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
811
811
|
*/
|
|
812
812
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
813
|
-
return (h(Host, { key: '
|
|
813
|
+
return (h(Host, { key: 'ada627c442ebcdd4a4ee96e5f5f3ec0e2181d689', onClick: this.onClick, class: createColorClasses(this.color, {
|
|
814
814
|
[mode]: true,
|
|
815
815
|
'in-item': inItem,
|
|
816
816
|
'in-item-color': hostContext('ion-item.ion-color', el),
|
|
@@ -828,7 +828,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
828
828
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
829
829
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
830
830
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
831
|
-
}) }, h("label", { key: '
|
|
831
|
+
}) }, 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()));
|
|
832
832
|
}
|
|
833
833
|
get el() { return this; }
|
|
834
834
|
static get watchers() { return {
|
|
@@ -477,7 +477,7 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
477
477
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
478
478
|
*/
|
|
479
479
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || hasFocus || hasStartEndSlots));
|
|
480
|
-
return (h(Host, { key: '
|
|
480
|
+
return (h(Host, { key: '543076e7ed730451b490a9008cabe8f4a5d1f347', class: createColorClasses(this.color, {
|
|
481
481
|
[mode]: true,
|
|
482
482
|
'has-value': hasValue,
|
|
483
483
|
'has-focus': hasFocus,
|
|
@@ -486,7 +486,7 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
486
486
|
[`textarea-shape-${shape}`]: shape !== undefined,
|
|
487
487
|
[`textarea-label-placement-${labelPlacement}`]: true,
|
|
488
488
|
'textarea-disabled': disabled,
|
|
489
|
-
}) }, h("label", { key: '
|
|
489
|
+
}) }, 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()));
|
|
490
490
|
}
|
|
491
491
|
get el() { return this; }
|
|
492
492
|
static get watchers() { return {
|
|
@@ -504,7 +504,7 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
504
504
|
"autofocus": [4],
|
|
505
505
|
"clearOnEdit": [4, "clear-on-edit"],
|
|
506
506
|
"debounce": [2],
|
|
507
|
-
"disabled": [
|
|
507
|
+
"disabled": [516],
|
|
508
508
|
"fill": [1],
|
|
509
509
|
"inputmode": [1],
|
|
510
510
|
"enterkeyhint": [1],
|
|
@@ -512,7 +512,7 @@ const Textarea = /*@__PURE__*/ proxyCustomElement(class Textarea extends HTMLEle
|
|
|
512
512
|
"minlength": [2],
|
|
513
513
|
"name": [1],
|
|
514
514
|
"placeholder": [1],
|
|
515
|
-
"readonly": [
|
|
515
|
+
"readonly": [516],
|
|
516
516
|
"required": [4],
|
|
517
517
|
"spellcheck": [4],
|
|
518
518
|
"cols": [514],
|