@ionic/core 7.8.0 → 7.8.1-dev.11710452743.1ca99e5e

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.
@@ -1,4 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import{r as i,d as t,h as e,H as s,f as o}from"./p-c7ee2812.js";import{r as n,g as a}from"./p-1b3ffb2f.js";import{a as r,b as c,h as d}from"./p-42f189f4.js";import{a as l,b as p}from"./p-fd14636e.js";import{c as h}from"./p-47794def.js";import"./p-c61cc894.js";import"./p-7b30edcc.js";const m=class{constructor(e){i(this,e),this.ionChange=t(this,"ionChange",7),this.isScrolling=!1,this.isColumnVisible=!1,this.canExitInputMode=!0,this.centerPickerItemInView=(i,t=!0,e=!0)=>{const{el:s,isColumnVisible:o}=this;if(o){const o=i.offsetTop-3*i.clientHeight+i.clientHeight/2;s.scrollTop!==o&&(this.canExitInputMode=e,s.scroll({top:o,left:0,behavior:t?"smooth":void 0}))}},this.setPickerItemActiveState=(i,t)=>{t?(i.classList.add(b),i.part.add(u)):(i.classList.remove(b),i.part.remove(u))},this.inputModeChange=i=>{if(!this.numericInput)return;const{useInputMode:t,inputModeColumn:e}=i.detail;this.setInputModeActive(!(!t||void 0!==e&&e!==this.el))},this.setInputModeActive=i=>{this.isScrolling?this.scrollEndCallback=()=>{this.isActive=i}:this.isActive=i},this.initializeScrollListener=()=>{const i=l("ios"),{el:t}=this;let e,s=this.activeItem;const o=()=>{n((()=>{e&&(clearTimeout(e),e=void 0),this.isScrolling||(i&&r(),this.isScrolling=!0);const o=t.getBoundingClientRect(),n=t.shadowRoot.elementFromPoint(o.x+o.width/2,o.y+o.height/2);null!==s&&this.setPickerItemActiveState(s,!1),null===n||n.disabled||(n!==s&&(i&&c(),this.canExitInputMode&&this.exitInputMode()),s=n,this.setPickerItemActiveState(n,!0),e=setTimeout((()=>{this.isScrolling=!1,i&&d();const{scrollEndCallback:t}=this;t&&(t(),this.scrollEndCallback=void 0),this.canExitInputMode=!0;const e=n.getAttribute("data-index");if(null===e)return;const s=parseInt(e,10),o=this.items[s];o.value!==this.value&&this.setValue(o.value)}),250))}))};n((()=>{t.addEventListener("scroll",o),this.destroyScrollListener=()=>{t.removeEventListener("scroll",o)}}))},this.exitInputMode=()=>{const{parentEl:i}=this;null!=i&&(i.exitInputMode(),this.el.classList.remove("picker-column-active"))},this.isActive=!1,this.disabled=!1,this.items=[],this.value=void 0,this.color="primary",this.numericInput=!1}valueChange(){this.isColumnVisible&&this.scrollActiveItemIntoView()}componentWillLoad(){new IntersectionObserver((i=>{if(i[0].isIntersecting){const{activeItem:i,el:t}=this;this.isColumnVisible=!0;const e=a(t).querySelector(`.${b}`);e&&this.setPickerItemActiveState(e,!1),this.scrollActiveItemIntoView(),i&&this.setPickerItemActiveState(i,!0),this.initializeScrollListener()}else this.isColumnVisible=!1,this.destroyScrollListener&&(this.destroyScrollListener(),this.destroyScrollListener=void 0)}),{threshold:.001}).observe(this.el);const i=this.parentEl=this.el.closest("ion-picker-internal");null!==i&&i.addEventListener("ionInputModeChange",(i=>this.inputModeChange(i)))}componentDidRender(){var i;const{activeItem:t,items:e,isColumnVisible:s,value:o}=this;s&&(t?this.scrollActiveItemIntoView():(null===(i=e[0])||void 0===i?void 0:i.value)!==o&&this.setValue(e[0].value))}async scrollActiveItemIntoView(){const i=this.activeItem;i&&this.centerPickerItemInView(i,!1,!1)}async setValue(i){const{items:t}=this;this.value=i;const e=t.find((t=>t.value===i&&!0!==t.disabled));e&&this.ionChange.emit(e)}get activeItem(){const i=`.picker-item[data-value="${this.value}"]${this.disabled?"":":not([disabled])"}`;return a(this.el).querySelector(i)}render(){const{items:i,color:t,disabled:o,isActive:n,numericInput:a}=this,r=p(this);return e(s,{key:"d0e3818aa4ab06aefd988d1b42ae754244727b8f",exportparts:`${f}, ${u}`,disabled:o,tabindex:o?null:0,class:h(t,{[r]:!0,"picker-column-active":n,"picker-column-numeric-input":a})},e("div",{key:"ec3b16415db5f64e3fab37fda023560ebcdc9423",class:"picker-item picker-item-empty","aria-hidden":"true"}," "),e("div",{key:"40c78c9a1277807572d73e23048c2730cab88f5a",class:"picker-item picker-item-empty","aria-hidden":"true"}," "),e("div",{key:"c51fa817f6999356cf3568a46098e954936b45d5",class:"picker-item picker-item-empty","aria-hidden":"true"}," "),i.map(((i,t)=>e("button",{tabindex:"-1",class:{"picker-item":!0},"data-value":i.value,"data-index":t,onClick:i=>{this.centerPickerItemInView(i.target,!0)},disabled:o||i.disabled||!1,part:f},i.text))),e("div",{key:"80a7461dfe571f46466219b05007b021711aed32",class:"picker-item picker-item-empty","aria-hidden":"true"}," "),e("div",{key:"fed82263295f58c51e2b753d0c06c7d71872b8a7",class:"picker-item picker-item-empty","aria-hidden":"true"}," "),e("div",{key:"e805dff4122cc4e5fb4d7dcb96054fee8ad3bd07",class:"picker-item picker-item-empty","aria-hidden":"true"}," "))}get el(){return o(this)}static get watchers(){return{value:["valueChange"]}}},b="picker-item-active",f="wheel-item",u="active";m.style={ios:":host{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;height:200px;outline:none;font-size:22px;-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory;overflow-x:hidden;overflow-y:scroll;scrollbar-width:none;text-align:center}:host::-webkit-scrollbar{display:none}:host .picker-item{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;scroll-snap-align:center}:host .picker-item-empty,:host .picker-item[disabled]{cursor:default}:host .picker-item-empty,:host(:not([disabled])) .picker-item[disabled]{scroll-snap-align:none}:host([disabled]){overflow-y:hidden}:host .picker-item[disabled]{opacity:0.4}:host(.picker-column-active) .picker-item.picker-item-active{color:var(--ion-color-base)}@media (any-hover: hover){:host(:focus){outline:none;background:rgba(var(--ion-color-base-rgb), 0.2)}}",md:":host{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;height:200px;outline:none;font-size:22px;-webkit-scroll-snap-type:y mandatory;-ms-scroll-snap-type:y mandatory;scroll-snap-type:y mandatory;overflow-x:hidden;overflow-y:scroll;scrollbar-width:none;text-align:center}:host::-webkit-scrollbar{display:none}:host .picker-item{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;height:34px;border:0px;outline:none;background:transparent;color:inherit;font-family:var(--ion-font-family, inherit);font-size:inherit;line-height:34px;text-align:inherit;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;overflow:hidden;scroll-snap-align:center}:host .picker-item-empty,:host .picker-item[disabled]{cursor:default}:host .picker-item-empty,:host(:not([disabled])) .picker-item[disabled]{scroll-snap-align:none}:host([disabled]){overflow-y:hidden}:host .picker-item[disabled]{opacity:0.4}:host(.picker-column-active) .picker-item.picker-item-active{color:var(--ion-color-base)}@media (any-hover: hover){:host(:focus){outline:none;background:rgba(var(--ion-color-base-rgb), 0.2)}}:host .picker-item-active{color:var(--ion-color-base)}"};export{m as ion_picker_column_internal}