@ionic/core 8.7.17-dev.11769628168.11eca7cd → 8.7.17-dev.11769813102.16c5bfac
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-datetime.js +10 -9
- package/components/ion-range.js +81 -39
- package/dist/cjs/ion-datetime_3.cjs.entry.js +10 -9
- package/dist/cjs/ion-range.cjs.entry.js +79 -38
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/datetime/datetime.js +11 -9
- package/dist/collection/components/range/range.js +99 -42
- package/dist/docs.json +134 -6
- package/dist/esm/ion-datetime_3.entry.js +10 -9
- package/dist/esm/ion-range.entry.js +79 -38
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-29721c43.entry.js +4 -0
- package/dist/ionic/p-73ecefff.entry.js +4 -0
- package/dist/types/components/datetime/datetime.d.ts +1 -0
- package/dist/types/components/range/range-interface.d.ts +1 -0
- package/dist/types/components/range/range.d.ts +20 -4
- package/hydrate/index.js +110 -51
- package/hydrate/index.mjs +110 -51
- package/package.json +1 -1
- package/dist/ionic/p-012212e4.entry.js +0 -4
- package/dist/ionic/p-c19af093.entry.js +0 -4
|
@@ -1397,7 +1397,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1397
1397
|
const todayString = workingParts.day !== null
|
|
1398
1398
|
? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
|
|
1399
1399
|
: `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
|
|
1400
|
-
return (h("ion-picker-column", { "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
|
|
1400
|
+
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
|
|
1401
1401
|
const { value } = ev.detail;
|
|
1402
1402
|
const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
|
|
1403
1403
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
|
|
@@ -1472,7 +1472,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1472
1472
|
const { disabled, workingParts } = this;
|
|
1473
1473
|
const activePart = this.getActivePartsWithFallback();
|
|
1474
1474
|
const pickerColumnValue = (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined;
|
|
1475
|
-
return (h("ion-picker-column", { "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
|
|
1475
|
+
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
|
|
1476
1476
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
|
|
1477
1477
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
|
|
1478
1478
|
ev.stopPropagation();
|
|
@@ -1484,7 +1484,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1484
1484
|
}
|
|
1485
1485
|
const { disabled, workingParts } = this;
|
|
1486
1486
|
const activePart = this.getActivePartsWithFallback();
|
|
1487
|
-
return (h("ion-picker-column", { "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
|
|
1487
|
+
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
|
|
1488
1488
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
|
|
1489
1489
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
|
|
1490
1490
|
ev.stopPropagation();
|
|
@@ -1496,7 +1496,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1496
1496
|
}
|
|
1497
1497
|
const { disabled, workingParts } = this;
|
|
1498
1498
|
const activePart = this.getActivePartsWithFallback();
|
|
1499
|
-
return (h("ion-picker-column", { "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
|
|
1499
|
+
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
|
|
1500
1500
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
|
|
1501
1501
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
|
|
1502
1502
|
ev.stopPropagation();
|
|
@@ -1529,7 +1529,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1529
1529
|
if (hoursData.length === 0)
|
|
1530
1530
|
return [];
|
|
1531
1531
|
const activePart = this.getActivePartsWithFallback();
|
|
1532
|
-
return (h("ion-picker-column", { "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
|
|
1532
|
+
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
|
|
1533
1533
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
|
|
1534
1534
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { hour: ev.detail.value }));
|
|
1535
1535
|
ev.stopPropagation();
|
|
@@ -1540,7 +1540,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1540
1540
|
if (minutesData.length === 0)
|
|
1541
1541
|
return [];
|
|
1542
1542
|
const activePart = this.getActivePartsWithFallback();
|
|
1543
|
-
return (h("ion-picker-column", { "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
|
|
1543
|
+
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
|
|
1544
1544
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
|
|
1545
1545
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { minute: ev.detail.value }));
|
|
1546
1546
|
ev.stopPropagation();
|
|
@@ -1553,7 +1553,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1553
1553
|
}
|
|
1554
1554
|
const activePart = this.getActivePartsWithFallback();
|
|
1555
1555
|
const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
|
|
1556
|
-
return (h("ion-picker-column", { "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
|
|
1556
|
+
return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
|
|
1557
1557
|
const hour = calculateHourFromAMPM(workingParts, ev.detail.value);
|
|
1558
1558
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
|
|
1559
1559
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { ampm: ev.detail.value, hour }));
|
|
@@ -1895,7 +1895,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1895
1895
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1896
1896
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1897
1897
|
renderHiddenInput(true, el, name, formatValue(value), disabled);
|
|
1898
|
-
return (h(Host, { key: '
|
|
1898
|
+
return (h(Host, { key: '19e20c9b6b5f9467e91a2567b6dc7d9d38b56cc3', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
|
|
1899
1899
|
[mode]: true,
|
|
1900
1900
|
['datetime-readonly']: readonly,
|
|
1901
1901
|
['datetime-disabled']: disabled,
|
|
@@ -1905,7 +1905,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1905
1905
|
[`datetime-size-${size}`]: true,
|
|
1906
1906
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1907
1907
|
[`datetime-grid`]: isGridStyle,
|
|
1908
|
-
})) }, h("div", { key: '
|
|
1908
|
+
})) }, h("div", { key: 'e31b5ef76cd6262dafd39f2d21980887880ec32e', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1909
1909
|
}
|
|
1910
1910
|
get el() { return this; }
|
|
1911
1911
|
static get watchers() { return {
|
|
@@ -1981,6 +1981,7 @@ const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends HTMLEle
|
|
|
1981
1981
|
let datetimeIds = 0;
|
|
1982
1982
|
const CANCEL_ROLE = 'datetime-cancel';
|
|
1983
1983
|
const CONFIRM_ROLE = 'datetime-confirm';
|
|
1984
|
+
const WHEEL_PART = 'wheel';
|
|
1984
1985
|
const WHEEL_ITEM_PART = 'wheel-item';
|
|
1985
1986
|
const WHEEL_ITEM_ACTIVE_PART = `active`;
|
|
1986
1987
|
function defineCustomElement$1() {
|
package/components/ion-range.js
CHANGED
|
@@ -79,6 +79,7 @@ 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;
|
|
82
83
|
this.ratioA = 0;
|
|
83
84
|
this.ratioB = 0;
|
|
84
85
|
/**
|
|
@@ -210,6 +211,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
210
211
|
this.onBlur = () => {
|
|
211
212
|
if (this.hasFocus) {
|
|
212
213
|
this.hasFocus = false;
|
|
214
|
+
this.focusedKnob = undefined;
|
|
213
215
|
this.ionBlur.emit();
|
|
214
216
|
}
|
|
215
217
|
};
|
|
@@ -220,21 +222,20 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
220
222
|
}
|
|
221
223
|
};
|
|
222
224
|
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
|
|
223
235
|
if (!this.hasFocus) {
|
|
224
236
|
this.hasFocus = true;
|
|
225
237
|
this.ionFocus.emit();
|
|
226
238
|
}
|
|
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
|
-
}
|
|
238
239
|
};
|
|
239
240
|
this.onKnobBlur = () => {
|
|
240
241
|
// Check if focus is moving to another knob within the same range
|
|
@@ -246,15 +247,9 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
246
247
|
if (!isStillFocusedOnKnob) {
|
|
247
248
|
if (this.hasFocus) {
|
|
248
249
|
this.hasFocus = false;
|
|
250
|
+
this.focusedKnob = undefined;
|
|
249
251
|
this.ionBlur.emit();
|
|
250
252
|
}
|
|
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
|
-
}
|
|
258
253
|
}
|
|
259
254
|
}, 0);
|
|
260
255
|
};
|
|
@@ -511,7 +506,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
511
506
|
ratio = 1 - ratio;
|
|
512
507
|
}
|
|
513
508
|
this.pressedKnob = !this.dualKnobs || Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio) ? 'A' : 'B';
|
|
514
|
-
this.setFocus(this.pressedKnob);
|
|
515
509
|
}
|
|
516
510
|
get valA() {
|
|
517
511
|
return ratioToValue(this.ratioA, this.min, this.max, this.step);
|
|
@@ -538,9 +532,23 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
538
532
|
updateRatio() {
|
|
539
533
|
const value = this.getValue();
|
|
540
534
|
const { min, max } = this;
|
|
535
|
+
/**
|
|
536
|
+
* For dual knobs, value gives lower/upper but not which is A vs B.
|
|
537
|
+
* Assign (lowerRatio, upperRatio) to (ratioA, ratioB) in the way that
|
|
538
|
+
* minimizes change from the current ratios so the knobs don't swap.
|
|
539
|
+
*/
|
|
541
540
|
if (this.dualKnobs) {
|
|
542
|
-
|
|
543
|
-
|
|
541
|
+
const lowerRatio = valueToRatio(value.lower, min, max);
|
|
542
|
+
const upperRatio = valueToRatio(value.upper, min, max);
|
|
543
|
+
if (Math.abs(this.ratioA - lowerRatio) + Math.abs(this.ratioB - upperRatio) <=
|
|
544
|
+
Math.abs(this.ratioA - upperRatio) + Math.abs(this.ratioB - lowerRatio)) {
|
|
545
|
+
this.ratioA = lowerRatio;
|
|
546
|
+
this.ratioB = upperRatio;
|
|
547
|
+
}
|
|
548
|
+
else {
|
|
549
|
+
this.ratioA = upperRatio;
|
|
550
|
+
this.ratioB = lowerRatio;
|
|
551
|
+
}
|
|
544
552
|
}
|
|
545
553
|
else {
|
|
546
554
|
this.ratioA = valueToRatio(value, min, max);
|
|
@@ -557,14 +565,6 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
557
565
|
};
|
|
558
566
|
this.noUpdate = false;
|
|
559
567
|
}
|
|
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
|
-
}
|
|
568
568
|
/**
|
|
569
569
|
* Returns true if content was passed to the "start" slot
|
|
570
570
|
*/
|
|
@@ -582,7 +582,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
582
582
|
}
|
|
583
583
|
renderRangeSlider() {
|
|
584
584
|
var _a;
|
|
585
|
-
const { min, max, step, handleKeyboard, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
|
|
585
|
+
const { min, max, step, handleKeyboard, focusedKnob, pressedKnob, disabled, pin, ratioLower, ratioUpper, pinFormatter, inheritedAttributes, } = this;
|
|
586
586
|
let barStart = `${ratioLower * 100}%`;
|
|
587
587
|
let barEnd = `${100 - ratioUpper * 100}%`;
|
|
588
588
|
const rtl = isRTL(this.el);
|
|
@@ -642,7 +642,9 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
642
642
|
ticks.push(tick);
|
|
643
643
|
}
|
|
644
644
|
}
|
|
645
|
-
return (h("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl),
|
|
645
|
+
return (h("div", { class: "range-slider", ref: (rangeEl) => (this.rangeSlider = rangeEl), onPointerDown: () => {
|
|
646
|
+
this.focusFromPointer = true;
|
|
647
|
+
},
|
|
646
648
|
/**
|
|
647
649
|
* Since the gesture has a threshold, the value
|
|
648
650
|
* won't change until the user has dragged past
|
|
@@ -655,6 +657,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
655
657
|
* we need to listen for the "pointerUp" event.
|
|
656
658
|
*/
|
|
657
659
|
onPointerUp: (ev) => {
|
|
660
|
+
this.focusFromPointer = false;
|
|
658
661
|
/**
|
|
659
662
|
* If the user drags the knob on the web
|
|
660
663
|
* version (does not occur on mobile),
|
|
@@ -680,7 +683,10 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
680
683
|
'has-ticks': ticks.length > 0,
|
|
681
684
|
}, role: "presentation", style: barStyle, part: "bar-active" })), renderKnob(rtl, {
|
|
682
685
|
knob: 'A',
|
|
686
|
+
position: this.dualKnobs ? (this.ratioA <= this.ratioB ? 'lower' : 'upper') : 'lower',
|
|
687
|
+
dualKnobs: this.dualKnobs,
|
|
683
688
|
pressed: pressedKnob === 'A',
|
|
689
|
+
focused: focusedKnob === 'A',
|
|
684
690
|
value: this.valA,
|
|
685
691
|
ratio: this.ratioA,
|
|
686
692
|
pin,
|
|
@@ -695,7 +701,10 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
695
701
|
}), this.dualKnobs &&
|
|
696
702
|
renderKnob(rtl, {
|
|
697
703
|
knob: 'B',
|
|
704
|
+
position: this.ratioB <= this.ratioA ? 'lower' : 'upper',
|
|
705
|
+
dualKnobs: this.dualKnobs,
|
|
698
706
|
pressed: pressedKnob === 'B',
|
|
707
|
+
focused: focusedKnob === 'B',
|
|
699
708
|
value: this.valB,
|
|
700
709
|
ratio: this.ratioB,
|
|
701
710
|
pin,
|
|
@@ -732,10 +741,11 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
732
741
|
const valueAtMin = dualKnobs ? this.valA === min || this.valB === min : this.valA === min;
|
|
733
742
|
const valueAtMax = dualKnobs ? this.valA === max || this.valB === max : this.valA === max;
|
|
734
743
|
renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);
|
|
735
|
-
return (h(Host, { key: '
|
|
744
|
+
return (h(Host, { key: '6f3ac66d528c499f840afd31fa3958f2749c9ff5', onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: createColorClasses(this.color, {
|
|
736
745
|
[mode]: true,
|
|
737
746
|
'in-item': inItem,
|
|
738
747
|
'range-disabled': disabled,
|
|
748
|
+
'range-dual-knobs': dualKnobs,
|
|
739
749
|
'range-pressed': pressedKnob !== undefined,
|
|
740
750
|
'range-has-pin': pin,
|
|
741
751
|
[`range-label-placement-${labelPlacement}`]: true,
|
|
@@ -743,10 +753,10 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
743
753
|
'range-item-end-adjustment': needsEndAdjustment,
|
|
744
754
|
'range-value-min': valueAtMin,
|
|
745
755
|
'range-value-max': valueAtMax,
|
|
746
|
-
}) }, h("label", { key: '
|
|
756
|
+
}) }, h("label", { key: 'a33e928dc37228bd4e1c4d3f804a7bb49d484088', class: "range-wrapper", id: "range-label" }, h("div", { key: '5d4b885fd1a87621734244701838f86d5145b914', class: {
|
|
747
757
|
'label-text-wrapper': true,
|
|
748
758
|
'label-text-wrapper-hidden': !hasLabel,
|
|
749
|
-
}, part: "label" }, label !== undefined ? h("div", { class: "label-text" }, label) : h("slot", { name: "label" })), h("div", { key: '
|
|
759
|
+
}, part: "label" }, label !== undefined ? h("div", { class: "label-text" }, label) : h("slot", { name: "label" })), h("div", { key: '335a10bdb191a179c426ecba3541adada6d6aeb8', class: "native-wrapper" }, h("slot", { key: '57dc846d33d0e1b1f4f18fc8553dc7fa2cca70bf', name: "start" }), this.renderRangeSlider(), h("slot", { key: '57f85044b4f507015d905a73dca9d13a224560b1', name: "end" })))));
|
|
750
760
|
}
|
|
751
761
|
get el() { return this; }
|
|
752
762
|
static get watchers() { return {
|
|
@@ -781,7 +791,8 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
781
791
|
"labelPlacement": [1, "label-placement"],
|
|
782
792
|
"ratioA": [32],
|
|
783
793
|
"ratioB": [32],
|
|
784
|
-
"pressedKnob": [32]
|
|
794
|
+
"pressedKnob": [32],
|
|
795
|
+
"focusedKnob": [32]
|
|
785
796
|
}, undefined, {
|
|
786
797
|
"debounce": ["debounceChanged"],
|
|
787
798
|
"min": ["minChanged"],
|
|
@@ -791,7 +802,7 @@ const Range = /*@__PURE__*/ proxyCustomElement(class Range extends HTMLElement {
|
|
|
791
802
|
"disabled": ["disabledChanged"],
|
|
792
803
|
"value": ["valueChanged"]
|
|
793
804
|
}]);
|
|
794
|
-
const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, }) => {
|
|
805
|
+
const renderKnob = (rtl, { knob, position, dualKnobs, value, ratio, min, max, disabled, pressed, focused, pin, handleKeyboard, pinFormatter, inheritedAttributes, onKnobFocus, onKnobBlur, }) => {
|
|
795
806
|
const start = rtl ? 'right' : 'left';
|
|
796
807
|
const knobStyle = () => {
|
|
797
808
|
const style = {};
|
|
@@ -814,14 +825,45 @@ const renderKnob = (rtl, { knob, value, ratio, min, max, disabled, pressed, pin,
|
|
|
814
825
|
}
|
|
815
826
|
}, onFocus: () => onKnobFocus(knob), onBlur: onKnobBlur, class: {
|
|
816
827
|
'range-knob-handle': true,
|
|
817
|
-
'range-knob-a': knob === 'A',
|
|
818
|
-
'range-knob-b': knob === 'B',
|
|
828
|
+
'range-knob-handle-a': knob === 'A',
|
|
829
|
+
'range-knob-handle-b': knob === 'B',
|
|
819
830
|
'range-knob-pressed': pressed,
|
|
820
831
|
'range-knob-min': value === min,
|
|
821
832
|
'range-knob-max': value === max,
|
|
822
833
|
'ion-activatable': true,
|
|
823
834
|
'ion-focusable': true,
|
|
824
|
-
|
|
835
|
+
'ion-focused': focused,
|
|
836
|
+
}, part: [
|
|
837
|
+
'knob-handle',
|
|
838
|
+
dualKnobs && knob === 'A' && 'knob-handle-a',
|
|
839
|
+
dualKnobs && knob === 'B' && 'knob-handle-b',
|
|
840
|
+
dualKnobs && position === 'lower' && 'knob-handle-lower',
|
|
841
|
+
dualKnobs && position === 'upper' && 'knob-handle-upper',
|
|
842
|
+
pressed && 'pressed',
|
|
843
|
+
focused && 'focused',
|
|
844
|
+
]
|
|
845
|
+
.filter(Boolean)
|
|
846
|
+
.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: [
|
|
847
|
+
'pin',
|
|
848
|
+
dualKnobs && knob === 'A' && 'pin-a',
|
|
849
|
+
dualKnobs && knob === 'B' && 'pin-b',
|
|
850
|
+
dualKnobs && position === 'lower' && 'pin-lower',
|
|
851
|
+
dualKnobs && position === 'upper' && 'pin-upper',
|
|
852
|
+
pressed && 'pressed',
|
|
853
|
+
focused && 'focused',
|
|
854
|
+
]
|
|
855
|
+
.filter(Boolean)
|
|
856
|
+
.join(' ') }, pinFormatter(value))), h("div", { class: "range-knob", role: "presentation", part: [
|
|
857
|
+
'knob',
|
|
858
|
+
dualKnobs && knob === 'A' && 'knob-a',
|
|
859
|
+
dualKnobs && knob === 'B' && 'knob-b',
|
|
860
|
+
dualKnobs && position === 'lower' && 'knob-lower',
|
|
861
|
+
dualKnobs && position === 'upper' && 'knob-upper',
|
|
862
|
+
pressed && 'pressed',
|
|
863
|
+
focused && 'focused',
|
|
864
|
+
]
|
|
865
|
+
.filter(Boolean)
|
|
866
|
+
.join(' ') })));
|
|
825
867
|
};
|
|
826
868
|
const ratioToValue = (ratio, min, max, step) => {
|
|
827
869
|
let value = (max - min) * ratio;
|
|
@@ -1393,7 +1393,7 @@ const Datetime = class {
|
|
|
1393
1393
|
const todayString = workingParts.day !== null
|
|
1394
1394
|
? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
|
|
1395
1395
|
: `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
|
|
1396
|
-
return (index.h("ion-picker-column", { "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
|
|
1396
|
+
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
|
|
1397
1397
|
const { value } = ev.detail;
|
|
1398
1398
|
const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
|
|
1399
1399
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
|
|
@@ -1468,7 +1468,7 @@ const Datetime = class {
|
|
|
1468
1468
|
const { disabled, workingParts } = this;
|
|
1469
1469
|
const activePart = this.getActivePartsWithFallback();
|
|
1470
1470
|
const pickerColumnValue = (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined;
|
|
1471
|
-
return (index.h("ion-picker-column", { "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
|
|
1471
|
+
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
|
|
1472
1472
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
|
|
1473
1473
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
|
|
1474
1474
|
ev.stopPropagation();
|
|
@@ -1480,7 +1480,7 @@ const Datetime = class {
|
|
|
1480
1480
|
}
|
|
1481
1481
|
const { disabled, workingParts } = this;
|
|
1482
1482
|
const activePart = this.getActivePartsWithFallback();
|
|
1483
|
-
return (index.h("ion-picker-column", { "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
|
|
1483
|
+
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
|
|
1484
1484
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
|
|
1485
1485
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
|
|
1486
1486
|
ev.stopPropagation();
|
|
@@ -1492,7 +1492,7 @@ const Datetime = class {
|
|
|
1492
1492
|
}
|
|
1493
1493
|
const { disabled, workingParts } = this;
|
|
1494
1494
|
const activePart = this.getActivePartsWithFallback();
|
|
1495
|
-
return (index.h("ion-picker-column", { "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
|
|
1495
|
+
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
|
|
1496
1496
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
|
|
1497
1497
|
this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
|
|
1498
1498
|
ev.stopPropagation();
|
|
@@ -1525,7 +1525,7 @@ const Datetime = class {
|
|
|
1525
1525
|
if (hoursData.length === 0)
|
|
1526
1526
|
return [];
|
|
1527
1527
|
const activePart = this.getActivePartsWithFallback();
|
|
1528
|
-
return (index.h("ion-picker-column", { "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
|
|
1528
|
+
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
|
|
1529
1529
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
|
|
1530
1530
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { hour: ev.detail.value }));
|
|
1531
1531
|
ev.stopPropagation();
|
|
@@ -1536,7 +1536,7 @@ const Datetime = class {
|
|
|
1536
1536
|
if (minutesData.length === 0)
|
|
1537
1537
|
return [];
|
|
1538
1538
|
const activePart = this.getActivePartsWithFallback();
|
|
1539
|
-
return (index.h("ion-picker-column", { "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
|
|
1539
|
+
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
|
|
1540
1540
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
|
|
1541
1541
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { minute: ev.detail.value }));
|
|
1542
1542
|
ev.stopPropagation();
|
|
@@ -1549,7 +1549,7 @@ const Datetime = class {
|
|
|
1549
1549
|
}
|
|
1550
1550
|
const activePart = this.getActivePartsWithFallback();
|
|
1551
1551
|
const isDayPeriodRTL = data.isLocaleDayPeriodRTL(this.locale);
|
|
1552
|
-
return (index.h("ion-picker-column", { "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
|
|
1552
|
+
return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
|
|
1553
1553
|
const hour = data.calculateHourFromAMPM(workingParts, ev.detail.value);
|
|
1554
1554
|
this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
|
|
1555
1555
|
this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { ampm: ev.detail.value, hour }));
|
|
@@ -1891,7 +1891,7 @@ const Datetime = class {
|
|
|
1891
1891
|
const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
|
|
1892
1892
|
const hasWheelVariant = hasDatePresentation && preferWheel;
|
|
1893
1893
|
helpers.renderHiddenInput(true, el, name, data.formatValue(value), disabled);
|
|
1894
|
-
return (index.h(index.Host, { key: '
|
|
1894
|
+
return (index.h(index.Host, { key: '19e20c9b6b5f9467e91a2567b6dc7d9d38b56cc3', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, theme.createColorClasses(color, {
|
|
1895
1895
|
[mode]: true,
|
|
1896
1896
|
['datetime-readonly']: readonly,
|
|
1897
1897
|
['datetime-disabled']: disabled,
|
|
@@ -1901,7 +1901,7 @@ const Datetime = class {
|
|
|
1901
1901
|
[`datetime-size-${size}`]: true,
|
|
1902
1902
|
[`datetime-prefer-wheel`]: hasWheelVariant,
|
|
1903
1903
|
[`datetime-grid`]: isGridStyle,
|
|
1904
|
-
})) }, index.h("div", { key: '
|
|
1904
|
+
})) }, index.h("div", { key: 'e31b5ef76cd6262dafd39f2d21980887880ec32e', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
|
|
1905
1905
|
}
|
|
1906
1906
|
get el() { return index.getElement(this); }
|
|
1907
1907
|
static get watchers() { return {
|
|
@@ -1921,6 +1921,7 @@ const Datetime = class {
|
|
|
1921
1921
|
let datetimeIds = 0;
|
|
1922
1922
|
const CANCEL_ROLE = 'datetime-cancel';
|
|
1923
1923
|
const CONFIRM_ROLE = 'datetime-confirm';
|
|
1924
|
+
const WHEEL_PART = 'wheel';
|
|
1924
1925
|
const WHEEL_ITEM_PART = 'wheel-item';
|
|
1925
1926
|
const WHEEL_ITEM_ACTIVE_PART = `active`;
|
|
1926
1927
|
Datetime.style = {
|