@ionic/core 7.5.1-dev.11697123035.1ee6b4a2 → 7.5.1-dev.11697139276.10eb94b8

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.
Files changed (36) hide show
  1. package/components/picker-column-internal.js +26 -27
  2. package/components/picker-internal.js +8 -12
  3. package/dist/cjs/ion-picker-column-internal.cjs.entry.js +24 -26
  4. package/dist/cjs/ion-picker-internal.cjs.entry.js +7 -11
  5. package/dist/cjs/ionic.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/picker-column-internal/picker-column-internal.js +54 -26
  8. package/dist/collection/components/picker-internal/picker-internal.js +7 -34
  9. package/dist/docs.json +1 -6
  10. package/dist/esm/ion-picker-column-internal.entry.js +24 -26
  11. package/dist/esm/ion-picker-internal.entry.js +8 -12
  12. package/dist/esm/ionic.js +1 -1
  13. package/dist/esm/loader.js +1 -1
  14. package/dist/esm-es5/ion-picker-column-internal.entry.js +1 -1
  15. package/dist/esm-es5/ion-picker-internal.entry.js +1 -1
  16. package/dist/esm-es5/ionic.js +1 -1
  17. package/dist/esm-es5/loader.js +1 -1
  18. package/dist/ionic/ionic.esm.js +1 -1
  19. package/dist/ionic/p-129bc265.system.entry.js +4 -0
  20. package/dist/ionic/p-5c3e72a8.system.js +1 -1
  21. package/dist/ionic/p-c0190e6d.system.entry.js +4 -0
  22. package/dist/ionic/p-d021cd8c.entry.js +4 -0
  23. package/dist/ionic/p-eed2c96d.entry.js +4 -0
  24. package/dist/types/components/menu/menu-interface.d.ts +4 -15
  25. package/dist/types/components/picker-column-internal/picker-column-internal.d.ts +3 -1
  26. package/dist/types/components/picker-internal/picker-internal.d.ts +4 -6
  27. package/dist/types/components.d.ts +4 -7
  28. package/dist/types/utils/menu-controller/index.d.ts +21 -2
  29. package/hydrate/index.js +33 -38
  30. package/package.json +3 -3
  31. package/dist/collection/components/picker-internal/picker-internal-interfaces.js +0 -1
  32. package/dist/ionic/p-0b7c25ee.system.entry.js +0 -4
  33. package/dist/ionic/p-3a58e3a4.system.entry.js +0 -4
  34. package/dist/ionic/p-818b2e75.entry.js +0 -4
  35. package/dist/ionic/p-afb6658f.entry.js +0 -4
  36. package/dist/types/components/picker-internal/picker-internal-interfaces.d.ts +0 -8
@@ -1,4 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import{r as t,d as r,h as e,H as i,f as o}from"./p-06ac429a.js";import{g as n}from"./p-63eb0acd.js";const a=class{constructor(e){t(this,e),this.ionInputModeChange=r(this,"ionInputModeChange",7),this.useInputMode=!1,this.isInHighlightBounds=t=>{const{highlightEl:r}=this;if(!r)return!1;const e=r.getBoundingClientRect();return!(t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom)},this.onFocusOut=t=>{const{relatedTarget:r}=t;(!r||"ION-PICKER-COLUMN-INTERNAL"!==r.tagName&&r!==this.inputEl)&&this.exitInputMode()},this.onFocusIn=t=>{const{target:r}=t;"ION-PICKER-COLUMN-INTERNAL"!==r.tagName||this.actionOnClick||(r.numericInput?this.enterInputMode(r,!1):this.exitInputMode())},this.onClick=()=>{const{actionOnClick:t}=this;t&&(t(),this.actionOnClick=void 0)},this.onPointerDown=t=>{const{useInputMode:r,inputModeColumn:e,el:i}=this;if(this.isInHighlightBounds(t))if(r)this.actionOnClick="ION-PICKER-COLUMN-INTERNAL"===t.target.tagName?e&&e===t.target?()=>{this.enterInputMode()}:()=>{this.enterInputMode(t.target)}:()=>{this.exitInputMode()};else{const r=1===i.querySelectorAll("ion-picker-column-internal.picker-column-numeric-input").length?t.target:void 0;this.actionOnClick=()=>{this.enterInputMode(r)}}else this.actionOnClick=()=>{this.exitInputMode()}},this.enterInputMode=(t,r=!0)=>{const{inputEl:e,el:i}=this;e&&i.querySelector("ion-picker-column-internal.picker-column-numeric-input")&&(this.useInputMode=!0,this.inputModeColumn=t,r?(this.destroyKeypressListener&&(this.destroyKeypressListener(),this.destroyKeypressListener=void 0),e.focus()):(i.addEventListener("keypress",this.onKeyPress),this.destroyKeypressListener=()=>{i.removeEventListener("keypress",this.onKeyPress)}),this.emitInputModeChange())},this.onKeyPress=t=>{const{inputEl:r}=this;if(!r)return;const e=parseInt(t.key,10);Number.isNaN(e)||(r.value+=t.key,this.onInputChange())},this.selectSingleColumn=()=>{const{inputEl:t,inputModeColumn:r,singleColumnSearchTimeout:e}=this;if(!t||!r)return;const i=r.items.filter((t=>!0!==t.disabled));if(e&&clearTimeout(e),this.singleColumnSearchTimeout=setTimeout((()=>{t.value="",this.singleColumnSearchTimeout=void 0}),1e3),t.value.length>=3){const r=t.value.substring(t.value.length-2);return t.value=r,void this.selectSingleColumn()}const o=i.find((({text:r})=>r.replace(/^0+(?=[1-9])|0+(?=0$)/,"")===t.value));if(o)r.setValue(o.value);else if(2===t.value.length){const r=t.value.substring(t.value.length-1);t.value=r,this.selectSingleColumn()}},this.searchColumn=(t,r,e="start")=>{const i="start"===e?/^0+/:/0$/,o=t.items.find((({text:t,disabled:e})=>!0!==e&&t.replace(i,"")===r));o&&t.setValue(o.value)},this.selectMultiColumn=()=>{const{inputEl:t,el:r}=this;if(!t)return;const e=Array.from(r.querySelectorAll("ion-picker-column-internal")).filter((t=>t.numericInput)),i=e[0],o=e[1];let n,a=t.value;switch(a.length){case 1:this.searchColumn(i,a);break;case 2:const r=t.value.substring(0,1);a="0"===r||"1"===r?t.value:r,this.searchColumn(i,a),1===a.length&&(n=t.value.substring(t.value.length-1),this.searchColumn(o,n,"end"));break;case 3:const e=t.value.substring(0,1);a="0"===e||"1"===e?t.value.substring(0,2):e,this.searchColumn(i,a),n=t.value.substring(1===a.length?1:2),this.searchColumn(o,n,"end");break;case 4:const s=t.value.substring(0,1);a="0"===s||"1"===s?t.value.substring(0,2):s,this.searchColumn(i,a);const c=t.value.substring(1===a.length?1:2,t.value.length);this.searchColumn(o,c,"end");break;default:const l=t.value.substring(t.value.length-4);t.value=l,this.selectMultiColumn()}},this.onInputChange=()=>{const{useInputMode:t,inputEl:r,inputModeColumn:e}=this;t&&r&&(e?this.selectSingleColumn():this.selectMultiColumn())},this.emitInputModeChange=()=>{const{useInputMode:t,inputModeColumn:r}=this;this.ionInputModeChange.emit({useInputMode:t,inputModeColumn:r})}}preventTouchStartPropagation(t){t.stopPropagation()}componentWillLoad(){n(this.el).addEventListener("focusin",this.onFocusIn),n(this.el).addEventListener("focusout",this.onFocusOut)}async exitInputMode(){const{inputEl:t,useInputMode:r}=this;r&&t&&(this.useInputMode=!1,this.inputModeColumn=void 0,t.blur(),t.value="",this.destroyKeypressListener&&(this.destroyKeypressListener(),this.destroyKeypressListener=void 0),this.emitInputModeChange())}render(){return e(i,{onPointerDown:t=>this.onPointerDown(t),onClick:()=>this.onClick()},e("input",{"aria-hidden":"true",tabindex:-1,inputmode:"numeric",type:"number",ref:t=>this.inputEl=t,onInput:()=>this.onInputChange(),onBlur:()=>this.exitInputMode()}),e("div",{class:"picker-before"}),e("div",{class:"picker-after"}),e("div",{class:"picker-highlight",ref:t=>this.highlightEl=t}),e("slot",null))}get el(){return o(this)}};a.style={ios:":host{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:200px;direction:ltr;z-index:0}:host .picker-before,:host .picker-after{position:absolute;width:100%;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:1;pointer-events:none}:host .picker-before{top:0;height:83px}@supports (inset-inline-start: 0){:host .picker-before{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host .picker-before{left:0}:host-context([dir=rtl]) .picker-before{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host .picker-before:dir(rtl){left:unset;right:unset;right:0}}}:host .picker-after{top:116px;height:84px}@supports (inset-inline-start: 0){:host .picker-after{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host .picker-after{left:0}:host-context([dir=rtl]) .picker-after{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host .picker-after:dir(rtl){left:unset;right:unset;right:0}}}:host .picker-highlight{border-radius:8px;left:0;right:0;top:50%;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;position:absolute;width:calc(100% - 16px);height:34px;-webkit-transform:translateY(-50%);transform:translateY(-50%);background:var(--wheel-highlight-background);z-index:-1}:host input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}:host ::slotted(ion-picker-column-internal:first-of-type){text-align:start}:host ::slotted(ion-picker-column-internal:last-of-type){text-align:end}:host ::slotted(ion-picker-column-internal:only-child){text-align:center}:host .picker-before{background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), to(rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8)));background:linear-gradient(to bottom, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8) 100%)}:host .picker-after{background:-webkit-gradient(linear, left bottom, left top, color-stop(20%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), to(rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8)));background:linear-gradient(to top, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0.8) 100%)}:host .picker-highlight{background:var(--wheel-highlight-background, var(--ion-color-step-150, #eeeeef))}",md:":host{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:200px;direction:ltr;z-index:0}:host .picker-before,:host .picker-after{position:absolute;width:100%;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:1;pointer-events:none}:host .picker-before{top:0;height:83px}@supports (inset-inline-start: 0){:host .picker-before{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host .picker-before{left:0}:host-context([dir=rtl]) .picker-before{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host .picker-before:dir(rtl){left:unset;right:unset;right:0}}}:host .picker-after{top:116px;height:84px}@supports (inset-inline-start: 0){:host .picker-after{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host .picker-after{left:0}:host-context([dir=rtl]) .picker-after{left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host .picker-after:dir(rtl){left:unset;right:unset;right:0}}}:host .picker-highlight{border-radius:8px;left:0;right:0;top:50%;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0;position:absolute;width:calc(100% - 16px);height:34px;-webkit-transform:translateY(-50%);transform:translateY(-50%);background:var(--wheel-highlight-background);z-index:-1}:host input{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}:host ::slotted(ion-picker-column-internal:first-of-type){text-align:start}:host ::slotted(ion-picker-column-internal:last-of-type){text-align:end}:host ::slotted(ion-picker-column-internal:only-child){text-align:center}:host .picker-before{background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), color-stop(90%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0)));background:linear-gradient(to bottom, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 20%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0) 90%)}:host .picker-after{background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1)), color-stop(90%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0)));background:linear-gradient(to top, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 1) 30%, rgba(var(--wheel-fade-background-rgb, var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255))), 0) 90%)}"};export{a as ion_picker_internal}
@@ -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-06ac429a.js";import{r as n,g as r}from"./p-63eb0acd.js";import{a,b as l,h as c}from"./p-b923f3d7.js";import{a as p,b as h}from"./p-76378400.js";import{c as d}from"./p-1d072d3d.js";import"./p-cc196b34.js";import"./p-b347cfd1.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(u),i.part.add(b)):(i.classList.remove(u),i.part.remove(b))},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=p("ios"),{el:t}=this;let e,s=this.activeItem;const o=()=>{n((()=>{e&&(clearTimeout(e),e=void 0),this.isScrolling||(i&&a(),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&&l(),this.canExitInputMode&&this.exitInputMode()),s=n,this.setPickerItemActiveState(n,!0),e=setTimeout((()=>{this.isScrolling=!1,i&&c();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.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=r(t).querySelector(`.${u}`);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(){return r(this.el).querySelector(`.picker-item[data-value="${this.value}"]:not([disabled])`)}render(){const{items:i,color:t,isActive:o,numericInput:n}=this,r=h(this);return e(s,{exportparts:`${g}, ${b}`,tabindex:0,class:d(t,{[r]:!0,"picker-column-active":o,"picker-column-numeric-input":n})},e("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "),e("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "),e("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "),i.map(((i,t)=>e("button",{tabindex:"-1",class:{"picker-item":!0,"picker-item-disabled":i.disabled||!1},"data-value":i.value,"data-index":t,onClick:i=>{this.centerPickerItemInView(i.target,!0)},disabled:i.disabled,part:g},i.text))),e("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "),e("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "),e("div",{class:"picker-item picker-item-empty","aria-hidden":"true"}," "))}get el(){return o(this)}static get watchers(){return{value:["valueChange"]}}},u="picker-item-active",g="wheel-item",b="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.picker-item-disabled{scroll-snap-align:none;cursor:default}:host .picker-item.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.picker-item-disabled{scroll-snap-align:none;cursor:default}:host .picker-item.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}
@@ -1,8 +0,0 @@
1
- export interface PickerInternalChangeEventDetail {
2
- useInputMode: boolean;
3
- inputModeColumn?: HTMLIonPickerColumnInternalElement;
4
- }
5
- export interface PickerInternalCustomEvent extends CustomEvent {
6
- target: HTMLIonPickerInternalElement;
7
- detail: PickerInternalChangeEventDetail;
8
- }