@ionic/core 8.3.2-dev.11726766329.1f0ae0fa → 8.3.2-dev.11726779768.16e1f1d2
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-segment.js +20 -20
- package/dist/cjs/ion-segment_2.cjs.entry.js +20 -20
- package/dist/collection/components/segment/segment.js +20 -20
- package/dist/docs.json +1 -1
- package/dist/esm/ion-segment_2.entry.js +20 -20
- package/dist/esm-es5/ion-segment_2.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-322c5fb4.system.js +1 -1
- package/dist/ionic/p-44d1539c.system.entry.js +4 -0
- package/dist/ionic/p-82ab7ccb.entry.js +4 -0
- package/hydrate/index.js +20 -20
- package/hydrate/index.mjs +20 -20
- package/package.json +1 -1
- package/dist/ionic/p-58191231.entry.js +0 -4
- package/dist/ionic/p-58b5dfe7.system.entry.js +0 -4
|
@@ -285,36 +285,36 @@ const Segment = /*@__PURE__*/ proxyCustomElement(class Segment extends HTMLEleme
|
|
|
285
285
|
* scroll container.
|
|
286
286
|
*/
|
|
287
287
|
const centeredX = activeButtonLeft - scrollContainerBox.width / 2 + activeButtonBox.width / 2;
|
|
288
|
-
console.log(centeredX);
|
|
289
288
|
/**
|
|
290
|
-
*
|
|
289
|
+
* newScrollPosition is the absolute scroll position that the
|
|
290
|
+
* container needs to move to in order to center the active button.
|
|
291
|
+
* It is calculated by adding the current scroll position
|
|
292
|
+
* (scrollLeft) to the offset needed to center the button
|
|
293
|
+
* (centeredX).
|
|
294
|
+
*/
|
|
295
|
+
const newScrollPosition = el.scrollLeft + centeredX;
|
|
296
|
+
/**
|
|
297
|
+
* We intentionally use scrollTo here instead of scrollIntoView
|
|
291
298
|
* to avoid a WebKit bug where accelerated animations break
|
|
292
299
|
* when using scrollIntoView. Using scrollIntoView will cause the
|
|
293
300
|
* segment container to jump during the transition and then snap into place.
|
|
294
301
|
* This is because scrollIntoView can potentially cause parent element
|
|
295
|
-
* containers to also scroll.
|
|
302
|
+
* containers to also scroll. scrollTo does not have this same behavior, so
|
|
296
303
|
* we use this API instead.
|
|
297
304
|
*
|
|
305
|
+
* scrollTo is used instead of scrollBy because there is a
|
|
306
|
+
* Webkit bug that causes scrollBy to not work smoothly when
|
|
307
|
+
* the active button is near the edge of the scroll container.
|
|
308
|
+
* This leads to the buttons to jump around during the transition.
|
|
309
|
+
*
|
|
298
310
|
* Note that if there is not enough scrolling space to center the element
|
|
299
311
|
* within the scroll container, the browser will attempt
|
|
300
312
|
* to center by as much as it can.
|
|
301
313
|
*/
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
// behavior: smoothScroll ? 'smooth' : 'instant',
|
|
306
|
-
// });
|
|
307
|
-
activeButton.scrollIntoView({
|
|
314
|
+
el.scrollTo({
|
|
315
|
+
top: 0,
|
|
316
|
+
left: newScrollPosition,
|
|
308
317
|
behavior: smoothScroll ? 'smooth' : 'instant',
|
|
309
|
-
inline: 'center',
|
|
310
|
-
/**
|
|
311
|
-
* Segment should scroll on the
|
|
312
|
-
* horizontal axis. `block: 'nearest'`
|
|
313
|
-
* ensures that the vertical axis
|
|
314
|
-
* does not scroll if the segment
|
|
315
|
-
* as a whole is already in view.
|
|
316
|
-
*/
|
|
317
|
-
block: 'nearest',
|
|
318
318
|
});
|
|
319
319
|
}
|
|
320
320
|
}
|
|
@@ -442,14 +442,14 @@ const Segment = /*@__PURE__*/ proxyCustomElement(class Segment extends HTMLEleme
|
|
|
442
442
|
}
|
|
443
443
|
render() {
|
|
444
444
|
const mode = getIonMode(this);
|
|
445
|
-
return (h(Host, { key: '
|
|
445
|
+
return (h(Host, { key: 'f1f7103b4c298e037df850ac809a1a7c6e9987a7', role: "tablist", onClick: this.onClick, class: createColorClasses(this.color, {
|
|
446
446
|
[mode]: true,
|
|
447
447
|
'in-toolbar': hostContext('ion-toolbar', this.el),
|
|
448
448
|
'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
|
449
449
|
'segment-activated': this.activated,
|
|
450
450
|
'segment-disabled': this.disabled,
|
|
451
451
|
'segment-scrollable': this.scrollable,
|
|
452
|
-
}) }, h("slot", { key: '
|
|
452
|
+
}) }, h("slot", { key: '6efdb318b13da8d21687084aa0761728fdf12579', onSlotchange: this.onSlottedItemsChange })));
|
|
453
453
|
}
|
|
454
454
|
get el() { return this; }
|
|
455
455
|
static get watchers() { return {
|
|
@@ -287,36 +287,36 @@ const Segment = class {
|
|
|
287
287
|
* scroll container.
|
|
288
288
|
*/
|
|
289
289
|
const centeredX = activeButtonLeft - scrollContainerBox.width / 2 + activeButtonBox.width / 2;
|
|
290
|
-
console.log(centeredX);
|
|
291
290
|
/**
|
|
292
|
-
*
|
|
291
|
+
* newScrollPosition is the absolute scroll position that the
|
|
292
|
+
* container needs to move to in order to center the active button.
|
|
293
|
+
* It is calculated by adding the current scroll position
|
|
294
|
+
* (scrollLeft) to the offset needed to center the button
|
|
295
|
+
* (centeredX).
|
|
296
|
+
*/
|
|
297
|
+
const newScrollPosition = el.scrollLeft + centeredX;
|
|
298
|
+
/**
|
|
299
|
+
* We intentionally use scrollTo here instead of scrollIntoView
|
|
293
300
|
* to avoid a WebKit bug where accelerated animations break
|
|
294
301
|
* when using scrollIntoView. Using scrollIntoView will cause the
|
|
295
302
|
* segment container to jump during the transition and then snap into place.
|
|
296
303
|
* This is because scrollIntoView can potentially cause parent element
|
|
297
|
-
* containers to also scroll.
|
|
304
|
+
* containers to also scroll. scrollTo does not have this same behavior, so
|
|
298
305
|
* we use this API instead.
|
|
299
306
|
*
|
|
307
|
+
* scrollTo is used instead of scrollBy because there is a
|
|
308
|
+
* Webkit bug that causes scrollBy to not work smoothly when
|
|
309
|
+
* the active button is near the edge of the scroll container.
|
|
310
|
+
* This leads to the buttons to jump around during the transition.
|
|
311
|
+
*
|
|
300
312
|
* Note that if there is not enough scrolling space to center the element
|
|
301
313
|
* within the scroll container, the browser will attempt
|
|
302
314
|
* to center by as much as it can.
|
|
303
315
|
*/
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
// behavior: smoothScroll ? 'smooth' : 'instant',
|
|
308
|
-
// });
|
|
309
|
-
activeButton.scrollIntoView({
|
|
316
|
+
el.scrollTo({
|
|
317
|
+
top: 0,
|
|
318
|
+
left: newScrollPosition,
|
|
310
319
|
behavior: smoothScroll ? 'smooth' : 'instant',
|
|
311
|
-
inline: 'center',
|
|
312
|
-
/**
|
|
313
|
-
* Segment should scroll on the
|
|
314
|
-
* horizontal axis. `block: 'nearest'`
|
|
315
|
-
* ensures that the vertical axis
|
|
316
|
-
* does not scroll if the segment
|
|
317
|
-
* as a whole is already in view.
|
|
318
|
-
*/
|
|
319
|
-
block: 'nearest',
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
322
|
}
|
|
@@ -444,14 +444,14 @@ const Segment = class {
|
|
|
444
444
|
}
|
|
445
445
|
render() {
|
|
446
446
|
const mode = ionicGlobal.getIonMode(this);
|
|
447
|
-
return (index.h(index.Host, { key: '
|
|
447
|
+
return (index.h(index.Host, { key: 'f1f7103b4c298e037df850ac809a1a7c6e9987a7', role: "tablist", onClick: this.onClick, class: theme.createColorClasses(this.color, {
|
|
448
448
|
[mode]: true,
|
|
449
449
|
'in-toolbar': theme.hostContext('ion-toolbar', this.el),
|
|
450
450
|
'in-toolbar-color': theme.hostContext('ion-toolbar[color]', this.el),
|
|
451
451
|
'segment-activated': this.activated,
|
|
452
452
|
'segment-disabled': this.disabled,
|
|
453
453
|
'segment-scrollable': this.scrollable,
|
|
454
|
-
}) }, index.h("slot", { key: '
|
|
454
|
+
}) }, index.h("slot", { key: '6efdb318b13da8d21687084aa0761728fdf12579', onSlotchange: this.onSlottedItemsChange })));
|
|
455
455
|
}
|
|
456
456
|
get el() { return index.getElement(this); }
|
|
457
457
|
static get watchers() { return {
|
|
@@ -275,36 +275,36 @@ export class Segment {
|
|
|
275
275
|
* scroll container.
|
|
276
276
|
*/
|
|
277
277
|
const centeredX = activeButtonLeft - scrollContainerBox.width / 2 + activeButtonBox.width / 2;
|
|
278
|
-
console.log(centeredX);
|
|
279
278
|
/**
|
|
280
|
-
*
|
|
279
|
+
* newScrollPosition is the absolute scroll position that the
|
|
280
|
+
* container needs to move to in order to center the active button.
|
|
281
|
+
* It is calculated by adding the current scroll position
|
|
282
|
+
* (scrollLeft) to the offset needed to center the button
|
|
283
|
+
* (centeredX).
|
|
284
|
+
*/
|
|
285
|
+
const newScrollPosition = el.scrollLeft + centeredX;
|
|
286
|
+
/**
|
|
287
|
+
* We intentionally use scrollTo here instead of scrollIntoView
|
|
281
288
|
* to avoid a WebKit bug where accelerated animations break
|
|
282
289
|
* when using scrollIntoView. Using scrollIntoView will cause the
|
|
283
290
|
* segment container to jump during the transition and then snap into place.
|
|
284
291
|
* This is because scrollIntoView can potentially cause parent element
|
|
285
|
-
* containers to also scroll.
|
|
292
|
+
* containers to also scroll. scrollTo does not have this same behavior, so
|
|
286
293
|
* we use this API instead.
|
|
287
294
|
*
|
|
295
|
+
* scrollTo is used instead of scrollBy because there is a
|
|
296
|
+
* Webkit bug that causes scrollBy to not work smoothly when
|
|
297
|
+
* the active button is near the edge of the scroll container.
|
|
298
|
+
* This leads to the buttons to jump around during the transition.
|
|
299
|
+
*
|
|
288
300
|
* Note that if there is not enough scrolling space to center the element
|
|
289
301
|
* within the scroll container, the browser will attempt
|
|
290
302
|
* to center by as much as it can.
|
|
291
303
|
*/
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
// behavior: smoothScroll ? 'smooth' : 'instant',
|
|
296
|
-
// });
|
|
297
|
-
activeButton.scrollIntoView({
|
|
304
|
+
el.scrollTo({
|
|
305
|
+
top: 0,
|
|
306
|
+
left: newScrollPosition,
|
|
298
307
|
behavior: smoothScroll ? 'smooth' : 'instant',
|
|
299
|
-
inline: 'center',
|
|
300
|
-
/**
|
|
301
|
-
* Segment should scroll on the
|
|
302
|
-
* horizontal axis. `block: 'nearest'`
|
|
303
|
-
* ensures that the vertical axis
|
|
304
|
-
* does not scroll if the segment
|
|
305
|
-
* as a whole is already in view.
|
|
306
|
-
*/
|
|
307
|
-
block: 'nearest',
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
310
|
}
|
|
@@ -434,14 +434,14 @@ export class Segment {
|
|
|
434
434
|
}
|
|
435
435
|
render() {
|
|
436
436
|
const mode = getIonMode(this);
|
|
437
|
-
return (h(Host, { key: '
|
|
437
|
+
return (h(Host, { key: 'f1f7103b4c298e037df850ac809a1a7c6e9987a7', role: "tablist", onClick: this.onClick, class: createColorClasses(this.color, {
|
|
438
438
|
[mode]: true,
|
|
439
439
|
'in-toolbar': hostContext('ion-toolbar', this.el),
|
|
440
440
|
'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
|
441
441
|
'segment-activated': this.activated,
|
|
442
442
|
'segment-disabled': this.disabled,
|
|
443
443
|
'segment-scrollable': this.scrollable,
|
|
444
|
-
}) }, h("slot", { key: '
|
|
444
|
+
}) }, h("slot", { key: '6efdb318b13da8d21687084aa0761728fdf12579', onSlotchange: this.onSlottedItemsChange })));
|
|
445
445
|
}
|
|
446
446
|
static get is() { return "ion-segment"; }
|
|
447
447
|
static get encapsulation() { return "shadow"; }
|
package/dist/docs.json
CHANGED
|
@@ -283,36 +283,36 @@ const Segment = class {
|
|
|
283
283
|
* scroll container.
|
|
284
284
|
*/
|
|
285
285
|
const centeredX = activeButtonLeft - scrollContainerBox.width / 2 + activeButtonBox.width / 2;
|
|
286
|
-
console.log(centeredX);
|
|
287
286
|
/**
|
|
288
|
-
*
|
|
287
|
+
* newScrollPosition is the absolute scroll position that the
|
|
288
|
+
* container needs to move to in order to center the active button.
|
|
289
|
+
* It is calculated by adding the current scroll position
|
|
290
|
+
* (scrollLeft) to the offset needed to center the button
|
|
291
|
+
* (centeredX).
|
|
292
|
+
*/
|
|
293
|
+
const newScrollPosition = el.scrollLeft + centeredX;
|
|
294
|
+
/**
|
|
295
|
+
* We intentionally use scrollTo here instead of scrollIntoView
|
|
289
296
|
* to avoid a WebKit bug where accelerated animations break
|
|
290
297
|
* when using scrollIntoView. Using scrollIntoView will cause the
|
|
291
298
|
* segment container to jump during the transition and then snap into place.
|
|
292
299
|
* This is because scrollIntoView can potentially cause parent element
|
|
293
|
-
* containers to also scroll.
|
|
300
|
+
* containers to also scroll. scrollTo does not have this same behavior, so
|
|
294
301
|
* we use this API instead.
|
|
295
302
|
*
|
|
303
|
+
* scrollTo is used instead of scrollBy because there is a
|
|
304
|
+
* Webkit bug that causes scrollBy to not work smoothly when
|
|
305
|
+
* the active button is near the edge of the scroll container.
|
|
306
|
+
* This leads to the buttons to jump around during the transition.
|
|
307
|
+
*
|
|
296
308
|
* Note that if there is not enough scrolling space to center the element
|
|
297
309
|
* within the scroll container, the browser will attempt
|
|
298
310
|
* to center by as much as it can.
|
|
299
311
|
*/
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
// behavior: smoothScroll ? 'smooth' : 'instant',
|
|
304
|
-
// });
|
|
305
|
-
activeButton.scrollIntoView({
|
|
312
|
+
el.scrollTo({
|
|
313
|
+
top: 0,
|
|
314
|
+
left: newScrollPosition,
|
|
306
315
|
behavior: smoothScroll ? 'smooth' : 'instant',
|
|
307
|
-
inline: 'center',
|
|
308
|
-
/**
|
|
309
|
-
* Segment should scroll on the
|
|
310
|
-
* horizontal axis. `block: 'nearest'`
|
|
311
|
-
* ensures that the vertical axis
|
|
312
|
-
* does not scroll if the segment
|
|
313
|
-
* as a whole is already in view.
|
|
314
|
-
*/
|
|
315
|
-
block: 'nearest',
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
318
|
}
|
|
@@ -440,14 +440,14 @@ const Segment = class {
|
|
|
440
440
|
}
|
|
441
441
|
render() {
|
|
442
442
|
const mode = getIonMode(this);
|
|
443
|
-
return (h(Host, { key: '
|
|
443
|
+
return (h(Host, { key: 'f1f7103b4c298e037df850ac809a1a7c6e9987a7', role: "tablist", onClick: this.onClick, class: createColorClasses(this.color, {
|
|
444
444
|
[mode]: true,
|
|
445
445
|
'in-toolbar': hostContext('ion-toolbar', this.el),
|
|
446
446
|
'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
|
447
447
|
'segment-activated': this.activated,
|
|
448
448
|
'segment-disabled': this.disabled,
|
|
449
449
|
'segment-scrollable': this.scrollable,
|
|
450
|
-
}) }, h("slot", { key: '
|
|
450
|
+
}) }, h("slot", { key: '6efdb318b13da8d21687084aa0761728fdf12579', onSlotchange: this.onSlottedItemsChange })));
|
|
451
451
|
}
|
|
452
452
|
get el() { return getElement(this); }
|
|
453
453
|
static get watchers() { return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{__awaiter,__generator}from"tslib";
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{r as registerInstance,d as createEvent,w as writeTask,h,f as Host,i as getElement,j as forceUpdate}from"./index-28849c61.js";import{r as raf,a as addEventListener,b as removeEventListener,h as inheritAttributes}from"./helpers-da915de8.js";import{i as isRTL}from"./dir-babeabeb.js";import{c as createColorClasses,h as hostContext}from"./theme-01f3f29c.js";import{b as getIonMode}from"./ionic-global-c81d82ab.js";var segmentIosCss=":host{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:grid;grid-auto-columns:1fr;position:relative;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:center;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.segment-scrollable){-ms-flex-pack:start;justify-content:start;width:auto;overflow-x:auto;grid-auto-columns:minmax(-webkit-min-content, 1fr);grid-auto-columns:minmax(min-content, 1fr)}:host(.segment-scrollable::-webkit-scrollbar){display:none}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.065);border-radius:8px;overflow:hidden;z-index:0}:host(.ion-color){background:rgba(var(--ion-color-base-rgb), 0.065)}:host(.in-toolbar){-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;width:auto}:host(.in-toolbar:not(.ion-color)){background:var(--ion-toolbar-segment-background, var(--background))}:host(.in-toolbar-color:not(.ion-color)){background:rgba(var(--ion-color-contrast-rgb), 0.11)}";var IonSegmentIosStyle0=segmentIosCss;var segmentMdCss=":host{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:grid;grid-auto-columns:1fr;position:relative;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:center;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.segment-scrollable){-ms-flex-pack:start;justify-content:start;width:auto;overflow-x:auto;grid-auto-columns:minmax(-webkit-min-content, 1fr);grid-auto-columns:minmax(min-content, 1fr)}:host(.segment-scrollable::-webkit-scrollbar){display:none}:host{--background:transparent;grid-auto-columns:minmax(auto, 360px)}:host(.in-toolbar){min-height:var(--min-height)}:host(.segment-scrollable) ::slotted(ion-segment-button){min-width:auto}";var IonSegmentMdStyle0=segmentMdCss;var Segment=function(){function t(t){var o=this;registerInstance(this,t);this.ionChange=createEvent(this,"ionChange",7);this.ionSelect=createEvent(this,"ionSelect",7);this.ionStyle=createEvent(this,"ionStyle",7);this.onClick=function(t){var n=t.target;var e=o.checked;if(n.tagName==="ION-SEGMENT"){return}o.value=n.value;if(n!==e){o.emitValueChange()}if(o.scrollable||!o.swipeGesture){if(e){o.checkButton(e,n)}else{o.setCheckedClasses()}}};this.onSlottedItemsChange=function(){o.valueChanged(o.value)};this.getSegmentButton=function(t){var n,e;var i=o.getButtons().filter((function(t){return!t.disabled}));var r=i.findIndex((function(t){return t===document.activeElement}));switch(t){case"first":return i[0];case"last":return i[i.length-1];case"next":return(n=i[r+1])!==null&&n!==void 0?n:i[0];case"previous":return(e=i[r-1])!==null&&e!==void 0?e:i[i.length-1];default:return null}};this.activated=false;this.color=undefined;this.disabled=false;this.scrollable=false;this.swipeGesture=true;this.value=undefined;this.selectOnFocus=false}t.prototype.colorChanged=function(t,o){if(o===undefined&&t!==undefined||o!==undefined&&t===undefined){this.emitStyle()}};t.prototype.swipeGestureChanged=function(){this.gestureChanged()};t.prototype.valueChanged=function(t){this.ionSelect.emit({value:t});this.scrollActiveButtonIntoView()};t.prototype.disabledChanged=function(){this.gestureChanged();var t=this.getButtons();for(var o=0,n=t;o<n.length;o++){var e=n[o];e.disabled=this.disabled}};t.prototype.gestureChanged=function(){if(this.gesture){this.gesture.enable(!this.scrollable&&!this.disabled&&this.swipeGesture)}};t.prototype.connectedCallback=function(){this.emitStyle()};t.prototype.componentWillLoad=function(){this.emitStyle()};t.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;var o=this;return __generator(this,(function(n){switch(n.label){case 0:this.setCheckedClasses();raf((function(){o.scrollActiveButtonIntoView(false)}));t=this;return[4,import("./index-39782642.js")];case 1:t.gesture=n.sent().createGesture({el:this.el,gestureName:"segment",gesturePriority:100,threshold:0,passive:false,onStart:function(t){return o.onStart(t)},onMove:function(t){return o.onMove(t)},onEnd:function(t){return o.onEnd(t)}});this.gestureChanged();if(this.disabled){this.disabledChanged()}return[2]}}))}))};t.prototype.onStart=function(t){this.valueBeforeGesture=this.value;this.activate(t)};t.prototype.onMove=function(t){this.setNextIndex(t)};t.prototype.onEnd=function(t){this.setActivated(false);this.setNextIndex(t,true);t.event.stopImmediatePropagation();var o=this.value;if(o!==undefined){if(this.valueBeforeGesture!==o){this.emitValueChange()}}this.valueBeforeGesture=undefined};t.prototype.emitValueChange=function(){var t=this.value;this.ionChange.emit({value:t})};t.prototype.getButtons=function(){return Array.from(this.el.querySelectorAll("ion-segment-button"))};Object.defineProperty(t.prototype,"checked",{get:function(){var t=this;return this.getButtons().find((function(o){return o.value===t.value}))},enumerable:false,configurable:true});t.prototype.setActivated=function(t){var o=this.getButtons();o.forEach((function(o){if(t){o.classList.add("segment-button-activated")}else{o.classList.remove("segment-button-activated")}}));this.activated=t};t.prototype.activate=function(t){var o=this;var n=t.event.target;var e=this.getButtons();var i=e.find((function(t){return t.value===o.value}));if(n.tagName!=="ION-SEGMENT-BUTTON"){return}if(!i){this.value=n.value;this.setCheckedClasses()}if(this.value===n.value){this.setActivated(true)}};t.prototype.getIndicator=function(t){var o=t.shadowRoot||t;return o.querySelector(".segment-button-indicator")};t.prototype.checkButton=function(t,o){var n=this.getIndicator(t);var e=this.getIndicator(o);if(n===null||e===null){return}var i=n.getBoundingClientRect();var r=e.getBoundingClientRect();var a=i.width/r.width;var s=i.left-r.left;var c="translate3d(".concat(s,"px, 0, 0) scaleX(").concat(a,")");writeTask((function(){e.classList.remove("segment-button-indicator-animated");e.style.setProperty("transform",c);e.getBoundingClientRect();e.classList.add("segment-button-indicator-animated");e.style.setProperty("transform","")}));this.value=o.value;this.setCheckedClasses()};t.prototype.setCheckedClasses=function(){var t=this;var o=this.getButtons();var n=o.findIndex((function(o){return o.value===t.value}));var e=n+1;for(var i=0,r=o;i<r.length;i++){var a=r[i];a.classList.remove("segment-button-after-checked")}if(e<o.length){o[e].classList.add("segment-button-after-checked")}};t.prototype.scrollActiveButtonIntoView=function(t){if(t===void 0){t=true}var o=this,n=o.scrollable,e=o.value,i=o.el;if(n){var r=this.getButtons();var a=r.find((function(t){return t.value===e}));if(a!==undefined){var s=i.getBoundingClientRect();var c=a.getBoundingClientRect();var l=c.x-s.x;var d=l-s.width/2+c.width/2;console.log(d);a.scrollIntoView({behavior:t?"smooth":"instant",inline:"center",block:"nearest"})}}};t.prototype.setNextIndex=function(t,o){var n=this;if(o===void 0){o=false}var e=isRTL(this.el);var i=this.activated;var r=this.getButtons();var a=r.findIndex((function(t){return t.value===n.value}));var s=r[a];var c;var l;if(a===-1){return}var d=s.getBoundingClientRect();var u=d.left;var b=d.width;var h=t.currentX;var g=d.top+d.height/2;var m=this.el.getRootNode();var f=m.elementFromPoint(h,g);var v=e?h>u+b:h<u;var p=e?h<u:h>u+b;if(i&&!o){if(v){var k=a-1;if(k>=0){l=k}}else if(p){if(i&&!o){var k=a+1;if(k<r.length){l=k}}}if(l!==undefined&&!r[l].disabled){c=r[l]}}if(!i&&o){c=f}if(c!=null){if(c.tagName==="ION-SEGMENT"){return false}if(s!==c){this.checkButton(s,c)}}return true};t.prototype.emitStyle=function(){this.ionStyle.emit({segment:true})};t.prototype.onKeyDown=function(t){var o=isRTL(this.el);var n=this.selectOnFocus;var e;switch(t.key){case"ArrowRight":t.preventDefault();e=o?this.getSegmentButton("previous"):this.getSegmentButton("next");break;case"ArrowLeft":t.preventDefault();e=o?this.getSegmentButton("next"):this.getSegmentButton("previous");break;case"Home":t.preventDefault();e=this.getSegmentButton("first");break;case"End":t.preventDefault();e=this.getSegmentButton("last");break;case" ":case"Enter":t.preventDefault();e=document.activeElement;n=true}if(!e){return}if(n){var i=this.checked;this.checkButton(i||e,e);if(e!==i){this.emitValueChange()}}e.setFocus()};t.prototype.render=function(){var t;var o=getIonMode(this);return h(Host,{key:"9d42778203585659c31de3ab828b3627852eef5f",role:"tablist",onClick:this.onClick,class:createColorClasses(this.color,(t={},t[o]=true,t["in-toolbar"]=hostContext("ion-toolbar",this.el),t["in-toolbar-color"]=hostContext("ion-toolbar[color]",this.el),t["segment-activated"]=this.activated,t["segment-disabled"]=this.disabled,t["segment-scrollable"]=this.scrollable,t))},h("slot",{key:"da2b189aba7ff6d02aa7e0f1b4ce227a6cd28cef",onSlotchange:this.onSlottedItemsChange}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{color:["colorChanged"],swipeGesture:["swipeGestureChanged"],value:["valueChanged"],disabled:["disabledChanged"]}},enumerable:false,configurable:true});return t}();Segment.style={ios:IonSegmentIosStyle0,md:IonSegmentMdStyle0};var segmentButtonIosCss=':host{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:column;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;grid-row:1;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;-webkit-transition:var(--transition);transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:inherit;flex-flow:inherit;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.segment-button-checked){background:var(--background-checked);color:var(--color-checked)}:host(.segment-button-disabled){cursor:default;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(:focus){outline:none}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.segment-button-checked:hover) .button-native{color:var(--color-checked)}}::slotted(ion-icon){-ms-flex-negative:0;flex-shrink:0;-ms-flex-order:-1;order:-1;pointer-events:none}::slotted(ion-label){display:block;-ms-flex-item-align:center;align-self:center;max-width:100%;line-height:22px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}:host(.segment-button-layout-icon-top) .button-native{-ms-flex-direction:column;flex-direction:column}:host(.segment-button-layout-icon-start) .button-native{-ms-flex-direction:row;flex-direction:row}:host(.segment-button-layout-icon-end) .button-native{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.segment-button-layout-icon-bottom) .button-native{-ms-flex-direction:column-reverse;flex-direction:column-reverse}:host(.segment-button-layout-icon-hide) ::slotted(ion-icon){display:none}:host(.segment-button-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color, var(--color-checked))}.segment-button-indicator{-webkit-transform-origin:left;transform-origin:left;position:absolute;opacity:0;-webkit-box-sizing:border-box;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}.segment-button-indicator-background{width:100%;height:var(--indicator-height);-webkit-transform:var(--indicator-transform);transform:var(--indicator-transform);-webkit-box-shadow:var(--indicator-box-shadow);box-shadow:var(--indicator-box-shadow);pointer-events:none}.segment-button-indicator-animated{-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition)}:host(.segment-button-checked) .segment-button-indicator{opacity:1}@media (prefers-reduced-motion: reduce){.segment-button-indicator-background{-webkit-transform:none;transform:none}.segment-button-indicator-animated{-webkit-transition:none;transition:none}}:host{--background:none;--background-checked:none;--background-hover:none;--background-hover-opacity:0;--background-focused:none;--background-focused-opacity:0;--border-radius:7px;--border-width:1px;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--border-style:solid;--indicator-box-shadow:0 0 5px rgba(0, 0, 0, 0.16);--indicator-color:var(--ion-color-step-350, var(--ion-background-color-step-350, var(--ion-background-color, #fff)));--indicator-height:100%;--indicator-transition:transform 260ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--transition:100ms all linear;--padding-top:0;--padding-end:13px;--padding-bottom:0;--padding-start:13px;margin-top:2px;margin-bottom:2px;position:relative;-ms-flex-direction:row;flex-direction:row;min-width:70px;min-height:28px;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);font-size:13px;font-weight:450;line-height:37px}:host::before{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px;-webkit-transition:160ms opacity ease-in-out;transition:160ms opacity ease-in-out;-webkit-transition-delay:100ms;transition-delay:100ms;border-left:var(--border-width) var(--border-style) var(--border-color);content:"";opacity:1;will-change:opacity}:host(:first-of-type)::before{border-left-color:transparent}:host(.segment-button-disabled){opacity:0.3}::slotted(ion-icon){font-size:24px}:host(.segment-button-layout-icon-start) ::slotted(ion-label){-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:0;margin-inline-end:0}:host(.segment-button-layout-icon-end) ::slotted(ion-label){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:2px;margin-inline-end:2px}.segment-button-indicator{-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:2px;padding-inline-end:2px;left:0;right:0;top:0;bottom:0}.segment-button-indicator-background{border-radius:var(--border-radius);background:var(--indicator-color)}.segment-button-indicator-background{-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition)}:host(.segment-button-checked)::before,:host(.segment-button-after-checked)::before{opacity:0}:host(.segment-button-checked){z-index:-1}:host(.segment-button-activated){--indicator-transform:scale(0.95)}:host(.ion-focused) .button-native{opacity:0.7}@media (any-hover: hover){:host(:hover) .button-native{opacity:0.5}:host(.segment-button-checked:hover) .button-native{opacity:1}}:host(.in-segment-color){background:none;color:var(--ion-text-color, #000)}:host(.in-segment-color) .segment-button-indicator-background{background:var(--ion-color-step-350, var(--ion-background-color-step-350, var(--ion-background-color, #fff)))}@media (any-hover: hover){:host(.in-segment-color:hover) .button-native,:host(.in-segment-color.segment-button-checked:hover) .button-native{color:var(--ion-text-color, #000)}}:host(.in-toolbar:not(.in-segment-color)){--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, var(--ion-toolbar-color), initial);--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-toolbar-color), initial);--indicator-color:var(--ion-toolbar-segment-indicator-color, var(--ion-color-step-350, var(--ion-background-color-step-350, var(--ion-background-color, #fff))))}:host(.in-toolbar-color) .segment-button-indicator-background{background:var(--ion-color-contrast)}:host(.in-toolbar-color:not(.in-segment-color)) .button-native{color:var(--ion-color-contrast)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native{color:var(--ion-color-base)}@media (any-hover: hover){:host(.in-toolbar-color:not(.in-segment-color):hover) .button-native{color:var(--ion-color-contrast)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color):hover) .button-native{color:var(--ion-color-base)}}';var IonSegmentButtonIosStyle0=segmentButtonIosCss;var segmentButtonMdCss=':host{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:column;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;grid-row:1;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;-webkit-transition:var(--transition);transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:inherit;flex-flow:inherit;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.segment-button-checked){background:var(--background-checked);color:var(--color-checked)}:host(.segment-button-disabled){cursor:default;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(:focus){outline:none}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.segment-button-checked:hover) .button-native{color:var(--color-checked)}}::slotted(ion-icon){-ms-flex-negative:0;flex-shrink:0;-ms-flex-order:-1;order:-1;pointer-events:none}::slotted(ion-label){display:block;-ms-flex-item-align:center;align-self:center;max-width:100%;line-height:22px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}:host(.segment-button-layout-icon-top) .button-native{-ms-flex-direction:column;flex-direction:column}:host(.segment-button-layout-icon-start) .button-native{-ms-flex-direction:row;flex-direction:row}:host(.segment-button-layout-icon-end) .button-native{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.segment-button-layout-icon-bottom) .button-native{-ms-flex-direction:column-reverse;flex-direction:column-reverse}:host(.segment-button-layout-icon-hide) ::slotted(ion-icon){display:none}:host(.segment-button-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color, var(--color-checked))}.segment-button-indicator{-webkit-transform-origin:left;transform-origin:left;position:absolute;opacity:0;-webkit-box-sizing:border-box;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}.segment-button-indicator-background{width:100%;height:var(--indicator-height);-webkit-transform:var(--indicator-transform);transform:var(--indicator-transform);-webkit-box-shadow:var(--indicator-box-shadow);box-shadow:var(--indicator-box-shadow);pointer-events:none}.segment-button-indicator-animated{-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition)}:host(.segment-button-checked) .segment-button-indicator{opacity:1}@media (prefers-reduced-motion: reduce){.segment-button-indicator-background{-webkit-transform:none;transform:none}.segment-button-indicator-animated{-webkit-transition:none;transition:none}}:host{--background:none;--background-checked:none;--background-hover:var(--color-checked);--background-focused:var(--color-checked);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--color-checked:var(--ion-color-primary, #0054e9);--indicator-box-shadow:none;--indicator-color:var(--color-checked);--indicator-height:2px;--indicator-transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--padding-top:0;--padding-end:16px;--padding-bottom:0;--padding-start:16px;--transition:color 0.15s linear 0s, opacity 0.15s linear 0s;min-width:90px;min-height:48px;border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);font-size:14px;font-weight:500;letter-spacing:0.06em;line-height:40px;text-transform:uppercase}:host(.segment-button-disabled){opacity:0.3}:host(.in-segment-color){background:none;color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}:host(.in-segment-color) ion-ripple-effect{color:var(--ion-color-base)}:host(.in-segment-color) .segment-button-indicator-background{background:var(--ion-color-base)}:host(.in-segment-color.segment-button-checked) .button-native{color:var(--ion-color-base)}:host(.in-segment-color.ion-focused) .button-native::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.in-segment-color:hover) .button-native{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}:host(.in-segment-color:hover) .button-native::after{background:var(--ion-color-base)}:host(.in-segment-color.segment-button-checked:hover) .button-native{color:var(--ion-color-base)}}:host(.in-toolbar:not(.in-segment-color)){--background:var(--ion-toolbar-segment-background, none);--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6));--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-color-primary, #0054e9));--indicator-color:var(--ion-toolbar-segment-color-checked, var(--color-checked))}:host(.in-toolbar-color:not(.in-segment-color)) .button-native{color:rgba(var(--ion-color-contrast-rgb), 0.6)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native{color:var(--ion-color-contrast)}@media (any-hover: hover){:host(.in-toolbar-color:not(.in-segment-color)) .button-native::after{background:var(--ion-color-contrast)}}::slotted(ion-icon){margin-top:12px;margin-bottom:12px;font-size:24px}::slotted(ion-label){margin-top:12px;margin-bottom:12px}:host(.segment-button-layout-icon-top) ::slotted(ion-label),:host(.segment-button-layout-icon-bottom) ::slotted(ion-icon){margin-top:0}:host(.segment-button-layout-icon-top) ::slotted(ion-icon),:host(.segment-button-layout-icon-bottom) ::slotted(ion-label){margin-bottom:0}:host(.segment-button-layout-icon-start) ::slotted(ion-label){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:0;margin-inline-end:0}:host(.segment-button-layout-icon-end) ::slotted(ion-label){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}:host(.segment-button-has-icon-only) ::slotted(ion-icon){margin-top:12px;margin-bottom:12px}:host(.segment-button-has-label-only) ::slotted(ion-label){margin-top:12px;margin-bottom:12px}.segment-button-indicator{left:0;right:0;bottom:0}.segment-button-indicator-background{background:var(--indicator-color)}:host(.in-toolbar:not(.in-segment-color)) .segment-button-indicator-background{background:var(--ion-toolbar-segment-indicator-color, var(--indicator-color))}:host(.in-toolbar-color:not(.in-segment-color)) .segment-button-indicator-background{background:var(--ion-color-contrast)}';var IonSegmentButtonMdStyle0=segmentButtonMdCss;var ids=0;var SegmentButton=function(){function t(t){var o=this;registerInstance(this,t);this.segmentEl=null;this.inheritedAttributes={};this.updateStyle=function(){forceUpdate(o)};this.updateState=function(){var t=o.segmentEl;if(t){o.checked=t.value===o.value;if(t.disabled){o.disabled=true}}};this.checked=false;this.disabled=false;this.layout="icon-top";this.type="button";this.value="ion-sb-"+ids++}t.prototype.valueChanged=function(){this.updateState()};t.prototype.connectedCallback=function(){var t=this.segmentEl=this.el.closest("ion-segment");if(t){this.updateState();addEventListener(t,"ionSelect",this.updateState);addEventListener(t,"ionStyle",this.updateStyle)}};t.prototype.disconnectedCallback=function(){var t=this.segmentEl;if(t){removeEventListener(t,"ionSelect",this.updateState);removeEventListener(t,"ionStyle",this.updateStyle);this.segmentEl=null}};t.prototype.componentWillLoad=function(){this.inheritedAttributes=Object.assign({},inheritAttributes(this.el,["aria-label"]))};Object.defineProperty(t.prototype,"hasLabel",{get:function(){return!!this.el.querySelector("ion-label")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hasIcon",{get:function(){return!!this.el.querySelector("ion-icon")},enumerable:false,configurable:true});t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(o){t=this.nativeEl;if(t!==undefined){t.focus()}return[2]}))}))};t.prototype.render=function(){var t;var o=this;var n=this,e=n.checked,i=n.type,r=n.disabled,a=n.hasIcon,s=n.hasLabel,c=n.layout,l=n.segmentEl;var d=getIonMode(this);var u=function(){return(l===null||l===void 0?void 0:l.color)!==undefined};return h(Host,{key:"70cf5c7a3ae2620222c5250c644faf3cfc3b3e4e",class:(t={},t[d]=true,t["in-toolbar"]=hostContext("ion-toolbar",this.el),t["in-toolbar-color"]=hostContext("ion-toolbar[color]",this.el),t["in-segment"]=hostContext("ion-segment",this.el),t["in-segment-color"]=u(),t["segment-button-has-label"]=s,t["segment-button-has-icon"]=a,t["segment-button-has-label-only"]=s&&!a,t["segment-button-has-icon-only"]=a&&!s,t["segment-button-disabled"]=r,t["segment-button-checked"]=e,t["segment-button-layout-".concat(c)]=true,t["ion-activatable"]=true,t["ion-activatable-instant"]=true,t["ion-focusable"]=true,t)},h("button",Object.assign({key:"a53c9f1e360934e8d2e90476642ba4507fc38ebd","aria-selected":e?"true":"false",role:"tab",ref:function(t){return o.nativeEl=t},type:i,class:"button-native",part:"native",disabled:r},this.inheritedAttributes),h("span",{key:"7d8feda840d389941cc693f500b5eba0b39b41da",class:"button-inner"},h("slot",{key:"d9ae1eec45db253cbf573d29cd545658dd595d87"})),d==="md"&&h("ion-ripple-effect",{key:"49e6a16968709dc9b3fc77bc9fb99acb42fda88c"})),h("div",{key:"4e3ea0989ed5205dbb03586e4facb439b05a92de",part:"indicator",class:{"segment-button-indicator":true,"segment-button-indicator-animated":true}},h("div",{key:"65c72a151080998c1e548c87d4d4ebd5c7dda72f",part:"indicator-background",class:"segment-button-indicator-background"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}();SegmentButton.style={ios:IonSegmentButtonIosStyle0,md:IonSegmentButtonMdStyle0};export{Segment as ion_segment,SegmentButton as ion_segment_button};
|
|
4
|
+
*/import{r as registerInstance,d as createEvent,w as writeTask,h,f as Host,i as getElement,j as forceUpdate}from"./index-28849c61.js";import{r as raf,a as addEventListener,b as removeEventListener,h as inheritAttributes}from"./helpers-da915de8.js";import{i as isRTL}from"./dir-babeabeb.js";import{c as createColorClasses,h as hostContext}from"./theme-01f3f29c.js";import{b as getIonMode}from"./ionic-global-c81d82ab.js";var segmentIosCss=":host{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:grid;grid-auto-columns:1fr;position:relative;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:center;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.segment-scrollable){-ms-flex-pack:start;justify-content:start;width:auto;overflow-x:auto;grid-auto-columns:minmax(-webkit-min-content, 1fr);grid-auto-columns:minmax(min-content, 1fr)}:host(.segment-scrollable::-webkit-scrollbar){display:none}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.065);border-radius:8px;overflow:hidden;z-index:0}:host(.ion-color){background:rgba(var(--ion-color-base-rgb), 0.065)}:host(.in-toolbar){-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;width:auto}:host(.in-toolbar:not(.ion-color)){background:var(--ion-toolbar-segment-background, var(--background))}:host(.in-toolbar-color:not(.ion-color)){background:rgba(var(--ion-color-contrast-rgb), 0.11)}";var IonSegmentIosStyle0=segmentIosCss;var segmentMdCss=":host{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:grid;grid-auto-columns:1fr;position:relative;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:center;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.segment-scrollable){-ms-flex-pack:start;justify-content:start;width:auto;overflow-x:auto;grid-auto-columns:minmax(-webkit-min-content, 1fr);grid-auto-columns:minmax(min-content, 1fr)}:host(.segment-scrollable::-webkit-scrollbar){display:none}:host{--background:transparent;grid-auto-columns:minmax(auto, 360px)}:host(.in-toolbar){min-height:var(--min-height)}:host(.segment-scrollable) ::slotted(ion-segment-button){min-width:auto}";var IonSegmentMdStyle0=segmentMdCss;var Segment=function(){function t(t){var o=this;registerInstance(this,t);this.ionChange=createEvent(this,"ionChange",7);this.ionSelect=createEvent(this,"ionSelect",7);this.ionStyle=createEvent(this,"ionStyle",7);this.onClick=function(t){var n=t.target;var e=o.checked;if(n.tagName==="ION-SEGMENT"){return}o.value=n.value;if(n!==e){o.emitValueChange()}if(o.scrollable||!o.swipeGesture){if(e){o.checkButton(e,n)}else{o.setCheckedClasses()}}};this.onSlottedItemsChange=function(){o.valueChanged(o.value)};this.getSegmentButton=function(t){var n,e;var i=o.getButtons().filter((function(t){return!t.disabled}));var r=i.findIndex((function(t){return t===document.activeElement}));switch(t){case"first":return i[0];case"last":return i[i.length-1];case"next":return(n=i[r+1])!==null&&n!==void 0?n:i[0];case"previous":return(e=i[r-1])!==null&&e!==void 0?e:i[i.length-1];default:return null}};this.activated=false;this.color=undefined;this.disabled=false;this.scrollable=false;this.swipeGesture=true;this.value=undefined;this.selectOnFocus=false}t.prototype.colorChanged=function(t,o){if(o===undefined&&t!==undefined||o!==undefined&&t===undefined){this.emitStyle()}};t.prototype.swipeGestureChanged=function(){this.gestureChanged()};t.prototype.valueChanged=function(t){this.ionSelect.emit({value:t});this.scrollActiveButtonIntoView()};t.prototype.disabledChanged=function(){this.gestureChanged();var t=this.getButtons();for(var o=0,n=t;o<n.length;o++){var e=n[o];e.disabled=this.disabled}};t.prototype.gestureChanged=function(){if(this.gesture){this.gesture.enable(!this.scrollable&&!this.disabled&&this.swipeGesture)}};t.prototype.connectedCallback=function(){this.emitStyle()};t.prototype.componentWillLoad=function(){this.emitStyle()};t.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;var o=this;return __generator(this,(function(n){switch(n.label){case 0:this.setCheckedClasses();raf((function(){o.scrollActiveButtonIntoView(false)}));t=this;return[4,import("./index-39782642.js")];case 1:t.gesture=n.sent().createGesture({el:this.el,gestureName:"segment",gesturePriority:100,threshold:0,passive:false,onStart:function(t){return o.onStart(t)},onMove:function(t){return o.onMove(t)},onEnd:function(t){return o.onEnd(t)}});this.gestureChanged();if(this.disabled){this.disabledChanged()}return[2]}}))}))};t.prototype.onStart=function(t){this.valueBeforeGesture=this.value;this.activate(t)};t.prototype.onMove=function(t){this.setNextIndex(t)};t.prototype.onEnd=function(t){this.setActivated(false);this.setNextIndex(t,true);t.event.stopImmediatePropagation();var o=this.value;if(o!==undefined){if(this.valueBeforeGesture!==o){this.emitValueChange()}}this.valueBeforeGesture=undefined};t.prototype.emitValueChange=function(){var t=this.value;this.ionChange.emit({value:t})};t.prototype.getButtons=function(){return Array.from(this.el.querySelectorAll("ion-segment-button"))};Object.defineProperty(t.prototype,"checked",{get:function(){var t=this;return this.getButtons().find((function(o){return o.value===t.value}))},enumerable:false,configurable:true});t.prototype.setActivated=function(t){var o=this.getButtons();o.forEach((function(o){if(t){o.classList.add("segment-button-activated")}else{o.classList.remove("segment-button-activated")}}));this.activated=t};t.prototype.activate=function(t){var o=this;var n=t.event.target;var e=this.getButtons();var i=e.find((function(t){return t.value===o.value}));if(n.tagName!=="ION-SEGMENT-BUTTON"){return}if(!i){this.value=n.value;this.setCheckedClasses()}if(this.value===n.value){this.setActivated(true)}};t.prototype.getIndicator=function(t){var o=t.shadowRoot||t;return o.querySelector(".segment-button-indicator")};t.prototype.checkButton=function(t,o){var n=this.getIndicator(t);var e=this.getIndicator(o);if(n===null||e===null){return}var i=n.getBoundingClientRect();var r=e.getBoundingClientRect();var a=i.width/r.width;var s=i.left-r.left;var c="translate3d(".concat(s,"px, 0, 0) scaleX(").concat(a,")");writeTask((function(){e.classList.remove("segment-button-indicator-animated");e.style.setProperty("transform",c);e.getBoundingClientRect();e.classList.add("segment-button-indicator-animated");e.style.setProperty("transform","")}));this.value=o.value;this.setCheckedClasses()};t.prototype.setCheckedClasses=function(){var t=this;var o=this.getButtons();var n=o.findIndex((function(o){return o.value===t.value}));var e=n+1;for(var i=0,r=o;i<r.length;i++){var a=r[i];a.classList.remove("segment-button-after-checked")}if(e<o.length){o[e].classList.add("segment-button-after-checked")}};t.prototype.scrollActiveButtonIntoView=function(t){if(t===void 0){t=true}var o=this,n=o.scrollable,e=o.value,i=o.el;if(n){var r=this.getButtons();var a=r.find((function(t){return t.value===e}));if(a!==undefined){var s=i.getBoundingClientRect();var c=a.getBoundingClientRect();var l=c.x-s.x;var d=l-s.width/2+c.width/2;var u=i.scrollLeft+d;i.scrollTo({top:0,left:u,behavior:t?"smooth":"instant"})}}};t.prototype.setNextIndex=function(t,o){var n=this;if(o===void 0){o=false}var e=isRTL(this.el);var i=this.activated;var r=this.getButtons();var a=r.findIndex((function(t){return t.value===n.value}));var s=r[a];var c;var l;if(a===-1){return}var d=s.getBoundingClientRect();var u=d.left;var b=d.width;var h=t.currentX;var g=d.top+d.height/2;var m=this.el.getRootNode();var f=m.elementFromPoint(h,g);var v=e?h>u+b:h<u;var p=e?h<u:h>u+b;if(i&&!o){if(v){var k=a-1;if(k>=0){l=k}}else if(p){if(i&&!o){var k=a+1;if(k<r.length){l=k}}}if(l!==undefined&&!r[l].disabled){c=r[l]}}if(!i&&o){c=f}if(c!=null){if(c.tagName==="ION-SEGMENT"){return false}if(s!==c){this.checkButton(s,c)}}return true};t.prototype.emitStyle=function(){this.ionStyle.emit({segment:true})};t.prototype.onKeyDown=function(t){var o=isRTL(this.el);var n=this.selectOnFocus;var e;switch(t.key){case"ArrowRight":t.preventDefault();e=o?this.getSegmentButton("previous"):this.getSegmentButton("next");break;case"ArrowLeft":t.preventDefault();e=o?this.getSegmentButton("next"):this.getSegmentButton("previous");break;case"Home":t.preventDefault();e=this.getSegmentButton("first");break;case"End":t.preventDefault();e=this.getSegmentButton("last");break;case" ":case"Enter":t.preventDefault();e=document.activeElement;n=true}if(!e){return}if(n){var i=this.checked;this.checkButton(i||e,e);if(e!==i){this.emitValueChange()}}e.setFocus()};t.prototype.render=function(){var t;var o=getIonMode(this);return h(Host,{key:"f1f7103b4c298e037df850ac809a1a7c6e9987a7",role:"tablist",onClick:this.onClick,class:createColorClasses(this.color,(t={},t[o]=true,t["in-toolbar"]=hostContext("ion-toolbar",this.el),t["in-toolbar-color"]=hostContext("ion-toolbar[color]",this.el),t["segment-activated"]=this.activated,t["segment-disabled"]=this.disabled,t["segment-scrollable"]=this.scrollable,t))},h("slot",{key:"6efdb318b13da8d21687084aa0761728fdf12579",onSlotchange:this.onSlottedItemsChange}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{color:["colorChanged"],swipeGesture:["swipeGestureChanged"],value:["valueChanged"],disabled:["disabledChanged"]}},enumerable:false,configurable:true});return t}();Segment.style={ios:IonSegmentIosStyle0,md:IonSegmentMdStyle0};var segmentButtonIosCss=':host{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:column;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;grid-row:1;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;-webkit-transition:var(--transition);transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:inherit;flex-flow:inherit;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.segment-button-checked){background:var(--background-checked);color:var(--color-checked)}:host(.segment-button-disabled){cursor:default;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(:focus){outline:none}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.segment-button-checked:hover) .button-native{color:var(--color-checked)}}::slotted(ion-icon){-ms-flex-negative:0;flex-shrink:0;-ms-flex-order:-1;order:-1;pointer-events:none}::slotted(ion-label){display:block;-ms-flex-item-align:center;align-self:center;max-width:100%;line-height:22px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}:host(.segment-button-layout-icon-top) .button-native{-ms-flex-direction:column;flex-direction:column}:host(.segment-button-layout-icon-start) .button-native{-ms-flex-direction:row;flex-direction:row}:host(.segment-button-layout-icon-end) .button-native{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.segment-button-layout-icon-bottom) .button-native{-ms-flex-direction:column-reverse;flex-direction:column-reverse}:host(.segment-button-layout-icon-hide) ::slotted(ion-icon){display:none}:host(.segment-button-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color, var(--color-checked))}.segment-button-indicator{-webkit-transform-origin:left;transform-origin:left;position:absolute;opacity:0;-webkit-box-sizing:border-box;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}.segment-button-indicator-background{width:100%;height:var(--indicator-height);-webkit-transform:var(--indicator-transform);transform:var(--indicator-transform);-webkit-box-shadow:var(--indicator-box-shadow);box-shadow:var(--indicator-box-shadow);pointer-events:none}.segment-button-indicator-animated{-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition)}:host(.segment-button-checked) .segment-button-indicator{opacity:1}@media (prefers-reduced-motion: reduce){.segment-button-indicator-background{-webkit-transform:none;transform:none}.segment-button-indicator-animated{-webkit-transition:none;transition:none}}:host{--background:none;--background-checked:none;--background-hover:none;--background-hover-opacity:0;--background-focused:none;--background-focused-opacity:0;--border-radius:7px;--border-width:1px;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--border-style:solid;--indicator-box-shadow:0 0 5px rgba(0, 0, 0, 0.16);--indicator-color:var(--ion-color-step-350, var(--ion-background-color-step-350, var(--ion-background-color, #fff)));--indicator-height:100%;--indicator-transition:transform 260ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--transition:100ms all linear;--padding-top:0;--padding-end:13px;--padding-bottom:0;--padding-start:13px;margin-top:2px;margin-bottom:2px;position:relative;-ms-flex-direction:row;flex-direction:row;min-width:70px;min-height:28px;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);font-size:13px;font-weight:450;line-height:37px}:host::before{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px;-webkit-transition:160ms opacity ease-in-out;transition:160ms opacity ease-in-out;-webkit-transition-delay:100ms;transition-delay:100ms;border-left:var(--border-width) var(--border-style) var(--border-color);content:"";opacity:1;will-change:opacity}:host(:first-of-type)::before{border-left-color:transparent}:host(.segment-button-disabled){opacity:0.3}::slotted(ion-icon){font-size:24px}:host(.segment-button-layout-icon-start) ::slotted(ion-label){-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:0;margin-inline-end:0}:host(.segment-button-layout-icon-end) ::slotted(ion-label){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:2px;margin-inline-end:2px}.segment-button-indicator{-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:2px;padding-inline-end:2px;left:0;right:0;top:0;bottom:0}.segment-button-indicator-background{border-radius:var(--border-radius);background:var(--indicator-color)}.segment-button-indicator-background{-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition)}:host(.segment-button-checked)::before,:host(.segment-button-after-checked)::before{opacity:0}:host(.segment-button-checked){z-index:-1}:host(.segment-button-activated){--indicator-transform:scale(0.95)}:host(.ion-focused) .button-native{opacity:0.7}@media (any-hover: hover){:host(:hover) .button-native{opacity:0.5}:host(.segment-button-checked:hover) .button-native{opacity:1}}:host(.in-segment-color){background:none;color:var(--ion-text-color, #000)}:host(.in-segment-color) .segment-button-indicator-background{background:var(--ion-color-step-350, var(--ion-background-color-step-350, var(--ion-background-color, #fff)))}@media (any-hover: hover){:host(.in-segment-color:hover) .button-native,:host(.in-segment-color.segment-button-checked:hover) .button-native{color:var(--ion-text-color, #000)}}:host(.in-toolbar:not(.in-segment-color)){--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, var(--ion-toolbar-color), initial);--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-toolbar-color), initial);--indicator-color:var(--ion-toolbar-segment-indicator-color, var(--ion-color-step-350, var(--ion-background-color-step-350, var(--ion-background-color, #fff))))}:host(.in-toolbar-color) .segment-button-indicator-background{background:var(--ion-color-contrast)}:host(.in-toolbar-color:not(.in-segment-color)) .button-native{color:var(--ion-color-contrast)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native{color:var(--ion-color-base)}@media (any-hover: hover){:host(.in-toolbar-color:not(.in-segment-color):hover) .button-native{color:var(--ion-color-contrast)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color):hover) .button-native{color:var(--ion-color-base)}}';var IonSegmentButtonIosStyle0=segmentButtonIosCss;var segmentButtonMdCss=':host{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:column;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;grid-row:1;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;-webkit-transition:var(--transition);transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:inherit;flex-flow:inherit;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.segment-button-checked){background:var(--background-checked);color:var(--color-checked)}:host(.segment-button-disabled){cursor:default;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(:focus){outline:none}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.segment-button-checked:hover) .button-native{color:var(--color-checked)}}::slotted(ion-icon){-ms-flex-negative:0;flex-shrink:0;-ms-flex-order:-1;order:-1;pointer-events:none}::slotted(ion-label){display:block;-ms-flex-item-align:center;align-self:center;max-width:100%;line-height:22px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}:host(.segment-button-layout-icon-top) .button-native{-ms-flex-direction:column;flex-direction:column}:host(.segment-button-layout-icon-start) .button-native{-ms-flex-direction:row;flex-direction:row}:host(.segment-button-layout-icon-end) .button-native{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.segment-button-layout-icon-bottom) .button-native{-ms-flex-direction:column-reverse;flex-direction:column-reverse}:host(.segment-button-layout-icon-hide) ::slotted(ion-icon){display:none}:host(.segment-button-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color, var(--color-checked))}.segment-button-indicator{-webkit-transform-origin:left;transform-origin:left;position:absolute;opacity:0;-webkit-box-sizing:border-box;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}.segment-button-indicator-background{width:100%;height:var(--indicator-height);-webkit-transform:var(--indicator-transform);transform:var(--indicator-transform);-webkit-box-shadow:var(--indicator-box-shadow);box-shadow:var(--indicator-box-shadow);pointer-events:none}.segment-button-indicator-animated{-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition)}:host(.segment-button-checked) .segment-button-indicator{opacity:1}@media (prefers-reduced-motion: reduce){.segment-button-indicator-background{-webkit-transform:none;transform:none}.segment-button-indicator-animated{-webkit-transition:none;transition:none}}:host{--background:none;--background-checked:none;--background-hover:var(--color-checked);--background-focused:var(--color-checked);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--color-checked:var(--ion-color-primary, #0054e9);--indicator-box-shadow:none;--indicator-color:var(--color-checked);--indicator-height:2px;--indicator-transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--padding-top:0;--padding-end:16px;--padding-bottom:0;--padding-start:16px;--transition:color 0.15s linear 0s, opacity 0.15s linear 0s;min-width:90px;min-height:48px;border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);font-size:14px;font-weight:500;letter-spacing:0.06em;line-height:40px;text-transform:uppercase}:host(.segment-button-disabled){opacity:0.3}:host(.in-segment-color){background:none;color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}:host(.in-segment-color) ion-ripple-effect{color:var(--ion-color-base)}:host(.in-segment-color) .segment-button-indicator-background{background:var(--ion-color-base)}:host(.in-segment-color.segment-button-checked) .button-native{color:var(--ion-color-base)}:host(.in-segment-color.ion-focused) .button-native::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.in-segment-color:hover) .button-native{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}:host(.in-segment-color:hover) .button-native::after{background:var(--ion-color-base)}:host(.in-segment-color.segment-button-checked:hover) .button-native{color:var(--ion-color-base)}}:host(.in-toolbar:not(.in-segment-color)){--background:var(--ion-toolbar-segment-background, none);--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6));--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-color-primary, #0054e9));--indicator-color:var(--ion-toolbar-segment-color-checked, var(--color-checked))}:host(.in-toolbar-color:not(.in-segment-color)) .button-native{color:rgba(var(--ion-color-contrast-rgb), 0.6)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native{color:var(--ion-color-contrast)}@media (any-hover: hover){:host(.in-toolbar-color:not(.in-segment-color)) .button-native::after{background:var(--ion-color-contrast)}}::slotted(ion-icon){margin-top:12px;margin-bottom:12px;font-size:24px}::slotted(ion-label){margin-top:12px;margin-bottom:12px}:host(.segment-button-layout-icon-top) ::slotted(ion-label),:host(.segment-button-layout-icon-bottom) ::slotted(ion-icon){margin-top:0}:host(.segment-button-layout-icon-top) ::slotted(ion-icon),:host(.segment-button-layout-icon-bottom) ::slotted(ion-label){margin-bottom:0}:host(.segment-button-layout-icon-start) ::slotted(ion-label){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:0;margin-inline-end:0}:host(.segment-button-layout-icon-end) ::slotted(ion-label){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}:host(.segment-button-has-icon-only) ::slotted(ion-icon){margin-top:12px;margin-bottom:12px}:host(.segment-button-has-label-only) ::slotted(ion-label){margin-top:12px;margin-bottom:12px}.segment-button-indicator{left:0;right:0;bottom:0}.segment-button-indicator-background{background:var(--indicator-color)}:host(.in-toolbar:not(.in-segment-color)) .segment-button-indicator-background{background:var(--ion-toolbar-segment-indicator-color, var(--indicator-color))}:host(.in-toolbar-color:not(.in-segment-color)) .segment-button-indicator-background{background:var(--ion-color-contrast)}';var IonSegmentButtonMdStyle0=segmentButtonMdCss;var ids=0;var SegmentButton=function(){function t(t){var o=this;registerInstance(this,t);this.segmentEl=null;this.inheritedAttributes={};this.updateStyle=function(){forceUpdate(o)};this.updateState=function(){var t=o.segmentEl;if(t){o.checked=t.value===o.value;if(t.disabled){o.disabled=true}}};this.checked=false;this.disabled=false;this.layout="icon-top";this.type="button";this.value="ion-sb-"+ids++}t.prototype.valueChanged=function(){this.updateState()};t.prototype.connectedCallback=function(){var t=this.segmentEl=this.el.closest("ion-segment");if(t){this.updateState();addEventListener(t,"ionSelect",this.updateState);addEventListener(t,"ionStyle",this.updateStyle)}};t.prototype.disconnectedCallback=function(){var t=this.segmentEl;if(t){removeEventListener(t,"ionSelect",this.updateState);removeEventListener(t,"ionStyle",this.updateStyle);this.segmentEl=null}};t.prototype.componentWillLoad=function(){this.inheritedAttributes=Object.assign({},inheritAttributes(this.el,["aria-label"]))};Object.defineProperty(t.prototype,"hasLabel",{get:function(){return!!this.el.querySelector("ion-label")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"hasIcon",{get:function(){return!!this.el.querySelector("ion-icon")},enumerable:false,configurable:true});t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(o){t=this.nativeEl;if(t!==undefined){t.focus()}return[2]}))}))};t.prototype.render=function(){var t;var o=this;var n=this,e=n.checked,i=n.type,r=n.disabled,a=n.hasIcon,s=n.hasLabel,c=n.layout,l=n.segmentEl;var d=getIonMode(this);var u=function(){return(l===null||l===void 0?void 0:l.color)!==undefined};return h(Host,{key:"70cf5c7a3ae2620222c5250c644faf3cfc3b3e4e",class:(t={},t[d]=true,t["in-toolbar"]=hostContext("ion-toolbar",this.el),t["in-toolbar-color"]=hostContext("ion-toolbar[color]",this.el),t["in-segment"]=hostContext("ion-segment",this.el),t["in-segment-color"]=u(),t["segment-button-has-label"]=s,t["segment-button-has-icon"]=a,t["segment-button-has-label-only"]=s&&!a,t["segment-button-has-icon-only"]=a&&!s,t["segment-button-disabled"]=r,t["segment-button-checked"]=e,t["segment-button-layout-".concat(c)]=true,t["ion-activatable"]=true,t["ion-activatable-instant"]=true,t["ion-focusable"]=true,t)},h("button",Object.assign({key:"a53c9f1e360934e8d2e90476642ba4507fc38ebd","aria-selected":e?"true":"false",role:"tab",ref:function(t){return o.nativeEl=t},type:i,class:"button-native",part:"native",disabled:r},this.inheritedAttributes),h("span",{key:"7d8feda840d389941cc693f500b5eba0b39b41da",class:"button-inner"},h("slot",{key:"d9ae1eec45db253cbf573d29cd545658dd595d87"})),d==="md"&&h("ion-ripple-effect",{key:"49e6a16968709dc9b3fc77bc9fb99acb42fda88c"})),h("div",{key:"4e3ea0989ed5205dbb03586e4facb439b05a92de",part:"indicator",class:{"segment-button-indicator":true,"segment-button-indicator-animated":true}},h("div",{key:"65c72a151080998c1e548c87d4d4ebd5c7dda72f",part:"indicator-background",class:"segment-button-indicator-background"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}();SegmentButton.style={ios:IonSegmentButtonIosStyle0,md:IonSegmentButtonMdStyle0};export{Segment as ion_segment,SegmentButton as ion_segment_button};
|