@ionic/core 7.4.2 → 7.4.3-dev.11695994917.15d3036b
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-fab-list.js +1 -1
- package/components/ion-fab.js +1 -1
- package/components/ion-range.js +1 -0
- package/components/popover.js +3 -4
- package/dist/cjs/ion-fab_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-popover.cjs.entry.js +3 -4
- package/dist/cjs/ion-range.cjs.entry.js +1 -0
- package/dist/collection/components/fab/fab.css +88 -28
- package/dist/collection/components/fab/test/custom-size/fab.e2e.js +17 -0
- package/dist/collection/components/fab-list/fab-list.css +17 -10
- package/dist/collection/components/picker-column/test/test.utils.js +1 -1
- package/dist/collection/components/popover/utils.js +3 -4
- package/dist/collection/components/range/range.js +1 -0
- package/dist/collection/utils/test/playwright/page/utils/index.js +0 -1
- package/dist/collection/utils/test/playwright/playwright-page.js +1 -2
- package/dist/collection/utils/test/playwright/viewports/index.js +4 -0
- package/dist/docs.json +1 -1
- package/dist/esm/ion-fab_3.entry.js +2 -2
- package/dist/esm/ion-popover.entry.js +3 -4
- package/dist/esm/ion-range.entry.js +1 -0
- package/dist/esm-es5/ion-fab_3.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-range.entry.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-09e15a2a.system.entry.js → p-410beeda.system.entry.js} +1 -1
- package/dist/ionic/p-6dfeeadf.entry.js +4 -0
- package/dist/ionic/p-6edbc09b.system.js +1 -1
- package/dist/ionic/p-95f8cb47.entry.js +4 -0
- package/dist/ionic/p-a76e80db.entry.js +4 -0
- package/dist/ionic/p-af624417.system.entry.js +4 -0
- package/dist/ionic/p-c14fb011.system.entry.js +4 -0
- package/dist/types/utils/test/playwright/page/utils/index.d.ts +0 -1
- package/dist/types/utils/test/playwright/playwright-declarations.d.ts +0 -5
- package/dist/types/utils/test/playwright/viewports/index.d.ts +4 -0
- package/hydrate/index.js +6 -6
- package/package.json +2 -1
- package/dist/collection/utils/test/playwright/page/utils/get-snapshot-settings.js +0 -32
- package/dist/ionic/p-37456282.system.entry.js +0 -4
- package/dist/ionic/p-3af01ae0.system.entry.js +0 -4
- package/dist/ionic/p-3cbcb899.entry.js +0 -4
- package/dist/ionic/p-a720dc73.entry.js +0 -4
- package/dist/ionic/p-a8d33949.entry.js +0 -4
- package/dist/types/utils/test/playwright/page/utils/get-snapshot-settings.d.ts +0 -8
|
@@ -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,h,H as Host,f as getElement,d as createEvent}from"./index-2d388930.js";import{b as getIonMode}from"./ionic-global-b3fc28dd.js";import{i as inheritAriaAttributes}from"./helpers-3379ba19.js";import{h as hostContext,o as openURL,c as createColorClasses}from"./theme-17531cdf.js";import{t as close}from"./index-ecfc2c9f.js";var fabCss=":host{position:absolute;z-index:999}:host(.fab-horizontal-center){-webkit-margin-start:-28px;margin-inline-start:-28px}@supports (inset-inline-start: 0){:host(.fab-horizontal-center){inset-inline-start:50%}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-center){left:50%}:host-context([dir=rtl]):host(.fab-horizontal-center),:host-context([dir=rtl]).fab-horizontal-center{left:unset;right:unset;right:50%}@supports selector(:dir(rtl)){:host(.fab-horizontal-center):dir(rtl){left:unset;right:unset;right:50%}}}@supports (inset-inline-start: 0){:host(.fab-horizontal-start){inset-inline-start:calc(10px + var(--ion-safe-area-left, 0px))}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-start){left:calc(10px + var(--ion-safe-area-left, 0px))}:host-context([dir=rtl]):host(.fab-horizontal-start),:host-context([dir=rtl]).fab-horizontal-start{left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}@supports selector(:dir(rtl)){:host(.fab-horizontal-start):dir(rtl){left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}}}@supports (inset-inline-start: 0){:host(.fab-horizontal-end){inset-inline-end:calc(10px + var(--ion-safe-area-right, 0px))}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-end){right:calc(10px + var(--ion-safe-area-right, 0px))}:host-context([dir=rtl]):host(.fab-horizontal-end),:host-context([dir=rtl]).fab-horizontal-end{left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}@supports selector(:dir(rtl)){:host(.fab-horizontal-end):dir(rtl){left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}}}:host(.fab-vertical-top){top:10px}:host(.fab-vertical-top.fab-edge){top:-28px}:host(.fab-vertical-bottom){bottom:10px}:host(.fab-vertical-bottom.fab-edge){bottom:-28px}:host(.fab-vertical-center){margin-top:-28px;top:50%}";var Fab=function(){function t(t){registerInstance(this,t);this.horizontal=undefined;this.vertical=undefined;this.edge=false;this.activated=false}t.prototype.activatedChanged=function(){var t=this.activated;var o=this.getFab();if(o){o.activated=t}Array.from(this.el.querySelectorAll("ion-fab-list")).forEach((function(o){o.activated=t}))};t.prototype.componentDidLoad=function(){if(this.activated){this.activatedChanged()}};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.activated=false;return[2]}))}))};t.prototype.getFab=function(){return this.el.querySelector("ion-fab-button")};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(o){t=!!this.el.querySelector("ion-fab-list");if(t){this.activated=!this.activated}return[2]}))}))};t.prototype.render=function(){var t;var o=this,r=o.horizontal,i=o.vertical,n=o.edge;var e=getIonMode(this);return h(Host,{class:(t={},t[e]=true,t["fab-horizontal-".concat(r)]=r!==undefined,t["fab-vertical-".concat(i)]=i!==undefined,t["fab-edge"]=n,t)},h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{activated:["activatedChanged"]}},enumerable:false,configurable:true});return t}();Fab.style=fabCss;var fabButtonIosCss=':host{--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--background-hover:var(--ion-color-primary-contrast, #fff);--background-hover-opacity:.08;--transition:background-color, opacity 100ms linear;--ripple-color:currentColor;--border-radius:50%;--border-width:0;--border-style:none;--border-color:initial;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:56px;height:56px;font-size:14px;text-align:center;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);-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);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;display:block;position:relative;width:100%;height:100%;-webkit-transform:var(--transform);transform:var(--transform);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);background-clip:padding-box;color:var(--color);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:strict;cursor:pointer;overflow:hidden;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}::slotted(ion-icon){line-height:1}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{left:0;right:0;top:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;z-index:1}:host(.fab-button-disabled){cursor:default;opacity:0.5;pointer-events: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(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-activated) .button-native{color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}::slotted(ion-icon){line-height:1}:host(.fab-button-small){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px;margin-bottom:8px;width:40px;height:40px}.close-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;left:0;right:0;top:0;position:absolute;height:100%;-webkit-transform:scale(0.4) rotateZ(-45deg);transform:scale(0.4) rotateZ(-45deg);-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;font-size:var(--close-icon-font-size);opacity:0;z-index:1}:host(.fab-button-close-active) .close-icon{-webkit-transform:scale(1) rotateZ(0deg);transform:scale(1) rotateZ(0deg);opacity:1}:host(.fab-button-close-active) .button-inner{-webkit-transform:scale(0.4) rotateZ(45deg);transform:scale(0.4) rotateZ(45deg);opacity:0}ion-ripple-effect{color:var(--ripple-color)}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.fab-button-translucent) .button-native{-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}}:host(.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{--background:var(--ion-color-primary, #3880ff);--background-activated:var(--ion-color-primary-shade, #3171e0);--background-focused:var(--ion-color-primary-shade, #3171e0);--background-hover:var(--ion-color-primary-tint, #4c8dff);--background-activated-opacity:1;--background-focused-opacity:1;--background-hover-opacity:1;--color:var(--ion-color-primary-contrast, #fff);--box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);--transition:0.2s transform cubic-bezier(0.25, 1.11, 0.78, 1.59);--close-icon-font-size:28px}:host(.ion-activated){--box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);--transform:scale(1.1);--transition:0.2s transform ease-out}::slotted(ion-icon){font-size:28px}:host(.fab-button-in-list){--background:var(--ion-color-light, #f4f5f8);--background-activated:var(--ion-color-light-shade, #d7d8da);--background-focused:var(--background-activated);--background-hover:var(--ion-color-light-tint, #f5f6f9);--color:var(--ion-color-light-contrast, #000);--color-activated:var(--ion-color-light-contrast, #000);--color-focused:var(--color-activated);--transition:transform 200ms ease 10ms, opacity 200ms ease 10ms}:host(.fab-button-in-list) ::slotted(ion-icon){font-size:18px}:host(.ion-color.ion-focused) .button-native::after{background:var(--ion-color-shade)}:host(.ion-color.ion-focused) .button-native,:host(.ion-color.ion-activated) .button-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .button-native::after,:host(.ion-color.ion-activated) .button-native::after{background:var(--ion-color-shade)}@media (any-hover: hover){:host(.ion-color:hover) .button-native{color:var(--ion-color-contrast)}:host(.ion-color:hover) .button-native::after{background:var(--ion-color-tint)}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.fab-button-translucent){--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.9);--background-hover:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.8);--background-focused:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.82);--backdrop-filter:saturate(180%) blur(20px)}:host(.fab-button-translucent-in-list){--background:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.9);--background-hover:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.8);--background-focused:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.82)}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){@media (any-hover: hover){:host(.fab-button-translucent.ion-color:hover) .button-native{background:rgba(var(--ion-color-base-rgb), 0.8)}}:host(.ion-color.fab-button-translucent) .button-native{background:rgba(var(--ion-color-base-rgb), 0.9)}:host(.ion-color.ion-focused.fab-button-translucent) .button-native,:host(.ion-color.ion-activated.fab-button-translucent) .button-native{background:var(--ion-color-base)}}';var fabButtonMdCss=':host{--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--background-hover:var(--ion-color-primary-contrast, #fff);--background-hover-opacity:.08;--transition:background-color, opacity 100ms linear;--ripple-color:currentColor;--border-radius:50%;--border-width:0;--border-style:none;--border-color:initial;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:56px;height:56px;font-size:14px;text-align:center;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);-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);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;display:block;position:relative;width:100%;height:100%;-webkit-transform:var(--transform);transform:var(--transform);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);background-clip:padding-box;color:var(--color);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:strict;cursor:pointer;overflow:hidden;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}::slotted(ion-icon){line-height:1}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{left:0;right:0;top:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;z-index:1}:host(.fab-button-disabled){cursor:default;opacity:0.5;pointer-events: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(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-activated) .button-native{color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}::slotted(ion-icon){line-height:1}:host(.fab-button-small){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px;margin-bottom:8px;width:40px;height:40px}.close-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;left:0;right:0;top:0;position:absolute;height:100%;-webkit-transform:scale(0.4) rotateZ(-45deg);transform:scale(0.4) rotateZ(-45deg);-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;font-size:var(--close-icon-font-size);opacity:0;z-index:1}:host(.fab-button-close-active) .close-icon{-webkit-transform:scale(1) rotateZ(0deg);transform:scale(1) rotateZ(0deg);opacity:1}:host(.fab-button-close-active) .button-inner{-webkit-transform:scale(0.4) rotateZ(45deg);transform:scale(0.4) rotateZ(45deg);opacity:0}ion-ripple-effect{color:var(--ripple-color)}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.fab-button-translucent) .button-native{-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}}:host(.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{--background:var(--ion-color-primary, #3880ff);--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--background-activated-opacity:0;--background-focused-opacity:.24;--background-hover-opacity:.08;--color:var(--ion-color-primary-contrast, #fff);--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1), background-color 280ms cubic-bezier(0.4, 0, 0.2, 1), color 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 15ms linear 30ms, transform 270ms cubic-bezier(0, 0, 0.2, 1) 0ms;--close-icon-font-size:24px}:host(.ion-activated){--box-shadow:0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 12px 17px 2px rgba(0, 0, 0, 0.14), 0 5px 22px 4px rgba(0, 0, 0, 0.12)}::slotted(ion-icon){font-size:24px}:host(.fab-button-in-list){--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);--color-activated:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);--color-focused:var(--color-activated);--background:var(--ion-color-light, #f4f5f8);--background-activated:transparent;--background-focused:var(--ion-color-light-shade, #d7d8da);--background-hover:var(--ion-color-light-tint, #f5f6f9)}:host(.fab-button-in-list) ::slotted(ion-icon){font-size:18px}:host(.ion-color.ion-focused) .button-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .button-native::after{background:var(--ion-color-contrast)}:host(.ion-color.ion-activated) .button-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activated) .button-native::after{background:transparent}@media (any-hover: hover){:host(.ion-color:hover) .button-native{color:var(--ion-color-contrast)}:host(.ion-color:hover) .button-native::after{background:var(--ion-color-contrast)}}';var FabButton=function(){function t(t){var o=this;registerInstance(this,t);this.ionFocus=createEvent(this,"ionFocus",7);this.ionBlur=createEvent(this,"ionBlur",7);this.fab=null;this.inheritedAttributes={};this.onFocus=function(){o.ionFocus.emit()};this.onBlur=function(){o.ionBlur.emit()};this.onClick=function(){var t=o.fab;if(!t){return}t.toggle()};this.color=undefined;this.activated=false;this.disabled=false;this.download=undefined;this.href=undefined;this.rel=undefined;this.routerDirection="forward";this.routerAnimation=undefined;this.target=undefined;this.show=false;this.translucent=false;this.type="button";this.size=undefined;this.closeIcon=close}t.prototype.connectedCallback=function(){this.fab=this.el.closest("ion-fab")};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAriaAttributes(this.el)};t.prototype.render=function(){var t;var o=this;var r=this,i=r.el,n=r.disabled,e=r.color,a=r.href,s=r.activated,c=r.show,l=r.translucent,d=r.size,b=r.inheritedAttributes;var f=hostContext("ion-fab-list",i);var p=getIonMode(this);var u=a===undefined?"button":"a";var g=u==="button"?{type:this.type}:{download:this.download,href:a,rel:this.rel,target:this.target};return h(Host,{onClick:this.onClick,"aria-disabled":n?"true":null,class:createColorClasses(e,(t={},t[p]=true,t["fab-button-in-list"]=f,t["fab-button-translucent-in-list"]=f&&l,t["fab-button-close-active"]=s,t["fab-button-show"]=c,t["fab-button-disabled"]=n,t["fab-button-translucent"]=l,t["ion-activatable"]=true,t["ion-focusable"]=true,t["fab-button-".concat(d)]=d!==undefined,t))},h(u,Object.assign({},g,{class:"button-native",part:"native",disabled:n,onFocus:this.onFocus,onBlur:this.onBlur,onClick:function(t){return openURL(a,t,o.routerDirection,o.routerAnimation)}},b),h("ion-icon",{"aria-hidden":"true",icon:this.closeIcon,part:"close-icon",class:"close-icon",lazy:false}),h("span",{class:"button-inner"},h("slot",null)),p==="md"&&h("ion-ripple-effect",null)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();FabButton.style={ios:fabButtonIosCss,md:fabButtonMdCss};var fabListCss=":host{margin-left:0;margin-right:0;margin-top:66px;margin-bottom:66px;display:none;position:absolute;top:0;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;min-width:56px;min-height:56px}:host(.fab-list-active){display:-ms-flexbox;display:flex}::slotted(.fab-button-in-list){margin-left:0;margin-right:0;margin-top:8px;margin-bottom:8px;width:40px;height:40px;-webkit-transform:scale(0);transform:scale(0);opacity:0;visibility:hidden}:host(.fab-list-side-top) ::slotted(.fab-button-in-list),:host(.fab-list-side-bottom) ::slotted(.fab-button-in-list){margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px}:host(.fab-list-side-start) ::slotted(.fab-button-in-list),:host(.fab-list-side-end) ::slotted(.fab-button-in-list){-webkit-margin-start:5px;margin-inline-start:5px;-webkit-margin-end:5px;margin-inline-end:5px;margin-top:0;margin-bottom:0}::slotted(.fab-button-in-list.fab-button-show){-webkit-transform:scale(1);transform:scale(1);opacity:1;visibility:visible}:host(.fab-list-side-top){top:auto;bottom:0;-ms-flex-direction:column-reverse;flex-direction:column-reverse}:host(.fab-list-side-start){-webkit-margin-start:66px;margin-inline-start:66px;-webkit-margin-end:66px;margin-inline-end:66px;margin-top:0;margin-bottom:0;-ms-flex-direction:row-reverse;flex-direction:row-reverse}@supports (inset-inline-start: 0){:host(.fab-list-side-start){inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.fab-list-side-start){right:0}:host-context([dir=rtl]):host(.fab-list-side-start),:host-context([dir=rtl]).fab-list-side-start{left:unset;right:unset;left:0}@supports selector(:dir(rtl)){:host(.fab-list-side-start):dir(rtl){left:unset;right:unset;left:0}}}:host(.fab-list-side-end){-webkit-margin-start:66px;margin-inline-start:66px;-webkit-margin-end:66px;margin-inline-end:66px;margin-top:0;margin-bottom:0;-ms-flex-direction:row;flex-direction:row}@supports (inset-inline-start: 0){:host(.fab-list-side-end){inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.fab-list-side-end){left:0}:host-context([dir=rtl]):host(.fab-list-side-end),:host-context([dir=rtl]).fab-list-side-end{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.fab-list-side-end):dir(rtl){left:unset;right:unset;right:0}}}";var FabList=function(){function t(t){registerInstance(this,t);this.activated=false;this.side="bottom"}t.prototype.activatedChanged=function(t){var o=Array.from(this.el.querySelectorAll("ion-fab-button"));var r=t?30:0;o.forEach((function(o,i){setTimeout((function(){return o.show=t}),i*r)}))};t.prototype.render=function(){var t;var o=getIonMode(this);return h(Host,{class:(t={},t[o]=true,t["fab-list-active"]=this.activated,t["fab-list-side-".concat(this.side)]=true,t)},h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{activated:["activatedChanged"]}},enumerable:false,configurable:true});return t}();FabList.style=fabListCss;export{Fab as ion_fab,FabButton as ion_fab_button,FabList as ion_fab_list};
|
|
4
|
+
*/import{r as registerInstance,h,H as Host,f as getElement,d as createEvent}from"./index-2d388930.js";import{b as getIonMode}from"./ionic-global-b3fc28dd.js";import{i as inheritAriaAttributes}from"./helpers-3379ba19.js";import{h as hostContext,o as openURL,c as createColorClasses}from"./theme-17531cdf.js";import{t as close}from"./index-ecfc2c9f.js";var fabCss=":host{position:absolute;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;z-index:999}:host(.fab-horizontal-center){left:0px;right:0px;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}@supports (inset-inline-start: 0){:host(.fab-horizontal-start){inset-inline-start:calc(10px + var(--ion-safe-area-left, 0px))}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-start){left:calc(10px + var(--ion-safe-area-left, 0px))}:host-context([dir=rtl]):host(.fab-horizontal-start),:host-context([dir=rtl]).fab-horizontal-start{left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}@supports selector(:dir(rtl)){:host(.fab-horizontal-start):dir(rtl){left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}}}@supports (inset-inline-start: 0){:host(.fab-horizontal-end){inset-inline-end:calc(10px + var(--ion-safe-area-right, 0px))}}@supports not (inset-inline-start: 0){:host(.fab-horizontal-end){right:calc(10px + var(--ion-safe-area-right, 0px))}:host-context([dir=rtl]):host(.fab-horizontal-end),:host-context([dir=rtl]).fab-horizontal-end{left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}@supports selector(:dir(rtl)){:host(.fab-horizontal-end):dir(rtl){left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}}}:host(.fab-vertical-top){top:10px}:host(.fab-vertical-top.fab-edge){top:0}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-button){margin-top:-50%}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-button.fab-button-small){margin-top:calc((-100% + 16px) / 2)}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-start),:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-end){margin-top:-50%}:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-top),:host(.fab-vertical-top.fab-edge) ::slotted(ion-fab-list.fab-list-side-bottom){margin-top:calc(50% + 10px)}:host(.fab-vertical-bottom){bottom:10px}:host(.fab-vertical-bottom.fab-edge){bottom:0}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-button){margin-bottom:-50%}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-button.fab-button-small){margin-bottom:calc((-100% + 16px) / 2)}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-start),:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-end){margin-bottom:-50%}:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-top),:host(.fab-vertical-bottom.fab-edge) ::slotted(ion-fab-list.fab-list-side-bottom){margin-bottom:calc(50% + 10px)}:host(.fab-vertical-center){top:0px;bottom:0px;margin-top:auto;margin-bottom:auto}";var Fab=function(){function t(t){registerInstance(this,t);this.horizontal=undefined;this.vertical=undefined;this.edge=false;this.activated=false}t.prototype.activatedChanged=function(){var t=this.activated;var o=this.getFab();if(o){o.activated=t}Array.from(this.el.querySelectorAll("ion-fab-list")).forEach((function(o){o.activated=t}))};t.prototype.componentDidLoad=function(){if(this.activated){this.activatedChanged()}};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.activated=false;return[2]}))}))};t.prototype.getFab=function(){return this.el.querySelector("ion-fab-button")};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(o){t=!!this.el.querySelector("ion-fab-list");if(t){this.activated=!this.activated}return[2]}))}))};t.prototype.render=function(){var t;var o=this,r=o.horizontal,i=o.vertical,e=o.edge;var a=getIonMode(this);return h(Host,{class:(t={},t[a]=true,t["fab-horizontal-".concat(r)]=r!==undefined,t["fab-vertical-".concat(i)]=i!==undefined,t["fab-edge"]=e,t)},h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{activated:["activatedChanged"]}},enumerable:false,configurable:true});return t}();Fab.style=fabCss;var fabButtonIosCss=':host{--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--background-hover:var(--ion-color-primary-contrast, #fff);--background-hover-opacity:.08;--transition:background-color, opacity 100ms linear;--ripple-color:currentColor;--border-radius:50%;--border-width:0;--border-style:none;--border-color:initial;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:56px;height:56px;font-size:14px;text-align:center;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);-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);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;display:block;position:relative;width:100%;height:100%;-webkit-transform:var(--transform);transform:var(--transform);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);background-clip:padding-box;color:var(--color);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:strict;cursor:pointer;overflow:hidden;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}::slotted(ion-icon){line-height:1}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{left:0;right:0;top:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;z-index:1}:host(.fab-button-disabled){cursor:default;opacity:0.5;pointer-events: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(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-activated) .button-native{color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}::slotted(ion-icon){line-height:1}:host(.fab-button-small){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px;margin-bottom:8px;width:40px;height:40px}.close-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;left:0;right:0;top:0;position:absolute;height:100%;-webkit-transform:scale(0.4) rotateZ(-45deg);transform:scale(0.4) rotateZ(-45deg);-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;font-size:var(--close-icon-font-size);opacity:0;z-index:1}:host(.fab-button-close-active) .close-icon{-webkit-transform:scale(1) rotateZ(0deg);transform:scale(1) rotateZ(0deg);opacity:1}:host(.fab-button-close-active) .button-inner{-webkit-transform:scale(0.4) rotateZ(45deg);transform:scale(0.4) rotateZ(45deg);opacity:0}ion-ripple-effect{color:var(--ripple-color)}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.fab-button-translucent) .button-native{-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}}:host(.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{--background:var(--ion-color-primary, #3880ff);--background-activated:var(--ion-color-primary-shade, #3171e0);--background-focused:var(--ion-color-primary-shade, #3171e0);--background-hover:var(--ion-color-primary-tint, #4c8dff);--background-activated-opacity:1;--background-focused-opacity:1;--background-hover-opacity:1;--color:var(--ion-color-primary-contrast, #fff);--box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);--transition:0.2s transform cubic-bezier(0.25, 1.11, 0.78, 1.59);--close-icon-font-size:28px}:host(.ion-activated){--box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);--transform:scale(1.1);--transition:0.2s transform ease-out}::slotted(ion-icon){font-size:28px}:host(.fab-button-in-list){--background:var(--ion-color-light, #f4f5f8);--background-activated:var(--ion-color-light-shade, #d7d8da);--background-focused:var(--background-activated);--background-hover:var(--ion-color-light-tint, #f5f6f9);--color:var(--ion-color-light-contrast, #000);--color-activated:var(--ion-color-light-contrast, #000);--color-focused:var(--color-activated);--transition:transform 200ms ease 10ms, opacity 200ms ease 10ms}:host(.fab-button-in-list) ::slotted(ion-icon){font-size:18px}:host(.ion-color.ion-focused) .button-native::after{background:var(--ion-color-shade)}:host(.ion-color.ion-focused) .button-native,:host(.ion-color.ion-activated) .button-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .button-native::after,:host(.ion-color.ion-activated) .button-native::after{background:var(--ion-color-shade)}@media (any-hover: hover){:host(.ion-color:hover) .button-native{color:var(--ion-color-contrast)}:host(.ion-color:hover) .button-native::after{background:var(--ion-color-tint)}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.fab-button-translucent){--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.9);--background-hover:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.8);--background-focused:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.82);--backdrop-filter:saturate(180%) blur(20px)}:host(.fab-button-translucent-in-list){--background:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.9);--background-hover:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.8);--background-focused:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.82)}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){@media (any-hover: hover){:host(.fab-button-translucent.ion-color:hover) .button-native{background:rgba(var(--ion-color-base-rgb), 0.8)}}:host(.ion-color.fab-button-translucent) .button-native{background:rgba(var(--ion-color-base-rgb), 0.9)}:host(.ion-color.ion-focused.fab-button-translucent) .button-native,:host(.ion-color.ion-activated.fab-button-translucent) .button-native{background:var(--ion-color-base)}}';var fabButtonMdCss=':host{--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--background-hover:var(--ion-color-primary-contrast, #fff);--background-hover-opacity:.08;--transition:background-color, opacity 100ms linear;--ripple-color:currentColor;--border-radius:50%;--border-width:0;--border-style:none;--border-color:initial;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:56px;height:56px;font-size:14px;text-align:center;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}.button-native{border-radius:var(--border-radius);-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);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;display:block;position:relative;width:100%;height:100%;-webkit-transform:var(--transform);transform:var(--transform);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);background-clip:padding-box;color:var(--color);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:strict;cursor:pointer;overflow:hidden;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}::slotted(ion-icon){line-height:1}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{left:0;right:0;top:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;z-index:1}:host(.fab-button-disabled){cursor:default;opacity:0.5;pointer-events: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(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(.ion-activated) .button-native{color:var(--color-activated)}:host(.ion-activated) .button-native::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}::slotted(ion-icon){line-height:1}:host(.fab-button-small){-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px;margin-bottom:8px;width:40px;height:40px}.close-icon{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;left:0;right:0;top:0;position:absolute;height:100%;-webkit-transform:scale(0.4) rotateZ(-45deg);transform:scale(0.4) rotateZ(-45deg);-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;font-size:var(--close-icon-font-size);opacity:0;z-index:1}:host(.fab-button-close-active) .close-icon{-webkit-transform:scale(1) rotateZ(0deg);transform:scale(1) rotateZ(0deg);opacity:1}:host(.fab-button-close-active) .button-inner{-webkit-transform:scale(0.4) rotateZ(45deg);transform:scale(0.4) rotateZ(45deg);opacity:0}ion-ripple-effect{color:var(--ripple-color)}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.fab-button-translucent) .button-native{-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}}:host(.ion-color) .button-native{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host{--background:var(--ion-color-primary, #3880ff);--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--background-activated-opacity:0;--background-focused-opacity:.24;--background-hover-opacity:.08;--color:var(--ion-color-primary-contrast, #fff);--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1), background-color 280ms cubic-bezier(0.4, 0, 0.2, 1), color 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 15ms linear 30ms, transform 270ms cubic-bezier(0, 0, 0.2, 1) 0ms;--close-icon-font-size:24px}:host(.ion-activated){--box-shadow:0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 12px 17px 2px rgba(0, 0, 0, 0.14), 0 5px 22px 4px rgba(0, 0, 0, 0.12)}::slotted(ion-icon){font-size:24px}:host(.fab-button-in-list){--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);--color-activated:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);--color-focused:var(--color-activated);--background:var(--ion-color-light, #f4f5f8);--background-activated:transparent;--background-focused:var(--ion-color-light-shade, #d7d8da);--background-hover:var(--ion-color-light-tint, #f5f6f9)}:host(.fab-button-in-list) ::slotted(ion-icon){font-size:18px}:host(.ion-color.ion-focused) .button-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-focused) .button-native::after{background:var(--ion-color-contrast)}:host(.ion-color.ion-activated) .button-native{color:var(--ion-color-contrast)}:host(.ion-color.ion-activated) .button-native::after{background:transparent}@media (any-hover: hover){:host(.ion-color:hover) .button-native{color:var(--ion-color-contrast)}:host(.ion-color:hover) .button-native::after{background:var(--ion-color-contrast)}}';var FabButton=function(){function t(t){var o=this;registerInstance(this,t);this.ionFocus=createEvent(this,"ionFocus",7);this.ionBlur=createEvent(this,"ionBlur",7);this.fab=null;this.inheritedAttributes={};this.onFocus=function(){o.ionFocus.emit()};this.onBlur=function(){o.ionBlur.emit()};this.onClick=function(){var t=o.fab;if(!t){return}t.toggle()};this.color=undefined;this.activated=false;this.disabled=false;this.download=undefined;this.href=undefined;this.rel=undefined;this.routerDirection="forward";this.routerAnimation=undefined;this.target=undefined;this.show=false;this.translucent=false;this.type="button";this.size=undefined;this.closeIcon=close}t.prototype.connectedCallback=function(){this.fab=this.el.closest("ion-fab")};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAriaAttributes(this.el)};t.prototype.render=function(){var t;var o=this;var r=this,i=r.el,e=r.disabled,a=r.color,n=r.href,s=r.activated,c=r.show,l=r.translucent,b=r.size,d=r.inheritedAttributes;var f=hostContext("ion-fab-list",i);var p=getIonMode(this);var u=n===undefined?"button":"a";var g=u==="button"?{type:this.type}:{download:this.download,href:n,rel:this.rel,target:this.target};return h(Host,{onClick:this.onClick,"aria-disabled":e?"true":null,class:createColorClasses(a,(t={},t[p]=true,t["fab-button-in-list"]=f,t["fab-button-translucent-in-list"]=f&&l,t["fab-button-close-active"]=s,t["fab-button-show"]=c,t["fab-button-disabled"]=e,t["fab-button-translucent"]=l,t["ion-activatable"]=true,t["ion-focusable"]=true,t["fab-button-".concat(b)]=b!==undefined,t))},h(u,Object.assign({},g,{class:"button-native",part:"native",disabled:e,onFocus:this.onFocus,onBlur:this.onBlur,onClick:function(t){return openURL(n,t,o.routerDirection,o.routerAnimation)}},d),h("ion-icon",{"aria-hidden":"true",icon:this.closeIcon,part:"close-icon",class:"close-icon",lazy:false}),h("span",{class:"button-inner"},h("slot",null)),p==="md"&&h("ion-ripple-effect",null)))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();FabButton.style={ios:fabButtonIosCss,md:fabButtonMdCss};var fabListCss=":host{margin-left:0;margin-right:0;margin-top:calc(100% + 10px);margin-bottom:calc(100% + 10px);display:none;position:absolute;top:0;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;min-width:56px;min-height:56px}:host(.fab-list-active){display:-ms-flexbox;display:flex}::slotted(.fab-button-in-list){margin-left:0;margin-right:0;margin-top:8px;margin-bottom:8px;width:40px;height:40px;-webkit-transform:scale(0);transform:scale(0);opacity:0;visibility:hidden}:host(.fab-list-side-top) ::slotted(.fab-button-in-list),:host(.fab-list-side-bottom) ::slotted(.fab-button-in-list){margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px}:host(.fab-list-side-start) ::slotted(.fab-button-in-list),:host(.fab-list-side-end) ::slotted(.fab-button-in-list){-webkit-margin-start:5px;margin-inline-start:5px;-webkit-margin-end:5px;margin-inline-end:5px;margin-top:0;margin-bottom:0}::slotted(.fab-button-in-list.fab-button-show){-webkit-transform:scale(1);transform:scale(1);opacity:1;visibility:visible}:host(.fab-list-side-top){top:auto;bottom:0;-ms-flex-direction:column-reverse;flex-direction:column-reverse}:host(.fab-list-side-start){-webkit-margin-start:calc(100% + 10px);margin-inline-start:calc(100% + 10px);-webkit-margin-end:calc(100% + 10px);margin-inline-end:calc(100% + 10px);margin-top:0;margin-bottom:0;-ms-flex-direction:row-reverse;flex-direction:row-reverse}@supports (inset-inline-start: 0){:host(.fab-list-side-start){inset-inline-end:0}}@supports not (inset-inline-start: 0){:host(.fab-list-side-start){right:0}:host-context([dir=rtl]):host(.fab-list-side-start),:host-context([dir=rtl]).fab-list-side-start{left:unset;right:unset;left:0}@supports selector(:dir(rtl)){:host(.fab-list-side-start):dir(rtl){left:unset;right:unset;left:0}}}:host(.fab-list-side-end){-webkit-margin-start:calc(100% + 10px);margin-inline-start:calc(100% + 10px);-webkit-margin-end:calc(100% + 10px);margin-inline-end:calc(100% + 10px);margin-top:0;margin-bottom:0;-ms-flex-direction:row;flex-direction:row}@supports (inset-inline-start: 0){:host(.fab-list-side-end){inset-inline-start:0}}@supports not (inset-inline-start: 0){:host(.fab-list-side-end){left:0}:host-context([dir=rtl]):host(.fab-list-side-end),:host-context([dir=rtl]).fab-list-side-end{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host(.fab-list-side-end):dir(rtl){left:unset;right:unset;right:0}}}";var FabList=function(){function t(t){registerInstance(this,t);this.activated=false;this.side="bottom"}t.prototype.activatedChanged=function(t){var o=Array.from(this.el.querySelectorAll("ion-fab-button"));var r=t?30:0;o.forEach((function(o,i){setTimeout((function(){return o.show=t}),i*r)}))};t.prototype.render=function(){var t;var o=getIonMode(this);return h(Host,{class:(t={},t[o]=true,t["fab-list-active"]=this.activated,t["fab-list-side-".concat(this.side)]=true,t)},h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{activated:["activatedChanged"]}},enumerable:false,configurable:true});return t}();FabList.style=fabListCss;export{Fab as ion_fab,FabButton as ion_fab_button,FabList as ion_fab_list};
|
|
@@ -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,h,H as Host,f as getElement}from"./index-2d388930.js";import{C as CoreDelegate,a as attachComponent,d as detachComponent}from"./framework-delegate-aa433dea.js";import{r as raf,g as getElementRoot,a as addEventListener,m as hasLazyBuild}from"./helpers-3379ba19.js";import{c as createLockController}from"./lock-controller-e8c6c051.js";import{p as printIonWarning}from"./index-595d62c9.js";import{B as BACKDROP,j as prepareOverlay,k as setOverlayId,f as present,o as focusFirstDescendant,g as dismiss,h as eventMethod}from"./overlays-8fc6656c.js";import{b as getIonMode,a as isPlatform}from"./ionic-global-b3fc28dd.js";import{g as getClassMap}from"./theme-17531cdf.js";import{e as deepReady,w as waitForMount}from"./index-87684bba.js";import{c as createAnimation}from"./animation-a1d9e088.js";import"./index-7a14ecec.js";import"./hardware-back-button-39299f84.js";var getArrowDimensions=function(e){if(!e){return{arrowWidth:0,arrowHeight:0}}var t=e.getBoundingClientRect(),r=t.width,o=t.height;return{arrowWidth:r,arrowHeight:o}};var getPopoverDimensions=function(e,t,r){var o=t.getBoundingClientRect();var n=o.height;var i=o.width;if(e==="cover"&&r){var a=r.getBoundingClientRect();i=a.width}return{contentWidth:i,contentHeight:n}};var configureDismissInteraction=function(e,t,r,o){var n=[];var i=getElementRoot(o);var a=i.querySelector(".popover-content");switch(t){case"hover":n=[{eventName:"mouseenter",callback:function(t){var o=document.elementFromPoint(t.clientX,t.clientY);if(o===e){return}r.dismiss(undefined,undefined,false)}}];break;case"context-menu":case"click":default:n=[{eventName:"click",callback:function(t){var o=t.target;var n=o.closest("[data-ion-popover-trigger]");if(n===e){t.stopPropagation();return}r.dismiss(undefined,undefined,false)}}];break}n.forEach((function(e){var t=e.eventName,r=e.callback;return a.addEventListener(t,r)}));return function(){n.forEach((function(e){var t=e.eventName,r=e.callback;return a.removeEventListener(t,r)}))}};var configureTriggerInteraction=function(e,t,r){var o=[];switch(t){case"hover":var n;o=[{eventName:"mouseenter",callback:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){e.stopPropagation();if(n){clearTimeout(n)}n=setTimeout((function(){raf((function(){r.presentFromTrigger(e);n=undefined}))}),100);return[2]}))}))}},{eventName:"mouseleave",callback:function(e){if(n){clearTimeout(n)}var t=e.relatedTarget;if(!t){return}if(t.closest("ion-popover")!==r){r.dismiss(undefined,undefined,false)}}},{eventName:"click",callback:function(e){return e.stopPropagation()}},{eventName:"ionPopoverActivateTrigger",callback:function(e){return r.presentFromTrigger(e,true)}}];break;case"context-menu":o=[{eventName:"contextmenu",callback:function(e){e.preventDefault();r.presentFromTrigger(e)}},{eventName:"click",callback:function(e){return e.stopPropagation()}},{eventName:"ionPopoverActivateTrigger",callback:function(e){return r.presentFromTrigger(e,true)}}];break;case"click":default:o=[{eventName:"click",callback:function(e){return r.presentFromTrigger(e)}},{eventName:"ionPopoverActivateTrigger",callback:function(e){return r.presentFromTrigger(e,true)}}];break}o.forEach((function(t){var r=t.eventName,o=t.callback;return e.addEventListener(r,o)}));e.setAttribute("data-ion-popover-trigger","true");return function(){o.forEach((function(t){var r=t.eventName,o=t.callback;return e.removeEventListener(r,o)}));e.removeAttribute("data-ion-popover-trigger")}};var getIndexOfItem=function(e,t){if(!t||t.tagName!=="ION-ITEM"){return-1}return e.findIndex((function(e){return e===t}))};var getNextItem=function(e,t){var r=getIndexOfItem(e,t);return e[r+1]};var getPrevItem=function(e,t){var r=getIndexOfItem(e,t);return e[r-1]};var focusItem=function(e){var t=getElementRoot(e);var r=t.querySelector("button");if(r){raf((function(){return r.focus()}))}};var isTriggerElement=function(e){return e.hasAttribute("data-ion-popover-trigger")};var configureKeyboardInteraction=function(e){var t=function(t){return __awaiter(void 0,void 0,void 0,(function(){var r,o,n,i,a,s,p,c,d,l,v;return __generator(this,(function(f){switch(f.label){case 0:o=document.activeElement;n=[];i=(r=t.target)===null||r===void 0?void 0:r.tagName;if(i!=="ION-POPOVER"&&i!=="ION-ITEM"){return[2]}try{n=Array.from(e.querySelectorAll("ion-item:not(ion-popover ion-popover *):not([disabled])"))}catch(e){}a=t.key;switch(a){case"ArrowLeft":return[3,1];case"ArrowDown":return[3,3];case"ArrowUp":return[3,4];case"Home":return[3,5];case"End":return[3,6];case"ArrowRight":return[3,7];case" ":return[3,7];case"Enter":return[3,7]}return[3,8];case 1:return[4,e.getParentPopover()];case 2:s=f.sent();if(s){e.dismiss(undefined,undefined,false)}return[3,8];case 3:t.preventDefault();p=getNextItem(n,o);if(p!==undefined){focusItem(p)}return[3,8];case 4:t.preventDefault();c=getPrevItem(n,o);if(c!==undefined){focusItem(c)}return[3,8];case 5:t.preventDefault();d=n[0];if(d!==undefined){focusItem(d)}return[3,8];case 6:t.preventDefault();l=n[n.length-1];if(l!==undefined){focusItem(l)}return[3,8];case 7:if(o&&isTriggerElement(o)){v=new CustomEvent("ionPopoverActivateTrigger");o.dispatchEvent(v)}return[3,8];case 8:return[2]}}))}))};e.addEventListener("keydown",t);return function(){return e.removeEventListener("keydown",t)}};var getPopoverPosition=function(e,t,r,o,n,i,a,s,p,c,d){var l;var v={top:0,left:0,width:0,height:0};switch(i){case"event":if(!d){return p}var f=d;v={top:f.clientY,left:f.clientX,width:1,height:1};break;case"trigger":default:var u=d;var h=c||((l=u===null||u===void 0?void 0:u.detail)===null||l===void 0?void 0:l.ionShadowTarget)||(u===null||u===void 0?void 0:u.target);if(!h){return p}var g=h.getBoundingClientRect();v={top:g.top,left:g.left,width:g.width,height:g.height};break}var m=calculatePopoverSide(a,v,t,r,o,n,e);var w=calculatePopoverAlign(s,a,v,t,r);var b=m.top+w.top;var x=m.left+w.left;var y=calculateArrowPosition(a,o,n,b,x,t,r,e),P=y.arrowTop,k=y.arrowLeft;var A=calculatePopoverOrigin(a,s,e),D=A.originX,E=A.originY;return{top:b,left:x,referenceCoordinates:v,arrowTop:P,arrowLeft:k,originX:D,originY:E}};var calculatePopoverOrigin=function(e,t,r){switch(e){case"top":return{originX:getOriginXAlignment(t),originY:"bottom"};case"bottom":return{originX:getOriginXAlignment(t),originY:"top"};case"left":return{originX:"right",originY:getOriginYAlignment(t)};case"right":return{originX:"left",originY:getOriginYAlignment(t)};case"start":return{originX:r?"left":"right",originY:getOriginYAlignment(t)};case"end":return{originX:r?"right":"left",originY:getOriginYAlignment(t)}}};var getOriginXAlignment=function(e){switch(e){case"start":return"left";case"center":return"center";case"end":return"right"}};var getOriginYAlignment=function(e){switch(e){case"start":return"top";case"center":return"center";case"end":return"bottom"}};var calculateArrowPosition=function(e,t,r,o,n,i,a,s){var p={arrowTop:o+a/2-t/2,arrowLeft:n+i-t/2};var c={arrowTop:o+a/2-t/2,arrowLeft:n-t*1.5};switch(e){case"top":return{arrowTop:o+a,arrowLeft:n+i/2-t/2};case"bottom":return{arrowTop:o-r,arrowLeft:n+i/2-t/2};case"left":return p;case"right":return c;case"start":return s?c:p;case"end":return s?p:c;default:return{arrowTop:0,arrowLeft:0}}};var calculatePopoverSide=function(e,t,r,o,n,i,a){var s={top:t.top,left:t.left-r-n};var p={top:t.top,left:t.left+t.width+n};switch(e){case"top":return{top:t.top-o-i,left:t.left};case"right":return p;case"bottom":return{top:t.top+t.height+i,left:t.left};case"left":return s;case"start":return a?p:s;case"end":return a?s:p}};var calculatePopoverAlign=function(e,t,r,o,n){switch(e){case"center":return calculatePopoverCenterAlign(t,r,o,n);case"end":return calculatePopoverEndAlign(t,r,o,n);case"start":default:return{top:0,left:0}}};var calculatePopoverEndAlign=function(e,t,r,o){switch(e){case"start":case"end":case"left":case"right":return{top:-(o-t.height),left:0};case"top":case"bottom":default:return{top:0,left:-(r-t.width)}}};var calculatePopoverCenterAlign=function(e,t,r,o){switch(e){case"start":case"end":case"left":case"right":return{top:-(o/2-t.height/2),left:0};case"top":case"bottom":default:return{top:0,left:-(r/2-t.width/2)}}};var calculateWindowAdjustment=function(e,t,r,o,n,i,a,s,p,c,d,l,v,f,u){if(v===void 0){v=0}if(f===void 0){f=0}if(u===void 0){u=0}var h=v;var g=f;var m=r;var w=t;var b;var x=c;var y=d;var P=false;var k=false;var A=l?l.top+l.height:i/2-s/2;var D=l?l.height:0;var E=false;if(m<o+p){m=o;P=true;x="left"}else if(a+o+m+p>n){k=true;m=n-a-o;x="right"}if(A+D+s>i&&(e==="top"||e==="bottom")){if(A-s>0){w=Math.max(12,A-s-D-(u-1));h=w+s;y="bottom";E=true}else{b=o}}return{top:w,left:m,bottom:b,originX:x,originY:y,checkSafeAreaLeft:P,checkSafeAreaRight:k,arrowTop:h,arrowLeft:g,addPopoverBottomClass:E}};var shouldShowArrow=function(e,t,r,o){if(t===void 0){t=false}if(!r&&!o){return false}if(e!=="top"&&e!=="bottom"&&t){return false}return true};var POPOVER_IOS_BODY_PADDING=5;var iosEnterAnimation=function(e,t){var r;var o=t.event,n=t.size,i=t.trigger,a=t.reference,s=t.side,p=t.align;var c=e.ownerDocument;var d=c.dir==="rtl";var l=c.defaultView.innerWidth;var v=c.defaultView.innerHeight;var f=getElementRoot(e);var u=f.querySelector(".popover-content");var h=f.querySelector(".popover-arrow");var g=i||((r=o===null||o===void 0?void 0:o.detail)===null||r===void 0?void 0:r.ionShadowTarget)||(o===null||o===void 0?void 0:o.target);var m=getPopoverDimensions(n,u,g),w=m.contentWidth,b=m.contentHeight;var x=getArrowDimensions(h),y=x.arrowWidth,P=x.arrowHeight;var k={top:v/2-b/2,left:l/2-w/2,originX:d?"right":"left",originY:"top"};var A=getPopoverPosition(d,w,b,y,P,a,s,p,k,i,o);var D=n==="cover"?0:POPOVER_IOS_BODY_PADDING;var E=n==="cover"?0:25;var I=calculateWindowAdjustment(s,A.top,A.left,D,l,v,w,b,E,A.originX,A.originY,A.referenceCoordinates,A.arrowTop,A.arrowLeft,P),T=I.originX,O=I.originY,C=I.top,L=I.left,S=I.bottom,_=I.checkSafeAreaLeft,W=I.checkSafeAreaRight,Y=I.arrowTop,N=I.arrowLeft,M=I.addPopoverBottomClass;var j=createAnimation();var R=createAnimation();var B=createAnimation();R.addElement(f.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);B.addElement(f.querySelector(".popover-arrow")).addElement(f.querySelector(".popover-content")).fromTo("opacity",.01,1);return j.easing("ease").duration(100).beforeAddWrite((function(){if(n==="cover"){e.style.setProperty("--width","".concat(w,"px"))}if(M){e.classList.add("popover-bottom")}if(S!==undefined){u.style.setProperty("bottom","".concat(S,"px"))}var t=" + var(--ion-safe-area-left, 0)";var r=" - var(--ion-safe-area-right, 0)";var a="".concat(L,"px");if(_){a="".concat(L,"px").concat(t)}if(W){a="".concat(L,"px").concat(r)}u.style.setProperty("top","calc(".concat(C,"px + var(--offset-y, 0))"));u.style.setProperty("left","calc(".concat(a," + var(--offset-x, 0))"));u.style.setProperty("transform-origin","".concat(O," ").concat(T));if(h!==null){var p=A.top!==C||A.left!==L;var c=shouldShowArrow(s,p,o,i);if(c){h.style.setProperty("top","calc(".concat(Y,"px + var(--offset-y, 0))"));h.style.setProperty("left","calc(".concat(N,"px + var(--offset-x, 0))"))}else{h.style.setProperty("display","none")}}})).addAnimation([R,B])};var iosLeaveAnimation=function(e){var t=getElementRoot(e);var r=t.querySelector(".popover-content");var o=t.querySelector(".popover-arrow");var n=createAnimation();var i=createAnimation();var a=createAnimation();i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0);a.addElement(t.querySelector(".popover-arrow")).addElement(t.querySelector(".popover-content")).fromTo("opacity",.99,0);return n.easing("ease").afterAddWrite((function(){e.style.removeProperty("--width");e.classList.remove("popover-bottom");r.style.removeProperty("top");r.style.removeProperty("left");r.style.removeProperty("bottom");r.style.removeProperty("transform-origin");if(o){o.style.removeProperty("top");o.style.removeProperty("left");o.style.removeProperty("display")}})).duration(300).addAnimation([i,a])};var POPOVER_MD_BODY_PADDING=12;var mdEnterAnimation=function(e,t){var r;var o=t.event,n=t.size,i=t.trigger,a=t.reference,s=t.side,p=t.align;var c=e.ownerDocument;var d=c.dir==="rtl";var l=c.defaultView.innerWidth;var v=c.defaultView.innerHeight;var f=getElementRoot(e);var u=f.querySelector(".popover-content");var h=i||((r=o===null||o===void 0?void 0:o.detail)===null||r===void 0?void 0:r.ionShadowTarget)||(o===null||o===void 0?void 0:o.target);var g=getPopoverDimensions(n,u,h),m=g.contentWidth,w=g.contentHeight;var b={top:v/2-w/2,left:l/2-m/2,originX:d?"right":"left",originY:"top"};var x=getPopoverPosition(d,m,w,0,0,a,s,p,b,i,o);var y=n==="cover"?0:POPOVER_MD_BODY_PADDING;var P=calculateWindowAdjustment(s,x.top,x.left,y,l,v,m,w,0,x.originX,x.originY,x.referenceCoordinates),k=P.originX,A=P.originY,D=P.top,E=P.left,I=P.bottom;var T=createAnimation();var O=createAnimation();var C=createAnimation();var L=createAnimation();var S=createAnimation();O.addElement(f.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);C.addElement(f.querySelector(".popover-wrapper")).duration(150).fromTo("opacity",.01,1);L.addElement(u).beforeStyles({top:"calc(".concat(D,"px + var(--offset-y, 0px))"),left:"calc(".concat(E,"px + var(--offset-x, 0px))"),"transform-origin":"".concat(A," ").concat(k)}).beforeAddWrite((function(){if(I!==undefined){u.style.setProperty("bottom","".concat(I,"px"))}})).fromTo("transform","scale(0.8)","scale(1)");S.addElement(f.querySelector(".popover-viewport")).fromTo("opacity",.01,1);return T.easing("cubic-bezier(0.36,0.66,0.04,1)").duration(300).beforeAddWrite((function(){if(n==="cover"){e.style.setProperty("--width","".concat(m,"px"))}if(A==="bottom"){e.classList.add("popover-bottom")}})).addAnimation([O,C,L,S])};var mdLeaveAnimation=function(e){var t=getElementRoot(e);var r=t.querySelector(".popover-content");var o=createAnimation();var n=createAnimation();var i=createAnimation();n.addElement(t.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0);i.addElement(t.querySelector(".popover-wrapper")).fromTo("opacity",.99,0);return o.easing("ease").afterAddWrite((function(){e.style.removeProperty("--width");e.classList.remove("popover-bottom");r.style.removeProperty("top");r.style.removeProperty("left");r.style.removeProperty("bottom");r.style.removeProperty("transform-origin")})).duration(150).addAnimation([n,i])};var popoverIosCss=':host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}.popover-viewport{--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start):dir(rtl){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end):dir(rtl){--offset-x:5px}}:host{--width:200px;--max-height:90%;--box-shadow:none;--backdrop-opacity:var(--ion-backdrop-opacity, 0.08)}:host(.popover-desktop){--box-shadow:0px 4px 16px 0px rgba(0, 0, 0, 0.12)}.popover-content{border-radius:10px}:host(.popover-desktop) .popover-content{border:0.5px solid var(--ion-color-step-100, #e6e6e6)}.popover-arrow{display:block;position:absolute;width:20px;height:10px;overflow:hidden}.popover-arrow::after{top:3px;border-radius:3px;position:absolute;width:14px;height:14px;-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--background);content:"";z-index:10}@supports (inset-inline-start: 0){.popover-arrow::after{inset-inline-start:3px}}@supports not (inset-inline-start: 0){.popover-arrow::after{left:3px}:host-context([dir=rtl]) .popover-arrow::after{left:unset;right:unset;right:3px}[dir=rtl] .popover-arrow::after{left:unset;right:unset;right:3px}@supports selector(:dir(rtl)){.popover-arrow::after:dir(rtl){left:unset;right:unset;right:3px}}}:host(.popover-bottom) .popover-arrow{top:auto;bottom:-10px}:host(.popover-bottom) .popover-arrow::after{top:-6px}:host(.popover-side-left) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host(.popover-side-right) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host(.popover-side-top) .popover-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host(.popover-side-start) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host-context([dir=rtl]):host(.popover-side-start) .popover-arrow,:host-context([dir=rtl]).popover-side-start .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@supports selector(:dir(rtl)){:host(.popover-side-start) .popover-arrow:dir(rtl){-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}}:host(.popover-side-end) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host-context([dir=rtl]):host(.popover-side-end) .popover-arrow,:host-context([dir=rtl]).popover-side-end .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}@supports selector(:dir(rtl)){:host(.popover-side-end) .popover-arrow:dir(rtl){-webkit-transform:rotate(90deg);transform:rotate(90deg)}}.popover-arrow,.popover-content{opacity:0}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.popover-translucent) .popover-content,:host(.popover-translucent) .popover-arrow::after{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}';var popoverMdCss=":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}.popover-viewport{--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start):dir(rtl){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end):dir(rtl){--offset-x:5px}}:host{--width:250px;--max-height:90%;--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}.popover-content{border-radius:4px;-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]) .popover-content{-webkit-transform-origin:right top;transform-origin:right top}[dir=rtl] .popover-content{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){.popover-content:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}.popover-viewport{-webkit-transition-delay:100ms;transition-delay:100ms}.popover-wrapper{opacity:0}";var Popover=function(){function e(e){var t=this;registerInstance(this,e);this.didPresent=createEvent(this,"ionPopoverDidPresent",7);this.willPresent=createEvent(this,"ionPopoverWillPresent",7);this.willDismiss=createEvent(this,"ionPopoverWillDismiss",7);this.didDismiss=createEvent(this,"ionPopoverDidDismiss",7);this.didPresentShorthand=createEvent(this,"didPresent",7);this.willPresentShorthand=createEvent(this,"willPresent",7);this.willDismissShorthand=createEvent(this,"willDismiss",7);this.didDismissShorthand=createEvent(this,"didDismiss",7);this.ionMount=createEvent(this,"ionMount",7);this.parentPopover=null;this.coreDelegate=CoreDelegate();this.lockController=createLockController();this.inline=false;this.focusDescendantOnPresent=false;this.onBackdropTap=function(){t.dismiss(undefined,BACKDROP)};this.onLifecycle=function(e){var r=t.usersElement;var o=LIFECYCLE_MAP[e.type];if(r&&o){var n=new CustomEvent(o,{bubbles:false,cancelable:false,detail:e.detail});r.dispatchEvent(n)}};this.configureTriggerInteraction=function(){var e=t,r=e.trigger,o=e.triggerAction,n=e.el,i=e.destroyTriggerInteraction;if(i){i()}if(r===undefined){return}var a=t.triggerEl=r!==undefined?document.getElementById(r):null;if(!a){printIonWarning('A trigger element with the ID "'.concat(r,'" was not found in the DOM. The trigger element must be in the DOM when the "trigger" property is set on ion-popover.'),t.el);return}t.destroyTriggerInteraction=configureTriggerInteraction(a,o,n)};this.configureKeyboardInteraction=function(){var e=t,r=e.destroyKeyboardInteraction,o=e.el;if(r){r()}t.destroyKeyboardInteraction=configureKeyboardInteraction(o)};this.configureDismissInteraction=function(){var e=t,r=e.destroyDismissInteraction,o=e.parentPopover,n=e.triggerAction,i=e.triggerEl,a=e.el;if(!o||!i){return}if(r){r()}t.destroyDismissInteraction=configureDismissInteraction(i,n,a,o)};this.presented=false;this.hasController=false;this.delegate=undefined;this.overlayIndex=undefined;this.enterAnimation=undefined;this.leaveAnimation=undefined;this.component=undefined;this.componentProps=undefined;this.keyboardClose=true;this.cssClass=undefined;this.backdropDismiss=true;this.event=undefined;this.showBackdrop=true;this.translucent=false;this.animated=true;this.htmlAttributes=undefined;this.triggerAction="click";this.trigger=undefined;this.size="auto";this.dismissOnSelect=false;this.reference="trigger";this.side="bottom";this.alignment=undefined;this.arrow=true;this.isOpen=false;this.keyboardEvents=false;this.keepContentsMounted=false}e.prototype.onTriggerChange=function(){this.configureTriggerInteraction()};e.prototype.onIsOpenChange=function(e,t){if(e===true&&t===false){this.present()}else if(e===false&&t===true){this.dismiss()}};e.prototype.connectedCallback=function(){var e=this,t=e.configureTriggerInteraction,r=e.el;prepareOverlay(r);t()};e.prototype.disconnectedCallback=function(){var e=this.destroyTriggerInteraction;if(e){e()}};e.prototype.componentWillLoad=function(){var e=this.el;var t=setOverlayId(e);this.parentPopover=e.closest("ion-popover:not(#".concat(t,")"));if(this.alignment===undefined){this.alignment=getIonMode(this)==="ios"?"center":"start"}};e.prototype.componentDidLoad=function(){var e=this;var t=this,r=t.parentPopover,o=t.isOpen;if(o===true){raf((function(){return e.present()}))}if(r){addEventListener(r,"ionPopoverWillDismiss",(function(){e.dismiss(undefined,undefined,false)}))}};e.prototype.presentFromTrigger=function(e,t){if(t===void 0){t=false}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:this.focusDescendantOnPresent=t;return[4,this.present(e)];case 1:r.sent();this.focusDescendantOnPresent=false;return[2]}}))}))};e.prototype.getDelegate=function(e){if(e===void 0){e=false}if(this.workingDelegate&&!e){return{delegate:this.workingDelegate,inline:this.inline}}var t=this.el.parentNode;var r=this.inline=t!==null&&!this.hasController;var o=this.workingDelegate=r?this.delegate||this.coreDelegate:this.delegate;return{inline:r,delegate:o}};e.prototype.present=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,o,n,i,a;return __generator(this,(function(s){switch(s.label){case 0:return[4,this.lockController.lock()];case 1:t=s.sent();if(this.presented){t();return[2]}r=this.el;o=this.getDelegate(true),n=o.inline,i=o.delegate;this.ionMount.emit();a=this;return[4,attachComponent(i,r,this.component,["popover-viewport"],this.componentProps,n)];case 2:a.usersElement=s.sent();if(!this.keyboardEvents){this.configureKeyboardInteraction()}this.configureDismissInteraction();if(!hasLazyBuild(r))return[3,4];return[4,deepReady(this.usersElement)];case 3:s.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:s.sent();s.label=6;case 6:return[4,present(this,"popoverEnter",iosEnterAnimation,mdEnterAnimation,{event:e||this.event,size:this.size,trigger:this.triggerEl,reference:this.reference,side:this.side,align:this.alignment})];case 7:s.sent();if(this.focusDescendantOnPresent){focusFirstDescendant(this.el,this.el)}t();return[2]}}))}))};e.prototype.dismiss=function(e,t,r){if(r===void 0){r=true}return __awaiter(this,void 0,void 0,(function(){var o,n,i,a,s,p;return __generator(this,(function(c){switch(c.label){case 0:return[4,this.lockController.lock()];case 1:o=c.sent();n=this,i=n.destroyKeyboardInteraction,a=n.destroyDismissInteraction;if(r&&this.parentPopover){this.parentPopover.dismiss(e,t,r)}return[4,dismiss(this,e,t,"popoverLeave",iosLeaveAnimation,mdLeaveAnimation,this.event)];case 2:s=c.sent();if(!s)return[3,4];if(i){i();this.destroyKeyboardInteraction=undefined}if(a){a();this.destroyDismissInteraction=undefined}p=this.getDelegate().delegate;return[4,detachComponent(p,this.usersElement)];case 3:c.sent();c.label=4;case 4:o();return[2,s]}}))}))};e.prototype.getParentPopover=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.parentPopover]}))}))};e.prototype.onDidDismiss=function(){return eventMethod(this.el,"ionPopoverDidDismiss")};e.prototype.onWillDismiss=function(){return eventMethod(this.el,"ionPopoverWillDismiss")};e.prototype.render=function(){var e;var t=this;var r=getIonMode(this);var o=this,n=o.onLifecycle,i=o.parentPopover,a=o.dismissOnSelect,s=o.side,p=o.arrow,c=o.htmlAttributes;var d=isPlatform("desktop");var l=p&&!i;return h(Host,Object.assign({"aria-modal":"true","no-router":true,tabindex:"-1"},c,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign(Object.assign({},getClassMap(this.cssClass)),(e={},e[r]=true,e["popover-translucent"]=this.translucent,e["overlay-hidden"]=true,e["popover-desktop"]=d,e["popover-side-".concat(s)]=true,e["popover-nested"]=!!i,e)),onIonPopoverDidPresent:n,onIonPopoverWillPresent:n,onIonPopoverWillDismiss:n,onIonPopoverDidDismiss:n,onIonBackdropTap:this.onBackdropTap}),!i&&h("ion-backdrop",{tappable:this.backdropDismiss,visible:this.showBackdrop,part:"backdrop"}),h("div",{class:"popover-wrapper ion-overlay-wrapper",onClick:a?function(){return t.dismiss()}:undefined},l&&h("div",{class:"popover-arrow",part:"arrow"}),h("div",{class:"popover-content",part:"content"},h("slot",null))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{trigger:["onTriggerChange"],triggerAction:["onTriggerChange"],isOpen:["onIsOpenChange"]}},enumerable:false,configurable:true});return e}();var LIFECYCLE_MAP={ionPopoverDidPresent:"ionViewDidEnter",ionPopoverWillPresent:"ionViewWillEnter",ionPopoverWillDismiss:"ionViewWillLeave",ionPopoverDidDismiss:"ionViewDidLeave"};Popover.style={ios:popoverIosCss,md:popoverMdCss};export{Popover as ion_popover};
|
|
4
|
+
*/import{r as registerInstance,d as createEvent,h,H as Host,f as getElement}from"./index-2d388930.js";import{C as CoreDelegate,a as attachComponent,d as detachComponent}from"./framework-delegate-aa433dea.js";import{r as raf,g as getElementRoot,a as addEventListener,m as hasLazyBuild}from"./helpers-3379ba19.js";import{c as createLockController}from"./lock-controller-e8c6c051.js";import{p as printIonWarning}from"./index-595d62c9.js";import{B as BACKDROP,j as prepareOverlay,k as setOverlayId,f as present,o as focusFirstDescendant,g as dismiss,h as eventMethod}from"./overlays-8fc6656c.js";import{b as getIonMode,a as isPlatform}from"./ionic-global-b3fc28dd.js";import{g as getClassMap}from"./theme-17531cdf.js";import{e as deepReady,w as waitForMount}from"./index-87684bba.js";import{c as createAnimation}from"./animation-a1d9e088.js";import"./index-7a14ecec.js";import"./hardware-back-button-39299f84.js";var getArrowDimensions=function(e){if(!e){return{arrowWidth:0,arrowHeight:0}}var t=e.getBoundingClientRect(),r=t.width,o=t.height;return{arrowWidth:r,arrowHeight:o}};var getPopoverDimensions=function(e,t,r){var o=t.getBoundingClientRect();var n=o.height;var i=o.width;if(e==="cover"&&r){var a=r.getBoundingClientRect();i=a.width}return{contentWidth:i,contentHeight:n}};var configureDismissInteraction=function(e,t,r,o){var n=[];var i=getElementRoot(o);var a=i.querySelector(".popover-content");switch(t){case"hover":n=[{eventName:"mouseenter",callback:function(t){var o=document.elementFromPoint(t.clientX,t.clientY);if(o===e){return}r.dismiss(undefined,undefined,false)}}];break;case"context-menu":case"click":default:n=[{eventName:"click",callback:function(t){var o=t.target;var n=o.closest("[data-ion-popover-trigger]");if(n===e){t.stopPropagation();return}r.dismiss(undefined,undefined,false)}}];break}n.forEach((function(e){var t=e.eventName,r=e.callback;return a.addEventListener(t,r)}));return function(){n.forEach((function(e){var t=e.eventName,r=e.callback;return a.removeEventListener(t,r)}))}};var configureTriggerInteraction=function(e,t,r){var o=[];switch(t){case"hover":var n;o=[{eventName:"mouseenter",callback:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){e.stopPropagation();if(n){clearTimeout(n)}n=setTimeout((function(){raf((function(){r.presentFromTrigger(e);n=undefined}))}),100);return[2]}))}))}},{eventName:"mouseleave",callback:function(e){if(n){clearTimeout(n)}var t=e.relatedTarget;if(!t){return}if(t.closest("ion-popover")!==r){r.dismiss(undefined,undefined,false)}}},{eventName:"click",callback:function(e){return e.stopPropagation()}},{eventName:"ionPopoverActivateTrigger",callback:function(e){return r.presentFromTrigger(e,true)}}];break;case"context-menu":o=[{eventName:"contextmenu",callback:function(e){e.preventDefault();r.presentFromTrigger(e)}},{eventName:"click",callback:function(e){return e.stopPropagation()}},{eventName:"ionPopoverActivateTrigger",callback:function(e){return r.presentFromTrigger(e,true)}}];break;case"click":default:o=[{eventName:"click",callback:function(e){return r.presentFromTrigger(e)}},{eventName:"ionPopoverActivateTrigger",callback:function(e){return r.presentFromTrigger(e,true)}}];break}o.forEach((function(t){var r=t.eventName,o=t.callback;return e.addEventListener(r,o)}));e.setAttribute("data-ion-popover-trigger","true");return function(){o.forEach((function(t){var r=t.eventName,o=t.callback;return e.removeEventListener(r,o)}));e.removeAttribute("data-ion-popover-trigger")}};var getIndexOfItem=function(e,t){if(!t||t.tagName!=="ION-ITEM"){return-1}return e.findIndex((function(e){return e===t}))};var getNextItem=function(e,t){var r=getIndexOfItem(e,t);return e[r+1]};var getPrevItem=function(e,t){var r=getIndexOfItem(e,t);return e[r-1]};var focusItem=function(e){var t=getElementRoot(e);var r=t.querySelector("button");if(r){raf((function(){return r.focus()}))}};var isTriggerElement=function(e){return e.hasAttribute("data-ion-popover-trigger")};var configureKeyboardInteraction=function(e){var t=function(t){return __awaiter(void 0,void 0,void 0,(function(){var r,o,n,i,a,s,p,c,d,l,v;return __generator(this,(function(f){switch(f.label){case 0:o=document.activeElement;n=[];i=(r=t.target)===null||r===void 0?void 0:r.tagName;if(i!=="ION-POPOVER"&&i!=="ION-ITEM"){return[2]}try{n=Array.from(e.querySelectorAll("ion-item:not(ion-popover ion-popover *):not([disabled])"))}catch(e){}a=t.key;switch(a){case"ArrowLeft":return[3,1];case"ArrowDown":return[3,3];case"ArrowUp":return[3,4];case"Home":return[3,5];case"End":return[3,6];case"ArrowRight":return[3,7];case" ":return[3,7];case"Enter":return[3,7]}return[3,8];case 1:return[4,e.getParentPopover()];case 2:s=f.sent();if(s){e.dismiss(undefined,undefined,false)}return[3,8];case 3:t.preventDefault();p=getNextItem(n,o);if(p!==undefined){focusItem(p)}return[3,8];case 4:t.preventDefault();c=getPrevItem(n,o);if(c!==undefined){focusItem(c)}return[3,8];case 5:t.preventDefault();d=n[0];if(d!==undefined){focusItem(d)}return[3,8];case 6:t.preventDefault();l=n[n.length-1];if(l!==undefined){focusItem(l)}return[3,8];case 7:if(o&&isTriggerElement(o)){v=new CustomEvent("ionPopoverActivateTrigger");o.dispatchEvent(v)}return[3,8];case 8:return[2]}}))}))};e.addEventListener("keydown",t);return function(){return e.removeEventListener("keydown",t)}};var getPopoverPosition=function(e,t,r,o,n,i,a,s,p,c,d){var l;var v={top:0,left:0,width:0,height:0};switch(i){case"event":if(!d){return p}var f=d;v={top:f.clientY,left:f.clientX,width:1,height:1};break;case"trigger":default:var u=d;var h=c||((l=u===null||u===void 0?void 0:u.detail)===null||l===void 0?void 0:l.ionShadowTarget)||(u===null||u===void 0?void 0:u.target);if(!h){return p}var g=h.getBoundingClientRect();v={top:g.top,left:g.left,width:g.width,height:g.height};break}var m=calculatePopoverSide(a,v,t,r,o,n,e);var w=calculatePopoverAlign(s,a,v,t,r);var b=m.top+w.top;var x=m.left+w.left;var y=calculateArrowPosition(a,o,n,b,x,t,r,e),P=y.arrowTop,k=y.arrowLeft;var A=calculatePopoverOrigin(a,s,e),D=A.originX,E=A.originY;return{top:b,left:x,referenceCoordinates:v,arrowTop:P,arrowLeft:k,originX:D,originY:E}};var calculatePopoverOrigin=function(e,t,r){switch(e){case"top":return{originX:getOriginXAlignment(t),originY:"bottom"};case"bottom":return{originX:getOriginXAlignment(t),originY:"top"};case"left":return{originX:"right",originY:getOriginYAlignment(t)};case"right":return{originX:"left",originY:getOriginYAlignment(t)};case"start":return{originX:r?"left":"right",originY:getOriginYAlignment(t)};case"end":return{originX:r?"right":"left",originY:getOriginYAlignment(t)}}};var getOriginXAlignment=function(e){switch(e){case"start":return"left";case"center":return"center";case"end":return"right"}};var getOriginYAlignment=function(e){switch(e){case"start":return"top";case"center":return"center";case"end":return"bottom"}};var calculateArrowPosition=function(e,t,r,o,n,i,a,s){var p={arrowTop:o+a/2-t/2,arrowLeft:n+i-t/2};var c={arrowTop:o+a/2-t/2,arrowLeft:n-t*1.5};switch(e){case"top":return{arrowTop:o+a,arrowLeft:n+i/2-t/2};case"bottom":return{arrowTop:o-r,arrowLeft:n+i/2-t/2};case"left":return p;case"right":return c;case"start":return s?c:p;case"end":return s?p:c;default:return{arrowTop:0,arrowLeft:0}}};var calculatePopoverSide=function(e,t,r,o,n,i,a){var s={top:t.top,left:t.left-r-n};var p={top:t.top,left:t.left+t.width+n};switch(e){case"top":return{top:t.top-o-i,left:t.left};case"right":return p;case"bottom":return{top:t.top+t.height+i,left:t.left};case"left":return s;case"start":return a?p:s;case"end":return a?s:p}};var calculatePopoverAlign=function(e,t,r,o,n){switch(e){case"center":return calculatePopoverCenterAlign(t,r,o,n);case"end":return calculatePopoverEndAlign(t,r,o,n);case"start":default:return{top:0,left:0}}};var calculatePopoverEndAlign=function(e,t,r,o){switch(e){case"start":case"end":case"left":case"right":return{top:-(o-t.height),left:0};case"top":case"bottom":default:return{top:0,left:-(r-t.width)}}};var calculatePopoverCenterAlign=function(e,t,r,o){switch(e){case"start":case"end":case"left":case"right":return{top:-(o/2-t.height/2),left:0};case"top":case"bottom":default:return{top:0,left:-(r/2-t.width/2)}}};var calculateWindowAdjustment=function(e,t,r,o,n,i,a,s,p,c,d,l,v,f,u){if(v===void 0){v=0}if(f===void 0){f=0}if(u===void 0){u=0}var h=v;var g=f;var m=r;var w=t;var b;var x=c;var y=d;var P=false;var k=false;var A=l?l.top:i/2-s/2;var D=l?l.height:0;var E=false;if(m<o+p){m=o;P=true;x="left"}else if(a+o+m+p>n){k=true;m=n-a-o;x="right"}if(A+D+s>i&&(e==="top"||e==="bottom")){if(A-s>0){w=Math.max(12,A-s-(u-1));h=w+s;y="bottom";E=true}else{b=o}}console.log(w,h);return{top:w,left:m,bottom:b,originX:x,originY:y,checkSafeAreaLeft:P,checkSafeAreaRight:k,arrowTop:h,arrowLeft:g,addPopoverBottomClass:E}};var shouldShowArrow=function(e,t,r,o){if(t===void 0){t=false}if(!r&&!o){return false}if(e!=="top"&&e!=="bottom"&&t){return false}return true};var POPOVER_IOS_BODY_PADDING=5;var iosEnterAnimation=function(e,t){var r;var o=t.event,n=t.size,i=t.trigger,a=t.reference,s=t.side,p=t.align;var c=e.ownerDocument;var d=c.dir==="rtl";var l=c.defaultView.innerWidth;var v=c.defaultView.innerHeight;var f=getElementRoot(e);var u=f.querySelector(".popover-content");var h=f.querySelector(".popover-arrow");var g=i||((r=o===null||o===void 0?void 0:o.detail)===null||r===void 0?void 0:r.ionShadowTarget)||(o===null||o===void 0?void 0:o.target);var m=getPopoverDimensions(n,u,g),w=m.contentWidth,b=m.contentHeight;var x=getArrowDimensions(h),y=x.arrowWidth,P=x.arrowHeight;var k={top:v/2-b/2,left:l/2-w/2,originX:d?"right":"left",originY:"top"};var A=getPopoverPosition(d,w,b,y,P,a,s,p,k,i,o);var D=n==="cover"?0:POPOVER_IOS_BODY_PADDING;var E=n==="cover"?0:25;var I=calculateWindowAdjustment(s,A.top,A.left,D,l,v,w,b,E,A.originX,A.originY,A.referenceCoordinates,A.arrowTop,A.arrowLeft,P),T=I.originX,O=I.originY,C=I.top,L=I.left,S=I.bottom,_=I.checkSafeAreaLeft,W=I.checkSafeAreaRight,Y=I.arrowTop,N=I.arrowLeft,M=I.addPopoverBottomClass;var j=createAnimation();var R=createAnimation();var B=createAnimation();R.addElement(f.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);B.addElement(f.querySelector(".popover-arrow")).addElement(f.querySelector(".popover-content")).fromTo("opacity",.01,1);return j.easing("ease").duration(100).beforeAddWrite((function(){if(n==="cover"){e.style.setProperty("--width","".concat(w,"px"))}if(M){e.classList.add("popover-bottom")}if(S!==undefined){u.style.setProperty("bottom","".concat(S,"px"))}var t=" + var(--ion-safe-area-left, 0)";var r=" - var(--ion-safe-area-right, 0)";var a="".concat(L,"px");if(_){a="".concat(L,"px").concat(t)}if(W){a="".concat(L,"px").concat(r)}u.style.setProperty("top","calc(".concat(C,"px + var(--offset-y, 0))"));u.style.setProperty("left","calc(".concat(a," + var(--offset-x, 0))"));u.style.setProperty("transform-origin","".concat(O," ").concat(T));if(h!==null){var p=A.top!==C||A.left!==L;var c=shouldShowArrow(s,p,o,i);if(c){h.style.setProperty("top","calc(".concat(Y,"px + var(--offset-y, 0))"));h.style.setProperty("left","calc(".concat(N,"px + var(--offset-x, 0))"))}else{h.style.setProperty("display","none")}}})).addAnimation([R,B])};var iosLeaveAnimation=function(e){var t=getElementRoot(e);var r=t.querySelector(".popover-content");var o=t.querySelector(".popover-arrow");var n=createAnimation();var i=createAnimation();var a=createAnimation();i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0);a.addElement(t.querySelector(".popover-arrow")).addElement(t.querySelector(".popover-content")).fromTo("opacity",.99,0);return n.easing("ease").afterAddWrite((function(){e.style.removeProperty("--width");e.classList.remove("popover-bottom");r.style.removeProperty("top");r.style.removeProperty("left");r.style.removeProperty("bottom");r.style.removeProperty("transform-origin");if(o){o.style.removeProperty("top");o.style.removeProperty("left");o.style.removeProperty("display")}})).duration(300).addAnimation([i,a])};var POPOVER_MD_BODY_PADDING=12;var mdEnterAnimation=function(e,t){var r;var o=t.event,n=t.size,i=t.trigger,a=t.reference,s=t.side,p=t.align;var c=e.ownerDocument;var d=c.dir==="rtl";var l=c.defaultView.innerWidth;var v=c.defaultView.innerHeight;var f=getElementRoot(e);var u=f.querySelector(".popover-content");var h=i||((r=o===null||o===void 0?void 0:o.detail)===null||r===void 0?void 0:r.ionShadowTarget)||(o===null||o===void 0?void 0:o.target);var g=getPopoverDimensions(n,u,h),m=g.contentWidth,w=g.contentHeight;var b={top:v/2-w/2,left:l/2-m/2,originX:d?"right":"left",originY:"top"};var x=getPopoverPosition(d,m,w,0,0,a,s,p,b,i,o);var y=n==="cover"?0:POPOVER_MD_BODY_PADDING;var P=calculateWindowAdjustment(s,x.top,x.left,y,l,v,m,w,0,x.originX,x.originY,x.referenceCoordinates),k=P.originX,A=P.originY,D=P.top,E=P.left,I=P.bottom;var T=createAnimation();var O=createAnimation();var C=createAnimation();var L=createAnimation();var S=createAnimation();O.addElement(f.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]);C.addElement(f.querySelector(".popover-wrapper")).duration(150).fromTo("opacity",.01,1);L.addElement(u).beforeStyles({top:"calc(".concat(D,"px + var(--offset-y, 0px))"),left:"calc(".concat(E,"px + var(--offset-x, 0px))"),"transform-origin":"".concat(A," ").concat(k)}).beforeAddWrite((function(){if(I!==undefined){u.style.setProperty("bottom","".concat(I,"px"))}})).fromTo("transform","scale(0.8)","scale(1)");S.addElement(f.querySelector(".popover-viewport")).fromTo("opacity",.01,1);return T.easing("cubic-bezier(0.36,0.66,0.04,1)").duration(300).beforeAddWrite((function(){if(n==="cover"){e.style.setProperty("--width","".concat(m,"px"))}if(A==="bottom"){e.classList.add("popover-bottom")}})).addAnimation([O,C,L,S])};var mdLeaveAnimation=function(e){var t=getElementRoot(e);var r=t.querySelector(".popover-content");var o=createAnimation();var n=createAnimation();var i=createAnimation();n.addElement(t.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0);i.addElement(t.querySelector(".popover-wrapper")).fromTo("opacity",.99,0);return o.easing("ease").afterAddWrite((function(){e.style.removeProperty("--width");e.classList.remove("popover-bottom");r.style.removeProperty("top");r.style.removeProperty("left");r.style.removeProperty("bottom");r.style.removeProperty("transform-origin")})).duration(150).addAnimation([n,i])};var popoverIosCss=':host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}.popover-viewport{--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start):dir(rtl){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end):dir(rtl){--offset-x:5px}}:host{--width:200px;--max-height:90%;--box-shadow:none;--backdrop-opacity:var(--ion-backdrop-opacity, 0.08)}:host(.popover-desktop){--box-shadow:0px 4px 16px 0px rgba(0, 0, 0, 0.12)}.popover-content{border-radius:10px}:host(.popover-desktop) .popover-content{border:0.5px solid var(--ion-color-step-100, #e6e6e6)}.popover-arrow{display:block;position:absolute;width:20px;height:10px;overflow:hidden}.popover-arrow::after{top:3px;border-radius:3px;position:absolute;width:14px;height:14px;-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--background);content:"";z-index:10}@supports (inset-inline-start: 0){.popover-arrow::after{inset-inline-start:3px}}@supports not (inset-inline-start: 0){.popover-arrow::after{left:3px}:host-context([dir=rtl]) .popover-arrow::after{left:unset;right:unset;right:3px}[dir=rtl] .popover-arrow::after{left:unset;right:unset;right:3px}@supports selector(:dir(rtl)){.popover-arrow::after:dir(rtl){left:unset;right:unset;right:3px}}}:host(.popover-bottom) .popover-arrow{top:auto;bottom:-10px}:host(.popover-bottom) .popover-arrow::after{top:-6px}:host(.popover-side-left) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host(.popover-side-right) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host(.popover-side-top) .popover-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host(.popover-side-start) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host-context([dir=rtl]):host(.popover-side-start) .popover-arrow,:host-context([dir=rtl]).popover-side-start .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@supports selector(:dir(rtl)){:host(.popover-side-start) .popover-arrow:dir(rtl){-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}}:host(.popover-side-end) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host-context([dir=rtl]):host(.popover-side-end) .popover-arrow,:host-context([dir=rtl]).popover-side-end .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}@supports selector(:dir(rtl)){:host(.popover-side-end) .popover-arrow:dir(rtl){-webkit-transform:rotate(90deg);transform:rotate(90deg)}}.popover-arrow,.popover-content{opacity:0}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.popover-translucent) .popover-content,:host(.popover-translucent) .popover-arrow::after{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}';var popoverMdCss=":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}.popover-viewport{--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start):dir(rtl){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end):dir(rtl){--offset-x:5px}}:host{--width:250px;--max-height:90%;--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}.popover-content{border-radius:4px;-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]) .popover-content{-webkit-transform-origin:right top;transform-origin:right top}[dir=rtl] .popover-content{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){.popover-content:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}.popover-viewport{-webkit-transition-delay:100ms;transition-delay:100ms}.popover-wrapper{opacity:0}";var Popover=function(){function e(e){var t=this;registerInstance(this,e);this.didPresent=createEvent(this,"ionPopoverDidPresent",7);this.willPresent=createEvent(this,"ionPopoverWillPresent",7);this.willDismiss=createEvent(this,"ionPopoverWillDismiss",7);this.didDismiss=createEvent(this,"ionPopoverDidDismiss",7);this.didPresentShorthand=createEvent(this,"didPresent",7);this.willPresentShorthand=createEvent(this,"willPresent",7);this.willDismissShorthand=createEvent(this,"willDismiss",7);this.didDismissShorthand=createEvent(this,"didDismiss",7);this.ionMount=createEvent(this,"ionMount",7);this.parentPopover=null;this.coreDelegate=CoreDelegate();this.lockController=createLockController();this.inline=false;this.focusDescendantOnPresent=false;this.onBackdropTap=function(){t.dismiss(undefined,BACKDROP)};this.onLifecycle=function(e){var r=t.usersElement;var o=LIFECYCLE_MAP[e.type];if(r&&o){var n=new CustomEvent(o,{bubbles:false,cancelable:false,detail:e.detail});r.dispatchEvent(n)}};this.configureTriggerInteraction=function(){var e=t,r=e.trigger,o=e.triggerAction,n=e.el,i=e.destroyTriggerInteraction;if(i){i()}if(r===undefined){return}var a=t.triggerEl=r!==undefined?document.getElementById(r):null;if(!a){printIonWarning('A trigger element with the ID "'.concat(r,'" was not found in the DOM. The trigger element must be in the DOM when the "trigger" property is set on ion-popover.'),t.el);return}t.destroyTriggerInteraction=configureTriggerInteraction(a,o,n)};this.configureKeyboardInteraction=function(){var e=t,r=e.destroyKeyboardInteraction,o=e.el;if(r){r()}t.destroyKeyboardInteraction=configureKeyboardInteraction(o)};this.configureDismissInteraction=function(){var e=t,r=e.destroyDismissInteraction,o=e.parentPopover,n=e.triggerAction,i=e.triggerEl,a=e.el;if(!o||!i){return}if(r){r()}t.destroyDismissInteraction=configureDismissInteraction(i,n,a,o)};this.presented=false;this.hasController=false;this.delegate=undefined;this.overlayIndex=undefined;this.enterAnimation=undefined;this.leaveAnimation=undefined;this.component=undefined;this.componentProps=undefined;this.keyboardClose=true;this.cssClass=undefined;this.backdropDismiss=true;this.event=undefined;this.showBackdrop=true;this.translucent=false;this.animated=true;this.htmlAttributes=undefined;this.triggerAction="click";this.trigger=undefined;this.size="auto";this.dismissOnSelect=false;this.reference="trigger";this.side="bottom";this.alignment=undefined;this.arrow=true;this.isOpen=false;this.keyboardEvents=false;this.keepContentsMounted=false}e.prototype.onTriggerChange=function(){this.configureTriggerInteraction()};e.prototype.onIsOpenChange=function(e,t){if(e===true&&t===false){this.present()}else if(e===false&&t===true){this.dismiss()}};e.prototype.connectedCallback=function(){var e=this,t=e.configureTriggerInteraction,r=e.el;prepareOverlay(r);t()};e.prototype.disconnectedCallback=function(){var e=this.destroyTriggerInteraction;if(e){e()}};e.prototype.componentWillLoad=function(){var e=this.el;var t=setOverlayId(e);this.parentPopover=e.closest("ion-popover:not(#".concat(t,")"));if(this.alignment===undefined){this.alignment=getIonMode(this)==="ios"?"center":"start"}};e.prototype.componentDidLoad=function(){var e=this;var t=this,r=t.parentPopover,o=t.isOpen;if(o===true){raf((function(){return e.present()}))}if(r){addEventListener(r,"ionPopoverWillDismiss",(function(){e.dismiss(undefined,undefined,false)}))}};e.prototype.presentFromTrigger=function(e,t){if(t===void 0){t=false}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:this.focusDescendantOnPresent=t;return[4,this.present(e)];case 1:r.sent();this.focusDescendantOnPresent=false;return[2]}}))}))};e.prototype.getDelegate=function(e){if(e===void 0){e=false}if(this.workingDelegate&&!e){return{delegate:this.workingDelegate,inline:this.inline}}var t=this.el.parentNode;var r=this.inline=t!==null&&!this.hasController;var o=this.workingDelegate=r?this.delegate||this.coreDelegate:this.delegate;return{inline:r,delegate:o}};e.prototype.present=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,o,n,i,a;return __generator(this,(function(s){switch(s.label){case 0:return[4,this.lockController.lock()];case 1:t=s.sent();if(this.presented){t();return[2]}r=this.el;o=this.getDelegate(true),n=o.inline,i=o.delegate;this.ionMount.emit();a=this;return[4,attachComponent(i,r,this.component,["popover-viewport"],this.componentProps,n)];case 2:a.usersElement=s.sent();if(!this.keyboardEvents){this.configureKeyboardInteraction()}this.configureDismissInteraction();if(!hasLazyBuild(r))return[3,4];return[4,deepReady(this.usersElement)];case 3:s.sent();return[3,6];case 4:if(!!this.keepContentsMounted)return[3,6];return[4,waitForMount()];case 5:s.sent();s.label=6;case 6:return[4,present(this,"popoverEnter",iosEnterAnimation,mdEnterAnimation,{event:e||this.event,size:this.size,trigger:this.triggerEl,reference:this.reference,side:this.side,align:this.alignment})];case 7:s.sent();if(this.focusDescendantOnPresent){focusFirstDescendant(this.el,this.el)}t();return[2]}}))}))};e.prototype.dismiss=function(e,t,r){if(r===void 0){r=true}return __awaiter(this,void 0,void 0,(function(){var o,n,i,a,s,p;return __generator(this,(function(c){switch(c.label){case 0:return[4,this.lockController.lock()];case 1:o=c.sent();n=this,i=n.destroyKeyboardInteraction,a=n.destroyDismissInteraction;if(r&&this.parentPopover){this.parentPopover.dismiss(e,t,r)}return[4,dismiss(this,e,t,"popoverLeave",iosLeaveAnimation,mdLeaveAnimation,this.event)];case 2:s=c.sent();if(!s)return[3,4];if(i){i();this.destroyKeyboardInteraction=undefined}if(a){a();this.destroyDismissInteraction=undefined}p=this.getDelegate().delegate;return[4,detachComponent(p,this.usersElement)];case 3:c.sent();c.label=4;case 4:o();return[2,s]}}))}))};e.prototype.getParentPopover=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.parentPopover]}))}))};e.prototype.onDidDismiss=function(){return eventMethod(this.el,"ionPopoverDidDismiss")};e.prototype.onWillDismiss=function(){return eventMethod(this.el,"ionPopoverWillDismiss")};e.prototype.render=function(){var e;var t=this;var r=getIonMode(this);var o=this,n=o.onLifecycle,i=o.parentPopover,a=o.dismissOnSelect,s=o.side,p=o.arrow,c=o.htmlAttributes;var d=isPlatform("desktop");var l=p&&!i;return h(Host,Object.assign({"aria-modal":"true","no-router":true,tabindex:"-1"},c,{style:{zIndex:"".concat(2e4+this.overlayIndex)},class:Object.assign(Object.assign({},getClassMap(this.cssClass)),(e={},e[r]=true,e["popover-translucent"]=this.translucent,e["overlay-hidden"]=true,e["popover-desktop"]=d,e["popover-side-".concat(s)]=true,e["popover-nested"]=!!i,e)),onIonPopoverDidPresent:n,onIonPopoverWillPresent:n,onIonPopoverWillDismiss:n,onIonPopoverDidDismiss:n,onIonBackdropTap:this.onBackdropTap}),!i&&h("ion-backdrop",{tappable:this.backdropDismiss,visible:this.showBackdrop,part:"backdrop"}),h("div",{class:"popover-wrapper ion-overlay-wrapper",onClick:a?function(){return t.dismiss()}:undefined},l&&h("div",{class:"popover-arrow",part:"arrow"}),h("div",{class:"popover-content",part:"content"},h("slot",null))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{trigger:["onTriggerChange"],triggerAction:["onTriggerChange"],isOpen:["onIsOpenChange"]}},enumerable:false,configurable:true});return e}();var LIFECYCLE_MAP={ionPopoverDidPresent:"ionViewDidEnter",ionPopoverWillPresent:"ionViewWillEnter",ionPopoverWillDismiss:"ionViewWillLeave",ionPopoverDidDismiss:"ionViewDidLeave"};Popover.style={ios:popoverIosCss,md:popoverMdCss};export{Popover as ion_popover};
|
|
@@ -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,h,H as Host,f as getElement}from"./index-2d388930.js";import{f as findClosestIonContent,d as disableContentScrollY,r as resetContentScrollY}from"./index-746a238e.js";import{c as createLegacyFormController}from"./form-controller-ed77647a.js";import{l as clamp,j as debounceEvent,i as inheritAriaAttributes,d as renderHiddenInput,e as getAriaLabel}from"./helpers-3379ba19.js";import{p as printIonWarning}from"./index-595d62c9.js";import{i as isRTL}from"./dir-912e3e13.js";import{c as createColorClasses,h as hostContext}from"./theme-17531cdf.js";import{b as getIonMode}from"./ionic-global-b3fc28dd.js";function getDecimalPlaces(e){if(e%1===0)return 0;return e.toString().split(".")[1].length}function roundToMaxDecimalPlaces(e){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}var r=Math.max.apply(Math,t.map((function(e){return getDecimalPlaces(e)})));return Number(e.toFixed(r))}var rangeIosCss=":host{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family, inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.range-disabled){pointer-events:none}::slotted(ion-label){-ms-flex:initial;flex:initial}::slotted(ion-icon[slot]){font-size:24px}.range-slider{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab;-ms-touch-action:pan-y;touch-action:pan-y}:host(.range-pressed) .range-slider{cursor:-webkit-grabbing;cursor:grabbing}.range-pin{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box}.range-knob-handle{top:calc((var(--height) - var(--knob-handle-size)) / 2);-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}@supports (inset-inline-start: 0){.range-knob-handle{inset-inline-start:0}}@supports not (inset-inline-start: 0){.range-knob-handle{left:0}:host-context([dir=rtl]) .range-knob-handle{left:unset;right:unset;right:0}[dir=rtl] .range-knob-handle{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.range-knob-handle:dir(rtl){left:unset;right:unset;right:0}}}:host-context([dir=rtl]) .range-knob-handle{left:unset}[dir=rtl] .range-knob-handle{left:unset}@supports selector(:dir(rtl)){.range-knob-handle:dir(rtl){left:unset}}.range-knob-handle:active,.range-knob-handle:focus{outline:none}.range-bar-container{border-radius:var(--bar-border-radius);top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height)}@supports (inset-inline-start: 0){.range-bar-container{inset-inline-start:0}}@supports not (inset-inline-start: 0){.range-bar-container{left:0}:host-context([dir=rtl]) .range-bar-container{left:unset;right:unset;right:0}[dir=rtl] .range-bar-container{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.range-bar-container:dir(rtl){left:unset;right:unset;right:0}}}:host-context([dir=rtl]) .range-bar-container{left:unset}[dir=rtl] .range-bar-container{left:unset}@supports selector(:dir(rtl)){.range-bar-container:dir(rtl){left:unset}}.range-bar{border-radius:var(--bar-border-radius);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}.range-knob{border-radius:var(--knob-border-radius);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}@supports (inset-inline-start: 0){.range-knob{inset-inline-start:calc(50% - var(--knob-size) / 2)}}@supports not (inset-inline-start: 0){.range-knob{left:calc(50% - var(--knob-size) / 2)}:host-context([dir=rtl]) .range-knob{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}[dir=rtl] .range-knob{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}@supports selector(:dir(rtl)){.range-knob:dir(rtl){left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}}}:host-context([dir=rtl]) .range-knob{left:unset}[dir=rtl] .range-knob{left:unset}@supports selector(:dir(rtl)){.range-knob:dir(rtl){left:unset}}:host(.range-pressed) .range-bar-active{will-change:left, right}:host(.in-item){width:100%}:host([slot=start]),:host([slot=end]){width:auto}:host(.in-item) ::slotted(ion-label){-ms-flex-item-align:center;align-self:center}.range-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit}::slotted([slot=label]){max-width:200px;pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}:host(.range-label-placement-start) .range-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.range-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-end) .range-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.range-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.range-label-placement-stacked) .range-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch}:host(.range-label-placement-stacked) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host-context([dir=rtl]):host(.range-label-placement-stacked) .label-text-wrapper,:host-context([dir=rtl]).range-label-placement-stacked .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.range-label-placement-stacked) .label-text-wrapper:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}:host(.in-item.range-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.range-label-placement-stacked) .native-wrapper{margin-bottom:0px}:host{--knob-border-radius:50%;--knob-background:#ffffff;--knob-box-shadow:0px 0.5px 4px rgba(0, 0, 0, 0.12), 0px 6px 13px rgba(0, 0, 0, 0.12);--knob-size:26px;--bar-height:4px;--bar-background:var(--ion-color-step-900, #e6e6e6);--bar-background-active:var(--ion-color-primary, #3880ff);--bar-border-radius:2px;--height:42px}:host(.legacy-range){-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}:host(.range-item-start-adjustment){-webkit-padding-start:24px;padding-inline-start:24px}:host(.range-item-end-adjustment){-webkit-padding-end:24px;padding-inline-end:24px}:host(.ion-color) .range-bar-active,:host(.ion-color) .range-tick-active{background:var(--ion-color-base)}::slotted([slot=start]){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}::slotted([slot=end]){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-has-pin:not(.range-label-placement-stacked)){padding-top:20px}:host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper{margin-bottom:20px}.range-bar-active{bottom:0;width:auto;background:var(--bar-background-active)}.range-bar-active.has-ticks{border-radius:0;-webkit-margin-start:-2px;margin-inline-start:-2px;-webkit-margin-end:-2px;margin-inline-end:-2px}.range-tick{-webkit-margin-start:-2px;margin-inline-start:-2px;border-radius:0;position:absolute;top:17px;width:4px;height:8px;background:var(--ion-color-step-900, #e6e6e6);pointer-events:none}.range-tick-active{background:var(--bar-background-active)}.range-pin{-webkit-transform:translate3d(0, 28px, 0) scale(0.01);transform:translate3d(0, 28px, 0) scale(0.01);-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;display:inline-block;position:relative;top:-20px;min-width:28px;-webkit-transition:-webkit-transform 120ms ease;transition:-webkit-transform 120ms ease;transition:transform 120ms ease;transition:transform 120ms ease, -webkit-transform 120ms ease;background:transparent;color:var(--ion-text-color, #000);font-size:12px;text-align:center}.range-knob-pressed .range-pin,.range-knob-handle.ion-focused .range-pin{-webkit-transform:translate3d(0, 0, 0) scale(1);transform:translate3d(0, 0, 0) scale(1)}:host(.range-disabled){opacity:0.3}";var rangeMdCss=':host{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family, inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.range-disabled){pointer-events:none}::slotted(ion-label){-ms-flex:initial;flex:initial}::slotted(ion-icon[slot]){font-size:24px}.range-slider{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab;-ms-touch-action:pan-y;touch-action:pan-y}:host(.range-pressed) .range-slider{cursor:-webkit-grabbing;cursor:grabbing}.range-pin{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box}.range-knob-handle{top:calc((var(--height) - var(--knob-handle-size)) / 2);-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}@supports (inset-inline-start: 0){.range-knob-handle{inset-inline-start:0}}@supports not (inset-inline-start: 0){.range-knob-handle{left:0}:host-context([dir=rtl]) .range-knob-handle{left:unset;right:unset;right:0}[dir=rtl] .range-knob-handle{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.range-knob-handle:dir(rtl){left:unset;right:unset;right:0}}}:host-context([dir=rtl]) .range-knob-handle{left:unset}[dir=rtl] .range-knob-handle{left:unset}@supports selector(:dir(rtl)){.range-knob-handle:dir(rtl){left:unset}}.range-knob-handle:active,.range-knob-handle:focus{outline:none}.range-bar-container{border-radius:var(--bar-border-radius);top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height)}@supports (inset-inline-start: 0){.range-bar-container{inset-inline-start:0}}@supports not (inset-inline-start: 0){.range-bar-container{left:0}:host-context([dir=rtl]) .range-bar-container{left:unset;right:unset;right:0}[dir=rtl] .range-bar-container{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.range-bar-container:dir(rtl){left:unset;right:unset;right:0}}}:host-context([dir=rtl]) .range-bar-container{left:unset}[dir=rtl] .range-bar-container{left:unset}@supports selector(:dir(rtl)){.range-bar-container:dir(rtl){left:unset}}.range-bar{border-radius:var(--bar-border-radius);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}.range-knob{border-radius:var(--knob-border-radius);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}@supports (inset-inline-start: 0){.range-knob{inset-inline-start:calc(50% - var(--knob-size) / 2)}}@supports not (inset-inline-start: 0){.range-knob{left:calc(50% - var(--knob-size) / 2)}:host-context([dir=rtl]) .range-knob{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}[dir=rtl] .range-knob{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}@supports selector(:dir(rtl)){.range-knob:dir(rtl){left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}}}:host-context([dir=rtl]) .range-knob{left:unset}[dir=rtl] .range-knob{left:unset}@supports selector(:dir(rtl)){.range-knob:dir(rtl){left:unset}}:host(.range-pressed) .range-bar-active{will-change:left, right}:host(.in-item){width:100%}:host([slot=start]),:host([slot=end]){width:auto}:host(.in-item) ::slotted(ion-label){-ms-flex-item-align:center;align-self:center}.range-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit}::slotted([slot=label]){max-width:200px;pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}:host(.range-label-placement-start) .range-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.range-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-end) .range-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.range-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.range-label-placement-stacked) .range-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch}:host(.range-label-placement-stacked) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host-context([dir=rtl]):host(.range-label-placement-stacked) .label-text-wrapper,:host-context([dir=rtl]).range-label-placement-stacked .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.range-label-placement-stacked) .label-text-wrapper:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}:host(.in-item.range-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.range-label-placement-stacked) .native-wrapper{margin-bottom:0px}:host{--knob-border-radius:50%;--knob-background:var(--bar-background-active);--knob-box-shadow:none;--knob-size:18px;--bar-height:2px;--bar-background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.26);--bar-background-active:var(--ion-color-primary, #3880ff);--bar-border-radius:0;--height:42px;--pin-background:var(--ion-color-primary, #3880ff);--pin-color:var(--ion-color-primary-contrast, #fff);font-size:12px}::slotted([slot=label]),.label-text{font-size:initial}:host(.legacy-range){-webkit-padding-start:14px;padding-inline-start:14px;-webkit-padding-end:14px;padding-inline-end:14px;padding-top:8px;padding-bottom:8px}:host(.range-item-start-adjustment){-webkit-padding-start:18px;padding-inline-start:18px}:host(.range-item-end-adjustment){-webkit-padding-end:18px;padding-inline-end:18px}:host(.ion-color) .range-bar{background:rgba(var(--ion-color-base-rgb), 0.26)}:host(.ion-color) .range-bar-active,:host(.ion-color) .range-knob,:host(.ion-color) .range-knob::before,:host(.ion-color) .range-pin,:host(.ion-color) .range-pin::before,:host(.ion-color) .range-tick{background:var(--ion-color-base);color:var(--ion-color-contrast)}::slotted([slot=start]){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:14px;margin-inline-end:14px;margin-top:0;margin-bottom:0}::slotted([slot=end]){-webkit-margin-start:14px;margin-inline-start:14px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-has-pin:not(.range-label-placement-stacked)){padding-top:28px}:host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper{margin-bottom:28px}.range-bar-active{bottom:0;width:auto;background:var(--bar-background-active)}.range-knob{-webkit-transform:scale(0.67);transform:scale(0.67);-webkit-transition-duration:120ms;transition-duration:120ms;-webkit-transition-property:background-color, border, -webkit-transform;transition-property:background-color, border, -webkit-transform;transition-property:transform, background-color, border;transition-property:transform, background-color, border, -webkit-transform;-webkit-transition-timing-function:ease;transition-timing-function:ease;z-index:2}.range-knob::before{border-radius:50%;position:absolute;width:var(--knob-size);height:var(--knob-size);-webkit-transform:scale(1);transform:scale(1);-webkit-transition:0.267s cubic-bezier(0, 0, 0.58, 1);transition:0.267s cubic-bezier(0, 0, 0.58, 1);background:var(--knob-background);content:"";opacity:0.13;pointer-events:none}@supports (inset-inline-start: 0){.range-knob::before{inset-inline-start:0}}@supports not (inset-inline-start: 0){.range-knob::before{left:0}:host-context([dir=rtl]) .range-knob::before{left:unset;right:unset;right:0}[dir=rtl] .range-knob::before{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.range-knob::before:dir(rtl){left:unset;right:unset;right:0}}}.range-tick{position:absolute;top:calc((var(--height) - var(--bar-height)) / 2);width:var(--bar-height);height:var(--bar-height);background:var(--bar-background-active);z-index:1;pointer-events:none}.range-tick-active{background:transparent}.range-pin{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;border-radius:50%;-webkit-transform:translate3d(0, 0, 0) scale(0.01);transform:translate3d(0, 0, 0) scale(0.01);display:inline-block;position:relative;min-width:28px;height:28px;-webkit-transition:background 120ms ease, -webkit-transform 120ms ease;transition:background 120ms ease, -webkit-transform 120ms ease;transition:transform 120ms ease, background 120ms ease;transition:transform 120ms ease, background 120ms ease, -webkit-transform 120ms ease;background:var(--pin-background);color:var(--pin-color);text-align:center}.range-pin::before{top:3px;-webkit-margin-start:-13px;margin-inline-start:-13px;border-radius:50% 50% 50% 0;position:absolute;width:26px;height:26px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transition:background 120ms ease;transition:background 120ms ease;background:var(--pin-background);content:"";z-index:-1}@supports (inset-inline-start: 0){.range-pin::before{inset-inline-start:50%}}@supports not (inset-inline-start: 0){.range-pin::before{left:50%}:host-context([dir=rtl]) .range-pin::before{left:unset;right:unset;right:50%}[dir=rtl] .range-pin::before{left:unset;right:unset;right:50%}@supports selector(:dir(rtl)){.range-pin::before:dir(rtl){left:unset;right:unset;right:50%}}}:host-context([dir=rtl]) .range-pin::before{left:unset}[dir=rtl] .range-pin::before{left:unset}@supports selector(:dir(rtl)){.range-pin::before:dir(rtl){left:unset}}.range-knob-pressed .range-pin,.range-knob-handle.ion-focused .range-pin{-webkit-transform:translate3d(0, -24px, 0) scale(1);transform:translate3d(0, -24px, 0) scale(1)}@media (any-hover: hover){.range-knob-handle:hover .range-knob:before{-webkit-transform:scale(2);transform:scale(2);opacity:0.13}}.range-knob-handle.ion-activated .range-knob:before,.range-knob-handle.ion-focused .range-knob:before,.range-knob-handle.range-knob-pressed .range-knob:before{-webkit-transform:scale(2);transform:scale(2)}.range-knob-handle.ion-focused .range-knob::before{opacity:0.13}.range-knob-handle.ion-activated .range-knob::before,.range-knob-handle.range-knob-pressed .range-knob::before{opacity:0.25}:host(:not(.range-has-pin)) .range-knob-pressed .range-knob,:host(:not(.range-has-pin)) .range-knob-handle.ion-focused .range-knob{-webkit-transform:scale(1);transform:scale(1)}:host(.range-disabled) .range-bar-active,:host(.range-disabled) .range-bar,:host(.range-disabled) .range-tick{background-color:var(--ion-color-step-250, #bfbfbf)}:host(.range-disabled) .range-knob{-webkit-transform:scale(0.55);transform:scale(0.55);outline:5px solid #fff;background-color:var(--ion-color-step-250, #bfbfbf)}:host(.range-disabled) .label-text-wrapper,:host(.range-disabled) ::slotted([slot=start]),:host(.range-disabled) ::slotted([slot=end]){opacity:0.38}';var Range=function(){function e(e){var t=this;registerInstance(this,e);this.ionChange=createEvent(this,"ionChange",7);this.ionInput=createEvent(this,"ionInput",7);this.ionStyle=createEvent(this,"ionStyle",7);this.ionFocus=createEvent(this,"ionFocus",7);this.ionBlur=createEvent(this,"ionBlur",7);this.ionKnobMoveStart=createEvent(this,"ionKnobMoveStart",7);this.ionKnobMoveEnd=createEvent(this,"ionKnobMoveEnd",7);this.rangeId="ion-r-".concat(rangeIds++);this.didLoad=false;this.noUpdate=false;this.hasFocus=false;this.inheritedAttributes={};this.contentEl=null;this.initialContentScrollY=true;this.hasLoggedDeprecationWarning=false;this.clampBounds=function(e){return clamp(t.min,e,t.max)};this.ensureValueInBounds=function(e){if(t.dualKnobs){return{lower:t.clampBounds(e.lower),upper:t.clampBounds(e.upper)}}else{return t.clampBounds(e)}};this.setupGesture=function(){return __awaiter(t,void 0,void 0,(function(){var e,t;var n=this;return __generator(this,(function(r){switch(r.label){case 0:e=this.rangeSlider;if(!e)return[3,2];t=this;return[4,import("./index-ff313b19.js")];case 1:t.gesture=r.sent().createGesture({el:e,gestureName:"range",gesturePriority:100,threshold:0,onStart:function(e){return n.onStart(e)},onMove:function(e){return n.onMove(e)},onEnd:function(e){return n.onEnd(e)}});this.gesture.enable(!this.disabled);r.label=2;case 2:return[2]}}))}))};this.handleKeyboard=function(e,n){var r=t.ensureValueInBounds;var a=t.step;a=a>0?a:1;a=a/(t.max-t.min);if(!n){a*=-1}if(e==="A"){t.ratioA=clamp(0,t.ratioA+a,1)}else{t.ratioB=clamp(0,t.ratioB+a,1)}t.ionKnobMoveStart.emit({value:r(t.value)});t.updateValue();t.emitValueChange();t.ionKnobMoveEnd.emit({value:r(t.value)})};this.onBlur=function(){if(t.hasFocus){t.hasFocus=false;t.ionBlur.emit();t.emitStyle()}};this.onFocus=function(){if(!t.hasFocus){t.hasFocus=true;t.ionFocus.emit();t.emitStyle()}};this.ratioA=0;this.ratioB=0;this.pressedKnob=undefined;this.color=undefined;this.debounce=undefined;this.name=this.rangeId;this.label=undefined;this.dualKnobs=false;this.min=0;this.max=100;this.pin=false;this.pinFormatter=function(e){return Math.round(e)};this.snaps=false;this.step=1;this.ticks=true;this.activeBarStart=undefined;this.disabled=false;this.value=0;this.labelPlacement="start";this.legacy=undefined}e.prototype.debounceChanged=function(){var e=this,t=e.ionInput,n=e.debounce,r=e.originalIonInput;this.ionInput=n===undefined?r!==null&&r!==void 0?r:t:debounceEvent(t,n)};e.prototype.minChanged=function(){if(!this.noUpdate){this.updateRatio()}};e.prototype.maxChanged=function(){if(!this.noUpdate){this.updateRatio()}};e.prototype.activeBarStartChanged=function(){var e=this.activeBarStart;if(e!==undefined){if(e>this.max){printIonWarning("Range: The value of activeBarStart (".concat(e,") is greater than the max (").concat(this.max,"). Valid values are greater than or equal to the min value and less than or equal to the max value."),this.el);this.activeBarStart=this.max}else if(e<this.min){printIonWarning("Range: The value of activeBarStart (".concat(e,") is less than the min (").concat(this.min,"). Valid values are greater than or equal to the min value and less than or equal to the max value."),this.el);this.activeBarStart=this.min}}};e.prototype.disabledChanged=function(){if(this.gesture){this.gesture.enable(!this.disabled)}this.emitStyle()};e.prototype.valueChanged=function(){if(!this.noUpdate){this.updateRatio()}};e.prototype.componentWillLoad=function(){if(this.el.hasAttribute("id")){this.rangeId=this.el.getAttribute("id")}this.inheritedAttributes=inheritAriaAttributes(this.el)};e.prototype.componentDidLoad=function(){this.originalIonInput=this.ionInput;this.setupGesture();this.didLoad=true};e.prototype.connectedCallback=function(){var e=this.el;this.legacyFormController=createLegacyFormController(e);this.updateRatio();this.debounceChanged();this.disabledChanged();this.activeBarStartChanged();if(this.didLoad){this.setupGesture()}this.contentEl=findClosestIonContent(this.el)};e.prototype.disconnectedCallback=function(){if(this.gesture){this.gesture.destroy();this.gesture=undefined}};e.prototype.getValue=function(){var e;var t=(e=this.value)!==null&&e!==void 0?e:0;if(this.dualKnobs){if(typeof t==="object"){return t}return{lower:0,upper:t}}else{if(typeof t==="object"){return t.upper}return t}};e.prototype.emitStyle=function(){if(this.legacyFormController.hasLegacyControl()){this.ionStyle.emit({interactive:true,"interactive-disabled":this.disabled})}};e.prototype.emitValueChange=function(){this.value=this.ensureValueInBounds(this.value);this.ionChange.emit({value:this.value})};e.prototype.onStart=function(e){var t=this.contentEl;if(t){this.initialContentScrollY=disableContentScrollY(t)}var n=this.rect=this.rangeSlider.getBoundingClientRect();var r=e.currentX;var a=clamp(0,(r-n.left)/n.width,1);if(isRTL(this.el)){a=1-a}this.pressedKnob=!this.dualKnobs||Math.abs(this.ratioA-a)<Math.abs(this.ratioB-a)?"A":"B";this.setFocus(this.pressedKnob);this.update(r);this.ionKnobMoveStart.emit({value:this.ensureValueInBounds(this.value)})};e.prototype.onMove=function(e){this.update(e.currentX)};e.prototype.onEnd=function(e){var t=this,n=t.contentEl,r=t.initialContentScrollY;if(n){resetContentScrollY(n,r)}this.update(e.currentX);this.pressedKnob=undefined;this.emitValueChange();this.ionKnobMoveEnd.emit({value:this.ensureValueInBounds(this.value)})};e.prototype.update=function(e){var t=this.rect;var n=clamp(0,(e-t.left)/t.width,1);if(isRTL(this.el)){n=1-n}if(this.snaps){n=valueToRatio(ratioToValue(n,this.min,this.max,this.step),this.min,this.max)}if(this.pressedKnob==="A"){this.ratioA=n}else{this.ratioB=n}this.updateValue()};Object.defineProperty(e.prototype,"valA",{get:function(){return ratioToValue(this.ratioA,this.min,this.max,this.step)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"valB",{get:function(){return ratioToValue(this.ratioB,this.min,this.max,this.step)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ratioLower",{get:function(){if(this.dualKnobs){return Math.min(this.ratioA,this.ratioB)}var e=this.activeBarStart;if(e==null){return 0}return valueToRatio(e,this.min,this.max)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ratioUpper",{get:function(){if(this.dualKnobs){return Math.max(this.ratioA,this.ratioB)}return this.ratioA},enumerable:false,configurable:true});e.prototype.updateRatio=function(){var e=this.getValue();var t=this,n=t.min,r=t.max;if(this.dualKnobs){this.ratioA=valueToRatio(e.lower,n,r);this.ratioB=valueToRatio(e.upper,n,r)}else{this.ratioA=valueToRatio(e,n,r)}};e.prototype.updateValue=function(){this.noUpdate=true;var e=this,t=e.valA,n=e.valB;this.value=!this.dualKnobs?t:{lower:Math.min(t,n),upper:Math.max(t,n)};this.ionInput.emit({value:this.value});this.noUpdate=false};e.prototype.setFocus=function(e){if(this.el.shadowRoot){var t=this.el.shadowRoot.querySelector(e==="A"?".range-knob-a":".range-knob-b");if(t){t.focus()}}};e.prototype.renderLegacyRange=function(){var e;if(!this.hasLoggedDeprecationWarning){printIonWarning('ion-range now requires providing a label with either the label slot or the "aria-label" attribute. To migrate, remove any usage of "ion-label" and pass the label text to either the component or the "aria-label" attribute.\n\nExample: <ion-range><div slot="label">Volume</div></ion-range>\nExample with aria-label: <ion-range aria-label="Volume"></ion-range>\n\nDevelopers can use the "legacy" property to continue using the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.',this.el);if(this.legacy){printIonWarning('ion-range is being used with the "legacy" property enabled which will forcibly enable the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.\n\nDevelopers can dismiss this warning by removing their usage of the "legacy" property and using the new range syntax.',this.el)}this.hasLoggedDeprecationWarning=true}var t=this,n=t.el,r=t.pressedKnob,a=t.disabled,i=t.pin,o=t.rangeId;var s=getIonMode(this);renderHiddenInput(true,n,this.name,JSON.stringify(this.getValue()),a);return h(Host,{onFocusin:this.onFocus,onFocusout:this.onBlur,id:o,class:createColorClasses(this.color,(e={},e[s]=true,e["in-item"]=hostContext("ion-item",n),e["range-disabled"]=a,e["range-pressed"]=r!==undefined,e["range-has-pin"]=i,e["legacy-range"]=true,e))},h("slot",{name:"start"}),this.renderRangeSlider(),h("slot",{name:"end"}))};Object.defineProperty(e.prototype,"hasStartSlotContent",{get:function(){return this.el.querySelector('[slot="start"]')!==null},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"hasEndSlotContent",{get:function(){return this.el.querySelector('[slot="end"]')!==null},enumerable:false,configurable:true});e.prototype.renderRange=function(){var e;var t=this,n=t.disabled,r=t.el,a=t.hasLabel,i=t.rangeId,o=t.pin,s=t.pressedKnob,l=t.labelPlacement,d=t.label;var p=hostContext("ion-item",r);var g=a&&(l==="start"||l==="fixed")||this.hasStartSlotContent;var b=p&&!g;var c=a&&l==="end"||this.hasEndSlotContent;var u=p&&!c;var m=getIonMode(this);renderHiddenInput(true,r,this.name,JSON.stringify(this.getValue()),n);return h(Host,{onFocusin:this.onFocus,onFocusout:this.onBlur,id:i,class:createColorClasses(this.color,(e={},e[m]=true,e["in-item"]=p,e["range-disabled"]=n,e["range-pressed"]=s!==undefined,e["range-has-pin"]=o,e["range-label-placement-".concat(l)]=true,e["range-item-start-adjustment"]=b,e["range-item-end-adjustment"]=u,e))},h("label",{class:"range-wrapper",id:"range-label"},h("div",{class:{"label-text-wrapper":true,"label-text-wrapper-hidden":!a}},d!==undefined?h("div",{class:"label-text"},d):h("slot",{name:"label"})),h("div",{class:"native-wrapper"},h("slot",{name:"start"}),this.renderRangeSlider(),h("slot",{name:"end"}))))};Object.defineProperty(e.prototype,"hasLabel",{get:function(){return this.label!==undefined||this.el.querySelector('[slot="label"]')!==null},enumerable:false,configurable:true});e.prototype.renderRangeSlider=function(){var e;var t=this;var n;var r=this,a=r.min,i=r.max,o=r.step,s=r.el,l=r.handleKeyboard,d=r.pressedKnob,p=r.disabled,g=r.pin,b=r.ratioLower,c=r.ratioUpper,u=r.inheritedAttributes,m=r.rangeId,f=r.pinFormatter;var v=getAriaLabel(s,m).labelText;if(v===undefined||v===null){v=u["aria-label"]}var x="".concat(b*100,"%");var k="".concat(100-c*100,"%");var w=isRTL(this.el);var y=w?"right":"left";var C=w?"left":"right";var z=function(e){var t;return t={},t[y]=e[y],t};if(this.dualKnobs===false){if(this.valA<((n=this.activeBarStart)!==null&&n!==void 0?n:this.min)){x="".concat(c*100,"%");k="".concat(100-b*100,"%")}else{x="".concat(b*100,"%");k="".concat(100-c*100,"%")}}var S=(e={},e[y]=x,e[C]=k,e);var B=[];if(this.snaps&&this.ticks){for(var I=a;I<=i;I+=o){var A=valueToRatio(I,a,i);var K=Math.min(b,c);var R=Math.max(b,c);var M={ratio:A,active:A>=K&&A<=R};M[y]="".concat(A*100,"%");B.push(M)}}var j;if(!this.legacyFormController.hasLegacyControl()&&this.hasLabel){j="range-label"}return h("div",{class:"range-slider",ref:function(e){return t.rangeSlider=e}},B.map((function(e){return h("div",{style:z(e),role:"presentation",class:{"range-tick":true,"range-tick-active":e.active},part:e.active?"tick-active":"tick"})})),h("div",{class:"range-bar-container"},h("div",{class:"range-bar",role:"presentation",part:"bar"}),h("div",{class:{"range-bar":true,"range-bar-active":true,"has-ticks":B.length>0},role:"presentation",style:S,part:"bar-active"})),renderKnob(w,{knob:"A",pressed:d==="A",value:this.valA,ratio:this.ratioA,pin:g,pinFormatter:f,disabled:p,handleKeyboard:l,min:a,max:i,labelText:v,labelledBy:j}),this.dualKnobs&&renderKnob(w,{knob:"B",pressed:d==="B",value:this.valB,ratio:this.ratioB,pin:g,pinFormatter:f,disabled:p,handleKeyboard:l,min:a,max:i,labelText:v,labelledBy:j}))};e.prototype.render=function(){var e=this.legacyFormController;return e.hasLegacyControl()?this.renderLegacyRange():this.renderRange()};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{debounce:["debounceChanged"],min:["minChanged"],max:["maxChanged"],activeBarStart:["activeBarStartChanged"],disabled:["disabledChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return e}();var renderKnob=function(e,t){var n=t.knob,r=t.value,a=t.ratio,i=t.min,o=t.max,s=t.disabled,l=t.pressed,d=t.pin,p=t.handleKeyboard,g=t.labelText,b=t.labelledBy,c=t.pinFormatter;var u=e?"right":"left";var m=function(){var e={};e[u]="".concat(a*100,"%");return e};return h("div",{onKeyDown:function(e){var t=e.key;if(t==="ArrowLeft"||t==="ArrowDown"){p(n,false);e.preventDefault();e.stopPropagation()}else if(t==="ArrowRight"||t==="ArrowUp"){p(n,true);e.preventDefault();e.stopPropagation()}},class:{"range-knob-handle":true,"range-knob-a":n==="A","range-knob-b":n==="B","range-knob-pressed":l,"range-knob-min":r===i,"range-knob-max":r===o,"ion-activatable":true,"ion-focusable":true},style:m(),role:"slider",tabindex:s?-1:0,"aria-label":b===undefined?g:null,"aria-labelledby":b!==undefined?b:null,"aria-valuemin":i,"aria-valuemax":o,"aria-disabled":s?"true":null,"aria-valuenow":r},d&&h("div",{class:"range-pin",role:"presentation",part:"pin"},c(r)),h("div",{class:"range-knob",role:"presentation",part:"knob"}))};var ratioToValue=function(e,t,n,r){var a=(n-t)*e;if(r>0){a=Math.round(a/r)*r+t}var i=clamp(t,a,n);return roundToMaxDecimalPlaces(i,t,n,r)};var valueToRatio=function(e,t,n){return clamp(0,(e-t)/(n-t),1)};var rangeIds=0;Range.style={ios:rangeIosCss,md:rangeMdCss};export{Range as ion_range};
|
|
4
|
+
*/import{r as registerInstance,d as createEvent,h,H as Host,f as getElement}from"./index-2d388930.js";import{f as findClosestIonContent,d as disableContentScrollY,r as resetContentScrollY}from"./index-746a238e.js";import{c as createLegacyFormController}from"./form-controller-ed77647a.js";import{l as clamp,j as debounceEvent,i as inheritAriaAttributes,d as renderHiddenInput,e as getAriaLabel}from"./helpers-3379ba19.js";import{p as printIonWarning}from"./index-595d62c9.js";import{i as isRTL}from"./dir-912e3e13.js";import{c as createColorClasses,h as hostContext}from"./theme-17531cdf.js";import{b as getIonMode}from"./ionic-global-b3fc28dd.js";function getDecimalPlaces(e){if(e%1===0)return 0;return e.toString().split(".")[1].length}function roundToMaxDecimalPlaces(e){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}var r=Math.max.apply(Math,t.map((function(e){return getDecimalPlaces(e)})));return Number(e.toFixed(r))}var rangeIosCss=":host{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family, inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.range-disabled){pointer-events:none}::slotted(ion-label){-ms-flex:initial;flex:initial}::slotted(ion-icon[slot]){font-size:24px}.range-slider{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab;-ms-touch-action:pan-y;touch-action:pan-y}:host(.range-pressed) .range-slider{cursor:-webkit-grabbing;cursor:grabbing}.range-pin{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box}.range-knob-handle{top:calc((var(--height) - var(--knob-handle-size)) / 2);-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}@supports (inset-inline-start: 0){.range-knob-handle{inset-inline-start:0}}@supports not (inset-inline-start: 0){.range-knob-handle{left:0}:host-context([dir=rtl]) .range-knob-handle{left:unset;right:unset;right:0}[dir=rtl] .range-knob-handle{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.range-knob-handle:dir(rtl){left:unset;right:unset;right:0}}}:host-context([dir=rtl]) .range-knob-handle{left:unset}[dir=rtl] .range-knob-handle{left:unset}@supports selector(:dir(rtl)){.range-knob-handle:dir(rtl){left:unset}}.range-knob-handle:active,.range-knob-handle:focus{outline:none}.range-bar-container{border-radius:var(--bar-border-radius);top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height)}@supports (inset-inline-start: 0){.range-bar-container{inset-inline-start:0}}@supports not (inset-inline-start: 0){.range-bar-container{left:0}:host-context([dir=rtl]) .range-bar-container{left:unset;right:unset;right:0}[dir=rtl] .range-bar-container{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.range-bar-container:dir(rtl){left:unset;right:unset;right:0}}}:host-context([dir=rtl]) .range-bar-container{left:unset}[dir=rtl] .range-bar-container{left:unset}@supports selector(:dir(rtl)){.range-bar-container:dir(rtl){left:unset}}.range-bar{border-radius:var(--bar-border-radius);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}.range-knob{border-radius:var(--knob-border-radius);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}@supports (inset-inline-start: 0){.range-knob{inset-inline-start:calc(50% - var(--knob-size) / 2)}}@supports not (inset-inline-start: 0){.range-knob{left:calc(50% - var(--knob-size) / 2)}:host-context([dir=rtl]) .range-knob{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}[dir=rtl] .range-knob{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}@supports selector(:dir(rtl)){.range-knob:dir(rtl){left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}}}:host-context([dir=rtl]) .range-knob{left:unset}[dir=rtl] .range-knob{left:unset}@supports selector(:dir(rtl)){.range-knob:dir(rtl){left:unset}}:host(.range-pressed) .range-bar-active{will-change:left, right}:host(.in-item){width:100%}:host([slot=start]),:host([slot=end]){width:auto}:host(.in-item) ::slotted(ion-label){-ms-flex-item-align:center;align-self:center}.range-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit}::slotted([slot=label]){max-width:200px;pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}:host(.range-label-placement-start) .range-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.range-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-end) .range-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.range-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.range-label-placement-stacked) .range-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch}:host(.range-label-placement-stacked) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host-context([dir=rtl]):host(.range-label-placement-stacked) .label-text-wrapper,:host-context([dir=rtl]).range-label-placement-stacked .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.range-label-placement-stacked) .label-text-wrapper:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}:host(.in-item.range-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.range-label-placement-stacked) .native-wrapper{margin-bottom:0px}:host{--knob-border-radius:50%;--knob-background:#ffffff;--knob-box-shadow:0px 0.5px 4px rgba(0, 0, 0, 0.12), 0px 6px 13px rgba(0, 0, 0, 0.12);--knob-size:26px;--bar-height:4px;--bar-background:var(--ion-color-step-900, #e6e6e6);--bar-background-active:var(--ion-color-primary, #3880ff);--bar-border-radius:2px;--height:42px}:host(.legacy-range){-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}:host(.range-item-start-adjustment){-webkit-padding-start:24px;padding-inline-start:24px}:host(.range-item-end-adjustment){-webkit-padding-end:24px;padding-inline-end:24px}:host(.ion-color) .range-bar-active,:host(.ion-color) .range-tick-active{background:var(--ion-color-base)}::slotted([slot=start]){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}::slotted([slot=end]){-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-has-pin:not(.range-label-placement-stacked)){padding-top:20px}:host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper{margin-bottom:20px}.range-bar-active{bottom:0;width:auto;background:var(--bar-background-active)}.range-bar-active.has-ticks{border-radius:0;-webkit-margin-start:-2px;margin-inline-start:-2px;-webkit-margin-end:-2px;margin-inline-end:-2px}.range-tick{-webkit-margin-start:-2px;margin-inline-start:-2px;border-radius:0;position:absolute;top:17px;width:4px;height:8px;background:var(--ion-color-step-900, #e6e6e6);pointer-events:none}.range-tick-active{background:var(--bar-background-active)}.range-pin{-webkit-transform:translate3d(0, 28px, 0) scale(0.01);transform:translate3d(0, 28px, 0) scale(0.01);-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;display:inline-block;position:relative;top:-20px;min-width:28px;-webkit-transition:-webkit-transform 120ms ease;transition:-webkit-transform 120ms ease;transition:transform 120ms ease;transition:transform 120ms ease, -webkit-transform 120ms ease;background:transparent;color:var(--ion-text-color, #000);font-size:12px;text-align:center}.range-knob-pressed .range-pin,.range-knob-handle.ion-focused .range-pin{-webkit-transform:translate3d(0, 0, 0) scale(1);transform:translate3d(0, 0, 0) scale(1)}:host(.range-disabled){opacity:0.3}";var rangeMdCss=':host{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family, inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.range-disabled){pointer-events:none}::slotted(ion-label){-ms-flex:initial;flex:initial}::slotted(ion-icon[slot]){font-size:24px}.range-slider{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab;-ms-touch-action:pan-y;touch-action:pan-y}:host(.range-pressed) .range-slider{cursor:-webkit-grabbing;cursor:grabbing}.range-pin{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box}.range-knob-handle{top:calc((var(--height) - var(--knob-handle-size)) / 2);-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}@supports (inset-inline-start: 0){.range-knob-handle{inset-inline-start:0}}@supports not (inset-inline-start: 0){.range-knob-handle{left:0}:host-context([dir=rtl]) .range-knob-handle{left:unset;right:unset;right:0}[dir=rtl] .range-knob-handle{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.range-knob-handle:dir(rtl){left:unset;right:unset;right:0}}}:host-context([dir=rtl]) .range-knob-handle{left:unset}[dir=rtl] .range-knob-handle{left:unset}@supports selector(:dir(rtl)){.range-knob-handle:dir(rtl){left:unset}}.range-knob-handle:active,.range-knob-handle:focus{outline:none}.range-bar-container{border-radius:var(--bar-border-radius);top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height)}@supports (inset-inline-start: 0){.range-bar-container{inset-inline-start:0}}@supports not (inset-inline-start: 0){.range-bar-container{left:0}:host-context([dir=rtl]) .range-bar-container{left:unset;right:unset;right:0}[dir=rtl] .range-bar-container{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.range-bar-container:dir(rtl){left:unset;right:unset;right:0}}}:host-context([dir=rtl]) .range-bar-container{left:unset}[dir=rtl] .range-bar-container{left:unset}@supports selector(:dir(rtl)){.range-bar-container:dir(rtl){left:unset}}.range-bar{border-radius:var(--bar-border-radius);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}.range-knob{border-radius:var(--knob-border-radius);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}@supports (inset-inline-start: 0){.range-knob{inset-inline-start:calc(50% - var(--knob-size) / 2)}}@supports not (inset-inline-start: 0){.range-knob{left:calc(50% - var(--knob-size) / 2)}:host-context([dir=rtl]) .range-knob{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}[dir=rtl] .range-knob{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}@supports selector(:dir(rtl)){.range-knob:dir(rtl){left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}}}:host-context([dir=rtl]) .range-knob{left:unset}[dir=rtl] .range-knob{left:unset}@supports selector(:dir(rtl)){.range-knob:dir(rtl){left:unset}}:host(.range-pressed) .range-bar-active{will-change:left, right}:host(.in-item){width:100%}:host([slot=start]),:host([slot=end]){width:auto}:host(.in-item) ::slotted(ion-label){-ms-flex-item-align:center;align-self:center}.range-wrapper{display:-ms-flexbox;display:flex;position:relative;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;height:inherit}::slotted([slot=label]){max-width:200px;pointer-events:none;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label-text-wrapper-hidden{display:none}.native-wrapper{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}:host(.range-label-placement-start) .range-wrapper{-ms-flex-direction:row;flex-direction:row}:host(.range-label-placement-start) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-end) .range-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host(.range-label-placement-end) .label-text-wrapper{-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px;margin-top:0;margin-bottom:0}:host(.range-label-placement-fixed) .label-text-wrapper{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}:host(.range-label-placement-stacked) .range-wrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch}:host(.range-label-placement-stacked) .label-text-wrapper{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:scale(0.75);transform:scale(0.75);margin-left:0;margin-right:0;margin-bottom:16px;max-width:calc(100% / 0.75)}:host-context([dir=rtl]):host(.range-label-placement-stacked) .label-text-wrapper,:host-context([dir=rtl]).range-label-placement-stacked .label-text-wrapper{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){:host(.range-label-placement-stacked) .label-text-wrapper:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}:host(.in-item.range-label-placement-stacked) .label-text-wrapper{margin-top:10px;margin-bottom:16px}:host(.in-item.range-label-placement-stacked) .native-wrapper{margin-bottom:0px}:host{--knob-border-radius:50%;--knob-background:var(--bar-background-active);--knob-box-shadow:none;--knob-size:18px;--bar-height:2px;--bar-background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.26);--bar-background-active:var(--ion-color-primary, #3880ff);--bar-border-radius:0;--height:42px;--pin-background:var(--ion-color-primary, #3880ff);--pin-color:var(--ion-color-primary-contrast, #fff);font-size:12px}::slotted([slot=label]),.label-text{font-size:initial}:host(.legacy-range){-webkit-padding-start:14px;padding-inline-start:14px;-webkit-padding-end:14px;padding-inline-end:14px;padding-top:8px;padding-bottom:8px}:host(.range-item-start-adjustment){-webkit-padding-start:18px;padding-inline-start:18px}:host(.range-item-end-adjustment){-webkit-padding-end:18px;padding-inline-end:18px}:host(.ion-color) .range-bar{background:rgba(var(--ion-color-base-rgb), 0.26)}:host(.ion-color) .range-bar-active,:host(.ion-color) .range-knob,:host(.ion-color) .range-knob::before,:host(.ion-color) .range-pin,:host(.ion-color) .range-pin::before,:host(.ion-color) .range-tick{background:var(--ion-color-base);color:var(--ion-color-contrast)}::slotted([slot=start]){-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:14px;margin-inline-end:14px;margin-top:0;margin-bottom:0}::slotted([slot=end]){-webkit-margin-start:14px;margin-inline-start:14px;-webkit-margin-end:0;margin-inline-end:0;margin-top:0;margin-bottom:0}:host(.range-has-pin:not(.range-label-placement-stacked)){padding-top:28px}:host(.range-has-pin.range-label-placement-stacked) .label-text-wrapper{margin-bottom:28px}.range-bar-active{bottom:0;width:auto;background:var(--bar-background-active)}.range-knob{-webkit-transform:scale(0.67);transform:scale(0.67);-webkit-transition-duration:120ms;transition-duration:120ms;-webkit-transition-property:background-color, border, -webkit-transform;transition-property:background-color, border, -webkit-transform;transition-property:transform, background-color, border;transition-property:transform, background-color, border, -webkit-transform;-webkit-transition-timing-function:ease;transition-timing-function:ease;z-index:2}.range-knob::before{border-radius:50%;position:absolute;width:var(--knob-size);height:var(--knob-size);-webkit-transform:scale(1);transform:scale(1);-webkit-transition:0.267s cubic-bezier(0, 0, 0.58, 1);transition:0.267s cubic-bezier(0, 0, 0.58, 1);background:var(--knob-background);content:"";opacity:0.13;pointer-events:none}@supports (inset-inline-start: 0){.range-knob::before{inset-inline-start:0}}@supports not (inset-inline-start: 0){.range-knob::before{left:0}:host-context([dir=rtl]) .range-knob::before{left:unset;right:unset;right:0}[dir=rtl] .range-knob::before{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){.range-knob::before:dir(rtl){left:unset;right:unset;right:0}}}.range-tick{position:absolute;top:calc((var(--height) - var(--bar-height)) / 2);width:var(--bar-height);height:var(--bar-height);background:var(--bar-background-active);z-index:1;pointer-events:none}.range-tick-active{background:transparent}.range-pin{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;border-radius:50%;-webkit-transform:translate3d(0, 0, 0) scale(0.01);transform:translate3d(0, 0, 0) scale(0.01);display:inline-block;position:relative;min-width:28px;height:28px;-webkit-transition:background 120ms ease, -webkit-transform 120ms ease;transition:background 120ms ease, -webkit-transform 120ms ease;transition:transform 120ms ease, background 120ms ease;transition:transform 120ms ease, background 120ms ease, -webkit-transform 120ms ease;background:var(--pin-background);color:var(--pin-color);text-align:center}.range-pin::before{top:3px;-webkit-margin-start:-13px;margin-inline-start:-13px;border-radius:50% 50% 50% 0;position:absolute;width:26px;height:26px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transition:background 120ms ease;transition:background 120ms ease;background:var(--pin-background);content:"";z-index:-1}@supports (inset-inline-start: 0){.range-pin::before{inset-inline-start:50%}}@supports not (inset-inline-start: 0){.range-pin::before{left:50%}:host-context([dir=rtl]) .range-pin::before{left:unset;right:unset;right:50%}[dir=rtl] .range-pin::before{left:unset;right:unset;right:50%}@supports selector(:dir(rtl)){.range-pin::before:dir(rtl){left:unset;right:unset;right:50%}}}:host-context([dir=rtl]) .range-pin::before{left:unset}[dir=rtl] .range-pin::before{left:unset}@supports selector(:dir(rtl)){.range-pin::before:dir(rtl){left:unset}}.range-knob-pressed .range-pin,.range-knob-handle.ion-focused .range-pin{-webkit-transform:translate3d(0, -24px, 0) scale(1);transform:translate3d(0, -24px, 0) scale(1)}@media (any-hover: hover){.range-knob-handle:hover .range-knob:before{-webkit-transform:scale(2);transform:scale(2);opacity:0.13}}.range-knob-handle.ion-activated .range-knob:before,.range-knob-handle.ion-focused .range-knob:before,.range-knob-handle.range-knob-pressed .range-knob:before{-webkit-transform:scale(2);transform:scale(2)}.range-knob-handle.ion-focused .range-knob::before{opacity:0.13}.range-knob-handle.ion-activated .range-knob::before,.range-knob-handle.range-knob-pressed .range-knob::before{opacity:0.25}:host(:not(.range-has-pin)) .range-knob-pressed .range-knob,:host(:not(.range-has-pin)) .range-knob-handle.ion-focused .range-knob{-webkit-transform:scale(1);transform:scale(1)}:host(.range-disabled) .range-bar-active,:host(.range-disabled) .range-bar,:host(.range-disabled) .range-tick{background-color:var(--ion-color-step-250, #bfbfbf)}:host(.range-disabled) .range-knob{-webkit-transform:scale(0.55);transform:scale(0.55);outline:5px solid #fff;background-color:var(--ion-color-step-250, #bfbfbf)}:host(.range-disabled) .label-text-wrapper,:host(.range-disabled) ::slotted([slot=start]),:host(.range-disabled) ::slotted([slot=end]){opacity:0.38}';var Range=function(){function e(e){var t=this;registerInstance(this,e);this.ionChange=createEvent(this,"ionChange",7);this.ionInput=createEvent(this,"ionInput",7);this.ionStyle=createEvent(this,"ionStyle",7);this.ionFocus=createEvent(this,"ionFocus",7);this.ionBlur=createEvent(this,"ionBlur",7);this.ionKnobMoveStart=createEvent(this,"ionKnobMoveStart",7);this.ionKnobMoveEnd=createEvent(this,"ionKnobMoveEnd",7);this.rangeId="ion-r-".concat(rangeIds++);this.didLoad=false;this.noUpdate=false;this.hasFocus=false;this.inheritedAttributes={};this.contentEl=null;this.initialContentScrollY=true;this.hasLoggedDeprecationWarning=false;this.clampBounds=function(e){return clamp(t.min,e,t.max)};this.ensureValueInBounds=function(e){if(t.dualKnobs){return{lower:t.clampBounds(e.lower),upper:t.clampBounds(e.upper)}}else{return t.clampBounds(e)}};this.setupGesture=function(){return __awaiter(t,void 0,void 0,(function(){var e,t;var n=this;return __generator(this,(function(r){switch(r.label){case 0:e=this.rangeSlider;if(!e)return[3,2];t=this;return[4,import("./index-ff313b19.js")];case 1:t.gesture=r.sent().createGesture({el:e,gestureName:"range",gesturePriority:100,threshold:0,onStart:function(e){return n.onStart(e)},onMove:function(e){return n.onMove(e)},onEnd:function(e){return n.onEnd(e)}});this.gesture.enable(!this.disabled);r.label=2;case 2:return[2]}}))}))};this.handleKeyboard=function(e,n){var r=t.ensureValueInBounds;var a=t.step;a=a>0?a:1;a=a/(t.max-t.min);if(!n){a*=-1}if(e==="A"){t.ratioA=clamp(0,t.ratioA+a,1)}else{t.ratioB=clamp(0,t.ratioB+a,1)}t.ionKnobMoveStart.emit({value:r(t.value)});t.updateValue();t.emitValueChange();t.ionKnobMoveEnd.emit({value:r(t.value)})};this.onBlur=function(){if(t.hasFocus){t.hasFocus=false;t.ionBlur.emit();t.emitStyle()}};this.onFocus=function(){if(!t.hasFocus){t.hasFocus=true;t.ionFocus.emit();t.emitStyle()}};this.ratioA=0;this.ratioB=0;this.pressedKnob=undefined;this.color=undefined;this.debounce=undefined;this.name=this.rangeId;this.label=undefined;this.dualKnobs=false;this.min=0;this.max=100;this.pin=false;this.pinFormatter=function(e){return Math.round(e)};this.snaps=false;this.step=1;this.ticks=true;this.activeBarStart=undefined;this.disabled=false;this.value=0;this.labelPlacement="start";this.legacy=undefined}e.prototype.debounceChanged=function(){var e=this,t=e.ionInput,n=e.debounce,r=e.originalIonInput;this.ionInput=n===undefined?r!==null&&r!==void 0?r:t:debounceEvent(t,n)};e.prototype.minChanged=function(){if(!this.noUpdate){this.updateRatio()}};e.prototype.maxChanged=function(){if(!this.noUpdate){this.updateRatio()}};e.prototype.activeBarStartChanged=function(){var e=this.activeBarStart;if(e!==undefined){if(e>this.max){printIonWarning("Range: The value of activeBarStart (".concat(e,") is greater than the max (").concat(this.max,"). Valid values are greater than or equal to the min value and less than or equal to the max value."),this.el);this.activeBarStart=this.max}else if(e<this.min){printIonWarning("Range: The value of activeBarStart (".concat(e,") is less than the min (").concat(this.min,"). Valid values are greater than or equal to the min value and less than or equal to the max value."),this.el);this.activeBarStart=this.min}}};e.prototype.disabledChanged=function(){if(this.gesture){this.gesture.enable(!this.disabled)}this.emitStyle()};e.prototype.valueChanged=function(){if(!this.noUpdate){this.updateRatio()}};e.prototype.componentWillLoad=function(){if(this.el.hasAttribute("id")){this.rangeId=this.el.getAttribute("id")}this.inheritedAttributes=inheritAriaAttributes(this.el)};e.prototype.componentDidLoad=function(){this.originalIonInput=this.ionInput;this.setupGesture();this.updateRatio();this.didLoad=true};e.prototype.connectedCallback=function(){var e=this.el;this.legacyFormController=createLegacyFormController(e);this.updateRatio();this.debounceChanged();this.disabledChanged();this.activeBarStartChanged();if(this.didLoad){this.setupGesture()}this.contentEl=findClosestIonContent(this.el)};e.prototype.disconnectedCallback=function(){if(this.gesture){this.gesture.destroy();this.gesture=undefined}};e.prototype.getValue=function(){var e;var t=(e=this.value)!==null&&e!==void 0?e:0;if(this.dualKnobs){if(typeof t==="object"){return t}return{lower:0,upper:t}}else{if(typeof t==="object"){return t.upper}return t}};e.prototype.emitStyle=function(){if(this.legacyFormController.hasLegacyControl()){this.ionStyle.emit({interactive:true,"interactive-disabled":this.disabled})}};e.prototype.emitValueChange=function(){this.value=this.ensureValueInBounds(this.value);this.ionChange.emit({value:this.value})};e.prototype.onStart=function(e){var t=this.contentEl;if(t){this.initialContentScrollY=disableContentScrollY(t)}var n=this.rect=this.rangeSlider.getBoundingClientRect();var r=e.currentX;var a=clamp(0,(r-n.left)/n.width,1);if(isRTL(this.el)){a=1-a}this.pressedKnob=!this.dualKnobs||Math.abs(this.ratioA-a)<Math.abs(this.ratioB-a)?"A":"B";this.setFocus(this.pressedKnob);this.update(r);this.ionKnobMoveStart.emit({value:this.ensureValueInBounds(this.value)})};e.prototype.onMove=function(e){this.update(e.currentX)};e.prototype.onEnd=function(e){var t=this,n=t.contentEl,r=t.initialContentScrollY;if(n){resetContentScrollY(n,r)}this.update(e.currentX);this.pressedKnob=undefined;this.emitValueChange();this.ionKnobMoveEnd.emit({value:this.ensureValueInBounds(this.value)})};e.prototype.update=function(e){var t=this.rect;var n=clamp(0,(e-t.left)/t.width,1);if(isRTL(this.el)){n=1-n}if(this.snaps){n=valueToRatio(ratioToValue(n,this.min,this.max,this.step),this.min,this.max)}if(this.pressedKnob==="A"){this.ratioA=n}else{this.ratioB=n}this.updateValue()};Object.defineProperty(e.prototype,"valA",{get:function(){return ratioToValue(this.ratioA,this.min,this.max,this.step)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"valB",{get:function(){return ratioToValue(this.ratioB,this.min,this.max,this.step)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ratioLower",{get:function(){if(this.dualKnobs){return Math.min(this.ratioA,this.ratioB)}var e=this.activeBarStart;if(e==null){return 0}return valueToRatio(e,this.min,this.max)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ratioUpper",{get:function(){if(this.dualKnobs){return Math.max(this.ratioA,this.ratioB)}return this.ratioA},enumerable:false,configurable:true});e.prototype.updateRatio=function(){var e=this.getValue();var t=this,n=t.min,r=t.max;if(this.dualKnobs){this.ratioA=valueToRatio(e.lower,n,r);this.ratioB=valueToRatio(e.upper,n,r)}else{this.ratioA=valueToRatio(e,n,r)}};e.prototype.updateValue=function(){this.noUpdate=true;var e=this,t=e.valA,n=e.valB;this.value=!this.dualKnobs?t:{lower:Math.min(t,n),upper:Math.max(t,n)};this.ionInput.emit({value:this.value});this.noUpdate=false};e.prototype.setFocus=function(e){if(this.el.shadowRoot){var t=this.el.shadowRoot.querySelector(e==="A"?".range-knob-a":".range-knob-b");if(t){t.focus()}}};e.prototype.renderLegacyRange=function(){var e;if(!this.hasLoggedDeprecationWarning){printIonWarning('ion-range now requires providing a label with either the label slot or the "aria-label" attribute. To migrate, remove any usage of "ion-label" and pass the label text to either the component or the "aria-label" attribute.\n\nExample: <ion-range><div slot="label">Volume</div></ion-range>\nExample with aria-label: <ion-range aria-label="Volume"></ion-range>\n\nDevelopers can use the "legacy" property to continue using the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.',this.el);if(this.legacy){printIonWarning('ion-range is being used with the "legacy" property enabled which will forcibly enable the legacy form markup. This property will be removed in an upcoming major release of Ionic where this form control will use the modern form markup.\n\nDevelopers can dismiss this warning by removing their usage of the "legacy" property and using the new range syntax.',this.el)}this.hasLoggedDeprecationWarning=true}var t=this,n=t.el,r=t.pressedKnob,a=t.disabled,i=t.pin,o=t.rangeId;var s=getIonMode(this);renderHiddenInput(true,n,this.name,JSON.stringify(this.getValue()),a);return h(Host,{onFocusin:this.onFocus,onFocusout:this.onBlur,id:o,class:createColorClasses(this.color,(e={},e[s]=true,e["in-item"]=hostContext("ion-item",n),e["range-disabled"]=a,e["range-pressed"]=r!==undefined,e["range-has-pin"]=i,e["legacy-range"]=true,e))},h("slot",{name:"start"}),this.renderRangeSlider(),h("slot",{name:"end"}))};Object.defineProperty(e.prototype,"hasStartSlotContent",{get:function(){return this.el.querySelector('[slot="start"]')!==null},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"hasEndSlotContent",{get:function(){return this.el.querySelector('[slot="end"]')!==null},enumerable:false,configurable:true});e.prototype.renderRange=function(){var e;var t=this,n=t.disabled,r=t.el,a=t.hasLabel,i=t.rangeId,o=t.pin,s=t.pressedKnob,l=t.labelPlacement,d=t.label;var p=hostContext("ion-item",r);var g=a&&(l==="start"||l==="fixed")||this.hasStartSlotContent;var b=p&&!g;var c=a&&l==="end"||this.hasEndSlotContent;var u=p&&!c;var m=getIonMode(this);renderHiddenInput(true,r,this.name,JSON.stringify(this.getValue()),n);return h(Host,{onFocusin:this.onFocus,onFocusout:this.onBlur,id:i,class:createColorClasses(this.color,(e={},e[m]=true,e["in-item"]=p,e["range-disabled"]=n,e["range-pressed"]=s!==undefined,e["range-has-pin"]=o,e["range-label-placement-".concat(l)]=true,e["range-item-start-adjustment"]=b,e["range-item-end-adjustment"]=u,e))},h("label",{class:"range-wrapper",id:"range-label"},h("div",{class:{"label-text-wrapper":true,"label-text-wrapper-hidden":!a}},d!==undefined?h("div",{class:"label-text"},d):h("slot",{name:"label"})),h("div",{class:"native-wrapper"},h("slot",{name:"start"}),this.renderRangeSlider(),h("slot",{name:"end"}))))};Object.defineProperty(e.prototype,"hasLabel",{get:function(){return this.label!==undefined||this.el.querySelector('[slot="label"]')!==null},enumerable:false,configurable:true});e.prototype.renderRangeSlider=function(){var e;var t=this;var n;var r=this,a=r.min,i=r.max,o=r.step,s=r.el,l=r.handleKeyboard,d=r.pressedKnob,p=r.disabled,g=r.pin,b=r.ratioLower,c=r.ratioUpper,u=r.inheritedAttributes,m=r.rangeId,f=r.pinFormatter;var v=getAriaLabel(s,m).labelText;if(v===undefined||v===null){v=u["aria-label"]}var x="".concat(b*100,"%");var k="".concat(100-c*100,"%");var w=isRTL(this.el);var y=w?"right":"left";var C=w?"left":"right";var z=function(e){var t;return t={},t[y]=e[y],t};if(this.dualKnobs===false){if(this.valA<((n=this.activeBarStart)!==null&&n!==void 0?n:this.min)){x="".concat(c*100,"%");k="".concat(100-b*100,"%")}else{x="".concat(b*100,"%");k="".concat(100-c*100,"%")}}var S=(e={},e[y]=x,e[C]=k,e);var B=[];if(this.snaps&&this.ticks){for(var I=a;I<=i;I+=o){var A=valueToRatio(I,a,i);var K=Math.min(b,c);var R=Math.max(b,c);var M={ratio:A,active:A>=K&&A<=R};M[y]="".concat(A*100,"%");B.push(M)}}var j;if(!this.legacyFormController.hasLegacyControl()&&this.hasLabel){j="range-label"}return h("div",{class:"range-slider",ref:function(e){return t.rangeSlider=e}},B.map((function(e){return h("div",{style:z(e),role:"presentation",class:{"range-tick":true,"range-tick-active":e.active},part:e.active?"tick-active":"tick"})})),h("div",{class:"range-bar-container"},h("div",{class:"range-bar",role:"presentation",part:"bar"}),h("div",{class:{"range-bar":true,"range-bar-active":true,"has-ticks":B.length>0},role:"presentation",style:S,part:"bar-active"})),renderKnob(w,{knob:"A",pressed:d==="A",value:this.valA,ratio:this.ratioA,pin:g,pinFormatter:f,disabled:p,handleKeyboard:l,min:a,max:i,labelText:v,labelledBy:j}),this.dualKnobs&&renderKnob(w,{knob:"B",pressed:d==="B",value:this.valB,ratio:this.ratioB,pin:g,pinFormatter:f,disabled:p,handleKeyboard:l,min:a,max:i,labelText:v,labelledBy:j}))};e.prototype.render=function(){var e=this.legacyFormController;return e.hasLegacyControl()?this.renderLegacyRange():this.renderRange()};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{debounce:["debounceChanged"],min:["minChanged"],max:["maxChanged"],activeBarStart:["activeBarStartChanged"],disabled:["disabledChanged"],value:["valueChanged"]}},enumerable:false,configurable:true});return e}();var renderKnob=function(e,t){var n=t.knob,r=t.value,a=t.ratio,i=t.min,o=t.max,s=t.disabled,l=t.pressed,d=t.pin,p=t.handleKeyboard,g=t.labelText,b=t.labelledBy,c=t.pinFormatter;var u=e?"right":"left";var m=function(){var e={};e[u]="".concat(a*100,"%");return e};return h("div",{onKeyDown:function(e){var t=e.key;if(t==="ArrowLeft"||t==="ArrowDown"){p(n,false);e.preventDefault();e.stopPropagation()}else if(t==="ArrowRight"||t==="ArrowUp"){p(n,true);e.preventDefault();e.stopPropagation()}},class:{"range-knob-handle":true,"range-knob-a":n==="A","range-knob-b":n==="B","range-knob-pressed":l,"range-knob-min":r===i,"range-knob-max":r===o,"ion-activatable":true,"ion-focusable":true},style:m(),role:"slider",tabindex:s?-1:0,"aria-label":b===undefined?g:null,"aria-labelledby":b!==undefined?b:null,"aria-valuemin":i,"aria-valuemax":o,"aria-disabled":s?"true":null,"aria-valuenow":r},d&&h("div",{class:"range-pin",role:"presentation",part:"pin"},c(r)),h("div",{class:"range-knob",role:"presentation",part:"knob"}))};var ratioToValue=function(e,t,n,r){var a=(n-t)*e;if(r>0){a=Math.round(a/r)*r+t}var i=clamp(t,a,n);return roundToMaxDecimalPlaces(i,t,n,r)};var valueToRatio=function(e,t,n){return clamp(0,(e-t)/(n-t),1)};var rangeIds=0;Range.style={ios:rangeIosCss,md:rangeMdCss};export{Range as ion_range};
|